query_name
stringlengths
13
55
code_file_path
stringlengths
14
194
context_blocks
list
answer_spans
list
supporting_fact_spans
list
example_type
int8
0
1
single_hop
bool
2 classes
subtokenized_input_sequence
sequence
label_sequence
sequence
Unused import
Neohapsis/bbqsql/bbqsql/menu/bbq_menu.py
[ { "content": "import bbqsql\n\nfrom bbq_core import bcolors\nfrom config import RequestsConfig,bbqsqlConfig\nimport text\nimport bbq_core\nimport time\nimport os\nimport sys\n\nimport argparse\nfrom ConfigParser import RawConfigParser,NoSectionError,MissingSectionHeaderError\nfrom copy import copy\n\n\n# config params that are only used in the menu and shouldn't be passed along to BlindSQLi or other parts of bbqsql\nexclude_parms = ['csv_output_file','hooks_file']\n\n# main menu\n\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser(prog='bbqsql')\n parser.add_argument('-V', '--version', action='version', version='%(prog)s 1.0')\n parser.add_argument('-c', metavar='config', nargs='+', help='import config file', default=None)\n\n results = parser.parse_args()\n print results\n\n if results.c is not None:\n bbqMenu(results.c[0])\n else:\n bbqMenu()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class bbqMenu():", "metadata": "root.bbqMenu", "header": "['module', '___EOS___']", "index": 19 }, { "content": " def __init__(self, run_config=None):\n # default name for config file\n self.config_file = 'attack.cfg'\n try:\n requests_config = RequestsConfig()\n bbqsql_config = bbqsqlConfig()\n\n results = None\n error = None\n valid = False\n\n # intitial user menu\n choice = ''\n while choice not in ['99',99,'quit','exit']:\n bbq_core.show_banner()\n show_main_menu = bbq_core.CreateMenu(text.main_text, text.main_menu)\n \n # special case of list item 99\n print '\\n 99) Exit the bbqsql injection toolkit\\n'\n \n rvalid = requests_config.validate()\n bvalid = bbqsql_config.validate()\n valid = rvalid and bvalid\n\n # Big results? throw that in a csv file!\n if results and len(results) <= 100:\n print results\n elif results:\n print '\\n\\nbbqsql recieved ' + str(len(results)) + ' rows of data, results truncated to last 100'\n print results[-100:]\n print '\\n\\nplease provide a filename so we can save all the results for you'\n try:\n import readline\n readline.parse_and_bind('tab: complete')\n except ImportError:\n print 'readline module not found'\n pass\n try:\n readline.parse_and_bind('tab: complete')\n fname = raw_input('CSV file name [./results.csv]: ')\n except:\n print \"something went wrong, didn't write results to a file\"\n pass\n\n if fname is not None:\n f = open(fname,'w')\n f.write(\"\\n\".join(\",\",results))\n f.close()\n\n\n if error: print bbq_core.bcolors.RED+error+ bbq_core.bcolors.ENDC\n\n if run_config:\n tmp_req_config = dict()\n tmp_http_config = dict()\n try:\n attack_config = RawConfigParser()\n self.config_file = [run_config,self.config_file][run_config is '']\n attack_config.read(self.config_file)\n except:\n pass\n try:\n for key,val in attack_config.items('Request Config'):\n tmp_req_config[key] = val\n for key,val in attack_config.items('HTTP Config'):\n tmp_http_config[key] = val\n requests_config.set_config(tmp_req_config)\n bbqsql_config.set_config(tmp_http_config)\n except NoSectionError:\n print \"bad config file. try again\"\n\n # Loaded config so clear it out\n run_config = None\n\n # mainc ore menu\n choice = (raw_input(bbq_core.setprompt()))\n\n if choice == '1':\n # Run configuration REPL for HTTP variables\n requests_config.run_config()\n \n if choice == '2':\n # Run configuration REPL for bbqsql variables\n bbqsql_config.run_config()\n \n if choice == '3': \n # Export Config\n try:\n import readline\n readline.parse_and_bind('tab: complete')\n except ImportError:\n pass\n attack_config = RawConfigParser()\n attack_config.add_section('Request Config')\n attack_config.add_section('HTTP Config')\n for key,val in requests_config.get_config().iteritems():\n attack_config.set('Request Config', key, val)\n\n for key,val in bbqsql_config.get_config().iteritems():\n attack_config.set('HTTP Config', key, val)\n\n #get filename\n try:\n fname = raw_input('Config file name [./%s]: '%self.config_file)\n self.config_file = [fname,self.config_file][fname is '']\n with open(self.config_file, 'wb') as configfile:\n attack_config.write(configfile)\n except IOError:\n print 'Invalid Config or File Path'\n pass\n except KeyboardInterrupt:\n pass \n\n if choice == '4':\n # Import Config\n try:\n import readline\n readline.parse_and_bind('tab: complete')\n except ImportError:\n pass\n tmp_req_config = dict()\n tmp_http_config = dict()\n attack_config = RawConfigParser()\n\n #get filename\n try:\n readline.parse_and_bind('tab: complete')\n fname = raw_input('Config file name [./%s]: '%self.config_file)\n self.config_file = [fname,self.config_file][fname is '']\n attack_config.read(self.config_file)\n except:\n pass\n try:\n for key,val in attack_config.items('Request Config'):\n tmp_req_config[key] = val\n for key,val in attack_config.items('HTTP Config'):\n tmp_http_config[key] = val\n requests_config.set_config(tmp_req_config)\n bbqsql_config.set_config(tmp_http_config)\n except NoSectionError:\n print \"bad config file. try again\"\n\n if choice == '5' and valid:\n # Run Exploit\n results = None\n\n # add user defined hooks to our config\n if bbqsql_config['hooks_file'] and bbqsql_config['hooks_file']['hooks_dict']:\n bbqsql_config['hooks'] = {'value':bbqsql_config['hooks_file']['hooks_dict'],'name':'hooks','validator':lambda x:True}\n\n # combine them into one dictionary\n attack_config = {}\n attack_config.update(requests_config.get_config())\n attack_config.update(bbqsql_config.get_config())\n\n #delete unwanted config params before sending the config along\n for key in exclude_parms:\n if key in attack_config:\n del(attack_config[key])\n\n # launch attack\n bbq = bbqsql.BlindSQLi(**attack_config)\n if not bbq.error:\n error = None\n try:\n ok = raw_input('Everything lookin groovy?[y,n] ')\n except KeyboardInterrupt:\n ok = False\n if ok and ok[0] != 'n':\n #print bbq\n #time.sleep(5)\n results = bbq.run()\n #output to a file if thats what they're into\n if bbqsql_config['csv_output_file']['value'] is not None:\n f = open(bbqsql_config['csv_output_file']['value'],'w')\n f.write(\"\\n\".join(results))\n f.close()\n else:\n error = bbq.error\n # delete stuff\n del(bbq)\n if choice == '6':\n bbq_core.about()\n\n bbq_core.ExitBBQ(0)\n \n # ## handle keyboard interrupts\n except KeyboardInterrupt:\n print \"\\n\\n Cath you later \" + bbq_core.bcolors.RED+\"@\" + bbq_core.bcolors.ENDC+\" the dinner table.\"", "metadata": "root.bbqMenu.__init__", "header": "['class', 'bbqMenu', '(', ')', ':', '___EOS___']", "index": 20 } ]
[ { "span": "from bbq_core import bcolors", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 28 }, { "span": "import time", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 11 }, { "span": "import os", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 9 }, { "span": "import sys", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 10 }, { "span": "from ConfigParser import RawConfigParser,NoSectionError,MissingSectionHeaderError", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 81 }, { "span": "from copy import copy", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 21 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "bb", "qs", "ql_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "bb", "q", "\\u", "core_", "import_", "bcolors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "config_", "import_", "Request", "s", "Config_", ",_", "bb", "qs", "ql", "Config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "bb", "q", "\\u", "core_", "\\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_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "argparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Config", "Parser_", "import_", "Ra", "w", "Config", "Parser_", ",_", "No", "Sect", "ion", "Error_", ",_", "Missing", "Sect", "ion", "Head", "er", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "copy_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "config", " ", "params", " ", "tha", "t", " ", "are", " ", "only", " ", "used", " ", "in", " ", "the", " ", "menu", " ", "and", " ", "shou", "ld", "n", "'", "t", " ", "be", " ", "pass", "ed", " ", "along", " ", "to", " ", "Blin", "d", "SQL", "i", " ", "or", " ", "other", " ", "part", "s", " ", "of", " ", "bb", "qs", "ql_", "\\u\\u\\uNL\\u\\u\\u_", "exclu", "de", "\\u", "parms_", "=_", "[_", "'", "csv", "\\u", "output", "\\u", "file", "'_", ",_", "'", "hook", "s", "\\u", "file", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "main", " ", "menu_", "\\u\\u\\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_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", "prog_", "=_", "'", "bb", "qs", "ql", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "V", "'_", ",_", "'--", "version", "'_", ",_", "action_", "=_", "'", "version", "'_", ",_", "version_", "=_", "'%", "(", "prog", ")", "s", " ", "1.0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "c", "'_", ",_", "metavar_", "=_", "'", "config", "'_", ",_", "nargs_", "=_", "'+'_", ",_", "help_", "=_", "'", "import", " ", "config", " ", "file", "'_", ",_", "default_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "results_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "results_", "._", "c_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bb", "q", "Menu_", "(_", "results_", "._", "c_", "[_", "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 ", " _", "bb", "q", "Menu_", "(_", ")_", "\\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_", "bb", "q", "Menu_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "bb", "q", "Menu_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "run", "\\u", "config_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "default", " ", "name", " ", "for", " ", "config", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "config", "\\u", "file_", "=_", "'", "attac", "k", ".", "cfg", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request", "s", "\\u", "config_", "=_", "Request", "s", "Config_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bb", "qs", "ql", "\\u", "config_", "=_", "bb", "qs", "ql", "Config_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "inti", "tial", " ", "user", " ", "menu_", "\\u\\u\\uNL\\u\\u\\u_", "choice_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "choice_", "not_", "in_", "[_", "'", "9", "9", "'_", ",_", "99_", ",_", "'", "quit", "'_", ",_", "'", "exit", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bb", "q", "\\u", "core_", "._", "show", "\\u", "banner_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "\\u", "main", "\\u", "menu_", "=_", "bb", "q", "\\u", "core_", "._", "Creat", "e", "Menu_", "(_", "text_", "._", "main", "\\u", "text_", ",_", "text_", "._", "main", "\\u", "menu_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "special", " ", "case", " ", "of", " ", "list", " ", "item", " ", "99_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "n", " ", " ", "9", "9", ")", " ", "Exi", "t", " ", "the", " ", "bb", "qs", "ql", " ", "injection", " ", "tool", "kit", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rval", "id_", "=_", "request", "s", "\\u", "config_", "._", "validate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bv", "alid", "_", "=_", "bb", "qs", "ql", "\\u", "config_", "._", "validate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid_", "=_", "rval", "id_", "and_", "bv", "alid", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Big", " ", "results", "?", " ", " ", "throw", " ", "tha", "t", " ", "in", " ", "a", " ", "csv", " ", "file", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "results_", "and_", "len_", "(_", "results_", ")_", "<=_", "100_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "results_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "'\\\\", "n", "\\\\", "nb", "bq", "sql", " ", "recieve", "d", " ", "'_", "+_", "str_", "(_", "len_", "(_", "results_", ")_", ")_", "+_", "'", " ", "rows", " ", "of", " ", "data", ",", " ", "results", " ", "truncat", "ed", " ", "to", " ", "last", " ", "100", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "results_", "[_", "-_", "100_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "n", "\\\\", "npl", "eas", "e", " ", "provide", " ", "a", " ", "filename", " ", "so", " ", "we", " ", "can", " ", "save", " ", "all", " ", "the", " ", "results", " ", "for", " ", "you", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "import_", "readline_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "readline_", "._", "parse", "\\u", "and", "\\u", "bind_", "(_", "'", "tab", ":", " ", "complete", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "'", "readline", " ", "module", " ", "not", " ", "found", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "readline_", "._", "parse", "\\u", "and", "\\u", "bind_", "(_", "'", "tab", ":", " ", "complete", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fname_", "=_", "raw", "\\u", "input_", "(_", "'", "CSV", " ", "file", " ", "name", " ", "[.", "/", "results", ".", "csv", "]:", " ", "'_", ")_", "\\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_", "\"", "somet", "hing", " ", "wen", "t", " ", "wrong", ",", " ", "did", "n", "'", "t", " ", "write", " ", "results", " ", "to", " ", "a", " ", "file", "\"_", "\\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_", "fname_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "f_", "=_", "open_", "(_", "fname_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "\"\\\\", "n", "\"_", "._", "join_", "(_", "\",\"_", ",_", "results_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\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_", "error_", ":_", "print_", "bb", "q", "\\u", "core_", "._", "bcolors_", "._", "RED_", "+_", "error_", "+_", "bb", "q", "\\u", "core_", "._", "bcolors_", "._", "ENDC_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "run", "\\u", "config_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "tmp", "\\u", "req", "\\u", "config_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "http", "\\u", "config_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "attac", "k", "\\u", "config_", "=_", "Ra", "w", "Config", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "config", "\\u", "file_", "=_", "[_", "run", "\\u", "config_", ",_", "self_", "._", "config", "\\u", "file_", "]_", "[_", "run", "\\u", "config_", "is_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "attac", "k", "\\u", "config_", "._", "read_", "(_", "self_", "._", "config", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "key_", ",_", "val_", "in_", "attac", "k", "\\u", "config_", "._", "items_", "(_", "'", "Request", " ", "Config", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "tmp", "\\u", "req", "\\u", "config_", "[_", "key_", "]_", "=_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", ",_", "val_", "in_", "attac", "k", "\\u", "config_", "._", "items_", "(_", "'", "HTTP", " ", "Config", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "tmp", "\\u", "http", "\\u", "config_", "[_", "key_", "]_", "=_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "request", "s", "\\u", "config_", "._", "set\\u", "config_", "(_", "tmp", "\\u", "req", "\\u", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bb", "qs", "ql", "\\u", "config_", "._", "set\\u", "config_", "(_", "tmp", "\\u", "http", "\\u", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "No", "Sect", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"", "bad", " ", "config", " ", "file", ".", " ", "try", " ", "again", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Load", "ed", " ", "config", " ", "so", " ", "clear", " ", "it", " ", "out_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "run", "\\u", "config_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "main", "c", " ", "ore", " ", "menu_", "\\u\\u\\uNL\\u\\u\\u_", "choice_", "=_", "(_", "raw", "\\u", "input_", "(_", "bb", "q", "\\u", "core_", "._", "setp", "rom", "pt_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "choice_", "==_", "'", "1", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Run", " ", "configura", "tion", " ", "REP", "L", " ", "for", " ", "HTTP", " ", "variables_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "request", "s", "\\u", "config_", "._", "run", "\\u", "config_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "choice_", "==_", "'", "2", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Run", " ", "configura", "tion", " ", "REP", "L", " ", "for", " ", "bb", "qs", "ql", " ", "variables_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "bb", "qs", "ql", "\\u", "config_", "._", "run", "\\u", "config_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "choice_", "==_", "'", "3", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Export", " ", "Config_", "\\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 ", " ", " _", "import_", "readline_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "readline_", "._", "parse", "\\u", "and", "\\u", "bind_", "(_", "'", "tab", ":", " ", "complete", "'_", ")_", "\\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\\uDEDENT\\u\\u\\u_", "attac", "k", "\\u", "config_", "=_", "Ra", "w", "Config", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "attac", "k", "\\u", "config_", "._", "add", "\\u", "section_", "(_", "'", "Request", " ", "Config", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "attac", "k", "\\u", "config_", "._", "add", "\\u", "section_", "(_", "'", "HTTP", " ", "Config", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", ",_", "val_", "in_", "request", "s", "\\u", "config_", "._", "get", "\\u", "config_", "(_", ")_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "attac", "k", "\\u", "config_", "._", "set_", "(_", "'", "Request", " ", "Config", "'_", ",_", "key_", ",_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", ",_", "val_", "in_", "bb", "qs", "ql", "\\u", "config_", "._", "get", "\\u", "config_", "(_", ")_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "attac", "k", "\\u", "config_", "._", "set_", "(_", "'", "HTTP", " ", "Config", "'_", ",_", "key_", ",_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "get", " ", "filename_", "\\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 ", " ", " _", "fname_", "=_", "raw", "\\u", "input_", "(_", "'", "Config", " ", "file", " ", "name", " ", "[.", "/", "%", "s", "]:", " ", "'_", "%_", "self_", "._", "config", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "config", "\\u", "file_", "=_", "[_", "fname_", ",_", "self_", "._", "config", "\\u", "file_", "]_", "[_", "fname_", "is_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "self_", "._", "config", "\\u", "file_", ",_", "'", "wb", "'_", ")_", "as_", "configfile_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "attac", "k", "\\u", "config_", "._", "write_", "(_", "configfile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "IO", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "'", "Inva", "lid", " ", "Config", " ", "or", " ", "File", " ", "Path", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "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_", "choice_", "==_", "'", "4", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Import", " ", "Config_", "\\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 ", " ", " _", "import_", "readline_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "readline_", "._", "parse", "\\u", "and", "\\u", "bind_", "(_", "'", "tab", ":", " ", "complete", "'_", ")_", "\\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\\uDEDENT\\u\\u\\u_", "tmp", "\\u", "req", "\\u", "config_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "http", "\\u", "config_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "attac", "k", "\\u", "config_", "=_", "Ra", "w", "Config", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "get", " ", "filename_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "readline_", "._", "parse", "\\u", "and", "\\u", "bind_", "(_", "'", "tab", ":", " ", "complete", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fname_", "=_", "raw", "\\u", "input_", "(_", "'", "Config", " ", "file", " ", "name", " ", "[.", "/", "%", "s", "]:", " ", "'_", "%_", "self_", "._", "config", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "config", "\\u", "file_", "=_", "[_", "fname_", ",_", "self_", "._", "config", "\\u", "file_", "]_", "[_", "fname_", "is_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "attac", "k", "\\u", "config_", "._", "read_", "(_", "self_", "._", "config", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "key_", ",_", "val_", "in_", "attac", "k", "\\u", "config_", "._", "items_", "(_", "'", "Request", " ", "Config", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "tmp", "\\u", "req", "\\u", "config_", "[_", "key_", "]_", "=_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", ",_", "val_", "in_", "attac", "k", "\\u", "config_", "._", "items_", "(_", "'", "HTTP", " ", "Config", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "tmp", "\\u", "http", "\\u", "config_", "[_", "key_", "]_", "=_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "request", "s", "\\u", "config_", "._", "set\\u", "config_", "(_", "tmp", "\\u", "req", "\\u", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bb", "qs", "ql", "\\u", "config_", "._", "set\\u", "config_", "(_", "tmp", "\\u", "http", "\\u", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "No", "Sect", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"", "bad", " ", "config", " ", "file", ".", " ", "try", " ", "again", "\"_", "\\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_", "choice_", "==_", "'", "5", "'_", "and_", "valid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Run", " ", "Explo", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "results_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "user", " ", "defin", "ed", " ", "hook", "s", " ", "to", " ", "our", " ", "config_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "bb", "qs", "ql", "\\u", "config_", "[_", "'", "hook", "s", "\\u", "file", "'_", "]_", "and_", "bb", "qs", "ql", "\\u", "config_", "[_", "'", "hook", "s", "\\u", "file", "'_", "]_", "[_", "'", "hook", "s", "\\u", "dict", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "bb", "qs", "ql", "\\u", "config_", "[_", "'", "hook", "s", "'_", "]_", "=_", "{_", "'", "value", "'_", ":_", "bb", "qs", "ql", "\\u", "config_", "[_", "'", "hook", "s", "\\u", "file", "'_", "]_", "[_", "'", "hook", "s", "\\u", "dict", "'_", "]_", ",_", "'", "name", "'_", ":_", "'", "hook", "s", "'_", ",_", "'", "validator", "'_", ":_", "lambda_", "x_", ":_", "True_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "combin", "e", " ", "them", " ", "int", "o", " ", "one", " ", "dictionary_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "attac", "k", "\\u", "config_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "attac", "k", "\\u", "config_", "._", "update_", "(_", "request", "s", "\\u", "config_", "._", "get", "\\u", "config_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "attac", "k", "\\u", "config_", "._", "update_", "(_", "bb", "qs", "ql", "\\u", "config_", "._", "get", "\\u", "config_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "delete", " ", "unwa", "nte", "d", " ", "config", " ", "params", " ", "bef", "ore", " ", "sendin", "g", " ", "the", " ", "config", " ", "along", "_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", "in_", "exclu", "de", "\\u", "parms_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "key_", "in_", "attac", "k", "\\u", "config_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "del_", "(_", "attac", "k", "\\u", "config_", "[_", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "launch", " ", "attack_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bb", "q_", "=_", "bb", "qs", "ql_", "._", "Blin", "d", "SQL", "i_", "(_", "**_", "attac", "k", "\\u", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "bb", "q_", "._", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "error_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ok_", "=_", "raw", "\\u", "input_", "(_", "'", "Every", "thing", " ", "look", "in", " ", "groo", "vy", "?", "[", "y", ",", "n", "]", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ok_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ok_", "and_", "ok_", "[_", "0_", "]_", "!=_", "'", "n", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "bb", "q_", "\\u\\u\\uNL\\u\\u\\u_", "#", "time", ".", "sleep", "(", "5", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "results_", "=_", "bb", "q_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "output", " ", "to", " ", "a", " ", "file", " ", "if", " ", "tha", "ts", " ", "what", " ", "the", "y", "'", "re", " ", "into_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "bb", "qs", "ql", "\\u", "config_", "[_", "'", "csv", "\\u", "output", "\\u", "file", "'_", "]_", "[_", "'", "value", "'_", "]_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "f_", "=_", "open_", "(_", "bb", "qs", "ql", "\\u", "config_", "[_", "'", "csv", "\\u", "output", "\\u", "file", "'_", "]_", "[_", "'", "value", "'_", "]_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "\"\\\\", "n", "\"_", "._", "join_", "(_", "results_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\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 ", " ", " _", "error_", "=_", "bb", "q_", "._", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "delete", " ", "stuff_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "del_", "(_", "bb", "q_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "choice_", "==_", "'", "6", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "bb", "q", "\\u", "core_", "._", "about_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bb", "q", "\\u", "core_", "._", "Exi", "t", "BB", "Q_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "##", " ", "handle", " ", "keyb", "oard", " ", "interrupt", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"\\\\", "n", "\\\\", "n", " ", "Cat", "h", " ", "you", " ", "late", "r", " ", "\"_", "+_", "bb", "q", "\\u", "core_", "._", "bcolors_", "._", "RED_", "+_", "\"@\"_", "+_", "bb", "q", "\\u", "core_", "._", "bcolors_", "._", "ENDC_", "+_", "\"", " ", "the", " ", "din", "ner", " ", "table", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unreachable code
samluescher/django-form-designer/form_designer/migrations/0009_set_data_to_form_log.py
[ { "content": " def backwards(self, orm):\n for log in orm['form_designer.FormLog'].objects.all():\n log.data = log.get_data()\n raise Exception(log.data)\n log.save()", "metadata": "root.Migration.backwards", "header": "['class', 'Migration', '(', 'DataMigration', ')', ':', '___EOS___']", "index": 26 } ]
[ { "span": "log.save()", "start_line": 30, "start_column": 12, "end_line": 30, "end_column": 22 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "class_", "Migration_", "(_", "Data", "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\\uINDENT\\u\\u\\u ", " _", "for_", "log_", "in_", "orm_", "[_", "'", "form", "\\u", "designer", ".", "Form", "Log", "'_", "]_", "._", "objects_", "._", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "data_", "=_", "log_", "._", "get", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Exception_", "(_", "log_", "._", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 2 ]
Unused import
CollabQ/CollabQ/vendor/django/db/models/fields/__init__.py
[ { "content": "import copy\nimport datetime\nimport os\nimport re\nimport time\ntry:\n import decimal\nexcept ImportError:\n from django.utils import _decimal as decimal # for Python 2.3\n\nfrom django.db import connection\nfrom django.db.models import signals\nfrom django.db.models.query_utils import QueryWrapper\nfrom django.dispatch import dispatcher\nfrom django.conf import settings\nfrom django import forms\nfrom django.core import exceptions\nfrom django.utils.datastructures import DictWrapper\nfrom django.utils.functional import curry\nfrom django.utils.itercompat import tee\nfrom django.utils.text import capfirst\nfrom django.utils.translation import ugettext_lazy, ugettext as _\nfrom django.utils.encoding import smart_unicode, force_unicode, smart_str\nfrom django.utils import datetime_safe\n\n\n# The values to use for \"blank\" in SelectFields. Will be appended to the start of most \"choices\" lists.\nBLANK_CHOICE_DASH = [(\"\", \"---------\")]\nBLANK_CHOICE_NONE = [(\"\", \"None\")]\n\n\n# A guide to Field parameters:\n#\n# * name: The name of the field specifed in the model.\n# * attname: The attribute to use on the model object. This is the same as\n# \"name\", except in the case of ForeignKeys, where \"_id\" is\n# appended.\n# * db_column: The db_column specified in the model (or None).\n# * column: The database column for this field. This is the same as\n# \"attname\", except if db_column is specified.\n#\n# Code that introspects values, or does other dynamic things, should use\n# attname. For example, this gets the primary key value of object \"obj\":\n#\n# getattr(obj, opts.pk.attname)\n\n\n\n\n\n# TODO: Maybe move this into contrib, because it's specialized.\n\nansi_date_re = re.compile(r'^\\d{4}-\\d{1,2}-\\d{1,2}$')\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class NOT_PROVIDED:\n pass", "metadata": "root.NOT_PROVIDED", "header": "['module', '___EOS___']", "index": 25 }, { "content": "class FieldDoesNotExist(Exception):\n pass", "metadata": "root.FieldDoesNotExist", "header": "['module', '___EOS___']", "index": 32 }, { "content": "class Field(object):\n # Designates whether empty strings fundamentally are allowed at the\n # database level.\n empty_strings_allowed = True\n\n # These track each time a Field instance is created. Used to retain order.\n # The auto_creation_counter is used for fields that Django implicitly\n # creates, creation_counter is used for all user-specified fields.\n creation_counter = 0\n auto_creation_counter = -1\n\n\n\n\n\n\n unique = property(unique)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n choices = property(_get_choices)\n\n flatchoices = property(_get_flatchoices)\n\n\n", "metadata": "root.Field", "header": "['module', '___EOS___']", "index": 50 }, { "content": " def __init__(self, verbose_name=None, name=None, primary_key=False,\n max_length=None, unique=False, blank=False, null=False,\n db_index=False, rel=None, default=NOT_PROVIDED, editable=True,\n serialize=True, unique_for_date=None, unique_for_month=None,\n unique_for_year=None, choices=None, help_text='', db_column=None,\n db_tablespace=None, auto_created=False):\n self.name = name\n self.verbose_name = verbose_name\n self.primary_key = primary_key\n self.max_length, self._unique = max_length, unique\n self.blank, self.null = blank, null\n # Oracle treats the empty string ('') as null, so coerce the null\n # option whenever '' is a possible value.\n if self.empty_strings_allowed and connection.features.interprets_empty_strings_as_nulls:\n self.null = True\n self.rel = rel\n self.default = default\n self.editable = editable\n self.serialize = serialize\n self.unique_for_date, self.unique_for_month = unique_for_date, unique_for_month\n self.unique_for_year = unique_for_year\n self._choices = choices or []\n self.help_text = help_text\n self.db_column = db_column\n self.db_tablespace = db_tablespace or settings.DEFAULT_INDEX_TABLESPACE\n self.auto_created = auto_created\n\n # Set db_index to True if the field has a relationship and doesn't explicitly set db_index.\n self.db_index = db_index\n\n # Adjust the appropriate creation counter, and save our local copy.\n if auto_created:\n self.creation_counter = Field.auto_creation_counter\n Field.auto_creation_counter -= 1\n else:\n self.creation_counter = Field.creation_counter\n Field.creation_counter += 1", "metadata": "root.Field.__init__", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 61 }, { "content": " def __cmp__(self, other):\n # This is needed because bisect does not take a comparison function.\n return cmp(self.creation_counter, other.creation_counter)", "metadata": "root.Field.__cmp__", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 99 }, { "content": " def __deepcopy__(self, memodict):\n # We don't have to deepcopy very much here, since most things are not\n # intended to be altered after initial creation.\n obj = copy.copy(self)\n if self.rel:\n obj.rel = copy.copy(self.rel)\n memodict[id(self)] = obj\n return obj", "metadata": "root.Field.__deepcopy__", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 103 }, { "content": " def to_python(self, value):\n \"\"\"\n Converts the input value into the expected Python data type, raising\n django.core.exceptions.ValidationError if the data can't be converted.\n Returns the converted value. Subclasses should override this.\n \"\"\"\n return value", "metadata": "root.Field.to_python", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 112 }, { "content": " def db_type(self):\n \"\"\"\n Returns the database column data type for this field, taking into\n account the DATABASE_ENGINE setting.\n \"\"\"\n # The default implementation of this method looks at the\n # backend-specific DATA_TYPES dictionary, looking up the field by its\n # \"internal type\".\n #\n # A Field class can implement the get_internal_type() method to specify\n # which *preexisting* Django Field class it's most similar to -- i.e.,\n # an XMLField is represented by a TEXT column type, which is the same\n # as the TextField Django field type, which means XMLField's\n # get_internal_type() returns 'TextField'.\n #\n # But the limitation of the get_internal_type() / data_types approach\n # is that it cannot handle database column types that aren't already\n # mapped to one of the built-in Django field types. In this case, you\n # can implement db_type() instead of get_internal_type() to specify\n # exactly which wacky database column type you want to use.\n data = DictWrapper(self.__dict__, connection.ops.quote_name, \"qn_\")\n try:\n return connection.creation.data_types[self.get_internal_type()] % data\n except KeyError:\n return None", "metadata": "root.Field.db_type", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 120 }, { "content": " def unique(self):\n return self._unique or self.primary_key", "metadata": "root.Field.unique", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 146 }, { "content": " def set_attributes_from_name(self, name):\n self.name = name\n self.attname, self.column = self.get_attname_column()\n if self.verbose_name is None and name:\n self.verbose_name = name.replace('_', ' ')", "metadata": "root.Field.set_attributes_from_name", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 150 }, { "content": " def contribute_to_class(self, cls, name):\n self.set_attributes_from_name(name)\n cls._meta.add_field(self)\n if self.choices:\n setattr(cls, 'get_%s_display' % self.name, curry(cls._get_FIELD_display, field=self))", "metadata": "root.Field.contribute_to_class", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 156 }, { "content": " def get_attname(self):\n return self.name", "metadata": "root.Field.get_attname", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 162 }, { "content": " def get_attname_column(self):\n attname = self.get_attname()\n column = self.db_column or attname\n return attname, column", "metadata": "root.Field.get_attname_column", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 165 }, { "content": " def get_cache_name(self):\n return '_%s_cache' % self.name", "metadata": "root.Field.get_cache_name", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 170 }, { "content": " def get_internal_type(self):\n return self.__class__.__name__", "metadata": "root.Field.get_internal_type", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 173 }, { "content": " def pre_save(self, model_instance, add):\n \"Returns field's value just before saving.\"\n return getattr(model_instance, self.attname)", "metadata": "root.Field.pre_save", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 176 }, { "content": " def get_db_prep_value(self, value):\n \"\"\"Returns field's value prepared for interacting with the database\n backend.\n\n Used by the default implementations of ``get_db_prep_save``and\n `get_db_prep_lookup```\n \"\"\"\n return value", "metadata": "root.Field.get_db_prep_value", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 180 }, { "content": " def get_db_prep_save(self, value):\n \"Returns field's value prepared for saving into a database.\"\n return self.get_db_prep_value(value)", "metadata": "root.Field.get_db_prep_save", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 189 }, { "content": " def get_db_prep_lookup(self, lookup_type, value):\n \"Returns field's value prepared for database lookup.\"\n if hasattr(value, 'as_sql') or hasattr(value, '_as_sql'):\n # If the value has a relabel_aliases method, it will need to\n # be invoked before the final SQL is evaluated\n if hasattr(value, 'relabel_aliases'):\n return value\n if hasattr(value, 'as_sql'):\n sql, params = value.as_sql()\n else:\n sql, params = value._as_sql()\n return QueryWrapper(('(%s)' % sql), params)\n\n if lookup_type in ('regex', 'iregex', 'month', 'day', 'week_day', 'search'):\n return [value]\n elif lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte'):\n return [self.get_db_prep_value(value)]\n elif lookup_type in ('range', 'in'):\n return [self.get_db_prep_value(v) for v in value]\n elif lookup_type in ('contains', 'icontains'):\n return [\"%%%s%%\" % connection.ops.prep_for_like_query(value)]\n elif lookup_type == 'iexact':\n return [connection.ops.prep_for_iexact_query(value)]\n elif lookup_type in ('startswith', 'istartswith'):\n return [\"%s%%\" % connection.ops.prep_for_like_query(value)]\n elif lookup_type in ('endswith', 'iendswith'):\n return [\"%%%s\" % connection.ops.prep_for_like_query(value)]\n elif lookup_type == 'isnull':\n return []\n elif lookup_type == 'year':\n try:\n value = int(value)\n except ValueError:\n raise ValueError(\"The __year lookup type requires an integer argument\")\n\n if self.get_internal_type() == 'DateField':\n return connection.ops.year_lookup_bounds_for_date_field(value)\n else:\n return connection.ops.year_lookup_bounds(value)\n\n raise TypeError(\"Field has invalid lookup: %s\" % lookup_type)", "metadata": "root.Field.get_db_prep_lookup", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 193 }, { "content": " def has_default(self):\n \"Returns a boolean of whether this field has a default value.\"\n return self.default is not NOT_PROVIDED", "metadata": "root.Field.has_default", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 235 }, { "content": " def get_default(self):\n \"Returns the default value for this field.\"\n if self.has_default():\n if callable(self.default):\n return self.default()\n return force_unicode(self.default, strings_only=True)\n if not self.empty_strings_allowed or (self.null and not connection.features.interprets_empty_strings_as_nulls):\n return None\n return \"\"", "metadata": "root.Field.get_default", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 239 }, { "content": " def get_validator_unique_lookup_type(self):\n return '%s__exact' % self.name", "metadata": "root.Field.get_validator_unique_lookup_type", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 249 }, { "content": " def get_choices(self, include_blank=True, blank_choice=BLANK_CHOICE_DASH):\n \"\"\"Returns choices with a default blank choices included, for use\n as SelectField choices for this field.\"\"\"\n first_choice = include_blank and blank_choice or []\n if self.choices:\n return first_choice + list(self.choices)\n rel_model = self.rel.to\n if hasattr(self.rel, 'get_related_field'):\n lst = [(getattr(x, self.rel.get_related_field().attname), smart_unicode(x)) for x in rel_model._default_manager.complex_filter(self.rel.limit_choices_to)]\n else:\n lst = [(x._get_pk_val(), smart_unicode(x)) for x in rel_model._default_manager.complex_filter(self.rel.limit_choices_to)]\n return first_choice + lst", "metadata": "root.Field.get_choices", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 252 }, { "content": " def get_choices_default(self):\n return self.get_choices()", "metadata": "root.Field.get_choices_default", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 265 }, { "content": " def get_flatchoices(self, include_blank=True, blank_choice=BLANK_CHOICE_DASH):\n \"Returns flattened choices with a default blank choice included.\"\n first_choice = include_blank and blank_choice or []\n return first_choice + list(self.flatchoices)", "metadata": "root.Field.get_flatchoices", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 268 }, { "content": " def _get_val_from_obj(self, obj):\n if obj:\n return getattr(obj, self.attname)\n else:\n return self.get_default()", "metadata": "root.Field._get_val_from_obj", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 273 }, { "content": " def value_to_string(self, obj):\n \"\"\"\n Returns a string value of this field from the passed obj.\n This is used by the serialization framework.\n \"\"\"\n return smart_unicode(self._get_val_from_obj(obj))", "metadata": "root.Field.value_to_string", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 279 }, { "content": " def bind(self, fieldmapping, original, bound_field_class):\n return bound_field_class(self, fieldmapping, original)", "metadata": "root.Field.bind", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 286 }, { "content": " def _get_choices(self):\n if hasattr(self._choices, 'next'):\n choices, self._choices = tee(self._choices)\n return choices\n else:\n return self._choices", "metadata": "root.Field._get_choices", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 289 }, { "content": " def _get_flatchoices(self):\n \"\"\"Flattened version of choices tuple.\"\"\"\n flat = []\n for choice, value in self.choices:\n if type(value) in (list, tuple):\n flat.extend(value)\n else:\n flat.append((choice,value))\n return flat", "metadata": "root.Field._get_flatchoices", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 297 }, { "content": " def save_form_data(self, instance, data):\n setattr(instance, self.name, data)", "metadata": "root.Field.save_form_data", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 308 }, { "content": " def formfield(self, form_class=forms.CharField, **kwargs):\n \"Returns a django.forms.Field instance for this database Field.\"\n defaults = {'required': not self.blank, 'label': capfirst(self.verbose_name), 'help_text': self.help_text}\n if self.has_default():\n defaults['initial'] = self.get_default()\n if callable(self.default):\n defaults['show_hidden_initial'] = True\n if self.choices:\n # Fields with choices get special treatment.\n include_blank = self.blank or not (self.has_default() or 'initial' in kwargs)\n defaults['choices'] = self.get_choices(include_blank=include_blank)\n defaults['coerce'] = self.to_python\n if self.null:\n defaults['empty_value'] = None\n form_class = forms.TypedChoiceField\n # Many of the subclass-specific formfield arguments (min_value,\n # max_value) don't apply for choice fields, so be sure to only pass\n # the values that TypedChoiceField will understand.\n for k in kwargs.keys():\n if k not in ('coerce', 'empty_value', 'choices', 'required',\n 'widget', 'label', 'initial', 'help_text',\n 'error_messages'):\n del kwargs[k]\n defaults.update(kwargs)\n return form_class(**defaults)", "metadata": "root.Field.formfield", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 311 }, { "content": " def value_from_object(self, obj):\n \"Returns the value of this field in the given model instance.\"\n return getattr(obj, self.attname)", "metadata": "root.Field.value_from_object", "header": "['class', 'Field', '(', 'object', ')', ':', '___NEWLINE___', '# Designates whether empty strings fundamentally are allowed at the', '___NL___', '# database level.', '___NL___', '___EOS___']", "index": 337 }, { "content": "class AutoField(Field):\n empty_strings_allowed = False\n\n\n\n", "metadata": "root.AutoField", "header": "['module', '___EOS___']", "index": 341 }, { "content": " def __init__(self, *args, **kwargs):\n assert kwargs.get('primary_key', False) is True, \"%ss must have primary_key=True.\" % self.__class__.__name__\n kwargs['blank'] = True\n Field.__init__(self, *args, **kwargs)", "metadata": "root.AutoField.__init__", "header": "['class', 'AutoField', '(', 'Field', ')', ':', '___EOS___']", "index": 343 }, { "content": " def to_python(self, value):\n if value is None:\n return value\n try:\n return int(value)\n except (TypeError, ValueError):\n raise exceptions.ValidationError(\n _(\"This value must be an integer.\"))", "metadata": "root.AutoField.to_python", "header": "['class', 'AutoField', '(', 'Field', ')', ':', '___EOS___']", "index": 348 }, { "content": " def get_db_prep_value(self, value):\n if value is None:\n return None\n return int(value)", "metadata": "root.AutoField.get_db_prep_value", "header": "['class', 'AutoField', '(', 'Field', ')', ':', '___EOS___']", "index": 357 }, { "content": " def contribute_to_class(self, cls, name):\n assert not cls._meta.has_auto_field, \"A model can't have more than one AutoField.\"\n super(AutoField, self).contribute_to_class(cls, name)\n cls._meta.has_auto_field = True\n cls._meta.auto_field = self", "metadata": "root.AutoField.contribute_to_class", "header": "['class', 'AutoField', '(', 'Field', ')', ':', '___EOS___']", "index": 362 }, { "content": " def formfield(self, **kwargs):\n return None", "metadata": "root.AutoField.formfield", "header": "['class', 'AutoField', '(', 'Field', ')', ':', '___EOS___']", "index": 368 }, { "content": "class BooleanField(Field):\n empty_strings_allowed = False\n\n\n\n\n", "metadata": "root.BooleanField", "header": "['module', '___EOS___']", "index": 371 }, { "content": " def __init__(self, *args, **kwargs):\n kwargs['blank'] = True\n if 'default' not in kwargs and not kwargs.get('null'):\n kwargs['default'] = False\n Field.__init__(self, *args, **kwargs)", "metadata": "root.BooleanField.__init__", "header": "['class', 'BooleanField', '(', 'Field', ')', ':', '___EOS___']", "index": 373 }, { "content": " def get_internal_type(self):\n return \"BooleanField\"", "metadata": "root.BooleanField.get_internal_type", "header": "['class', 'BooleanField', '(', 'Field', ')', ':', '___EOS___']", "index": 379 }, { "content": " def to_python(self, value):\n if value in (True, False): return value\n if value in ('t', 'True', '1'): return True\n if value in ('f', 'False', '0'): return False\n raise exceptions.ValidationError(\n _(\"This value must be either True or False.\"))", "metadata": "root.BooleanField.to_python", "header": "['class', 'BooleanField', '(', 'Field', ')', ':', '___EOS___']", "index": 382 }, { "content": " def get_db_prep_lookup(self, lookup_type, value):\n # Special-case handling for filters coming from a web request (e.g. the\n # admin interface). Only works for scalar values (not lists). If you're\n # passing in a list, you might as well make things the right type when\n # constructing the list.\n if value in ('1', '0'):\n value = bool(int(value))\n return super(BooleanField, self).get_db_prep_lookup(lookup_type, value)", "metadata": "root.BooleanField.get_db_prep_lookup", "header": "['class', 'BooleanField', '(', 'Field', ')', ':', '___EOS___']", "index": 389 }, { "content": " def get_db_prep_value(self, value):\n if value is None:\n return None\n return bool(value)", "metadata": "root.BooleanField.get_db_prep_value", "header": "['class', 'BooleanField', '(', 'Field', ')', ':', '___EOS___']", "index": 398 }, { "content": " def formfield(self, **kwargs):\n # Unlike most fields, BooleanField figures out include_blank from\n # self.null instead of self.blank.\n if self.choices:\n include_blank = self.null or not (self.has_default() or 'initial' in kwargs)\n defaults = {'choices': self.get_choices(include_blank=include_blank)}\n else:\n defaults = {'form_class': forms.BooleanField}\n defaults.update(kwargs)\n return super(BooleanField, self).formfield(**defaults)", "metadata": "root.BooleanField.formfield", "header": "['class', 'BooleanField', '(', 'Field', ')', ':', '___EOS___']", "index": 403 }, { "content": "class CharField(Field):\n\n", "metadata": "root.CharField", "header": "['module', '___EOS___']", "index": 414 }, { "content": " def get_internal_type(self):\n return \"CharField\"", "metadata": "root.CharField.get_internal_type", "header": "['class', 'CharField', '(', 'Field', ')', ':', '___EOS___']", "index": 415 }, { "content": " def to_python(self, value):\n if isinstance(value, basestring):\n return value\n if value is None:\n if self.null:\n return value\n else:\n raise exceptions.ValidationError(\n ugettext_lazy(\"This field cannot be null.\"))\n return smart_unicode(value)", "metadata": "root.CharField.to_python", "header": "['class', 'CharField', '(', 'Field', ')', ':', '___EOS___']", "index": 418 }, { "content": " def formfield(self, **kwargs):\n defaults = {'max_length': self.max_length}\n defaults.update(kwargs)\n return super(CharField, self).formfield(**defaults)", "metadata": "root.CharField.formfield", "header": "['class', 'CharField', '(', 'Field', ')', ':', '___EOS___']", "index": 429 }, { "content": "class CommaSeparatedIntegerField(CharField):", "metadata": "root.CommaSeparatedIntegerField", "header": "['module', '___EOS___']", "index": 435 }, { "content": " def formfield(self, **kwargs):\n defaults = {\n 'form_class': forms.RegexField,\n 'regex': '^[\\d,]+$',\n 'max_length': self.max_length,\n 'error_messages': {\n 'invalid': _(u'Enter only digits separated by commas.'),\n }\n }\n defaults.update(kwargs)\n return super(CommaSeparatedIntegerField, self).formfield(**defaults)", "metadata": "root.CommaSeparatedIntegerField.formfield", "header": "['class', 'CommaSeparatedIntegerField', '(', 'CharField', ')', ':', '___EOS___']", "index": 436 }, { "content": "class DateField(Field):\n empty_strings_allowed = False\n\n\n\n\n\n\n\n", "metadata": "root.DateField", "header": "['module', '___EOS___']", "index": 450 }, { "content": " def __init__(self, verbose_name=None, name=None, auto_now=False, auto_now_add=False, **kwargs):\n self.auto_now, self.auto_now_add = auto_now, auto_now_add\n #HACKs : auto_now_add/auto_now should be done as a default or a pre_save.\n if auto_now or auto_now_add:\n kwargs['editable'] = False\n kwargs['blank'] = True\n Field.__init__(self, verbose_name, name, **kwargs)", "metadata": "root.DateField.__init__", "header": "['class', 'DateField', '(', 'Field', ')', ':', '___EOS___']", "index": 452 }, { "content": " def get_internal_type(self):\n return \"DateField\"", "metadata": "root.DateField.get_internal_type", "header": "['class', 'DateField', '(', 'Field', ')', ':', '___EOS___']", "index": 460 }, { "content": " def to_python(self, value):\n if value is None:\n return value\n if isinstance(value, datetime.datetime):\n return value.date()\n if isinstance(value, datetime.date):\n return value\n\n if not ansi_date_re.search(value):\n raise exceptions.ValidationError(\n _('Enter a valid date in YYYY-MM-DD format.'))\n # Now that we have the date string in YYYY-MM-DD format, check to make\n # sure it's a valid date.\n # We could use time.strptime here and catch errors, but datetime.date\n # produces much friendlier error messages.\n year, month, day = map(int, value.split('-'))\n try:\n return datetime.date(year, month, day)\n except ValueError, e:\n msg = _('Invalid date: %s') % _(str(e))\n raise exceptions.ValidationError(msg)", "metadata": "root.DateField.to_python", "header": "['class', 'DateField', '(', 'Field', ')', ':', '___EOS___']", "index": 463 }, { "content": " def pre_save(self, model_instance, add):\n if self.auto_now or (self.auto_now_add and add):\n value = datetime.datetime.now()\n setattr(model_instance, self.attname, value)\n return value\n else:\n return super(DateField, self).pre_save(model_instance, add)", "metadata": "root.DateField.pre_save", "header": "['class', 'DateField', '(', 'Field', ')', ':', '___EOS___']", "index": 485 }, { "content": " def contribute_to_class(self, cls, name):\n super(DateField,self).contribute_to_class(cls, name)\n if not self.null:\n setattr(cls, 'get_next_by_%s' % self.name,\n curry(cls._get_next_or_previous_by_FIELD, field=self, is_next=True))\n setattr(cls, 'get_previous_by_%s' % self.name,\n curry(cls._get_next_or_previous_by_FIELD, field=self, is_next=False))", "metadata": "root.DateField.contribute_to_class", "header": "['class', 'DateField', '(', 'Field', ')', ':', '___EOS___']", "index": 493 }, { "content": " def get_db_prep_lookup(self, lookup_type, value):\n # For \"__month\", \"__day\", and \"__week_day\" lookups, convert the value\n # to an int so the database backend always sees a consistent type.\n if lookup_type in ('month', 'day', 'week_day'):\n return [int(value)]\n return super(DateField, self).get_db_prep_lookup(lookup_type, value)", "metadata": "root.DateField.get_db_prep_lookup", "header": "['class', 'DateField', '(', 'Field', ')', ':', '___EOS___']", "index": 501 }, { "content": " def get_db_prep_value(self, value):\n # Casts dates into the format expected by the backend\n return connection.ops.value_to_db_date(self.to_python(value))", "metadata": "root.DateField.get_db_prep_value", "header": "['class', 'DateField', '(', 'Field', ')', ':', '___EOS___']", "index": 508 }, { "content": " def value_to_string(self, obj):\n val = self._get_val_from_obj(obj)\n if val is None:\n data = ''\n else:\n data = datetime_safe.new_date(val).strftime(\"%Y-%m-%d\")\n return data", "metadata": "root.DateField.value_to_string", "header": "['class', 'DateField', '(', 'Field', ')', ':', '___EOS___']", "index": 512 }, { "content": " def formfield(self, **kwargs):\n defaults = {'form_class': forms.DateField}\n defaults.update(kwargs)\n return super(DateField, self).formfield(**defaults)", "metadata": "root.DateField.formfield", "header": "['class', 'DateField', '(', 'Field', ')', ':', '___EOS___']", "index": 520 }, { "content": "class DateTimeField(DateField):\n\n\n\n", "metadata": "root.DateTimeField", "header": "['module', '___EOS___']", "index": 525 }, { "content": " def get_internal_type(self):\n return \"DateTimeField\"", "metadata": "root.DateTimeField.get_internal_type", "header": "['class', 'DateTimeField', '(', 'DateField', ')', ':', '___EOS___']", "index": 526 }, { "content": " def to_python(self, value):\n if value is None:\n return value\n if isinstance(value, datetime.datetime):\n return value\n if isinstance(value, datetime.date):\n return datetime.datetime(value.year, value.month, value.day)\n\n # Attempt to parse a datetime:\n value = smart_str(value)\n # split usecs, because they are not recognized by strptime.\n if '.' in value:\n try:\n value, usecs = value.split('.')\n usecs = int(usecs)\n except ValueError:\n raise exceptions.ValidationError(\n _('Enter a valid date/time in YYYY-MM-DD HH:MM[:ss[.uuuuuu]] format.'))\n else:\n usecs = 0\n kwargs = {'microsecond': usecs}\n try: # Seconds are optional, so try converting seconds first.\n return datetime.datetime(*time.strptime(value, '%Y-%m-%d %H:%M:%S')[:6],\n **kwargs)\n\n except ValueError:\n try: # Try without seconds.\n return datetime.datetime(*time.strptime(value, '%Y-%m-%d %H:%M')[:5],\n **kwargs)\n except ValueError: # Try without hour/minutes/seconds.\n try:\n return datetime.datetime(*time.strptime(value, '%Y-%m-%d')[:3],\n **kwargs)\n except ValueError:\n raise exceptions.ValidationError(\n _('Enter a valid date/time in YYYY-MM-DD HH:MM[:ss[.uuuuuu]] format.'))", "metadata": "root.DateTimeField.to_python", "header": "['class', 'DateTimeField', '(', 'DateField', ')', ':', '___EOS___']", "index": 529 }, { "content": " def get_db_prep_value(self, value):\n # Casts dates into the format expected by the backend\n return connection.ops.value_to_db_datetime(self.to_python(value))", "metadata": "root.DateTimeField.get_db_prep_value", "header": "['class', 'DateTimeField', '(', 'DateField', ')', ':', '___EOS___']", "index": 566 }, { "content": " def value_to_string(self, obj):\n val = self._get_val_from_obj(obj)\n if val is None:\n data = ''\n else:\n d = datetime_safe.new_datetime(val)\n data = d.strftime('%Y-%m-%d %H:%M:%S')\n return data", "metadata": "root.DateTimeField.value_to_string", "header": "['class', 'DateTimeField', '(', 'DateField', ')', ':', '___EOS___']", "index": 570 }, { "content": " def formfield(self, **kwargs):\n defaults = {'form_class': forms.DateTimeField}\n defaults.update(kwargs)\n return super(DateTimeField, self).formfield(**defaults)", "metadata": "root.DateTimeField.formfield", "header": "['class', 'DateTimeField', '(', 'DateField', ')', ':', '___EOS___']", "index": 579 }, { "content": "class DecimalField(Field):\n empty_strings_allowed = False\n\n\n\n\n\n\n", "metadata": "root.DecimalField", "header": "['module', '___EOS___']", "index": 584 }, { "content": " def __init__(self, verbose_name=None, name=None, max_digits=None, decimal_places=None, **kwargs):\n self.max_digits, self.decimal_places = max_digits, decimal_places\n Field.__init__(self, verbose_name, name, **kwargs)", "metadata": "root.DecimalField.__init__", "header": "['class', 'DecimalField', '(', 'Field', ')', ':', '___EOS___']", "index": 586 }, { "content": " def get_internal_type(self):\n return \"DecimalField\"", "metadata": "root.DecimalField.get_internal_type", "header": "['class', 'DecimalField', '(', 'Field', ')', ':', '___EOS___']", "index": 590 }, { "content": " def to_python(self, value):\n if value is None:\n return value\n try:\n return decimal.Decimal(value)\n except decimal.InvalidOperation:\n raise exceptions.ValidationError(\n _(\"This value must be a decimal number.\"))", "metadata": "root.DecimalField.to_python", "header": "['class', 'DecimalField', '(', 'Field', ')', ':', '___EOS___']", "index": 593 }, { "content": " def _format(self, value):\n if isinstance(value, basestring) or value is None:\n return value\n else:\n return self.format_number(value)", "metadata": "root.DecimalField._format", "header": "['class', 'DecimalField', '(', 'Field', ')', ':', '___EOS___']", "index": 602 }, { "content": " def format_number(self, value):\n \"\"\"\n Formats a number into a string with the requisite number of digits and\n decimal places.\n \"\"\"\n # Method moved to django.db.backends.util.\n #\n # It is preserved because it is used by the oracle backend\n # (django.db.backends.oracle.query), and also for\n # backwards-compatibility with any external code which may have used\n # this method.\n from django.db.backends import util\n return util.format_number(value, self.max_digits, self.decimal_places)", "metadata": "root.DecimalField.format_number", "header": "['class', 'DecimalField', '(', 'Field', ')', ':', '___EOS___']", "index": 608 }, { "content": " def get_db_prep_save(self, value):\n return connection.ops.value_to_db_decimal(self.to_python(value),\n self.max_digits, self.decimal_places)", "metadata": "root.DecimalField.get_db_prep_save", "header": "['class', 'DecimalField', '(', 'Field', ')', ':', '___EOS___']", "index": 622 }, { "content": " def get_db_prep_value(self, value):\n return self.to_python(value)", "metadata": "root.DecimalField.get_db_prep_value", "header": "['class', 'DecimalField', '(', 'Field', ')', ':', '___EOS___']", "index": 626 }, { "content": " def formfield(self, **kwargs):\n defaults = {\n 'max_digits': self.max_digits,\n 'decimal_places': self.decimal_places,\n 'form_class': forms.DecimalField,\n }\n defaults.update(kwargs)\n return super(DecimalField, self).formfield(**defaults)", "metadata": "root.DecimalField.formfield", "header": "['class', 'DecimalField', '(', 'Field', ')', ':', '___EOS___']", "index": 629 }, { "content": "class EmailField(CharField):\n", "metadata": "root.EmailField", "header": "['module', '___EOS___']", "index": 638 }, { "content": " def __init__(self, *args, **kwargs):\n kwargs['max_length'] = kwargs.get('max_length', 75)\n CharField.__init__(self, *args, **kwargs)", "metadata": "root.EmailField.__init__", "header": "['class', 'EmailField', '(', 'CharField', ')', ':', '___EOS___']", "index": 639 }, { "content": " def formfield(self, **kwargs):\n defaults = {'form_class': forms.EmailField}\n defaults.update(kwargs)\n return super(EmailField, self).formfield(**defaults)", "metadata": "root.EmailField.formfield", "header": "['class', 'EmailField', '(', 'CharField', ')', ':', '___EOS___']", "index": 643 }, { "content": "class FilePathField(Field):\n\n", "metadata": "root.FilePathField", "header": "['module', '___EOS___']", "index": 648 }, { "content": " def __init__(self, verbose_name=None, name=None, path='', match=None, recursive=False, **kwargs):\n self.path, self.match, self.recursive = path, match, recursive\n kwargs['max_length'] = kwargs.get('max_length', 100)\n Field.__init__(self, verbose_name, name, **kwargs)", "metadata": "root.FilePathField.__init__", "header": "['class', 'FilePathField', '(', 'Field', ')', ':', '___EOS___']", "index": 649 }, { "content": " def formfield(self, **kwargs):\n defaults = {\n 'path': self.path,\n 'match': self.match,\n 'recursive': self.recursive,\n 'form_class': forms.FilePathField,\n }\n defaults.update(kwargs)\n return super(FilePathField, self).formfield(**defaults)", "metadata": "root.FilePathField.formfield", "header": "['class', 'FilePathField', '(', 'Field', ')', ':', '___EOS___']", "index": 654 }, { "content": " def get_internal_type(self):\n return \"FilePathField\"", "metadata": "root.FilePathField.get_internal_type", "header": "['class', 'FilePathField', '(', 'Field', ')', ':', '___EOS___']", "index": 664 }, { "content": "class FloatField(Field):\n empty_strings_allowed = False\n\n\n\n", "metadata": "root.FloatField", "header": "['module', '___EOS___']", "index": 667 }, { "content": " def get_db_prep_value(self, value):\n if value is None:\n return None\n return float(value)", "metadata": "root.FloatField.get_db_prep_value", "header": "['class', 'FloatField', '(', 'Field', ')', ':', '___EOS___']", "index": 670 }, { "content": " def get_internal_type(self):\n return \"FloatField\"", "metadata": "root.FloatField.get_internal_type", "header": "['class', 'FloatField', '(', 'Field', ')', ':', '___EOS___']", "index": 675 }, { "content": " def to_python(self, value):\n if value is None:\n return value\n try:\n return float(value)\n except (TypeError, ValueError):\n raise exceptions.ValidationError(\n _(\"This value must be a float.\"))", "metadata": "root.FloatField.to_python", "header": "['class', 'FloatField', '(', 'Field', ')', ':', '___EOS___']", "index": 678 }, { "content": " def formfield(self, **kwargs):\n defaults = {'form_class': forms.FloatField}\n defaults.update(kwargs)\n return super(FloatField, self).formfield(**defaults)", "metadata": "root.FloatField.formfield", "header": "['class', 'FloatField', '(', 'Field', ')', ':', '___EOS___']", "index": 687 }, { "content": "class IntegerField(Field):\n empty_strings_allowed = False\n\n\n", "metadata": "root.IntegerField", "header": "['module', '___EOS___']", "index": 692 }, { "content": " def get_db_prep_value(self, value):\n if value is None:\n return None\n return int(value)", "metadata": "root.IntegerField.get_db_prep_value", "header": "['class', 'IntegerField', '(', 'Field', ')', ':', '___EOS___']", "index": 694 }, { "content": " def get_internal_type(self):\n return \"IntegerField\"", "metadata": "root.IntegerField.get_internal_type", "header": "['class', 'IntegerField', '(', 'Field', ')', ':', '___EOS___']", "index": 699 }, { "content": " def to_python(self, value):\n if value is None:\n return value\n try:\n return int(value)\n except (TypeError, ValueError):\n raise exceptions.ValidationError(\n _(\"This value must be an integer.\"))", "metadata": "root.IntegerField.to_python", "header": "['class', 'IntegerField', '(', 'Field', ')', ':', '___EOS___']", "index": 702 }, { "content": " def formfield(self, **kwargs):\n defaults = {'form_class': forms.IntegerField}\n defaults.update(kwargs)\n return super(IntegerField, self).formfield(**defaults)", "metadata": "root.IntegerField.formfield", "header": "['class', 'IntegerField', '(', 'Field', ')', ':', '___EOS___']", "index": 711 }, { "content": "class IPAddressField(Field):\n empty_strings_allowed = False\n\n", "metadata": "root.IPAddressField", "header": "['module', '___EOS___']", "index": 716 }, { "content": " def __init__(self, *args, **kwargs):\n kwargs['max_length'] = 15\n Field.__init__(self, *args, **kwargs)", "metadata": "root.IPAddressField.__init__", "header": "['class', 'IPAddressField', '(', 'Field', ')', ':', '___EOS___']", "index": 718 }, { "content": " def get_internal_type(self):\n return \"IPAddressField\"", "metadata": "root.IPAddressField.get_internal_type", "header": "['class', 'IPAddressField', '(', 'Field', ')', ':', '___EOS___']", "index": 722 }, { "content": " def formfield(self, **kwargs):\n defaults = {'form_class': forms.IPAddressField}\n defaults.update(kwargs)\n return super(IPAddressField, self).formfield(**defaults)", "metadata": "root.IPAddressField.formfield", "header": "['class', 'IPAddressField', '(', 'Field', ')', ':', '___EOS___']", "index": 725 }, { "content": "class NullBooleanField(Field):\n empty_strings_allowed = False\n\n\n\n\n", "metadata": "root.NullBooleanField", "header": "['module', '___EOS___']", "index": 730 }, { "content": " def __init__(self, *args, **kwargs):\n kwargs['null'] = True\n Field.__init__(self, *args, **kwargs)", "metadata": "root.NullBooleanField.__init__", "header": "['class', 'NullBooleanField', '(', 'Field', ')', ':', '___EOS___']", "index": 732 }, { "content": " def get_internal_type(self):\n return \"NullBooleanField\"", "metadata": "root.NullBooleanField.get_internal_type", "header": "['class', 'NullBooleanField', '(', 'Field', ')', ':', '___EOS___']", "index": 736 }, { "content": " def to_python(self, value):\n if value in (None, True, False): return value\n if value in ('None',): return None\n if value in ('t', 'True', '1'): return True\n if value in ('f', 'False', '0'): return False\n raise exceptions.ValidationError(\n _(\"This value must be either None, True or False.\"))", "metadata": "root.NullBooleanField.to_python", "header": "['class', 'NullBooleanField', '(', 'Field', ')', ':', '___EOS___']", "index": 739 }, { "content": " def get_db_prep_lookup(self, lookup_type, value):\n # Special-case handling for filters coming from a web request (e.g. the\n # admin interface). Only works for scalar values (not lists). If you're\n # passing in a list, you might as well make things the right type when\n # constructing the list.\n if value in ('1', '0'):\n value = bool(int(value))\n return super(NullBooleanField, self).get_db_prep_lookup(lookup_type, value)", "metadata": "root.NullBooleanField.get_db_prep_lookup", "header": "['class', 'NullBooleanField', '(', 'Field', ')', ':', '___EOS___']", "index": 747 }, { "content": " def get_db_prep_value(self, value):\n if value is None:\n return None\n return bool(value)", "metadata": "root.NullBooleanField.get_db_prep_value", "header": "['class', 'NullBooleanField', '(', 'Field', ')', ':', '___EOS___']", "index": 756 }, { "content": " def formfield(self, **kwargs):\n defaults = {\n 'form_class': forms.NullBooleanField,\n 'required': not self.blank,\n 'label': capfirst(self.verbose_name),\n 'help_text': self.help_text}\n defaults.update(kwargs)\n return super(NullBooleanField, self).formfield(**defaults)", "metadata": "root.NullBooleanField.formfield", "header": "['class', 'NullBooleanField', '(', 'Field', ')', ':', '___EOS___']", "index": 761 }, { "content": "class PositiveIntegerField(IntegerField):\n", "metadata": "root.PositiveIntegerField", "header": "['module', '___EOS___']", "index": 770 }, { "content": " def get_internal_type(self):\n return \"PositiveIntegerField\"", "metadata": "root.PositiveIntegerField.get_internal_type", "header": "['class', 'PositiveIntegerField', '(', 'IntegerField', ')', ':', '___EOS___']", "index": 771 }, { "content": " def formfield(self, **kwargs):\n defaults = {'min_value': 0}\n defaults.update(kwargs)\n return super(PositiveIntegerField, self).formfield(**defaults)", "metadata": "root.PositiveIntegerField.formfield", "header": "['class', 'PositiveIntegerField', '(', 'IntegerField', ')', ':', '___EOS___']", "index": 774 }, { "content": "class PositiveSmallIntegerField(IntegerField):\n", "metadata": "root.PositiveSmallIntegerField", "header": "['module', '___EOS___']", "index": 779 }, { "content": " def get_internal_type(self):\n return \"PositiveSmallIntegerField\"", "metadata": "root.PositiveSmallIntegerField.get_internal_type", "header": "['class', 'PositiveSmallIntegerField', '(', 'IntegerField', ')', ':', '___EOS___']", "index": 780 }, { "content": " def formfield(self, **kwargs):\n defaults = {'min_value': 0}\n defaults.update(kwargs)\n return super(PositiveSmallIntegerField, self).formfield(**defaults)", "metadata": "root.PositiveSmallIntegerField.formfield", "header": "['class', 'PositiveSmallIntegerField', '(', 'IntegerField', ')', ':', '___EOS___']", "index": 783 }, { "content": "class SlugField(CharField):\n\n", "metadata": "root.SlugField", "header": "['module', '___EOS___']", "index": 788 }, { "content": " def __init__(self, *args, **kwargs):\n kwargs['max_length'] = kwargs.get('max_length', 50)\n # Set db_index=True unless it's been set manually.\n if 'db_index' not in kwargs:\n kwargs['db_index'] = True\n super(SlugField, self).__init__(*args, **kwargs)", "metadata": "root.SlugField.__init__", "header": "['class', 'SlugField', '(', 'CharField', ')', ':', '___EOS___']", "index": 789 }, { "content": " def get_internal_type(self):\n return \"SlugField\"", "metadata": "root.SlugField.get_internal_type", "header": "['class', 'SlugField', '(', 'CharField', ')', ':', '___EOS___']", "index": 796 }, { "content": " def formfield(self, **kwargs):\n defaults = {'form_class': forms.SlugField}\n defaults.update(kwargs)\n return super(SlugField, self).formfield(**defaults)", "metadata": "root.SlugField.formfield", "header": "['class', 'SlugField', '(', 'CharField', ')', ':', '___EOS___']", "index": 799 }, { "content": "class SmallIntegerField(IntegerField):", "metadata": "root.SmallIntegerField", "header": "['module', '___EOS___']", "index": 804 }, { "content": " def get_internal_type(self):\n return \"SmallIntegerField\"", "metadata": "root.SmallIntegerField.get_internal_type", "header": "['class', 'SmallIntegerField', '(', 'IntegerField', ')', ':', '___EOS___']", "index": 805 }, { "content": "class TextField(Field):\n", "metadata": "root.TextField", "header": "['module', '___EOS___']", "index": 808 }, { "content": " def get_internal_type(self):\n return \"TextField\"", "metadata": "root.TextField.get_internal_type", "header": "['class', 'TextField', '(', 'Field', ')', ':', '___EOS___']", "index": 809 }, { "content": " def formfield(self, **kwargs):\n defaults = {'widget': forms.Textarea}\n defaults.update(kwargs)\n return super(TextField, self).formfield(**defaults)", "metadata": "root.TextField.formfield", "header": "['class', 'TextField', '(', 'Field', ')', ':', '___EOS___']", "index": 812 }, { "content": "class TimeField(Field):\n empty_strings_allowed = False\n\n\n\n\n\n", "metadata": "root.TimeField", "header": "['module', '___EOS___']", "index": 817 }, { "content": " def __init__(self, verbose_name=None, name=None, auto_now=False, auto_now_add=False, **kwargs):\n self.auto_now, self.auto_now_add = auto_now, auto_now_add\n if auto_now or auto_now_add:\n kwargs['editable'] = False\n Field.__init__(self, verbose_name, name, **kwargs)", "metadata": "root.TimeField.__init__", "header": "['class', 'TimeField', '(', 'Field', ')', ':', '___EOS___']", "index": 819 }, { "content": " def get_internal_type(self):\n return \"TimeField\"", "metadata": "root.TimeField.get_internal_type", "header": "['class', 'TimeField', '(', 'Field', ')', ':', '___EOS___']", "index": 825 }, { "content": " def to_python(self, value):\n if value is None:\n return None\n if isinstance(value, datetime.time):\n return value\n if isinstance(value, datetime.datetime):\n # Not usually a good idea to pass in a datetime here (it loses\n # information), but this can be a side-effect of interacting with a\n # database backend (e.g. Oracle), so we'll be accommodating.\n return value.time\n\n # Attempt to parse a datetime:\n value = smart_str(value)\n # split usecs, because they are not recognized by strptime.\n if '.' in value:\n try:\n value, usecs = value.split('.')\n usecs = int(usecs)\n except ValueError:\n raise exceptions.ValidationError(\n _('Enter a valid time in HH:MM[:ss[.uuuuuu]] format.'))\n else:\n usecs = 0\n kwargs = {'microsecond': usecs}\n\n try: # Seconds are optional, so try converting seconds first.\n return datetime.time(*time.strptime(value, '%H:%M:%S')[3:6],\n **kwargs)\n except ValueError:\n try: # Try without seconds.\n return datetime.time(*time.strptime(value, '%H:%M')[3:5],\n **kwargs)\n except ValueError:\n raise exceptions.ValidationError(\n _('Enter a valid time in HH:MM[:ss[.uuuuuu]] format.'))", "metadata": "root.TimeField.to_python", "header": "['class', 'TimeField', '(', 'Field', ')', ':', '___EOS___']", "index": 828 }, { "content": " def pre_save(self, model_instance, add):\n if self.auto_now or (self.auto_now_add and add):\n value = datetime.datetime.now().time()\n setattr(model_instance, self.attname, value)\n return value\n else:\n return super(TimeField, self).pre_save(model_instance, add)", "metadata": "root.TimeField.pre_save", "header": "['class', 'TimeField', '(', 'Field', ')', ':', '___EOS___']", "index": 864 }, { "content": " def get_db_prep_value(self, value):\n # Casts times into the format expected by the backend\n return connection.ops.value_to_db_time(self.to_python(value))", "metadata": "root.TimeField.get_db_prep_value", "header": "['class', 'TimeField', '(', 'Field', ')', ':', '___EOS___']", "index": 872 }, { "content": " def value_to_string(self, obj):\n val = self._get_val_from_obj(obj)\n if val is None:\n data = ''\n else:\n data = val.strftime(\"%H:%M:%S\")\n return data", "metadata": "root.TimeField.value_to_string", "header": "['class', 'TimeField', '(', 'Field', ')', ':', '___EOS___']", "index": 876 }, { "content": " def formfield(self, **kwargs):\n defaults = {'form_class': forms.TimeField}\n defaults.update(kwargs)\n return super(TimeField, self).formfield(**defaults)", "metadata": "root.TimeField.formfield", "header": "['class', 'TimeField', '(', 'Field', ')', ':', '___EOS___']", "index": 884 }, { "content": "class URLField(CharField):\n", "metadata": "root.URLField", "header": "['module', '___EOS___']", "index": 889 }, { "content": " def __init__(self, verbose_name=None, name=None, verify_exists=True, **kwargs):\n kwargs['max_length'] = kwargs.get('max_length', 200)\n self.verify_exists = verify_exists\n CharField.__init__(self, verbose_name, name, **kwargs)", "metadata": "root.URLField.__init__", "header": "['class', 'URLField', '(', 'CharField', ')', ':', '___EOS___']", "index": 890 }, { "content": " def formfield(self, **kwargs):\n defaults = {'form_class': forms.URLField, 'verify_exists': self.verify_exists}\n defaults.update(kwargs)\n return super(URLField, self).formfield(**defaults)", "metadata": "root.URLField.formfield", "header": "['class', 'URLField', '(', 'CharField', ')', ':', '___EOS___']", "index": 895 }, { "content": "class XMLField(TextField):", "metadata": "root.XMLField", "header": "['module', '___EOS___']", "index": 900 }, { "content": " def __init__(self, verbose_name=None, name=None, schema_path=None, **kwargs):\n self.schema_path = schema_path\n Field.__init__(self, verbose_name, name, **kwargs)", "metadata": "root.XMLField.__init__", "header": "['class', 'XMLField', '(', 'TextField', ')', ':', '___EOS___']", "index": 901 } ]
[ { "span": "import os", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 9 }, { "span": "from django.db.models import signals", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 36 }, { "span": "from django.dispatch import dispatcher", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 38 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "decimal_", "\\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_", "django_", "._", "utils_", "import_", "\\u", "decimal_", "as_", "decimal_", "#", " ", "for", " ", "Pyth", "on", " ", "2.3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "import_", "signals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "query", "\\u", "utils_", "import_", "Query", "Wrapper_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "dispatch_", "import_", "dispatcher_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "import_", "forms_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "import_", "exceptions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "datastr", "ucture", "s_", "import_", "Dict", "Wrapper_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "functional_", "import_", "curr", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "iter", "compat_", "import_", "tee", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "text_", "import_", "cap", "first_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "translation_", "import_", "uge", "ttext", "\\u", "lazy_", ",_", "ugettext_", "as_", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "encoding_", "import_", "smart", "\\u", "unicode_", ",_", "force", "\\u", "unicode_", ",_", "smart", "\\u", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "import_", "datetime", "\\u", "safe_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "values", " ", "to", " ", "use", " ", "for", " ", "\"", "blank", "\"", " ", "in", " ", "Select", "Field", "s", ".", " ", "Wil", "l", " ", "be", " ", "append", "ed", " ", "to", " ", "the", " ", "start", " ", "of", " ", "most", " ", "\"", "choice", "s", "\"", " ", "lists", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "BLANK", "\\u", "CHOICE", "\\u", "DAS", "H_", "=_", "[_", "(_", "\"\"_", ",_", "\"-------", "--\"_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BLANK", "\\u", "CHOICE", "\\u", "NONE_", "=_", "[_", "(_", "\"\"_", ",_", "\"", "Non", "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_", "#", " ", "A", " ", "guide", " ", "to", " ", "Field", " ", "parameter", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "*", " ", "name", ":", " ", " ", "The", " ", "name", " ", "of", " ", "the", " ", "field", " ", "speci", "fed", " ", "in", " ", "the", " ", "model", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "*", " ", "attn", "ame", ":", " ", " ", " ", "The", " ", "attribute", " ", "to", " ", "use", " ", "on", " ", "the", " ", "model", " ", "object", ".", " ", "Thi", "s", " ", "is", " ", "the", " ", "same", " ", "as_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "\"", "name", "\",", " ", "except", " ", "in", " ", "the", " ", "case", " ", "of", " ", "Fore", "ign", "Keys", ",", " ", "where", " ", "\"\\u", "id", "\"", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "append", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "*", " ", "db", "\\u", "column", ":", " ", "The", " ", "db", "\\u", "column", " ", "specified", " ", "in", " ", "the", " ", "model", " ", "(", "or", " ", "Non", "e", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "*", " ", "column", ":", " ", " ", " ", " ", "The", " ", "databa", "se", " ", "column", " ", "for", " ", "this", " ", "field", ".", " ", "Thi", "s", " ", "is", " ", "the", " ", "same", " ", "as_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "\"", "attn", "ame", "\",", " ", "except", " ", "if", " ", "db", "\\u", "column", " ", "is", " ", "specified", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Code", " ", "tha", "t", " ", "introspect", "s", " ", "values", ",", " ", "or", " ", "doe", "s", " ", "other", " ", "dynami", "c", " ", "thing", "s", ",", " ", "shou", "ld", " ", "use_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "attn", "ame", ".", " ", "For", " ", "example", ",", " ", "this", " ", "gets", " ", "the", " ", "primary", " ", "key", " ", "value", " ", "of", " ", "object", " ", "\"", "obj", "\":", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "getattr", "(", "obj", ",", " ", "opts", ".", "pk", ".", "attn", "ame", ")_", "\\u\\u\\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_", "#", " ", "TOD", "O", ":", " ", "Ma", "yb", "e", " ", "move", " ", "this", " ", "int", "o", " ", "contrib", ",", " ", "bec", "aus", "e", " ", "it", "'", "s", " ", "specialize", "d", "._", "\\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_", "ansi", "\\u", "date", "\\u", "re_", "=_", "re_", "._", "compile_", "(_", "r", "'", "^", "\\\\", "d", "{", "4", "}-", "\\\\", "d", "{", "1", ",", "2", "}-", "\\\\", "d", "{", "1", ",", "2", "}$'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "NOT", "\\u", "PROVI", "DED", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Field", "Do", "es", "Not", "Exist_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "empty", "\\u", "string", "s", "\\u", "allowed_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", "se", " ", "track", " ", "each", " ", "time", " ", "a", " ", "Field", " ", "instance", " ", "is", " ", "created", ".", " ", "Us", "ed", " ", "to", " ", "retain", " ", "order", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "auto", "\\u", "creati", "on", "\\u", "counter", " ", "is", " ", "used", " ", "for", " ", "fields", " ", "tha", "t", " ", "Dj", "ang", "o", " ", "implicit", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", "s", ",", " ", "creati", "on", "\\u", "counter", " ", "is", " ", "used", " ", "for", " ", "all", " ", "user", "-", "specified", " ", "fields", "._", "\\u\\u\\uNL\\u\\u\\u_", "creati", "on", "\\u", "counter_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "auto", "\\u", "creati", "on", "\\u", "counter_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "unique_", "=_", "property_", "(_", "unique_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "choices_", "=_", "property_", "(_", "\\u", "get", "\\u", "choices_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "flat", "choices_", "=_", "property_", "(_", "\\u", "get", "\\u", "flat", "choices_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\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_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", "=_", "None_", ",_", "name_", "=_", "None_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "length_", "=_", "None_", ",_", "unique_", "=_", "False_", ",_", "blank_", "=_", "False_", ",_", "null_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "index_", "=_", "False_", ",_", "rel_", "=_", "None_", ",_", "default_", "=_", "NOT", "\\u", "PROVI", "DED", "_", ",_", "editable_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "serialize_", "=_", "True_", ",_", "unique", "\\u", "for", "\\u", "date_", "=_", "None_", ",_", "unique", "\\u", "for", "\\u", "month_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "unique", "\\u", "for", "\\u", "year_", "=_", "None_", ",_", "choices_", "=_", "None_", ",_", "help", "\\u", "text_", "=_", "''_", ",_", "db", "\\u", "column_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "tables", "pace_", "=_", "None_", ",_", "auto", "\\u", "created_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "verbo", "se", "\\u", "name_", "=_", "verbo", "se", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "primary", "\\u", "key_", "=_", "primary", "\\u", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "max", "\\u", "length_", ",_", "self_", "._", "\\u", "unique_", "=_", "max", "\\u", "length_", ",_", "unique_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "blank_", ",_", "self_", "._", "null_", "=_", "blank_", ",_", "null_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ora", "cle", " ", "treat", "s", " ", "the", " ", "empty", " ", "string", " ", "(''", ")", " ", "as", " ", "null", ",", " ", "so", " ", "coerce", " ", "the", " ", "null_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "option", " ", "whe", "neve", "r", " ", "''", " ", "is", " ", "a", " ", "possib", "le", " ", "value", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "empty", "\\u", "string", "s", "\\u", "allowed_", "and_", "connection_", "._", "features_", "._", "interpret", "s", "\\u", "empty", "\\u", "string", "s", "\\u", "as", "\\u", "null", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "null_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "rel_", "=_", "rel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "default_", "=_", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "editable_", "=_", "editable_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "serialize_", "=_", "serialize_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "unique", "\\u", "for", "\\u", "date_", ",_", "self_", "._", "unique", "\\u", "for", "\\u", "month_", "=_", "unique", "\\u", "for", "\\u", "date_", ",_", "unique", "\\u", "for", "\\u", "month_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "unique", "\\u", "for", "\\u", "year_", "=_", "unique", "\\u", "for", "\\u", "year_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "choices_", "=_", "choices_", "or_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "help", "\\u", "text_", "=_", "help", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db", "\\u", "column_", "=_", "db", "\\u", "column_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db", "\\u", "tables", "pace_", "=_", "db", "\\u", "tables", "pace_", "or_", "settings_", "._", "DEF", "AUL", "T", "\\u", "INDE", "X", "\\u", "TABLES", "PACE", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "auto", "\\u", "created_", "=_", "auto", "\\u", "created_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "db", "\\u", "index", " ", "to", " ", "Tru", "e", " ", "if", " ", "the", " ", "field", " ", "has", " ", "a", " ", "relation", "ship", " ", "and", " ", "doe", "sn", "'", "t", " ", "explicit", "ly", " ", "set", " ", "db", "\\u", "index", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "index_", "=_", "db", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Adjust", " ", "the", " ", "appropr", "iate", " ", "creati", "on", " ", "counter", ",", " ", "and", " ", "save", " ", "our", " ", "local", " ", "copy", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "auto", "\\u", "created_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "creati", "on", "\\u", "counter_", "=_", "Field_", "._", "auto", "\\u", "creati", "on", "\\u", "counter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Field_", "._", "auto", "\\u", "creati", "on", "\\u", "counter_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "creati", "on", "\\u", "counter_", "=_", "Field_", "._", "creati", "on", "\\u", "counter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Field_", "._", "creati", "on", "\\u", "counter_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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_", "\\u\\u", "cmp", "\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "need", "ed", " ", "bec", "aus", "e", " ", "bisect", " ", "doe", "s", " ", "not", " ", "take", " ", "a", " ", "compa", "ris", "on", " ", "function", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmp_", "(_", "self_", "._", "creati", "on", "\\u", "counter_", ",_", "other_", "._", "creati", "on", "\\u", "counter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "deepc", "opy", "\\u\\u_", "(_", "self_", ",_", "memo", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "don", "'", "t", " ", "have", " ", "to", " ", "deepc", "opy", " ", "very", " ", "muc", "h", " ", "here", ",", " ", "sinc", "e", " ", "most", " ", "thing", "s", " ", "are", " ", "not_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "inten", "ded", " ", "to", " ", "be", " ", "alter", "ed", " ", "after", " ", "initial", " ", "creati", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "=_", "copy_", "._", "copy_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "rel_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "._", "rel_", "=_", "copy_", "._", "copy_", "(_", "self_", "._", "rel_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "memo", "dict_", "[_", "id_", "(_", "self_", ")_", "]_", "=_", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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_", "to", "\\u", "python_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Convert", "s", " ", "the", " ", "input", " ", "value", " ", "int", "o", " ", "the", " ", "expected", " ", "Pyth", "on", " ", "data", " ", "type", ",", " ", "rais", "ing", "\\", "10", ";", " ", " ", " ", " ", "django", ".", "core", ".", "exception", "s", ".", "Validat", "ion", "Error", " ", "if", " ", "the", " ", "data", " ", "can", "'", "t", " ", "be", " ", "convert", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "convert", "ed", " ", "value", ".", " ", "Subc", "lasse", "s", " ", "shou", "ld", " ", "override", " ", "this", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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_", "db", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "databa", "se", " ", "column", " ", "data", " ", "type", " ", "for", " ", "this", " ", "field", ",", " ", "tak", "ing", " ", "int", "o", "\\", "10", ";", " ", " ", " ", " ", "account", " ", "the", " ", "DATA", "BASE", "\\u", "ENGINE", " ", "setti", "ng", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "default", " ", "implementation", " ", "of", " ", "this", " ", "method", " ", "look", "s", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "back", "end", "-", "specific", " ", "DATA", "\\u", "TYPES", " ", "dictionar", "y", ",", " ", "look", "ing", " ", "up", " ", "the", " ", "field", " ", "by", " ", "its_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "internal", " ", "type", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "Field", " ", "class", " ", "can", " ", "implement", " ", "the", " ", "get", "\\u", "internal", "\\u", "type", "()", " ", "method", " ", "to", " ", "speci", "fy_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whi", "ch", " ", "*", "pree", "xist", "ing", "*", " ", "Dj", "ang", "o", " ", "Field", " ", "class", " ", "it", "'", "s", " ", "most", " ", "similar", " ", "to", " ", "--", " ", "i", ".", "e", ".,", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "an", " ", "XML", "Field", " ", "is", " ", "represent", "ed", " ", "by", " ", "a", " ", "TEXT", " ", "column", " ", "type", ",", " ", "whi", "ch", " ", "is", " ", "the", " ", "same_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "as", " ", "the", " ", "Text", "Field", " ", "Dj", "ang", "o", " ", "field", " ", "type", ",", " ", "whi", "ch", " ", "means", " ", "XML", "Field", "'", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", "\\u", "internal", "\\u", "type", "()", " ", "return", "s", " ", "'", "Text", "Field", "'.", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Bu", "t", " ", "the", " ", "limit", "ation", " ", "of", " ", "the", " ", "get", "\\u", "internal", "\\u", "type", "()", " ", "/", " ", "data\\u", "types", " ", "appro", "ach", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "tha", "t", " ", "it", " ", "cann", "ot", " ", "handle", " ", "databa", "se", " ", "column", " ", "types", " ", "tha", "t", " ", "are", "n", "'", "t", " ", "alr", "ead", "y_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "mapp", "ed", " ", "to", " ", "one", " ", "of", " ", "the", " ", "bui", "lt", "-", "in", " ", "Dj", "ang", "o", " ", "field", " ", "types", ".", " ", "In", " ", "this", " ", "case", ",", " ", "you", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "can", " ", "implement", " ", "db", "\\u", "type", "()", " ", "inst", "ead", " ", "of", " ", "get", "\\u", "internal", "\\u", "type", "()", " ", "to", " ", "speci", "fy_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "exact", "ly", " ", "whi", "ch", " ", "wa", "ck", "y", " ", "databa", "se", " ", "column", " ", "type", " ", "you", " ", "want", " ", "to", " ", "use", "._", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "Dict", "Wrapper_", "(_", "self_", "._", "\\u\\u", "dict\\u\\u_", ",_", "connection_", "._", "ops_", "._", "quote", "\\u", "name_", ",_", "\"", "qn", "\\u\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "connection_", "._", "creation_", "._", "data\\u", "types_", "[_", "self_", "._", "get", "\\u", "internal", "\\u", "type_", "(_", ")_", "]_", "%_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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_", "unique_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "unique_", "or_", "self_", "._", "primary", "\\u", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set\\u", "attribute", "s", "\\u", "from", "\\u", "name_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "attn", "ame_", ",_", "self_", "._", "column_", "=_", "self_", "._", "get", "\\u", "attn", "ame", "\\u", "column_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "verbo", "se", "\\u", "name_", "is_", "None_", "and_", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "verbo", "se", "\\u", "name_", "=_", "name_", "._", "replace_", "(_", "'\\u'_", ",_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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_", "contribute", "\\u", "to", "\\u", "class_", "(_", "self_", ",_", "cls_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "attribute", "s", "\\u", "from", "\\u", "name_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "\\u", "meta_", "._", "add", "\\u", "field_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "choices_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "cls_", ",_", "'", "get", "\\u", "%", "s", "\\u", "display", "'_", "%_", "self_", "._", "name_", ",_", "curr", "y_", "(_", "cls_", "._", "\\u", "get", "\\u", "FIE", "LD", "\\u", "display_", ",_", "field_", "=_", "self_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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", "\\u", "attn", "ame_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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", "attn", "ame", "\\u", "column_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "attn", "ame_", "=_", "self_", "._", "get", "\\u", "attn", "ame_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "column_", "=_", "self_", "._", "db", "\\u", "column_", "or_", "attn", "ame_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "attn", "ame_", ",_", "column_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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", "cache", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'\\u", "%", "s", "\\u", "cache", "'_", "%_", "self_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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_", "pre", "\\u", "save_", "(_", "self_", ",_", "model", "\\u", "instance_", ",_", "add_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "field", "'", "s", " ", "value", " ", "just", " ", "bef", "ore", " ", "saving", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "getattr_", "(_", "model", "\\u", "instance_", ",_", "self_", "._", "attn", "ame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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", "db", "\\u", "prep", "\\u", "value_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "field", "'", "s", " ", "value", " ", "prepared", " ", "for", " ", "interacti", "ng", " ", "with", " ", "the", " ", "databa", "se", "\\", "10", ";", " ", " ", " ", " ", "back", "end", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Us", "ed", " ", "by", " ", "the", " ", "default", " ", "implementation", "s", " ", "of", " ", "``", "get", "\\u", "db", "\\u", "prep", "\\u", "save", "``", "and", "\\", "10", ";", " ", " ", " ", " ", "`", "get", "\\u", "db", "\\u", "prep", "\\u", "look", "up", "```", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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", "db", "\\u", "prep", "\\u", "save_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "field", "'", "s", " ", "value", " ", "prepared", " ", "for", " ", "saving", " ", "int", "o", " ", "a", " ", "databa", "se", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "get", "\\u", "db", "\\u", "prep", "\\u", "value_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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", "db", "\\u", "prep", "\\u", "lookup_", "(_", "self_", ",_", "look", "up", "\\u", "type_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "field", "'", "s", " ", "value", " ", "prepared", " ", "for", " ", "databa", "se", " ", "look", "up", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "value_", ",_", "'", "as", "\\u", "sql", "'_", ")_", "or_", "hasattr_", "(_", "value_", ",_", "'\\u", "as", "\\u", "sql", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "value", " ", "has", " ", "a", " ", "rela", "bel", "\\u", "alias", "es", " ", "method", ",", " ", "it", " ", "will", " ", "need", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "be", " ", "invoke", "d", " ", "bef", "ore", " ", "the", " ", "final", " ", "SQL", " ", "is", " ", "evaluate", "d_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "value_", ",_", "'", "rela", "bel", "\\u", "alias", "es", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "value_", ",_", "'", "as", "\\u", "sql", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", ",_", "params_", "=_", "value_", "._", "as", "\\u", "sql_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", ",_", "params_", "=_", "value_", "._", "\\u", "as", "\\u", "sql_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Query", "Wrapper_", "(_", "(_", "'(", "%", "s", ")'_", "%_", "sql_", ")_", ",_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "look", "up", "\\u", "type_", "in_", "(_", "'", "regex", "'_", ",_", "'", "ire", "gex", "'_", ",_", "'", "month", "'_", ",_", "'", "day", "'_", ",_", "'", "week", "\\u", "day", "'_", ",_", "'", "search", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "value_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "look", "up", "\\u", "type_", "in_", "(_", "'", "exact", "'_", ",_", "'", "gt", "'_", ",_", "'", "gte", "'_", ",_", "'", "lt", "'_", ",_", "'", "lte", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "self_", "._", "get", "\\u", "db", "\\u", "prep", "\\u", "value_", "(_", "value_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "look", "up", "\\u", "type_", "in_", "(_", "'", "range", "'_", ",_", "'", "in", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "self_", "._", "get", "\\u", "db", "\\u", "prep", "\\u", "value_", "(_", "v_", ")_", "for_", "v_", "in_", "value_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "look", "up", "\\u", "type_", "in_", "(_", "'", "contain", "s", "'_", ",_", "'", "icon", "tain", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "\"%%", "%", "s", "%%\"_", "%_", "connection_", "._", "ops_", "._", "prep", "\\u", "for", "\\u", "like", "\\u", "query_", "(_", "value_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "look", "up", "\\u", "type_", "==_", "'", "iex", "act", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "connection_", "._", "ops_", "._", "prep", "\\u", "for", "\\u", "iex", "act", "\\u", "query_", "(_", "value_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "look", "up", "\\u", "type_", "in_", "(_", "'", "startswith", "'_", ",_", "'", "ista", "rts", "with", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "\"%", "s", "%%\"_", "%_", "connection_", "._", "ops_", "._", "prep", "\\u", "for", "\\u", "like", "\\u", "query_", "(_", "value_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "look", "up", "\\u", "type_", "in_", "(_", "'", "ends", "with", "'_", ",_", "'", "ien", "ds", "with", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "\"%%", "%", "s", "\"_", "%_", "connection_", "._", "ops_", "._", "prep", "\\u", "for", "\\u", "like", "\\u", "query_", "(_", "value_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "look", "up", "\\u", "type_", "==_", "'", "isn", "ull", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "look", "up", "\\u", "type_", "==_", "'", "year", "'_", ":_", "\\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 ", " _", "value_", "=_", "int_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "The", " ", "\\u\\u", "year", " ", "look", "up", " ", "type", " ", "require", "s", " ", "an", " ", "integ", "er", " ", "argu", "ment", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "get", "\\u", "internal", "\\u", "type_", "(_", ")_", "==_", "'", "Date", "Field", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "connection_", "._", "ops_", "._", "year", "\\u", "look", "up", "\\u", "bound", "s", "\\u", "for", "\\u", "date", "\\u", "field_", "(_", "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 ", " _", "return_", "connection_", "._", "ops_", "._", "year", "\\u", "look", "up", "\\u", "bounds_", "(_", "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_", "raise_", "Type", "Error_", "(_", "\"", "Field", " ", "has", " ", "invalid", " ", "look", "up", ":", " ", "%", "s", "\"_", "%_", "look", "up", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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_", "has", "\\u", "default_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "a", " ", "boolean", " ", "of", " ", "whe", "ther", " ", "this", " ", "field", " ", "has", " ", "a", " ", "default", " ", "value", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "default_", "is_", "not_", "NOT", "\\u", "PROVI", "DED", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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", "default_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "the", " ", "default", " ", "value", " ", "for", " ", "this", " ", "field", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "default_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "callable_", "(_", "self_", "._", "default_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "default_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "force", "\\u", "unicode_", "(_", "self_", "._", "default_", ",_", "string", "s", "\\u", "only_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "self_", "._", "empty", "\\u", "string", "s", "\\u", "allowed_", "or_", "(_", "self_", "._", "null_", "and_", "not_", "connection_", "._", "features_", "._", "interpret", "s", "\\u", "empty", "\\u", "string", "s", "\\u", "as", "\\u", "null", "s_", ")_", ":_", "\\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_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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", "validator", "\\u", "unique", "\\u", "look", "up", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'%", "s", "\\u\\u", "exact", "'_", "%_", "self_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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", "choices_", "(_", "self_", ",_", "include", "\\u", "blank_", "=_", "True_", ",_", "blank", "\\u", "choice_", "=_", "BLANK", "\\u", "CHOICE", "\\u", "DAS", "H_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "choice", "s", " ", "with", " ", "a", " ", "default", " ", "blank", " ", "choice", "s", " ", "include", "d", ",", " ", "for", " ", "use", "\\", "10", ";", " ", " ", " ", " ", "as", " ", "Select", "Field", " ", "choice", "s", " ", "for", " ", "this", " ", "field", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "first", "\\u", "choice_", "=_", "include", "\\u", "blank_", "and_", "blank", "\\u", "choice_", "or_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "choices_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "first", "\\u", "choice_", "+_", "list_", "(_", "self_", "._", "choices_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rel", "\\u", "model_", "=_", "self_", "._", "rel_", "._", "to_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "self_", "._", "rel_", ",_", "'", "get", "\\u", "relate", "d\\u", "field", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lst_", "=_", "[_", "(_", "getattr_", "(_", "x_", ",_", "self_", "._", "rel_", "._", "get", "\\u", "relate", "d\\u", "field_", "(_", ")_", "._", "attn", "ame_", ")_", ",_", "smart", "\\u", "unicode_", "(_", "x_", ")_", ")_", "for_", "x_", "in_", "rel", "\\u", "model_", "._", "\\u", "default", "\\u", "manager_", "._", "complex", "\\u", "filter_", "(_", "self_", "._", "rel_", "._", "limit", "\\u", "choice", "s", "\\u", "to_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lst_", "=_", "[_", "(_", "x_", "._", "\\u", "get", "\\u", "pk", "\\u", "val_", "(_", ")_", ",_", "smart", "\\u", "unicode_", "(_", "x_", ")_", ")_", "for_", "x_", "in_", "rel", "\\u", "model_", "._", "\\u", "default", "\\u", "manager_", "._", "complex", "\\u", "filter_", "(_", "self_", "._", "rel_", "._", "limit", "\\u", "choice", "s", "\\u", "to_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "first", "\\u", "choice_", "+_", "lst_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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", "choice", "s", "\\u", "default_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "\\u", "choices_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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", "flat", "choices_", "(_", "self_", ",_", "include", "\\u", "blank_", "=_", "True_", ",_", "blank", "\\u", "choice_", "=_", "BLANK", "\\u", "CHOICE", "\\u", "DAS", "H_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "flattened", " ", "choice", "s", " ", "with", " ", "a", " ", "default", " ", "blank", " ", "choice", " ", "include", "d", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "first", "\\u", "choice_", "=_", "include", "\\u", "blank_", "and_", "blank", "\\u", "choice_", "or_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "first", "\\u", "choice_", "+_", "list_", "(_", "self_", "._", "flat", "choices_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "val", "\\u", "from", "\\u", "obj_", "(_", "self_", ",_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "obj_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "getattr_", "(_", "obj_", ",_", "self_", "._", "attn", "ame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "\\u", "default_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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_", "value", "\\u", "to", "\\u", "string_", "(_", "self_", ",_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "string", " ", "value", " ", "of", " ", "this", " ", "field", " ", "from", " ", "the", " ", "pass", "ed", " ", "obj", ".", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "used", " ", "by", " ", "the", " ", "serializ", "ation", " ", "frame", "work", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "smart", "\\u", "unicode_", "(_", "self_", "._", "\\u", "get", "\\u", "val", "\\u", "from", "\\u", "obj_", "(_", "obj_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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_", "bind_", "(_", "self_", ",_", "field", "mapping_", ",_", "original_", ",_", "bound", "\\u", "field", "\\u", "class_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "bound", "\\u", "field", "\\u", "class_", "(_", "self_", ",_", "field", "mapping_", ",_", "original_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "choices_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "self_", "._", "\\u", "choices_", ",_", "'", "next", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "choices_", ",_", "self_", "._", "\\u", "choices_", "=_", "tee", "_", "(_", "self_", "._", "\\u", "choices_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "choices_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "choices_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "get", "\\u", "flat", "choices_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Flatt", "ened", " ", "version", " ", "of", " ", "choice", "s", " ", "tuple", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flat_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "choice_", ",_", "value_", "in_", "self_", "._", "choices_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "value_", ")_", "in_", "(_", "list_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flat_", "._", "extend_", "(_", "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 ", " _", "flat_", "._", "append_", "(_", "(_", "choice_", ",_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "flat_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "save", "\\u", "form", "\\u", "data_", "(_", "self_", ",_", "instance_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "instance_", ",_", "self_", "._", "name_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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_", "formfi", "eld_", "(_", "self_", ",_", "form", "\\u", "class_", "=_", "forms_", "._", "Char", "Field_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "a", " ", "django", ".", "forms", ".", "Field", " ", "instance", " ", "for", " ", "this", " ", "databa", "se", " ", "Field", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "=_", "{_", "'", "require", "d", "'_", ":_", "not_", "self_", "._", "blank_", ",_", "'", "label", "'_", ":_", "cap", "first_", "(_", "self_", "._", "verbo", "se", "\\u", "name_", ")_", ",_", "'", "help", "\\u", "text", "'_", ":_", "self_", "._", "help", "\\u", "text_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "default_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "[_", "'", "initial", "'_", "]_", "=_", "self_", "._", "get", "\\u", "default_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "callable_", "(_", "self_", "._", "default_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "[_", "'", "show", "\\u", "hidden", "\\u", "initial", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "choices_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Field", "s", " ", "with", " ", "choice", "s", " ", "get", " ", "special", " ", "treatment", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "include", "\\u", "blank_", "=_", "self_", "._", "blank_", "or_", "not_", "(_", "self_", "._", "has", "\\u", "default_", "(_", ")_", "or_", "'", "initial", "'_", "in_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "[_", "'", "choice", "s", "'_", "]_", "=_", "self_", "._", "get", "\\u", "choices_", "(_", "include", "\\u", "blank_", "=_", "include", "\\u", "blank_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "[_", "'", "coerce", "'_", "]_", "=_", "self_", "._", "to", "\\u", "python_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "null_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "[_", "'", "empty", "\\u", "value", "'_", "]_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "form", "\\u", "class_", "=_", "forms_", "._", "Type", "d", "Choi", "ce", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Many", " ", "of", " ", "the", " ", "subclass", "-", "specific", " ", "formfi", "eld", " ", "argu", "ment", "s", " ", "(", "min", "\\u", "value", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "max", "\\u", "value", ")", " ", "don", "'", "t", " ", "appl", "y", " ", "for", " ", "choice", " ", "fields", ",", " ", "so", " ", "be", " ", "sure", " ", "to", " ", "only", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "values", " ", "tha", "t", " ", "Type", "d", "Choi", "ce", "Field", " ", "will", " ", "underst", "and", "._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", "in_", "kwargs_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "k_", "not_", "in_", "(_", "'", "coerce", "'_", ",_", "'", "empty", "\\u", "value", "'_", ",_", "'", "choice", "s", "'_", ",_", "'", "require", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "widget", "'_", ",_", "'", "label", "'_", ",_", "'", "initial", "'_", ",_", "'", "help", "\\u", "text", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "error", "\\u", "message", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "del_", "kwargs_", "[_", "k_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "form", "\\u", "class_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\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_", "value", "\\u", "from", "\\u", "object_", "(_", "self_", ",_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "the", " ", "value", " ", "of", " ", "this", " ", "field", " ", "in", " ", "the", " ", "give", "n", " ", "model", " ", "instance", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "getattr_", "(_", "obj_", ",_", "self_", "._", "attn", "ame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Auto", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "empty", "\\u", "string", "s", "\\u", "allowed_", "=_", "False_", "\\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_", "Auto", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "kwargs_", "._", "get_", "(_", "'", "primary", "\\u", "key", "'_", ",_", "False_", ")_", "is_", "True_", ",_", "\"%", "ss", " ", "must", " ", "have", " ", "primary", "\\u", "key", "=", "Tru", "e", ".\"_", "%_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "blank", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Field_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Auto", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "python_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "int_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Type", "Error_", ",_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "\"", "Thi", "s", " ", "value", " ", "must", " ", "be", " ", "an", " ", "integ", "er", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Auto", "Field_", "(_", "Field_", ")_", ":_", "\\u\\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", "db", "\\u", "prep", "\\u", "value_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "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_", "int_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Auto", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "contribute", "\\u", "to", "\\u", "class_", "(_", "self_", ",_", "cls_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "not_", "cls_", "._", "\\u", "meta_", "._", "has", "\\u", "auto", "\\u", "field_", ",_", "\"", "A", " ", "model", " ", "can", "'", "t", " ", "have", " ", "more", " ", "than", " ", "one", " ", "Auto", "Field", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Auto", "Field_", ",_", "self_", ")_", "._", "contribute", "\\u", "to", "\\u", "class_", "(_", "cls_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "\\u", "meta_", "._", "has", "\\u", "auto", "\\u", "field_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "\\u", "meta_", "._", "auto", "\\u", "field_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Auto", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Boo", "lean", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "empty", "\\u", "string", "s", "\\u", "allowed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Boo", "lean", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'", "blank", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "default", "'_", "not_", "in_", "kwargs_", "and_", "not_", "kwargs_", "._", "get_", "(_", "'", "null", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'", "default", "'_", "]_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Field_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Boo", "lean", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Boo", "lean", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Boo", "lean", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "python_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "in_", "(_", "True_", ",_", "False_", ")_", ":_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "value_", "in_", "(_", "'", "t", "'_", ",_", "'", "Tru", "e", "'_", ",_", "'", "1", "'_", ")_", ":_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "value_", "in_", "(_", "'", "f", "'_", ",_", "'", "Fal", "se", "'_", ",_", "'", "0", "'_", ")_", ":_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "\"", "Thi", "s", " ", "value", " ", "must", " ", "be", " ", "eit", "her", " ", "Tru", "e", " ", "or", " ", "Fal", "se", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Boo", "lean", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "db", "\\u", "prep", "\\u", "lookup_", "(_", "self_", ",_", "look", "up", "\\u", "type_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Special", "-", "case", " ", "handling", " ", "for", " ", "filter", "s", " ", "comi", "ng", " ", "from", " ", "a", " ", "web", " ", "request", " ", "(", "e", ".", "g", ".", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "admin", " ", "interface", ").", " ", "On", "ly", " ", "works", " ", "for", " ", "scala", "r", " ", "values", " ", "(", "not", " ", "lists", ").", " ", "If", " ", "you", "'", "re_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "passi", "ng", " ", "in", " ", "a", " ", "list", ",", " ", "you", " ", "mig", "ht", " ", "as", " ", "well", " ", "make", " ", "thing", "s", " ", "the", " ", "right", " ", "type", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "constructi", "ng", " ", "the", " ", "list", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "in_", "(_", "'", "1", "'_", ",_", "'", "0", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "bool_", "(_", "int_", "(_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "super_", "(_", "Boo", "lean", "Field_", ",_", "self_", ")_", "._", "get", "\\u", "db", "\\u", "prep", "\\u", "lookup_", "(_", "look", "up", "\\u", "type_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Boo", "lean", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "db", "\\u", "prep", "\\u", "value_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "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_", "bool_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Boo", "lean", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Unli", "ke", " ", "most", " ", "fields", ",", " ", "Boo", "lean", "Field", " ", "figure", "s", " ", "out", " ", "include", "\\u", "blank", " ", "from_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "null", " ", "inst", "ead", " ", "of", " ", "self", ".", "blank", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "choices_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "include", "\\u", "blank_", "=_", "self_", "._", "null_", "or_", "not_", "(_", "self_", "._", "has", "\\u", "default_", "(_", ")_", "or_", "'", "initial", "'_", "in_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "=_", "{_", "'", "choice", "s", "'_", ":_", "self_", "._", "get", "\\u", "choices_", "(_", "include", "\\u", "blank_", "=_", "include", "\\u", "blank_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "'", "form", "\\u", "class", "'_", ":_", "forms_", "._", "Boo", "lean", "Field_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Boo", "lean", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Char", "Field_", "(_", "Field_", ")_", ":_", "\\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_", "Char", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Char", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Char", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "python_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "value_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "value_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "null_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "uge", "ttext", "\\u", "lazy_", "(_", "\"", "Thi", "s", " ", "field", " ", "cann", "ot", " ", "be", " ", "null", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "smart", "\\u", "unicode_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Char", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "'", "max", "\\u", "length", "'_", ":_", "self_", "._", "max", "\\u", "length_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Char", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Comm", "a", "Separate", "d", "Integer", "Field_", "(_", "Char", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Comm", "a", "Separate", "d", "Integer", "Field_", "(_", "Char", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "form", "\\u", "class", "'_", ":_", "forms_", "._", "Rege", "x", "Field_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "regex", "'_", ":_", "'", "^", "[\\\\", "d", ",]", "+$", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "max", "\\u", "length", "'_", ":_", "self_", "._", "max", "\\u", "length_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "error", "\\u", "message", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "invalid", "'_", ":_", "\\u_", "(_", "u", "'", "Enter", " ", "only", " ", "digit", "s", " ", "separate", "d", " ", "by", " ", "commas", ".'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Comm", "a", "Separate", "d", "Integer", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "empty", "\\u", "string", "s", "\\u", "allowed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", "=_", "None_", ",_", "name_", "=_", "None_", ",_", "auto", "\\u", "now_", "=_", "False_", ",_", "auto", "\\u", "now", "\\u", "add_", "=_", "False_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "auto", "\\u", "now_", ",_", "self_", "._", "auto", "\\u", "now", "\\u", "add_", "=_", "auto", "\\u", "now_", ",_", "auto", "\\u", "now", "\\u", "add_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "HA", "CK", "s", " ", ":", " ", "auto", "\\u", "now", "\\u", "add", "/", "auto", "\\u", "now", " ", "shou", "ld", " ", "be", " ", "don", "e", " ", "as", " ", "a", " ", "default", " ", "or", " ", "a", " ", "pre", "\\u", "save", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "auto", "\\u", "now_", "or_", "auto", "\\u", "now", "\\u", "add_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'", "edita", "ble", "'_", "]_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "blank", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Field_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", ",_", "name_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Date", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "python_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "value_", ",_", "datetime_", "._", "datetime_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "._", "date_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "value_", ",_", "datetime_", "._", "date_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "ansi", "\\u", "date", "\\u", "re_", "._", "search_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "'", "Enter", " ", "a", " ", "valid", " ", "date", " ", "in", " ", "YYY", "Y", "-", "MM", "-", "DD", " ", "format", ".'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", "w", " ", "tha", "t", " ", "we", " ", "have", " ", "the", " ", "date", " ", "string", " ", "in", " ", "YYY", "Y", "-", "MM", "-", "DD", " ", "format", ",", " ", "check", " ", "to", " ", "make_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sure", " ", "it", "'", "s", " ", "a", " ", "valid", " ", "date", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "coul", "d", " ", "use", " ", "time", ".", "strp", "time", " ", "here", " ", "and", " ", "catch", " ", "error", "s", ",", " ", "but", " ", "datetime", ".", "date_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "produce", "s", " ", "muc", "h", " ", "frie", "ndl", "ier", " ", "error", " ", "message", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "year_", ",_", "month_", ",_", "day_", "=_", "map_", "(_", "int_", ",_", "value_", "._", "split_", "(_", "'-'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "datetime_", "._", "date_", "(_", "year_", ",_", "month_", ",_", "day_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\\u_", "(_", "'", "Inva", "lid", " ", "date", ":", " ", "%", "s", "'_", ")_", "%_", "\\u_", "(_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pre", "\\u", "save_", "(_", "self_", ",_", "model", "\\u", "instance_", ",_", "add_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "auto", "\\u", "now_", "or_", "(_", "self_", "._", "auto", "\\u", "now", "\\u", "add_", "and_", "add_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "setattr_", "(_", "model", "\\u", "instance_", ",_", "self_", "._", "attn", "ame_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "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 ", " _", "return_", "super_", "(_", "Date", "Field_", ",_", "self_", ")_", "._", "pre", "\\u", "save_", "(_", "model", "\\u", "instance_", ",_", "add_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "contribute", "\\u", "to", "\\u", "class_", "(_", "self_", ",_", "cls_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Date", "Field_", ",_", "self_", ")_", "._", "contribute", "\\u", "to", "\\u", "class_", "(_", "cls_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "null_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "cls_", ",_", "'", "get", "\\u", "next", "\\u", "by", "\\u", "%", "s", "'_", "%_", "self_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "curr", "y_", "(_", "cls_", "._", "\\u", "get", "\\u", "next", "\\u", "or", "\\u", "previ", "ous", "\\u", "by", "\\u", "FIELD_", ",_", "field_", "=_", "self_", ",_", "is", "\\u", "next_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "setattr_", "(_", "cls_", ",_", "'", "get", "\\u", "previ", "ous", "\\u", "by", "\\u", "%", "s", "'_", "%_", "self_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "curr", "y_", "(_", "cls_", "._", "\\u", "get", "\\u", "next", "\\u", "or", "\\u", "previ", "ous", "\\u", "by", "\\u", "FIELD_", ",_", "field_", "=_", "self_", ",_", "is", "\\u", "next_", "=_", "False_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\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", "db", "\\u", "prep", "\\u", "lookup_", "(_", "self_", ",_", "look", "up", "\\u", "type_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "For", " ", "\"\\u\\u", "month", "\",", " ", "\"\\u\\u", "day", "\",", " ", "and", " ", "\"\\u\\u", "week", "\\u", "day", "\"", " ", "lookups", ",", " ", "convert", " ", "the", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "an", " ", "int", " ", "so", " ", "the", " ", "databa", "se", " ", "back", "end", " ", "alw", "ay", "s", " ", "see", "s", " ", "a", " ", "consistent", " ", "type", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "look", "up", "\\u", "type_", "in_", "(_", "'", "month", "'_", ",_", "'", "day", "'_", ",_", "'", "week", "\\u", "day", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "int_", "(_", "value_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "super_", "(_", "Date", "Field_", ",_", "self_", ")_", "._", "get", "\\u", "db", "\\u", "prep", "\\u", "lookup_", "(_", "look", "up", "\\u", "type_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "db", "\\u", "prep", "\\u", "value_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Cast", "s", " ", "dates", " ", "int", "o", " ", "the", " ", "format", " ", "expected", " ", "by", " ", "the", " ", "backend_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "connection_", "._", "ops_", "._", "value", "\\u", "to", "\\u", "db", "\\u", "date_", "(_", "self_", "._", "to", "\\u", "python_", "(_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "value", "\\u", "to", "\\u", "string_", "(_", "self_", ",_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "val_", "=_", "self_", "._", "\\u", "get", "\\u", "val", "\\u", "from", "\\u", "obj_", "(_", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "val_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "''_", "\\u\\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_", "=_", "datetime", "\\u", "safe_", "._", "new", "\\u", "date_", "(_", "val_", ")_", "._", "strftime_", "(_", "\"%", "Y", "-%", "m", "-%", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "'", "form", "\\u", "class", "'_", ":_", "forms_", "._", "Date", "Field_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Date", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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", "Field_", "(_", "Date", "Field_", ")_", ":_", "\\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_", "Date", "Time", "Field_", "(_", "Date", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Date", "Time", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Time", "Field_", "(_", "Date", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "python_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "value_", ",_", "datetime_", "._", "datetime_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "value_", ",_", "datetime_", "._", "date_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "datetime_", "._", "datetime_", "(_", "value_", "._", "year_", ",_", "value_", "._", "month_", ",_", "value_", "._", "day_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Atte", "mpt", " ", "to", " ", "parse", " ", "a", " ", "datetime", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "value_", "=_", "smart", "\\u", "str_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "split", " ", "usec", "s", ",", " ", "bec", "aus", "e", " ", "the", "y", " ", "are", " ", "not", " ", "recognize", "d", " ", "by", " ", "strp", "time", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'.'_", "in_", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", ",_", "usec", "s_", "=_", "value_", "._", "split_", "(_", "'.'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "usec", "s_", "=_", "int_", "(_", "usec", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "'", "Enter", " ", "a", " ", "valid", " ", "date", "/", "time", " ", "in", " ", "YYY", "Y", "-", "MM", "-", "DD", " ", "HH", ":", "MM", "[:", "ss", "[.", "uu", "uu", "uu", "]]", " ", "format", ".'_", ")_", ")_", "\\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 ", " _", "usec", "s_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kwargs_", "=_", "{_", "'", "microsecond", "'_", ":_", "usec", "s_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "#", " ", "Second", "s", " ", "are", " ", "option", "al", ",", " ", "so", " ", "try", " ", "convert", "ing", " ", "second", "s", " ", "first", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "datetime_", "._", "datetime_", "(_", "*_", "time_", "._", "strptime_", "(_", "value_", ",_", "'%", "Y", "-%", "m", "-%", "d", " ", "%", "H", ":", "%", "M", ":", "%", "S", "'_", ")_", "[_", ":_", "6_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "#", " ", "Tr", "y", " ", "with", "out", " ", "second", "s", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "datetime_", "._", "datetime_", "(_", "*_", "time_", "._", "strptime_", "(_", "value_", ",_", "'%", "Y", "-%", "m", "-%", "d", " ", "%", "H", ":", "%", "M", "'_", ")_", "[_", ":_", "5_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "#", " ", "Tr", "y", " ", "with", "out", " ", "hour", "/", "minute", "s", "/", "second", "s", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "datetime_", "._", "datetime_", "(_", "*_", "time_", "._", "strptime_", "(_", "value_", ",_", "'%", "Y", "-%", "m", "-%", "d", "'_", ")_", "[_", ":_", "3_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "'", "Enter", " ", "a", " ", "valid", " ", "date", "/", "time", " ", "in", " ", "YYY", "Y", "-", "MM", "-", "DD", " ", "HH", ":", "MM", "[:", "ss", "[.", "uu", "uu", "uu", "]]", " ", "format", ".'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Time", "Field_", "(_", "Date", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "db", "\\u", "prep", "\\u", "value_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Cast", "s", " ", "dates", " ", "int", "o", " ", "the", " ", "format", " ", "expected", " ", "by", " ", "the", " ", "backend_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "connection_", "._", "ops_", "._", "value", "\\u", "to", "\\u", "db", "\\u", "datetime_", "(_", "self_", "._", "to", "\\u", "python_", "(_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Time", "Field_", "(_", "Date", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "value", "\\u", "to", "\\u", "string_", "(_", "self_", ",_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "val_", "=_", "self_", "._", "\\u", "get", "\\u", "val", "\\u", "from", "\\u", "obj_", "(_", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "val_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "''_", "\\u\\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_", "=_", "datetime", "\\u", "safe_", "._", "new", "\\u", "datetime_", "(_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "d_", "._", "strftime_", "(_", "'%", "Y", "-%", "m", "-%", "d", " ", "%", "H", ":", "%", "M", ":", "%", "S", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Time", "Field_", "(_", "Date", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "'", "form", "\\u", "class", "'_", ":_", "forms_", "._", "Date", "Time", "Field_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Date", "Time", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Deci", "mal", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "empty", "\\u", "string", "s", "\\u", "allowed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Deci", "mal", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", "=_", "None_", ",_", "name_", "=_", "None_", ",_", "max", "\\u", "digits_", "=_", "None_", ",_", "decima", "l\\u", "places_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "max", "\\u", "digits_", ",_", "self_", "._", "decima", "l\\u", "places_", "=_", "max", "\\u", "digits_", ",_", "decima", "l\\u", "places_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Field_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", ",_", "name_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Deci", "mal", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Deci", "mal", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Deci", "mal", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "python_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "decimal_", "._", "Decimal_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "decimal_", "._", "Inva", "lid", "Operation_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "\"", "Thi", "s", " ", "value", " ", "must", " ", "be", " ", "a", " ", "decima", "l", " ", "number", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Deci", "mal", "Field_", "(_", "Field_", ")_", ":_", "\\u\\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", "format_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "value_", ",_", "basestring_", ")_", "or_", "value_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "format\\u", "number_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Deci", "mal", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "format\\u", "number_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Format", "s", " ", "a", " ", "number", " ", "int", "o", " ", "a", " ", "string", " ", "with", " ", "the", " ", "requisit", "e", " ", "number", " ", "of", " ", "digit", "s", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "decima", "l", " ", "place", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Meth", "od", " ", "moved", " ", "to", " ", "django", ".", "db", ".", "back", "ends", ".", "util", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "It", " ", "is", " ", "preserved", " ", "bec", "aus", "e", " ", "it", " ", "is", " ", "used", " ", "by", " ", "the", " ", "oracle", " ", "backend_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "django", ".", "db", ".", "back", "ends", ".", "oracle", ".", "query", "),", " ", "and", " ", "als", "o", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "back", "ward", "s", "-", "compatibility", " ", "with", " ", "any", " ", "external", " ", "code", " ", "whi", "ch", " ", "may", " ", "have", " ", "used_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "method", "._", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "backends_", "import_", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "util_", "._", "format\\u", "number_", "(_", "value_", ",_", "self_", "._", "max", "\\u", "digits_", ",_", "self_", "._", "decima", "l\\u", "places_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Deci", "mal", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "db", "\\u", "prep", "\\u", "save_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "connection_", "._", "ops_", "._", "value", "\\u", "to", "\\u", "db", "\\u", "decimal_", "(_", "self_", "._", "to", "\\u", "python_", "(_", "value_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "max", "\\u", "digits_", ",_", "self_", "._", "decima", "l\\u", "places_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Deci", "mal", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "db", "\\u", "prep", "\\u", "value_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "to", "\\u", "python_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Deci", "mal", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "max", "\\u", "digit", "s", "'_", ":_", "self_", "._", "max", "\\u", "digits_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "decima", "l\\u", "place", "s", "'_", ":_", "self_", "._", "decima", "l\\u", "places_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "form", "\\u", "class", "'_", ":_", "forms_", "._", "Deci", "mal", "Field_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Deci", "mal", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Ema", "il", "Field_", "(_", "Char", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Ema", "il", "Field_", "(_", "Char", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'", "max", "\\u", "length", "'_", "]_", "=_", "kwargs_", "._", "get_", "(_", "'", "max", "\\u", "length", "'_", ",_", "75_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Char", "Field_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ema", "il", "Field_", "(_", "Char", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "'", "form", "\\u", "class", "'_", ":_", "forms_", "._", "Ema", "il", "Field_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Ema", "il", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "File", "Path", "Field_", "(_", "Field_", ")_", ":_", "\\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_", "File", "Path", "Field_", "(_", "Field_", ")_", ":_", "\\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_", ",_", "verbo", "se", "\\u", "name_", "=_", "None_", ",_", "name_", "=_", "None_", ",_", "path_", "=_", "''_", ",_", "match_", "=_", "None_", ",_", "recursive_", "=_", "False_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "path_", ",_", "self_", "._", "match_", ",_", "self_", "._", "recursive_", "=_", "path_", ",_", "match_", ",_", "recursive_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "max", "\\u", "length", "'_", "]_", "=_", "kwargs_", "._", "get_", "(_", "'", "max", "\\u", "length", "'_", ",_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Field_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", ",_", "name_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "File", "Path", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "path", "'_", ":_", "self_", "._", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "match", "'_", ":_", "self_", "._", "match_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "recurs", "ive", "'_", ":_", "self_", "._", "recursive_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "form", "\\u", "class", "'_", ":_", "forms_", "._", "File", "Path", "Field_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "File", "Path", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "File", "Path", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "File", "Path", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Float", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "empty", "\\u", "string", "s", "\\u", "allowed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Float", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "db", "\\u", "prep", "\\u", "value_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "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_", "float_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Float", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Float", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Float", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "python_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "float_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Type", "Error_", ",_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "\"", "Thi", "s", " ", "value", " ", "must", " ", "be", " ", "a", " ", "float", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Float", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "'", "form", "\\u", "class", "'_", ":_", "forms_", "._", "Float", "Field_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Float", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Integer", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "empty", "\\u", "string", "s", "\\u", "allowed_", "=_", "False_", "\\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_", "Integer", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "db", "\\u", "prep", "\\u", "value_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "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_", "int_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Integer", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Integer", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Integer", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "python_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "int_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Type", "Error_", ",_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "\"", "Thi", "s", " ", "value", " ", "must", " ", "be", " ", "an", " ", "integ", "er", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Integer", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "'", "form", "\\u", "class", "'_", ":_", "forms_", "._", "Integer", "Field_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Integer", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "IPA", "ddress", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "empty", "\\u", "string", "s", "\\u", "allowed_", "=_", "False_", "\\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_", "IPA", "ddress", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'", "max", "\\u", "length", "'_", "]_", "=_", "15_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Field_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IPA", "ddress", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "IPA", "ddress", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IPA", "ddress", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "'", "form", "\\u", "class", "'_", ":_", "forms_", "._", "IPA", "ddress", "Field_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "IPA", "ddress", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Null", "Boo", "lean", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "empty", "\\u", "string", "s", "\\u", "allowed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Null", "Boo", "lean", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'", "null", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Field_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Null", "Boo", "lean", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Null", "Boo", "lean", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Null", "Boo", "lean", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "python_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "in_", "(_", "None_", ",_", "True_", ",_", "False_", ")_", ":_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "value_", "in_", "(_", "'", "Non", "e", "'_", ",_", ")_", ":_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "value_", "in_", "(_", "'", "t", "'_", ",_", "'", "Tru", "e", "'_", ",_", "'", "1", "'_", ")_", ":_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "value_", "in_", "(_", "'", "f", "'_", ",_", "'", "Fal", "se", "'_", ",_", "'", "0", "'_", ")_", ":_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "\"", "Thi", "s", " ", "value", " ", "must", " ", "be", " ", "eit", "her", " ", "Non", "e", ",", " ", "Tru", "e", " ", "or", " ", "Fal", "se", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Null", "Boo", "lean", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "db", "\\u", "prep", "\\u", "lookup_", "(_", "self_", ",_", "look", "up", "\\u", "type_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Special", "-", "case", " ", "handling", " ", "for", " ", "filter", "s", " ", "comi", "ng", " ", "from", " ", "a", " ", "web", " ", "request", " ", "(", "e", ".", "g", ".", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "admin", " ", "interface", ").", " ", "On", "ly", " ", "works", " ", "for", " ", "scala", "r", " ", "values", " ", "(", "not", " ", "lists", ").", " ", "If", " ", "you", "'", "re_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "passi", "ng", " ", "in", " ", "a", " ", "list", ",", " ", "you", " ", "mig", "ht", " ", "as", " ", "well", " ", "make", " ", "thing", "s", " ", "the", " ", "right", " ", "type", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "constructi", "ng", " ", "the", " ", "list", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "in_", "(_", "'", "1", "'_", ",_", "'", "0", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "bool_", "(_", "int_", "(_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "super_", "(_", "Null", "Boo", "lean", "Field_", ",_", "self_", ")_", "._", "get", "\\u", "db", "\\u", "prep", "\\u", "lookup_", "(_", "look", "up", "\\u", "type_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Null", "Boo", "lean", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "db", "\\u", "prep", "\\u", "value_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "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_", "bool_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Null", "Boo", "lean", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "form", "\\u", "class", "'_", ":_", "forms_", "._", "Null", "Boo", "lean", "Field_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "require", "d", "'_", ":_", "not_", "self_", "._", "blank_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "label", "'_", ":_", "cap", "first_", "(_", "self_", "._", "verbo", "se", "\\u", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "help", "\\u", "text", "'_", ":_", "self_", "._", "help", "\\u", "text_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Null", "Boo", "lean", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Posi", "tiv", "e", "Integer", "Field_", "(_", "Integer", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Posi", "tiv", "e", "Integer", "Field_", "(_", "Integer", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Posi", "tiv", "e", "Integer", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Posi", "tiv", "e", "Integer", "Field_", "(_", "Integer", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "'", "min", "\\u", "value", "'_", ":_", "0_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Posi", "tiv", "e", "Integer", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Posi", "tiv", "e", "Small", "Integer", "Field_", "(_", "Integer", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Posi", "tiv", "e", "Small", "Integer", "Field_", "(_", "Integer", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Posi", "tiv", "e", "Small", "Integer", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Posi", "tiv", "e", "Small", "Integer", "Field_", "(_", "Integer", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "'", "min", "\\u", "value", "'_", ":_", "0_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Posi", "tiv", "e", "Small", "Integer", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Sl", "ug", "Field_", "(_", "Char", "Field_", ")_", ":_", "\\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_", "Sl", "ug", "Field_", "(_", "Char", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'", "max", "\\u", "length", "'_", "]_", "=_", "kwargs_", "._", "get_", "(_", "'", "max", "\\u", "length", "'_", ",_", "50_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Set", " ", "db", "\\u", "index", "=", "Tru", "e", " ", "unl", "ess", " ", "it", "'", "s", " ", "bee", "n", " ", "set", " ", "manu", "ally", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "db", "\\u", "index", "'_", "not_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'", "db", "\\u", "index", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "super_", "(_", "Sl", "ug", "Field_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sl", "ug", "Field_", "(_", "Char", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Sl", "ug", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sl", "ug", "Field_", "(_", "Char", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "'", "form", "\\u", "class", "'_", ":_", "forms_", "._", "Sl", "ug", "Field_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Sl", "ug", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Small", "Integer", "Field_", "(_", "Integer", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Small", "Integer", "Field_", "(_", "Integer", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Small", "Integer", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Text", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Text", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Text", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "'", "widget", "'_", ":_", "forms_", "._", "Textarea_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Text", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Time", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "empty", "\\u", "string", "s", "\\u", "allowed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Time", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", "=_", "None_", ",_", "name_", "=_", "None_", ",_", "auto", "\\u", "now_", "=_", "False_", ",_", "auto", "\\u", "now", "\\u", "add_", "=_", "False_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "auto", "\\u", "now_", ",_", "self_", "._", "auto", "\\u", "now", "\\u", "add_", "=_", "auto", "\\u", "now_", ",_", "auto", "\\u", "now", "\\u", "add_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "auto", "\\u", "now_", "or_", "auto", "\\u", "now", "\\u", "add_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'", "edita", "ble", "'_", "]_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Field_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", ",_", "name_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Time", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "python_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "value_", ",_", "datetime_", "._", "time_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "value_", ",_", "datetime_", "._", "datetime_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", " ", "usual", "ly", " ", "a", " ", "good", " ", "idea", " ", "to", " ", "pass", " ", "in", " ", "a", " ", "datetime", " ", "here", " ", "(", "it", " ", "lose", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "informati", "on", "),", " ", "but", " ", "this", " ", "can", " ", "be", " ", "a", " ", "side", "-", "effect", " ", "of", " ", "interacti", "ng", " ", "with", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "back", "end", " ", "(", "e", ".", "g", ".", " ", "Ora", "cle", "),", " ", "so", " ", "we", "'", "ll", " ", "be", " ", "accom", "mod", "ati", "ng", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "._", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Atte", "mpt", " ", "to", " ", "parse", " ", "a", " ", "datetime", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "value_", "=_", "smart", "\\u", "str_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "split", " ", "usec", "s", ",", " ", "bec", "aus", "e", " ", "the", "y", " ", "are", " ", "not", " ", "recognize", "d", " ", "by", " ", "strp", "time", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'.'_", "in_", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", ",_", "usec", "s_", "=_", "value_", "._", "split_", "(_", "'.'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "usec", "s_", "=_", "int_", "(_", "usec", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "'", "Enter", " ", "a", " ", "valid", " ", "time", " ", "in", " ", "HH", ":", "MM", "[:", "ss", "[.", "uu", "uu", "uu", "]]", " ", "format", ".'_", ")_", ")_", "\\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 ", " _", "usec", "s_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kwargs_", "=_", "{_", "'", "microsecond", "'_", ":_", "usec", "s_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "#", " ", "Second", "s", " ", "are", " ", "option", "al", ",", " ", "so", " ", "try", " ", "convert", "ing", " ", "second", "s", " ", "first", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "datetime_", "._", "time_", "(_", "*_", "time_", "._", "strptime_", "(_", "value_", ",_", "'%", "H", ":", "%", "M", ":", "%", "S", "'_", ")_", "[_", "3_", ":_", "6_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", "\\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 ", " _", "try_", ":_", "#", " ", "Tr", "y", " ", "with", "out", " ", "second", "s", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "datetime_", "._", "time_", "(_", "*_", "time_", "._", "strptime_", "(_", "value_", ",_", "'%", "H", ":", "%", "M", "'_", ")_", "[_", "3_", ":_", "5_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "'", "Enter", " ", "a", " ", "valid", " ", "time", " ", "in", " ", "HH", ":", "MM", "[:", "ss", "[.", "uu", "uu", "uu", "]]", " ", "format", ".'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "Field_", "(_", "Field_", ")_", ":_", "\\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_", "pre", "\\u", "save_", "(_", "self_", ",_", "model", "\\u", "instance_", ",_", "add_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "auto", "\\u", "now_", "or_", "(_", "self_", "._", "auto", "\\u", "now", "\\u", "add_", "and_", "add_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "setattr_", "(_", "model", "\\u", "instance_", ",_", "self_", "._", "attn", "ame_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "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 ", " _", "return_", "super_", "(_", "Time", "Field_", ",_", "self_", ")_", "._", "pre", "\\u", "save_", "(_", "model", "\\u", "instance_", ",_", "add_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "Field_", "(_", "Field_", ")_", ":_", "\\u\\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", "db", "\\u", "prep", "\\u", "value_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Cast", "s", " ", "times", " ", "int", "o", " ", "the", " ", "format", " ", "expected", " ", "by", " ", "the", " ", "backend_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "connection_", "._", "ops_", "._", "value", "\\u", "to", "\\u", "db", "\\u", "time_", "(_", "self_", "._", "to", "\\u", "python_", "(_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "value", "\\u", "to", "\\u", "string_", "(_", "self_", ",_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "val_", "=_", "self_", "._", "\\u", "get", "\\u", "val", "\\u", "from", "\\u", "obj_", "(_", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "val_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "''_", "\\u\\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_", "=_", "val_", "._", "strftime_", "(_", "\"%", "H", ":", "%", "M", ":", "%", "S", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "'", "form", "\\u", "class", "'_", ":_", "forms_", "._", "Time", "Field_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Time", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "URL", "Field_", "(_", "Char", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "URL", "Field_", "(_", "Char", "Field_", ")_", ":_", "\\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_", ",_", "verbo", "se", "\\u", "name_", "=_", "None_", ",_", "name_", "=_", "None_", ",_", "verify", "\\u", "exists_", "=_", "True_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'", "max", "\\u", "length", "'_", "]_", "=_", "kwargs_", "._", "get_", "(_", "'", "max", "\\u", "length", "'_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "verify", "\\u", "exists_", "=_", "verify", "\\u", "exists_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Char", "Field_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", ",_", "name_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "URL", "Field_", "(_", "Char", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "'", "form", "\\u", "class", "'_", ":_", "forms_", "._", "URL", "Field_", ",_", "'", "verify", "\\u", "exist", "s", "'_", ":_", "self_", "._", "verify", "\\u", "exists_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "URL", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "XML", "Field_", "(_", "Text", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "XML", "Field_", "(_", "Text", "Field_", ")_", ":_", "\\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_", ",_", "verbo", "se", "\\u", "name_", "=_", "None_", ",_", "name_", "=_", "None_", ",_", "schema", "\\u", "path_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "schema", "\\u", "path_", "=_", "schema", "\\u", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Field_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", ",_", "name_", ",_", "**_", "kwargs_", ")_" ]
[ 4, 4, 4, 4, 4, 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, 0, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 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 ]
Unused import
cesium-ml/cesium/doc/conf.py
[ { "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n#\n# cesium documentation build configuration file, created by\n# sphinx-quickstart on Thu Jul 23 13:00:45 2015.\n#\n# This file is execfile()d with the current directory set to its\n# containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\nimport sys\nimport os\nimport shlex\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n#sys.path.insert(0, os.path.abspath('.'))\n\n# -- General configuration ------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#needs_sphinx = '1.0'\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [\n 'sphinx.ext.mathjax',\n 'sphinx.ext.autodoc',\n 'sphinx.ext.autosummary',\n# 'sphinx.ext.pngmath',\n 'numpydoc',\n# 'plot2rst',\n# 'sphinx.ext.intersphinx',\n# 'sphinx.ext.linkcode',\n]\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix(es) of source filenames.\nfrom recommonmark.parser import CommonMarkParser\n\nsource_parsers = {\n '.md': CommonMarkParser,\n}\n\nsource_suffix = ['.rst', '.md', '.txt']\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 = 'cesium'\ncopyright = '2015, The cesium Team'\nauthor = 'The cesium Team'\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\nsetup_lines = open('../cesium/__init__.py').readlines()\nversion = 'vUndefined'\nfor l in setup_lines:\n if l.startswith('__version__'):\n version = l.split(\"'\")[1]\n break\n\n# The full version, including alpha/beta/rc tags.\nrelease = version\n\n# The short X.Y version.\nversion = '0.4'\n# The full version, including alpha/beta/rc tags.\nrelease = '0.4.dev0'\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#\n# This is also used if you do content translation via gettext catalogs.\n# Usually you set \"language\" from the command line for these cases.\nlanguage = None\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n#today = ''\n# Else, today_fmt is used as the format for a strftime call.\n#today_fmt = '%B %d, %Y'\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = ['_build']\n\n# The reST default role (used for this markup: `text`) to use for all\n# documents.\n#default_role = None\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\n#add_function_parentheses = True\n\n# If true, the current module name will be prepended to all description\n# unit titles (such as .. function::).\n#add_module_names = True\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\n#show_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# A list of ignored prefixes for module index sorting.\n#modindex_common_prefix = []\n\n# If true, keep warnings as \"system message\" paragraphs in the built documents.\n#keep_warnings = False\n\n# If true, `todo` and `todoList` produce output, else they produce nothing.\ntodo_include_todos = False\n\n# -- Options for HTML output ----------------------------------------------\n\n# The theme to use for HTML and HTML Help pages. See the documentation for\n# a list of builtin themes.\n# Per https://github.com/snide/sphinx_rtd_theme: specify theme if not on RTD\non_rtd = os.environ.get('READTHEDOCS', None) == 'True'\nif not on_rtd: # only import and set the theme if we're building docs locally\n import sphinx_rtd_theme\n html_theme = 'sphinx_rtd_theme'\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.\nhtml_show_sourcelink = False\n\n# If true, \"Created using Sphinx\" is shown in the HTML footer. Default is True.\n#html_show_sphinx = True\n\n# If true, \"(C) Copyright ...\" is shown in the HTML footer. Default is True.\n#html_show_copyright = True\n\n# If true, an OpenSearch description file will be output, and all pages will\n# contain a <link> tag referring to it. The value of this option must be the\n# base URL from which the finished HTML is served.\n#html_use_opensearch = ''\n\n# This is the file name suffix for HTML files (e.g. \".xhtml\").\n#html_file_suffix = None\n\n# Language to be used for generating the HTML full-text search index.\n# Sphinx supports the following languages:\n# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'\n# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'\n#html_search_language = 'en'\n\n# A dictionary with options for the search language support, empty by default.\n# Now only 'ja' uses this config value\n#html_search_options = {'type': 'default'}\n\n# The name of a javascript file (relative to the configuration directory) that\n# implements a search results scorer. If empty, the default will be used.\n#html_search_scorer = 'scorer.js'\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'cesiumdoc'\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# Latex figure (float) alignment\n#'figure_align': 'htbp',\n}\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title,\n# author, documentclass [howto, manual, or own class]).\nlatex_documents = [\n (master_doc, 'cesium.tex', 'cesium Documentation',\n 'The cesium Team', '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 (master_doc, 'cesium', 'cesium Documentation',\n [author], 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 (master_doc, 'cesium', 'cesium Documentation',\n author, 'cesium', 'One line description of project.',\n 'Miscellaneous'),\n]\n\n# Documents to append as an appendix to all manuals.\n#texinfo_appendices = []\n\n# If false, no module index is generated.\n#texinfo_domain_indices = True\n\n# How to display URL addresses: 'footnote', 'no', or 'inline'.\n#texinfo_show_urls = 'footnote'\n\n# If true, do not generate a @detailmenu in the \"Top\" node's menu.\n#texinfo_no_detailmenu = False\n\n\n# -- Build cesium API documentation ----------------------------------------\nsys.path.append(os.path.join(os.path.dirname(__name__), '..'))\nsys.path.append(os.path.join(os.path.dirname(__name__), 'tools'))\nfrom apigen import ApiDocWriter\nimport cesium\npackage = 'cesium'\nmodule = sys.modules[package]\n\noutdir = 'api'\ndocwriter = ApiDocWriter(package)\ndocwriter.write_api_docs(outdir)\ndocwriter.write_index(outdir, 'api', relative_to='api')\nprint('%d files written' % len(docwriter.written_modules))\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def setup(app):\n app.add_stylesheet(\"output_cells.css\")", "metadata": "root.setup", "header": "['module', '___EOS___']", "index": 329 } ]
[ { "span": "import shlex", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 12 }, { "span": "import sphinx_rtd_theme", "start_line": 137, "start_column": 4, "end_line": 137, "end_column": 27 }, { "span": "import cesium", "start_line": 318, "start_column": 0, "end_line": 318, "end_column": 13 } ]
[]
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_", "#", " ", "ces", "ium", " ", "documentation", " ", "build", " ", "configura", "tion", " ", "file", ",", " ", "created", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sphinx", "-", "quicks", "tart", " ", "on", " ", "Thu", " ", "Ju", "l", " ", "23", " ", "13", ":", "00", ":", "4", "5", " ", "201", "5._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "file", " ", "is", " ", "execfile", "()", "d", " ", "with", " ", "the", " ", "current", " ", "director", "y", " ", "set", " ", "to", " ", "its_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contain", "ing", " ", "dir", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", " ", "tha", "t", " ", "not", " ", "all", " ", "possib", "le", " ", "configura", "tion", " ", "values", " ", "are", " ", "presen", "t", " ", "in", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "autogen", "erate", "d", " ", "file", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "configura", "tion", " ", "values", " ", "have", " ", "a", " ", "default", ";", " ", "values", " ", "tha", "t", " ", "are", " ", "commente", "d", " ", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "serve", " ", "to", " ", "show", " ", "the", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "shlex_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "extensi", "ons", " ", "(", "or", " ", "module", "s", " ", "to", " ", "document", " ", "with", " ", "autod", "oc", ")", " ", "are", " ", "in", " ", "anot", "her", " ", "director", "y", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "these", " ", "director", "ies", " ", "to", " ", "sys", ".", "path", " ", "here", ".", " ", "If", " ", "the", " ", "director", "y", " ", "is", " ", "relative", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", " ", "root", ",", " ", "use", " ", "os", ".", "path", ".", "abs", "path", " ", "to", " ", "make", " ", "it", " ", "abs", "olute", ",", " ", "like", " ", "shown", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "sys", ".", "path", ".", "insert", "(", "0", ",", " ", "os", ".", "path", ".", "abs", "path", "('.", "'))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "General", " ", "configura", "tion", " ", "--------------", "--------------", "--------------", "------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "your", " ", "documentation", " ", "need", "s", " ", "a", " ", "minima", "l", " ", "Sph", "inx", " ", "version", ",", " ", "state", " ", "it", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "need", "s", "\\u", "sphinx", " ", "=", " ", "'", "1.0", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "Sph", "inx", " ", "extensi", "on", " ", "module", " ", "names", " ", "here", ",", " ", "as", " ", "string", "s", ".", " ", "The", "y", " ", "can", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "extensi", "ons", " ", "comi", "ng", " ", "with", " ", "Sph", "inx", " ", "(", "named", " ", "'", "sphinx", ".", "ext", ".*", "')", " ", "or", " ", "your", " ", "custom_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ones", "._", "\\u\\u\\uNL\\u\\u\\u_", "extensions_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sphinx", ".", "ext", ".", "math", "jax", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sphinx", ".", "ext", ".", "autod", "oc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sphinx", ".", "ext", ".", "autosu", "mmar", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "'", "sphinx", ".", "ext", ".", "png", "math", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nump", "ydo", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "'", "plot", "2r", "st", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "'", "sphinx", ".", "ext", ".", "intersphinx", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "'", "sphinx", ".", "ext", ".", "link", "code", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "template", "s", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "template", "s", "\\u", "path_", "=_", "[_", "'\\u", "template", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "suff", "ix", "(", "es", ")", " ", "of", " ", "source", " ", "filename", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "from_", "recom", "mon", "mark_", "._", "parser_", "import_", "Common", "Mark", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "source", "\\u", "parsers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'.", "md", "'_", ":_", "Common", "Mark", "Parser_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "source", "\\u", "suffix_", "=_", "[_", "'.", "rst", "'_", ",_", "'.", "md", "'_", ",_", "'.", "txt", "'_", "]_", "\\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_", "=_", "'", "ces", "ium", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "copyright_", "=_", "'", "201", "5", ",", " ", "The", " ", "ces", "ium", " ", "Tea", "m", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "author_", "=_", "'", "The", " ", "ces", "ium", " ", "Tea", "m", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "version", " ", "info", " ", "for", " ", "the", " ", "project", " ", "you", "'", "re", " ", "document", "ing", ",", " ", "acts", " ", "as", " ", "replace", "ment", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "|", "version", "|", " ", "and", " ", "|", "release", "|", ",", " ", "als", "o", " ", "used", " ", "in", " ", "vari", "ous", " ", "other", " ", "place", "s", " ", "through", "out", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bui", "lt", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "setup", "\\u", "lines_", "=_", "open_", "(_", "'../", "ces", "ium", "/\\u", "\\u", "init", "\\u\\u", ".", "py", "'_", ")_", "._", "readlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "version_", "=_", "'", "v", "Unde", "fined", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "l_", "in_", "setup", "\\u", "lines_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "l_", "._", "startswith_", "(_", "'\\u", "\\u", "version", "\\u\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "=_", "l_", "._", "split_", "(_", "\"'\"_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "full", " ", "version", ",", " ", "inclu", "ding", " ", "alpha", "/", "beta", "/", "rc", " ", "tags", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "release_", "=_", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "short", " ", "X", ".", "Y", " ", "version", "._", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "'", "0.", "4", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "full", " ", "version", ",", " ", "inclu", "ding", " ", "alpha", "/", "beta", "/", "rc", " ", "tags", "._", "\\u\\u\\uNL\\u\\u\\u_", "release_", "=_", "'", "0.", "4", ".", "dev", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "language", " ", "for", " ", "content", " ", "autogen", "erate", "d", " ", "by", " ", "Sph", "inx", ".", " ", "Refer", " ", "to", " ", "documentation", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "a", " ", "list", " ", "of", " ", "support", "ed", " ", "language", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "als", "o", " ", "used", " ", "if", " ", "you", " ", "do", " ", "content", " ", "translatio", "n", " ", "via", " ", "gettext", " ", "catalogs", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ual", "ly", " ", "you", " ", "set", " ", "\"", "language", "\"", " ", "from", " ", "the", " ", "command", " ", "line", " ", "for", " ", "these", " ", "case", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "language_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "There", " ", "are", " ", "two", " ", "options", " ", "for", " ", "repla", "cing", " ", "|", "toda", "y", "|", ":", " ", "eit", "her", ",", " ", "you", " ", "set", " ", "toda", "y", " ", "to", " ", "some", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "non", "-", "fal", "se", " ", "value", ",", " ", "then", " ", "it", " ", "is", " ", "used", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "toda", "y", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Else", ",", " ", "toda", "y", "\\u", "fmt", " ", "is", " ", "used", " ", "as", " ", "the", " ", "format", " ", "for", " ", "a", " ", "strf", "time", " ", "call", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "toda", "y", "\\u", "fmt", " ", "=", " ", "'%", "B", " ", "%", "d", ",", " ", "%", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "List", " ", "of", " ", "pattern", "s", ",", " ", "relative", " ", "to", " ", "source", " ", "director", "y", ",", " ", "tha", "t", " ", "match", " ", "files", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "director", "ies", " ", "to", " ", "ignore", " ", "whe", "n", " ", "look", "ing", " ", "for", " ", "source", " ", "files", "._", "\\u\\u\\uNL\\u\\u\\u_", "exclu", "de", "\\u", "patterns_", "=_", "[_", "'\\u", "build", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "re", "ST", " ", "default", " ", "role", " ", "(", "used", " ", "for", " ", "this", " ", "markup", ":", " ", "`", "text", "`)", " ", "to", " ", "use", " ", "for", " ", "all_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "default", "\\u", "role", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "'(", ")'", " ", "will", " ", "be", " ", "append", "ed", " ", "to", " ", ":", "func", ":", " ", "etc", ".", " ", "cross", "-", "reference", " ", "text", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "\\u", "function", "\\u", "parenthes", "es", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "the", " ", "current", " ", "module", " ", "name", " ", "will", " ", "be", " ", "prepend", "ed", " ", "to", " ", "all", " ", "description_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unit", " ", "titles", " ", "(", "suc", "h", " ", "as", " ", "..", " ", "function", "::", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "\\u", "module", "\\u", "names", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "section", "author", " ", "and", " ", "module", "author", " ", "directive", "s", " ", "will", " ", "be", " ", "shown", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "output", ".", " ", "The", "y", " ", "are", " ", "ignore", "d", " ", "by", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "show", "\\u", "author", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "the", " ", "Pyg", "ment", "s", " ", "(", "synta", "x", " ", "highlight", "ing", ")", " ", "style", " ", "to", " ", "use", "._", "\\u\\u\\uNL\\u\\u\\u_", "pyg", "ment", "s", "\\u", "style_", "=_", "'", "sphinx", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "list", " ", "of", " ", "ignore", "d", " ", "prefix", "es", " ", "for", " ", "module", " ", "index", " ", "sorting", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "modi", "nde", "x", "\\u", "common", "\\u", "prefix", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "keep", " ", "warn", "ings", " ", "as", " ", "\"", "system", " ", "message", "\"", " ", "paragraph", "s", " ", "in", " ", "the", " ", "bui", "lt", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "keep", "\\u", "warn", "ings", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "`", "todo", "`", " ", "and", " ", "`", "todo", "List", "`", " ", "produce", " ", "output", ",", " ", "else", " ", "the", "y", " ", "produce", " ", "not", "hing", "._", "\\u\\u\\uNL\\u\\u\\u_", "todo", "\\u", "include", "\\u", "todos_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "HTM", "L", " ", "output", " ", "--------------", "--------------", "--------------", "----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "them", "e", " ", "to", " ", "use", " ", "for", " ", "HTM", "L", " ", "and", " ", "HTM", "L", " ", "Help", " ", "page", "s", ".", " ", " ", "See", " ", "the", " ", "documentation", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "list", " ", "of", " ", "bui", "lti", "n", " ", "themes", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Per", " ", "https", "://", "git", "hub", ".", "com", "/", "sni", "de", "/", "sphinx", "\\u", "rtd", "\\u", "them", "e", ":", " ", "speci", "fy", " ", "them", "e", " ", "if", " ", "not", " ", "on", " ", "RT", "D_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "rtd", "_", "=_", "os_", "._", "environ_", "._", "get_", "(_", "'", "READ", "THE", "DOCS", "'_", ",_", "None_", ")_", "==_", "'", "Tru", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "on", "\\u", "rtd", "_", ":_", "#", " ", "only", " ", "import", " ", "and", " ", "set", " ", "the", " ", "them", "e", " ", "if", " ", "we", "'", "re", " ", "buildi", "ng", " ", "docs", " ", "local", "ly_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "sphinx", "\\u", "rtd", "\\u", "theme_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "\\u", "theme_", "=_", "'", "sphinx", "\\u", "rtd", "\\u", "them", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\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_", "\\u\\u\\uDEDENT\\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_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "\"", "Creat", "ed", " ", "usi", "ng", " ", "Sph", "inx", "\"", " ", "is", " ", "shown", " ", "in", " ", "the", " ", "HTM", "L", " ", "footer", ".", " ", "Default", " ", "is", " ", "Tru", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "sphinx", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "\"(", "C", ")", " ", "Copy", "right", " ", "...\"", " ", "is", " ", "shown", " ", "in", " ", "the", " ", "HTM", "L", " ", "footer", ".", " ", "Default", " ", "is", " ", "Tru", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "copyr", "ight", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "an", " ", "Open", "Sear", "ch", " ", "description", " ", "file", " ", "will", " ", "be", " ", "output", ",", " ", "and", " ", "all", " ", "page", "s", " ", "will", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contain", " ", "a", " ", "<", "link", ">", " ", "tag", " ", "refer", "ring", " ", "to", " ", "it", ".", " ", " ", "The", " ", "value", " ", "of", " ", "this", " ", "option", " ", "must", " ", "be", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "base", " ", "URL", " ", "from", " ", "whi", "ch", " ", "the", " ", "finish", "ed", " ", "HTM", "L", " ", "is", " ", "serve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "opens", "ear", "ch", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "the", " ", "file", " ", "name", " ", "suff", "ix", " ", "for", " ", "HTM", "L", " ", "files", " ", "(", "e", ".", "g", ".", " ", "\".", "xh", "tml", "\")", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "file", "\\u", "suff", "ix", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Lang", "ua", "ge", " ", "to", " ", "be", " ", "used", " ", "for", " ", "generat", "ing", " ", "the", " ", "HTM", "L", " ", "full", "-", "text", " ", "search", " ", "index", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sph", "inx", " ", "support", "s", " ", "the", " ", "follow", "ing", " ", "language", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "'", "da", "',", " ", "'", "de", "',", " ", "'", "en", "',", " ", "'", "es", "',", " ", "'", "fi", "',", " ", "'", "fr", "',", " ", "'", "h", "',", " ", "'", "it", "',", " ", "'", "ja", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "'", "nl", "',", " ", "'", "no", "',", " ", "'", "pt", "',", " ", "'", "ro", "',", " ", "'", "r", "',", " ", "'", "sv", "',", " ", "'", "tr", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "search", "\\u", "language", " ", "=", " ", "'", "en", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "dictionar", "y", " ", "with", " ", "options", " ", "for", " ", "the", " ", "search", " ", "language", " ", "support", ",", " ", "empty", " ", "by", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "only", " ", "'", "ja", "'", " ", "use", "s", " ", "this", " ", "config", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "search", "\\u", "options", " ", "=", " ", "{", "'", "type", "':", " ", "'", "default", "'}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "a", " ", "javascript", " ", "file", " ", "(", "relative", " ", "to", " ", "the", " ", "configura", "tion", " ", "director", "y", ")", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "implement", "s", " ", "a", " ", "search", " ", "results", " ", "scorer", ".", " ", "If", " ", "empty", ",", " ", "the", " ", "default", " ", "will", " ", "be", " ", "used", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "search", "\\u", "scorer", " ", "=", " ", "'", "scorer", ".", "js", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Output", " ", "file", " ", "base", " ", "name", " ", "for", " ", "HTM", "L", " ", "help", " ", "builde", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "help", "\\u", "basename_", "=_", "'", "ces", "ium", "doc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "La", "Te", "X", " ", "output", " ", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "late", "x", "\\u", "elements_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "pape", "r", " ", "size", " ", "('", "letter", "pape", "r", "'", " ", "or", " ", "'", "a4", "pape", "r", "')", "._", "\\u\\u\\uNL\\u\\u\\u_", "#'", "papers", "ize", "':", " ", "'", "letter", "pape", "r", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\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\\uNL\\u\\u\\u_", "#", " ", "Latex", " ", "figure", " ", "(", "float", ")", " ", "alignment_", "\\u\\u\\uNL\\u\\u\\u_", "#'", "figure", "\\u", "align", "':", " ", "'", "ht", "bp", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Group", "ing", " ", "the", " ", "document", " ", "tree", " ", "int", "o", " ", "La", "Te", "X", " ", "files", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "target", " ", "name", ",", " ", "title", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "author", ",", " ", "document", "class", " ", "[", "how", "to", ",", " ", "manu", "al", ",", " ", "or", " ", "own", " ", "class", "])", "._", "\\u\\u\\uNL\\u\\u\\u_", "late", "x", "\\u", "documents_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "master", "\\u", "doc_", ",_", "'", "ces", "ium", ".", "tex", "'_", ",_", "'", "ces", "ium", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "The", " ", "ces", "ium", " ", "Tea", "m", "'_", ",_", "'", "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_", "(_", "master", "\\u", "doc_", ",_", "'", "ces", "ium", "'_", ",_", "'", "ces", "ium", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "author_", "]_", ",_", "1_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "URL", " ", "addresse", "s", " ", "after", " ", "external", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "man", "\\u", "show", "\\u", "urls", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "Tex", "info", " ", "output", " ", "--------------", "--------------", "--------------", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Group", "ing", " ", "the", " ", "document", " ", "tree", " ", "int", "o", " ", "Tex", "info", " ", "files", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "target", " ", "name", ",", " ", "title", ",", " ", "author", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "dir", " ", "menu", " ", "entry", ",", " ", "description", ",", " ", "category", ")_", "\\u\\u\\uNL\\u\\u\\u_", "tex", "info", "\\u", "documents_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "master", "\\u", "doc_", ",_", "'", "ces", "ium", "'_", ",_", "'", "ces", "ium", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "author_", ",_", "'", "ces", "ium", "'_", ",_", "'", "One", " ", "line", " ", "description", " ", "of", " ", "project", ".'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mis", "cell", "ane", "ous", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Document", "s", " ", "to", " ", "append", " ", "as", " ", "an", " ", "appendi", "x", " ", "to", " ", "all", " ", "manu", "als", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "appendi", "ces", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "domain", "\\u", "indice", "s", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ho", "w", " ", "to", " ", "display", " ", "URL", " ", "addresse", "s", ":", " ", "'", "footnote", "',", " ", "'", "no", "',", " ", "or", " ", "'", "inline", "'.", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "show", "\\u", "urls", " ", "=", " ", "'", "footnote", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "do", " ", "not", " ", "generat", "e", " ", "a", " ", "@", "deta", "il", "menu", " ", "in", " ", "the", " ", "\"", "Top", "\"", " ", "node", "'", "s", " ", "menu", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "no", "\\u", "deta", "il", "menu", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Build", " ", "ces", "ium", " ", "API", " ", "documentation", " ", "--------------", "--------------", "------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "name\\u\\u_", ")_", ",_", "'..'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "name\\u\\u_", ")_", ",_", "'", "tool", "s", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "api", "gen_", "import_", "Ap", "i", "Doc", "Writer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "ces", "ium_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "package_", "=_", "'", "ces", "ium", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module_", "=_", "sys_", "._", "modules_", "[_", "package_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "outdir_", "=_", "'", "api", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc", "writer_", "=_", "Ap", "i", "Doc", "Writer_", "(_", "package_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc", "writer_", "._", "write", "\\u", "api", "\\u", "docs_", "(_", "outdir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc", "writer_", "._", "write", "\\u", "index_", "(_", "outdir_", ",_", "'", "api", "'_", ",_", "relative", "\\u", "to_", "=_", "'", "api", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'%", "d", " ", "files", " ", "writt", "en", "'_", "%_", "len_", "(_", "doc", "writer_", "._", "writt", "en", "\\u", "modules_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 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
memex-explorer/memex-explorer/source/memex/rest.py
[ { "content": "import shutil\nimport json\n\nfrom rest_framework import routers, serializers, viewsets, parsers, filters\nfrom rest_framework.views import APIView\nfrom rest_framework.exceptions import APIException\nfrom rest_framework.response import Response\n\nfrom django.core.exceptions import ValidationError\nfrom django.core.files.uploadedfile import SimpleUploadedFile, InMemoryUploadedFile\nfrom django.core.validators import URLValidator\n\nfrom base.models import Project, SeedsList\nfrom apps.crawl_space.models import Crawl, CrawlModel\n\nfrom elasticsearch import Elasticsearch\nfrom elasticsearch.exceptions import ConnectionError, NotFoundError\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\"\"\"\nViewset Classes.\n\nFiltering is provided by django-filter.\n\nBackend settings are in common_settings.py under REST_FRAMEWORK. Setting is:\n 'DEFAULT_FILTER_BACKENDS': ('rest_framework.filters.DjangoFilterBackend',)\n\nThis backend is supplied to every viewset by default. Alter query fields by adding\nor removing items from filter_fields\n\"\"\"\n\n\n\n\n\n\n\n\n\n\nrouter = routers.DefaultRouter()\nrouter.register(r\"projects\", ProjectViewSet)\nrouter.register(r\"crawls\", CrawlViewSet)\nrouter.register(r\"crawl_models\", CrawlModelViewSet)\nrouter.register(r\"seeds_list\", SeedsListViewSet)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class DataWakeIndexUnavailable(APIException):\n status_code = 404\n default_detail = \"The server failed to find the DataWake index in elasticsearch.\"", "metadata": "root.DataWakeIndexUnavailable", "header": "['module', '___EOS___']", "index": 19 }, { "content": "class SlugModelSerializer(serializers.ModelSerializer):\n slug = serializers.SlugField(required=False, read_only=True)", "metadata": "root.SlugModelSerializer", "header": "['module', '___EOS___']", "index": 24 }, { "content": "class ProjectSerializer(SlugModelSerializer):\n url = serializers.CharField(read_only=True)\n\n class Meta:\n model = Project", "metadata": "root.ProjectSerializer", "header": "['module', '___EOS___']", "index": 28 }, { "content": "class CrawlSerializer(SlugModelSerializer):\n # Expose these fields, but only as read only.\n id = serializers.ReadOnlyField()\n seeds_list = serializers.FileField(read_only=True, use_url=False)\n status = serializers.CharField(read_only=True)\n config = serializers.CharField(read_only=True)\n index_name = serializers.CharField(read_only=True)\n url = serializers.CharField(read_only=True)\n pages_crawled = serializers.IntegerField(read_only=True)\n harvest_rate = serializers.FloatField(read_only=True)\n location = serializers.CharField(read_only=True)\n\n\n class Meta:\n model = Crawl", "metadata": "root.CrawlSerializer", "header": "['module', '___EOS___']", "index": 35 }, { "content": " def validate_crawler(self, value):\n if value == \"ache\" and not self.initial_data.get(\"crawl_model\"):\n raise serializers.ValidationError(\"Ache crawls require a Crawl Model.\")\n return value", "metadata": "root.CrawlSerializer.validate_crawler", "header": "['class', 'CrawlSerializer', '(', 'SlugModelSerializer', ')', ':', '___NEWLINE___', '# Expose these fields, but only as read only.', '___NL___', '___EOS___']", "index": 47 }, { "content": "class CrawlModelSerializer(SlugModelSerializer):\n model = serializers.FileField(use_url=False)\n features = serializers.FileField(use_url=False)\n url = serializers.CharField(read_only=True)\n\n\n\n class Meta:\n model = CrawlModel", "metadata": "root.CrawlModelSerializer", "header": "['module', '___EOS___']", "index": 56 }, { "content": " def validate_model(self, value):\n if value.name != \"pageclassifier.model\":\n raise serializers.ValidationError(\"File must be named pageclassifier.model\")\n return value", "metadata": "root.CrawlModelSerializer.validate_model", "header": "['class', 'CrawlModelSerializer', '(', 'SlugModelSerializer', ')', ':', '___EOS___']", "index": 61 }, { "content": " def validate_features(self, value):\n if value.name != \"pageclassifier.features\":\n raise serializers.ValidationError(\"File must be named pageclassifier.features\")\n return value", "metadata": "root.CrawlModelSerializer.validate_features", "header": "['class', 'CrawlModelSerializer', '(', 'SlugModelSerializer', ')', ':', '___EOS___']", "index": 66 }, { "content": "class SeedsListSerializer(SlugModelSerializer):\n url = serializers.CharField(read_only=True)\n file_string = serializers.CharField(read_only=True)\n\n\n class Meta:\n model = SeedsList", "metadata": "root.SeedsListSerializer", "header": "['module', '___EOS___']", "index": 75 }, { "content": " def validate_seeds(self, value):\n try:\n seeds = json.loads(value)\n except ValueError:\n raise serializers.ValidationError(\"Seeds must be a JSON encoded string.\")\n if type(seeds) != list:\n raise serializers.ValidationError(\"Seeds must be an array of URLs.\")\n validator = URLValidator()\n errors = []\n for index, x in enumerate(seeds):\n try:\n validator(x)\n except ValidationError:\n # Add index to make it easier for CodeMirror to select the right\n # line.\n errors.append({index: x})\n if errors:\n errors.insert(0, \"The seeds list contains invalid urls.\")\n errors.append({\"list\": \"\\n\".join(seeds)})\n raise serializers.ValidationError(errors)\n return value", "metadata": "root.SeedsListSerializer.validate_seeds", "header": "['class', 'SeedsListSerializer', '(', 'SlugModelSerializer', ')', ':', '___EOS___']", "index": 79 }, { "content": "class ProjectViewSet(viewsets.ModelViewSet):\n queryset = Project.objects.all()\n serializer_class = ProjectSerializer\n filter_fields = ('id', 'slug', 'name',)", "metadata": "root.ProjectViewSet", "header": "['module', '___EOS___']", "index": 116 }, { "content": "class CrawlViewSet(viewsets.ModelViewSet):\n queryset = Crawl.objects.all()\n serializer_class = CrawlSerializer\n filter_fields = ('id', 'slug', 'name', 'description', 'status', 'project',\n 'crawl_model', 'crawler', 'seeds_object')", "metadata": "root.CrawlViewSet", "header": "['module', '___EOS___']", "index": 122 }, { "content": "class CrawlModelViewSet(viewsets.ModelViewSet):\n queryset = CrawlModel.objects.all()\n serializer_class = CrawlModelSerializer\n filter_fields = ('id', 'slug', 'name', 'project',)\n", "metadata": "root.CrawlModelViewSet", "header": "['module', '___EOS___']", "index": 129 }, { "content": " def destroy(self, request, pk=None):\n model = CrawlModel.objects.get(pk=pk)\n crawls = Crawl.objects.all().filter(crawl_model=pk)\n if crawls:\n message = \"The Crawl Model is being used by the following Crawls and cannot be deleted: \"\n raise serializers.ValidationError({\n \"message\": message,\n \"errors\": [x.name for x in crawls],\n })\n else:\n shutil.rmtree(model.get_model_path())\n return super(CrawlModelViewSet, self).destroy(request)", "metadata": "root.CrawlModelViewSet.destroy", "header": "['class', 'CrawlModelViewSet', '(', 'viewsets', '.', 'ModelViewSet', ')', ':', '___EOS___']", "index": 134 }, { "content": "class SeedsListViewSet(viewsets.ModelViewSet):\n queryset = SeedsList.objects.all()\n serializer_class = SeedsListSerializer\n filter_fields = ('id', 'name', 'seeds', 'slug',)\n\n", "metadata": "root.SeedsListViewSet", "header": "['module', '___EOS___']", "index": 148 }, { "content": " def create(self, request):\n # If a seeds file or a textseeds exists, then use those. Otherwise, look\n # for a string in request.data[\"seeds\"]\n seeds_list = request.FILES.get(\"seeds\", False)\n textseeds = request.data.get(\"textseeds\", False)\n if seeds_list:\n request.data[\"seeds\"] = json.dumps(map(str.strip, seeds_list.readlines()))\n elif textseeds:\n if type(textseeds) == unicode:\n request.data[\"seeds\"] = json.dumps(map(unicode.strip, textseeds.split(\"\\n\")))\n # Get rid of carriage return character.\n elif type(textseeds) == str:\n request.data[\"seeds\"] = json.dumps(map(str.strip, textseeds.split(\"\\n\")))\n return super(SeedsListViewSet, self).create(request)", "metadata": "root.SeedsListViewSet.create", "header": "['class', 'SeedsListViewSet', '(', 'viewsets', '.', 'ModelViewSet', ')', ':', '___EOS___']", "index": 153 }, { "content": " def destroy(self, request, pk=None):\n seeds = SeedsList.objects.get(pk=pk)\n crawls = Crawl.objects.all().filter(seeds_object=pk)\n if crawls:\n message = \"The Seeds List is being used by the following Crawls and cannot be deleted: \"\n raise serializers.ValidationError({\n \"message\": message,\n \"errors\": [x.name for x in crawls],\n })\n else:\n return super(SeedsListViewSet, self).destroy(request)", "metadata": "root.SeedsListViewSet.destroy", "header": "['class', 'SeedsListViewSet', '(', 'viewsets', '.', 'ModelViewSet', ')', ':', '___EOS___']", "index": 168 }, { "content": "class DataWakeView(APIView):\n index = \"datawake\"\n es = Elasticsearch()\n\n", "metadata": "root.DataWakeView", "header": "['module', '___EOS___']", "index": 181 }, { "content": " def create_trails(self, trail_ids):\n trails = []\n for x in trail_ids:\n url_search = self.es.search(index=self.index, q=\"trail_id:%d\" % x,\n fields=\"url\", size=1000)[\"hits\"][\"hits\"]\n new_trail = {\"trail_id\": x, \"urls\": [], \"domain_name\":url_search[0][\"_type\"]}\n for y in url_search:\n new_trail[\"urls\"].append(y[\"fields\"][\"url\"][0])\n new_trail.update({\"urls_string\": \"\\n\".join(new_trail[\"urls\"])})\n trails.append(new_trail)\n return trails", "metadata": "root.DataWakeView.create_trails", "header": "['class', 'DataWakeView', '(', 'APIView', ')', ':', '___EOS___']", "index": 185 }, { "content": " def get(self, request, format=None):\n # TODO: catch all exception. At the very least, deal with 404 not found and\n # connection refused exceptions.\n # Temporarily remove exceptions for debugging.\n try:\n trail_ids = [x[\"key\"] for x in self.es.search(index=self.index, body={\n \"aggs\" : {\n \"trail_id\" : {\n \"terms\" : { \"field\" : \"trail_id\" }\n }\n }\n })[\"aggregations\"][\"trail_id\"][\"buckets\"]]\n response = self.create_trails(trail_ids)\n except ConnectionError as e:\n raise OSError(\"Failed to connect to local elasticsearch instance.\")\n except NotFoundError:\n raise DataWakeIndexUnavailable\n return Response(response)", "metadata": "root.DataWakeView.get", "header": "['class', 'DataWakeView', '(', 'APIView', ')', ':', '___EOS___']", "index": 197 } ]
[ { "span": "from rest_framework import routers, serializers, viewsets, parsers, filters", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 75 }, { "span": "from django.core.files.uploadedfile import SimpleUploadedFile, InMemoryUploadedFile", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 83 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "shutil_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "rest", "\\u", "framework_", "import_", "routers_", ",_", "serializers_", ",_", "viewsets_", ",_", "parsers_", ",_", "filters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "rest", "\\u", "framework_", "._", "views_", "import_", "API", "View_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "rest", "\\u", "framework_", "._", "exceptions_", "import_", "API", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "rest", "\\u", "framework_", "._", "response_", "import_", "Response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "exceptions_", "import_", "Validat", "ion", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "files_", "._", "uploade", "dfile", "_", "import_", "Simple", "Upload", "ed", "File_", ",_", "In", "Memo", "ry", "Upload", "ed", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "validators_", "import_", "URL", "Validator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "base_", "._", "models_", "import_", "Project_", ",_", "See", "ds", "List_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "apps_", "._", "crawl", "\\u", "space_", "._", "models_", "import_", "Crawl", "_", ",_", "Crawl", "Model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "elasticsearch_", "import_", "Elast", "ics", "earch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "elasticsearch_", "._", "exceptions_", "import_", "Connect", "ion", "Error_", ",_", "Not", "Foun", "d", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "\"\"\"", "\\", "10", ";", "View", "set", " ", "Class", "es", ".", "\\", "10", ";", "\\", "10", ";", "Filtering", " ", "is", " ", "provided", " ", "by", " ", "django", "-", "filter", ".", "\\", "10", ";", "\\", "10", ";", "Back", "end", " ", "settings", " ", "are", " ", "in", " ", "common", "\\u", "settings", ".", "py", " ", "under", " ", "REST", "\\u", "FRAME", "WORK", ".", " ", "Sett", "ing", " ", "is", ":", "\\", "10", ";", " ", " ", " ", " ", "'", "DEF", "AUL", "T", "\\u", "FILTER", "\\u", "BACKENDS", "':", " ", "('", "rest", "\\u", "frame", "work", ".", "filter", "s", ".", "Dj", "ang", "o", "Filter", "Back", "end", "',", ")", "\\", "10", ";", "\\", "10", ";", "Thi", "s", " ", "back", "end", " ", "is", " ", "supplie", "d", " ", "to", " ", "every", " ", "views", "et", " ", "by", " ", "default", ".", " ", "Alter", " ", "query", " ", "fields", " ", "by", " ", "addin", "g", "\\", "10", ";", "or", " ", "remo", "ving", " ", "items", " ", "from", " ", "filter", "\\u", "fields", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "router_", "=_", "routers_", "._", "Default", "Router_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "router_", "._", "register_", "(_", "r", "\"", "project", "s", "\"_", ",_", "Project", "View", "Set_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "router_", "._", "register_", "(_", "r", "\"", "crawl", "s", "\"_", ",_", "Crawl", "View", "Set_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "router_", "._", "register_", "(_", "r", "\"", "crawl", "\\u", "model", "s", "\"_", ",_", "Crawl", "Model", "View", "Set_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "router_", "._", "register_", "(_", "r", "\"", "seeds", "\\u", "list", "\"_", ",_", "See", "ds", "List", "View", "Set_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Data", "Wake", "Index", "Una", "vail", "able_", "(_", "API", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "status", "\\u", "code_", "=_", "404_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default", "\\u", "detail_", "=_", "\"", "The", " ", "server", " ", "fail", "ed", " ", "to", " ", "find", " ", "the", " ", "Data", "Wake", " ", "index", " ", "in", " ", "elastic", "search", ".\"_", "\\u\\u\\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_", "Sl", "ug", "Model", "Serializer_", "(_", "serializers_", "._", "Model", "Serializer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "slug_", "=_", "serializers_", "._", "Sl", "ug", "Field_", "(_", "required_", "=_", "False_", ",_", "read", "\\u", "only_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Project", "Serializer_", "(_", "Sl", "ug", "Model", "Serializer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "serializers_", "._", "Char", "Field_", "(_", "read", "\\u", "only_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Project_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Crawl", "Serializer_", "(_", "Sl", "ug", "Model", "Serializer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Expos", "e", " ", "these", " ", "fields", ",", " ", "but", " ", "only", " ", "as", " ", "read", " ", "only", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "id_", "=_", "serializers_", "._", "Read", "On", "ly", "Field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "seeds", "\\u", "list_", "=_", "serializers_", "._", "File", "Field_", "(_", "read", "\\u", "only_", "=_", "True_", ",_", "use", "\\u", "url_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "serializers_", "._", "Char", "Field_", "(_", "read", "\\u", "only_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config_", "=_", "serializers_", "._", "Char", "Field_", "(_", "read", "\\u", "only_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index", "\\u", "name_", "=_", "serializers_", "._", "Char", "Field_", "(_", "read", "\\u", "only_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "serializers_", "._", "Char", "Field_", "(_", "read", "\\u", "only_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "s", "\\u", "crawle", "d_", "=_", "serializers_", "._", "Integer", "Field_", "(_", "read", "\\u", "only_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "harvest", "\\u", "rate_", "=_", "serializers_", "._", "Float", "Field_", "(_", "read", "\\u", "only_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "location_", "=_", "serializers_", "._", "Char", "Field_", "(_", "read", "\\u", "only_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Crawl", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Serializer_", "(_", "Sl", "ug", "Model", "Serializer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Expos", "e", " ", "these", " ", "fields", ",", " ", "but", " ", "only", " ", "as", " ", "read", " ", "only", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "validat", "e\\u", "crawler_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "==_", "\"", "ache", "\"_", "and_", "not_", "self_", "._", "initial", "\\u", "data_", "._", "get_", "(_", "\"", "crawl", "\\u", "model", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "serializers_", "._", "Validat", "ion", "Error_", "(_", "\"", "Ach", "e", " ", "crawl", "s", " ", "require", " ", "a", " ", "Crawl", " ", "Model", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Crawl", "Model", "Serializer_", "(_", "Sl", "ug", "Model", "Serializer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "serializers_", "._", "File", "Field_", "(_", "use", "\\u", "url_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "features_", "=_", "serializers_", "._", "File", "Field_", "(_", "use", "\\u", "url_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "serializers_", "._", "Char", "Field_", "(_", "read", "\\u", "only_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Crawl", "Model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Model", "Serializer_", "(_", "Sl", "ug", "Model", "Serializer_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "validat", "e\\u", "model_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "._", "name_", "!=_", "\"", "page", "classif", "ier", ".", "model", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "serializers_", "._", "Validat", "ion", "Error_", "(_", "\"", "File", " ", "must", " ", "be", " ", "named", " ", "page", "classif", "ier", ".", "model", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Model", "Serializer_", "(_", "Sl", "ug", "Model", "Serializer_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validat", "e\\u", "features_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "._", "name_", "!=_", "\"", "page", "classif", "ier", ".", "features", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "serializers_", "._", "Validat", "ion", "Error_", "(_", "\"", "File", " ", "must", " ", "be", " ", "named", " ", "page", "classif", "ier", ".", "features", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "See", "ds", "List", "Serializer_", "(_", "Sl", "ug", "Model", "Serializer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "serializers_", "._", "Char", "Field_", "(_", "read", "\\u", "only_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "string_", "=_", "serializers_", "._", "Char", "Field_", "(_", "read", "\\u", "only_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "See", "ds", "List_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "See", "ds", "List", "Serializer_", "(_", "Sl", "ug", "Model", "Serializer_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "validat", "e\\u", "seeds_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "seeds_", "=_", "json_", "._", "loads_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "serializers_", "._", "Validat", "ion", "Error_", "(_", "\"", "See", "ds", " ", "must", " ", "be", " ", "a", " ", "JSO", "N", " ", "encode", "d", " ", "string", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "seeds_", ")_", "!=_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "serializers_", "._", "Validat", "ion", "Error_", "(_", "\"", "See", "ds", " ", "must", " ", "be", " ", "an", " ", "array", " ", "of", " ", "URL", "s", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "validator_", "=_", "URL", "Validator_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "errors_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "index_", ",_", "x_", "in_", "enumerate_", "(_", "seeds_", ")_", ":_", "\\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 ", " _", "validator_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Validat", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", " ", "index", " ", "to", " ", "make", " ", "it", " ", "easi", "er", " ", "for", " ", "Code", "Mirror", " ", "to", " ", "select", " ", "the", " ", "right_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "line", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "errors_", "._", "append_", "(_", "{_", "index_", ":_", "x_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "errors_", "._", "insert_", "(_", "0_", ",_", "\"", "The", " ", "seeds", " ", "list", " ", "contain", "s", " ", "invalid", " ", "urls", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "errors_", "._", "append_", "(_", "{_", "\"", "list", "\"_", ":_", "\"\\\\", "n", "\"_", "._", "join_", "(_", "seeds_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "serializers_", "._", "Validat", "ion", "Error_", "(_", "errors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Project", "View", "Set_", "(_", "viewsets_", "._", "Model", "View", "Set_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "queryset_", "=_", "Project_", "._", "objects_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "serialize", "r", "\\u", "class_", "=_", "Project", "Serializer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filter", "\\u", "fields_", "=_", "(_", "'", "id", "'_", ",_", "'", "slug", "'_", ",_", "'", "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_", "class_", "Crawl", "View", "Set_", "(_", "viewsets_", "._", "Model", "View", "Set_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "queryset_", "=_", "Crawl", "_", "._", "objects_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "serialize", "r", "\\u", "class_", "=_", "Crawl", "Serializer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filter", "\\u", "fields_", "=_", "(_", "'", "id", "'_", ",_", "'", "slug", "'_", ",_", "'", "name", "'_", ",_", "'", "description", "'_", ",_", "'", "status", "'_", ",_", "'", "project", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "crawl", "\\u", "model", "'_", ",_", "'", "crawle", "r", "'_", ",_", "'", "seeds", "\\u", "object", "'_", ")_", "\\u\\u\\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_", "Crawl", "Model", "View", "Set_", "(_", "viewsets_", "._", "Model", "View", "Set_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "queryset_", "=_", "Crawl", "Model_", "._", "objects_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "serialize", "r", "\\u", "class_", "=_", "Crawl", "Model", "Serializer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filter", "\\u", "fields_", "=_", "(_", "'", "id", "'_", ",_", "'", "slug", "'_", ",_", "'", "name", "'_", ",_", "'", "project", "'_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Model", "View", "Set_", "(_", "viewsets_", "._", "Model", "View", "Set_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "destroy_", "(_", "self_", ",_", "request_", ",_", "pk_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Crawl", "Model_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "pk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "crawl", "s_", "=_", "Crawl", "_", "._", "objects_", "._", "all_", "(_", ")_", "._", "filter_", "(_", "crawl", "\\u", "model_", "=_", "pk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "crawl", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "message_", "=_", "\"", "The", " ", "Crawl", " ", "Model", " ", "is", " ", "bei", "ng", " ", "used", " ", "by", " ", "the", " ", "follow", "ing", " ", "Crawl", "s", " ", "and", " ", "cann", "ot", " ", "be", " ", "delete", "d", ":", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "serializers_", "._", "Validat", "ion", "Error_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "message", "\"_", ":_", "message_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "error", "s", "\"_", ":_", "[_", "x_", "._", "name_", "for_", "x_", "in_", "crawl", "s_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "shutil_", "._", "rmtree_", "(_", "model_", "._", "get", "\\u", "model", "\\u", "path_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Crawl", "Model", "View", "Set_", ",_", "self_", ")_", "._", "destroy_", "(_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "See", "ds", "List", "View", "Set_", "(_", "viewsets_", "._", "Model", "View", "Set_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "queryset_", "=_", "See", "ds", "List_", "._", "objects_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "serialize", "r", "\\u", "class_", "=_", "See", "ds", "List", "Serializer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filter", "\\u", "fields_", "=_", "(_", "'", "id", "'_", ",_", "'", "name", "'_", ",_", "'", "seeds", "'_", ",_", "'", "slug", "'_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "See", "ds", "List", "View", "Set_", "(_", "viewsets_", "._", "Model", "View", "Set_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "create_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "seeds", " ", "file", " ", "or", " ", "a", " ", "texts", "eed", "s", " ", "exist", "s", ",", " ", "then", " ", "use", " ", "tho", "se", ".", " ", "Ot", "her", "wis", "e", ",", " ", "look", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "a", " ", "string", " ", "in", " ", "request", ".", "data", "[\"", "seeds", "\"]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "seeds", "\\u", "list_", "=_", "request_", "._", "FILES_", "._", "get_", "(_", "\"", "seeds", "\"_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "texts", "eed", "s_", "=_", "request_", "._", "data_", "._", "get_", "(_", "\"", "texts", "eed", "s", "\"_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "seeds", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "._", "data_", "[_", "\"", "seeds", "\"_", "]_", "=_", "json_", "._", "dumps_", "(_", "map_", "(_", "str_", "._", "strip_", ",_", "seeds", "\\u", "list_", "._", "readlines_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "texts", "eed", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "texts", "eed", "s_", ")_", "==_", "unicode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "._", "data_", "[_", "\"", "seeds", "\"_", "]_", "=_", "json_", "._", "dumps_", "(_", "map_", "(_", "unicode_", "._", "strip_", ",_", "texts", "eed", "s_", "._", "split_", "(_", "\"\\\\", "n", "\"_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Get", " ", "rid", " ", "of", " ", "carri", "age", " ", "return", " ", "character", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "(_", "texts", "eed", "s_", ")_", "==_", "str_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "._", "data_", "[_", "\"", "seeds", "\"_", "]_", "=_", "json_", "._", "dumps_", "(_", "map_", "(_", "str_", "._", "strip_", ",_", "texts", "eed", "s_", "._", "split_", "(_", "\"\\\\", "n", "\"_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "super_", "(_", "See", "ds", "List", "View", "Set_", ",_", "self_", ")_", "._", "create_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "See", "ds", "List", "View", "Set_", "(_", "viewsets_", "._", "Model", "View", "Set_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "destroy_", "(_", "self_", ",_", "request_", ",_", "pk_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "seeds_", "=_", "See", "ds", "List_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "pk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "crawl", "s_", "=_", "Crawl", "_", "._", "objects_", "._", "all_", "(_", ")_", "._", "filter_", "(_", "seeds", "\\u", "object_", "=_", "pk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "crawl", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "message_", "=_", "\"", "The", " ", "See", "ds", " ", "List", " ", "is", " ", "bei", "ng", " ", "used", " ", "by", " ", "the", " ", "follow", "ing", " ", "Crawl", "s", " ", "and", " ", "cann", "ot", " ", "be", " ", "delete", "d", ":", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "serializers_", "._", "Validat", "ion", "Error_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "message", "\"_", ":_", "message_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "error", "s", "\"_", ":_", "[_", "x_", "._", "name_", "for_", "x_", "in_", "crawl", "s_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "super_", "(_", "See", "ds", "List", "View", "Set_", ",_", "self_", ")_", "._", "destroy_", "(_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Data", "Wake", "View_", "(_", "API", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "index_", "=_", "\"", "data", "wake", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "es_", "=_", "Elast", "ics", "earch_", "(_", ")_", "\\u\\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_", "Data", "Wake", "View_", "(_", "API", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "create", "\\u", "trail", "s_", "(_", "self_", ",_", "trail", "\\u", "ids_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "trail", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "trail", "\\u", "ids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url", "\\u", "search_", "=_", "self_", "._", "es_", "._", "search_", "(_", "index_", "=_", "self_", "._", "index_", ",_", "q_", "=_", "\"", "trail", "\\u", "id", ":", "%", "d", "\"_", "%_", "x_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fields_", "=_", "\"", "url", "\"_", ",_", "size_", "=_", "1000_", ")_", "[_", "\"", "hits", "\"_", "]_", "[_", "\"", "hits", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "trail_", "=_", "{_", "\"", "trail", "\\u", "id", "\"_", ":_", "x_", ",_", "\"", "urls", "\"_", ":_", "[_", "]_", ",_", "\"", "domain", "\\u", "name", "\"_", ":_", "url", "\\u", "search_", "[_", "0_", "]_", "[_", "\"\\u", "type", "\"_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "y_", "in_", "url", "\\u", "search_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "trail_", "[_", "\"", "urls", "\"_", "]_", "._", "append_", "(_", "y_", "[_", "\"", "fields", "\"_", "]_", "[_", "\"", "url", "\"_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "\\u", "trail_", "._", "update_", "(_", "{_", "\"", "urls", "\\u", "string", "\"_", ":_", "\"\\\\", "n", "\"_", "._", "join_", "(_", "new", "\\u", "trail_", "[_", "\"", "urls", "\"_", "]_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trail", "s_", "._", "append_", "(_", "new", "\\u", "trail_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "trail", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Data", "Wake", "View_", "(_", "API", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get_", "(_", "self_", ",_", "request_", ",_", "format_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "catch", " ", "all", " ", "exception", ".", " ", "At", " ", "the", " ", "very", " ", "leas", "t", ",", " ", "deal", " ", "with", " ", "404", " ", "not", " ", "found", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "connecti", "on", " ", "refuse", "d", " ", "exception", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tempora", "ri", "ly", " ", "remove", " ", "exception", "s", " ", "for", " ", "debugg", "ing", "._", "\\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 ", " _", "trail", "\\u", "ids_", "=_", "[_", "x_", "[_", "\"", "key", "\"_", "]_", "for_", "x_", "in_", "self_", "._", "es_", "._", "search_", "(_", "index_", "=_", "self_", "._", "index_", ",_", "body_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "aggs", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "trail", "\\u", "id", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "term", "s", "\"_", ":_", "{_", "\"", "field", "\"_", ":_", "\"", "trail", "\\u", "id", "\"_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "[_", "\"", "aggregation", "s", "\"_", "]_", "[_", "\"", "trail", "\\u", "id", "\"_", "]_", "[_", "\"", "bucket", "s", "\"_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "create", "\\u", "trail", "s_", "(_", "trail", "\\u", "ids_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Connect", "ion", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "OSE", "rror_", "(_", "\"", "Fail", "ed", " ", "to", " ", "connect", " ", "to", " ", "local", " ", "elastic", "search", " ", "instance", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
First parameter of a method is not named 'self'
ClusterHQ/flocker/flocker/control/_model.py
[ { "content": " def __invariant__(dataset_id, lease):\n \"\"\"\n The UUID of the dataset (key) must match the dataset UUID of\n the Lease instance (value).\n \"\"\"\n if dataset_id != lease.dataset_id:\n return (False, \"dataset_id {} does not match lease {}\".format(\n dataset_id, lease.dataset_id\n ))\n return (True, \"\")", "metadata": "root.Leases.__invariant__", "header": "['class', 'Leases', '(', 'CheckedPMap', ')', ':', '___EOS___']", "index": 542 } ]
[ { "span": "def __invariant__(dataset_id, lease):", "start_line": 542, "start_column": 4, "end_line": 542, "end_column": 41 } ]
[]
1
true
[ "[CLS]_", "First_", "parameter_", "of_", "a_", "method_", "is_", "not_", "named_", "'", "self", "'_", "[SEP]_", "class_", "Leas", "es_", "(_", "Check", "ed", "PM", "ap_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "invariant", "\\u\\u_", "(_", "dataset", "\\u", "id_", ",_", "lease_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "UU", "ID", " ", "of", " ", "the", " ", "dataset", " ", "(", "key", ")", " ", "must", " ", "match", " ", "the", " ", "dataset", " ", "UU", "ID", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "Leas", "e", " ", "instance", " ", "(", "value", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "dataset", "\\u", "id_", "!=_", "lease_", "._", "dataset", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "False_", ",_", "\"", "dataset", "\\u", "id", " ", "{}", " ", "doe", "s", " ", "not", " ", "match", " ", "lease", " ", "{}\"_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "dataset", "\\u", "id_", ",_", "lease_", "._", "dataset", "\\u", "id_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "True_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
ofri/Open-Knesset/persons/migrations/0010_auto__add_field_person_user.py
[ { "content": "# -*- coding: utf-8 -*-\nfrom south.utils import datetime_utils as 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 u'auth.group': {\n 'Meta': {'object_name': 'Group'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),\n 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u\"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'})\n },\n u'auth.permission': {\n 'Meta': {'ordering': \"(u'content_type__app_label', u'content_type__model', u'codename')\", 'unique_together': \"((u'content_type', u'codename'),)\", 'object_name': 'Permission'},\n 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['contenttypes.ContentType']\"}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})\n },\n u'auth.user': {\n 'Meta': {'object_name': 'User'},\n 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),\n 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': \"u'user_set'\", 'blank': 'True', 'to': u\"orm['auth.Group']\"}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),\n 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': \"u'user_set'\", 'blank': 'True', 'to': u\"orm['auth.Permission']\"}),\n 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})\n },\n u'contenttypes.contenttype': {\n 'Meta': {'ordering': \"('name',)\", 'unique_together': \"(('app_label', 'model'),)\", 'object_name': 'ContentType', 'db_table': \"'django_content_type'\"},\n 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})\n },\n u'mks.knesset': {\n 'Meta': {'object_name': 'Knesset'},\n 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'number': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}),\n 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'})\n },\n u'mks.member': {\n 'Meta': {'ordering': \"['name']\", 'object_name': 'Member'},\n 'area_of_residence': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'average_monthly_committee_presence': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),\n 'average_weekly_presence_hours': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),\n 'backlinks_enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'bills_stats_approved': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'bills_stats_first': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'bills_stats_pre': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'bills_stats_proposed': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'blog': ('django.db.models.fields.related.OneToOneField', [], {'to': u\"orm['planet.Blog']\", 'unique': 'True', 'null': 'True', 'blank': 'True'}),\n 'current_party': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'members'\", 'null': 'True', 'to': u\"orm['mks.Party']\"}),\n 'current_position': ('django.db.models.fields.PositiveIntegerField', [], {'default': '999', 'blank': 'True'}),\n 'current_role_descriptions': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}),\n 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'date_of_death': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),\n 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'family_status': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),\n 'fax': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),\n 'gender': ('django.db.models.fields.CharField', [], {'max_length': '1', 'null': 'True', 'blank': 'True'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'img_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),\n 'is_current': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}),\n 'number_of_children': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'parties': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': \"'all_members'\", 'symmetrical': 'False', 'through': u\"orm['mks.Membership']\", 'to': u\"orm['mks.Party']\"}),\n 'phone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),\n 'place_of_birth': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'place_of_residence': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'place_of_residence_lat': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}),\n 'place_of_residence_lon': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}),\n 'residence_centrality': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'residence_economy': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['auth.User']\", 'null': 'True', 'blank': 'True'}),\n 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),\n 'year_of_aliyah': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})\n },\n u'mks.membership': {\n 'Meta': {'object_name': 'Membership'},\n 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'member': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['mks.Member']\"}),\n 'party': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['mks.Party']\"}),\n 'position': ('django.db.models.fields.PositiveIntegerField', [], {'default': '999', 'blank': 'True'}),\n 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'})\n },\n u'mks.party': {\n 'Meta': {'ordering': \"('-number_of_seats',)\", 'unique_together': \"(('knesset', 'name'),)\", 'object_name': 'Party'},\n 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'is_coalition': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'knesset': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'parties'\", 'null': 'True', 'to': u\"orm['mks.Knesset']\"}),\n 'logo': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}),\n 'number_of_members': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'number_of_seats': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'split_from': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['mks.Party']\", 'null': 'True', 'blank': 'True'}),\n 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'})\n },\n u'persons.person': {\n 'Meta': {'ordering': \"('name',)\", 'object_name': 'Person'},\n 'area_of_residence': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'calendar_sync_token': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}),\n 'calendar_url': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}),\n 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'date_of_death': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),\n 'family_status': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),\n 'fax': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),\n 'gender': ('django.db.models.fields.CharField', [], {'max_length': '1', 'null': 'True', 'blank': 'True'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'img_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),\n 'mk': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'person'\", 'null': 'True', 'to': u\"orm['mks.Member']\"}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}),\n 'number_of_children': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'phone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),\n 'place_of_birth': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'place_of_residence': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'place_of_residence_lat': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}),\n 'place_of_residence_lon': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}),\n 'residence_centrality': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'residence_economy': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'titles': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': \"'persons'\", 'null': 'True', 'symmetrical': 'False', 'to': u\"orm['persons.Title']\"}),\n 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['auth.User']\", 'null': 'True', 'blank': 'True'}),\n 'year_of_aliyah': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})\n },\n u'persons.personalias': {\n 'Meta': {'object_name': 'PersonAlias'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}),\n 'person': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'aliases'\", 'to': u\"orm['persons.Person']\"})\n },\n u'persons.processedprotocolpart': {\n 'Meta': {'object_name': 'ProcessedProtocolPart'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'protocol_part_id': ('django.db.models.fields.IntegerField', [], {})\n },\n u'persons.role': {\n 'Meta': {'object_name': 'Role'},\n 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'org': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'person': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'roles'\", 'to': u\"orm['persons.Person']\"}),\n 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True'}),\n 'text': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'})\n },\n u'persons.title': {\n 'Meta': {'object_name': 'Title'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'})\n },\n u'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 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'title': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),\n 'url': ('django.db.models.fields.URLField', [], {'unique': 'True', 'max_length': '1024', 'db_index': 'True'})\n }\n }\n\n complete_apps = ['persons']", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 7 }, { "content": " def forwards(self, orm):\n # Adding field 'Person.user'\n db.add_column(u'persons_person', 'user',\n self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, blank=True),\n keep_default=False)", "metadata": "root.Migration.forwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 9 }, { "content": " def backwards(self, orm):\n # Deleting field 'Person.user'\n db.delete_column(u'persons_person', 'user_id')", "metadata": "root.Migration.backwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 16 } ]
[ { "span": "from south.utils import datetime_utils as datetime", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 50 }, { "span": "from django.db import models", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 28 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "south_", "._", "utils_", "import_", "datetime", "\\u", "utils_", "as_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "db_", "import_", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "v2_", "import_", "Schema", "Migration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "models_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "auth", ".", "group", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Group", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "80", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "auth", ".", "permissi", "on", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "u", "'", "content", "\\u", "type\\u\\u", "app", "\\u", "label", "',", " ", "u", "'", "content", "\\u", "type\\u\\u", "model", "',", " ", "u", "'", "code", "name", "')\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "(", "u", "'", "content", "\\u", "type", "',", " ", "u", "'", "code", "name", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Permi", "ssion", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "code", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\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", "'", "auth", ".", "user", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "User", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "joine", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Ema", "il", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "7", "5", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "first", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"", "u", "'", "user", "\\u", "set", "'\"_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "auth", ".", "Group", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "active", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "sta", "ff", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "super", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "login", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "128", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"", "u", "'", "user", "\\u", "set", "'\"_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "contenttype", "s", ".", "contenttype", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "name", "',)\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "app", "\\u", "label", "',", " ", "'", "model", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Conten", "t", "Type", "'_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "django", "\\u", "content", "\\u", "type", "'\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "app", "\\u", "label", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "model", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "mks", ".", "kne", "sset", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Kn", "esse", "t", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "end", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "number", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "mks", ".", "member", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'", "name", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Mem", "ber", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "area", "\\u", "of", "\\u", "reside", "nce", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "averag", "e\\u", "month", "ly", "\\u", "committee", "\\u", "presen", "ce", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "averag", "e\\u", "week", "ly", "\\u", "presen", "ce", "\\u", "hour", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "backli", "nks", "\\u", "enable", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bill", "s", "\\u", "stats", "\\u", "approved", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bill", "s", "\\u", "stats", "\\u", "first", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bill", "s", "\\u", "stats", "\\u", "pre", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bill", "s", "\\u", "stats", "\\u", "proposed", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "blog", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "planet", ".", "Blog", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "current", "\\u", "part", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "member", "s", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "mks", ".", "Part", "y", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "current", "\\u", "position", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "999", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "current", "\\u", "role", "\\u", "description", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1024", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "of", "\\u", "birth", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "of", "\\u", "death", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Ema", "il", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "7", "5", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "end", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "famil", "y", "\\u", "status", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "10", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fax", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "20", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gender", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "img", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "current", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "64", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "number", "\\u", "of", "\\u", "child", "ren", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "parties", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "all", "\\u", "member", "s", "'\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "through", "'_", ":_", "u", "\"", "orm", "['", "mks", ".", "Membership", "']\"_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "mks", ".", "Part", "y", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "phone", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "20", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "\\u", "of", "\\u", "birth", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "\\u", "of", "\\u", "reside", "nce", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "\\u", "of", "\\u", "reside", "nce", "\\u", "lat", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "16", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "\\u", "of", "\\u", "reside", "nce", "\\u", "lon", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "16", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reside", "nce", "\\u", "centrali", "ty", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reside", "nce", "\\u", "econom", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "auth", ".", "User", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "webs", "ite", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "year", "\\u", "of", "\\u", "ali", "ya", "h", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "mks", ".", "member", "ship", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Membership", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "end", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "mks", ".", "Mem", "ber", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "part", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "mks", ".", "Part", "y", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "position", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "999", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "mks", ".", "part", "y", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'-", "number", "\\u", "of", "\\u", "seats", "',)\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "kne", "sset", "',", " ", "'", "name", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Part", "y", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "end", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "coal", "ition", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "kne", "sset", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "parties", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "mks", ".", "Kn", "esse", "t", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "logo", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "files", ".", "Image", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "64", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "number", "\\u", "of", "\\u", "member", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "number", "\\u", "of", "\\u", "seats", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "split", "\\u", "from", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "mks", ".", "Part", "y", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "person", "s", ".", "person", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "name", "',)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Person", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "area", "\\u", "of", "\\u", "reside", "nce", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "calendar", "\\u", "sync", "\\u", "token", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1024", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "calendar", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1024", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "of", "\\u", "birth", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "of", "\\u", "death", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Ema", "il", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "7", "5", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "famil", "y", "\\u", "status", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "10", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fax", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "20", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gender", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "img", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mk", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "person", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "mks", ".", "Mem", "ber", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "64", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "number", "\\u", "of", "\\u", "child", "ren", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "phone", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "20", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "\\u", "of", "\\u", "birth", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "\\u", "of", "\\u", "reside", "nce", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "\\u", "of", "\\u", "reside", "nce", "\\u", "lat", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "16", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "\\u", "of", "\\u", "reside", "nce", "\\u", "lon", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "16", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reside", "nce", "\\u", "centrali", "ty", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reside", "nce", "\\u", "econom", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "titles", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "person", "s", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "person", "s", ".", "Tit", "le", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "auth", ".", "User", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "year", "\\u", "of", "\\u", "ali", "ya", "h", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "person", "s", ".", "personali", "as", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Person", "Ali", "as", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "64", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "person", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "alias", "es", "'\"_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "person", "s", ".", "Person", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "person", "s", ".", "process", "edp", "roto", "col", "part", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Processe", "d", "Proto", "col", "Part", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "protoc", "ol", "\\u", "part", "\\u", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "person", "s", ".", "role", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Ro", "le", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "end", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "org", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "person", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "role", "s", "'\"_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "person", "s", ".", "Person", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "text", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1024", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "person", "s", ".", "title", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Tit", "le", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "64", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "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_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "1024", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "complete", "\\u", "apps_", "=_", "[_", "'", "person", "s", "'_", "]_", "[SEP]_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "forwards_", "(_", "self_", ",_", "orm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", "ing", " ", "field", " ", "'", "Person", ".", "user", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "add", "\\u", "column_", "(_", "u", "'", "person", "s", "\\u", "person", "'_", ",_", "'", "user", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "to_", "=_", "orm_", "[_", "'", "auth", ".", "User", "'_", "]_", ",_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "keep", "\\u", "default_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "backwards_", "(_", "self_", ",_", "orm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "field", " ", "'", "Person", ".", "user", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "delete", "\\u", "column_", "(_", "u", "'", "person", "s", "\\u", "person", "'_", ",_", "'", "user", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 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,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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 ]
First parameter of a method is not named 'self'
sahana/eden/tests/unit_tests/modules/test_utils/find_JSON_format_data_structure.py
[ { "content": " def test_bad_javascript(test):\n test_utils.find_JSON_format_data_structure(\n string = \"x = ksdkjnsdf;ajndflkj\",\n name = \"x\",\n found = fail(\"shouldn't be found\"),\n not_found = fail(\"should bork\"),\n cannot_parse_JSON = ok\n )", "metadata": "root.Test_find_JSON_format_data_structure.test_bad_javascript", "header": "['class', 'Test_find_JSON_format_data_structure', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 16 }, { "content": " def test_missing_data_structure(test):\n test_utils.find_JSON_format_data_structure(\n string = \"ksdkjnsdf;ajndflkj\",\n name = \"x\",\n found = fail(\"shouldn't be found\"),\n not_found = ok,\n cannot_parse_JSON = fail(\"shoudn't bork\")\n )", "metadata": "root.Test_find_JSON_format_data_structure.test_missing_data_structure", "header": "['class', 'Test_find_JSON_format_data_structure', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 25 }, { "content": " def test_found_data_structure(test):\n test_utils.find_JSON_format_data_structure(\n string = \"ksdkjnsdf;ajndflkj; x = {\\\"a\\\": 1}\\n ksjndfkjsd\",\n name = \"x\",\n found = ok,\n not_found = fail(\"should be found\"),\n cannot_parse_JSON = fail(\"shoudn't bork\")\n )", "metadata": "root.Test_find_JSON_format_data_structure.test_found_data_structure", "header": "['class', 'Test_find_JSON_format_data_structure', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 34 }, { "content": " def test_complex_name_data_structure(test):\n test_utils.find_JSON_format_data_structure(\n string = \"ksdkjnsdf;ajndflkj; x.y.z = {\\\"a\\\": 1}\\n sdkfjnk\",\n name = \"x.y.z\",\n found = ok,\n not_found = fail(\"should be found\"),\n cannot_parse_JSON = fail(\"shoudn't bork\")\n )", "metadata": "root.Test_find_JSON_format_data_structure.test_complex_name_data_structure", "header": "['class', 'Test_find_JSON_format_data_structure', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 43 } ]
[ { "span": "def test_bad_javascript(test):", "start_line": 16, "start_column": 4, "end_line": 16, "end_column": 34 }, { "span": "def test_missing_data_structure(test):", "start_line": 25, "start_column": 4, "end_line": 25, "end_column": 42 }, { "span": "def test_found_data_structure(test):", "start_line": 34, "start_column": 4, "end_line": 34, "end_column": 40 }, { "span": "def test_complex_name_data_structure(test):", "start_line": 43, "start_column": 4, "end_line": 43, "end_column": 47 } ]
[]
1
true
[ "[CLS]_", "First_", "parameter_", "of_", "a_", "method_", "is_", "not_", "named_", "'", "self", "'_", "[SEP]_", "class_", "Test", "\\u", "find", "\\u", "JSO", "N", "\\u", "format\\u", "data\\u", "structure_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "bad", "\\u", "javascript", "_", "(_", "test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "utils_", "._", "find", "\\u", "JSO", "N", "\\u", "format\\u", "data\\u", "structure_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "string_", "=_", "\"", "x", " ", "=", " ", "ks", "dk", "jn", "sdf", ";", "aj", "nd", "fl", "kj", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "\"", "x", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "found_", "=_", "fail_", "(_", "\"", "shou", "ld", "n", "'", "t", " ", "be", " ", "found", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "not", "\\u", "found_", "=_", "fail_", "(_", "\"", "shou", "ld", " ", "bor", "k", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cann", "ot", "\\u", "parse", "\\u", "JSON_", "=_", "ok_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "find", "\\u", "JSO", "N", "\\u", "format\\u", "data\\u", "structure_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "missi", "ng", "\\u", "data\\u", "structure_", "(_", "test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "utils_", "._", "find", "\\u", "JSO", "N", "\\u", "format\\u", "data\\u", "structure_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "string_", "=_", "\"", "ks", "dk", "jn", "sdf", ";", "aj", "nd", "fl", "kj", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "\"", "x", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "found_", "=_", "fail_", "(_", "\"", "shou", "ld", "n", "'", "t", " ", "be", " ", "found", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "not", "\\u", "found_", "=_", "ok_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cann", "ot", "\\u", "parse", "\\u", "JSON_", "=_", "fail_", "(_", "\"", "shou", "dn", "'", "t", " ", "bor", "k", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "find", "\\u", "JSO", "N", "\\u", "format\\u", "data\\u", "structure_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "found", "\\u", "data\\u", "structure_", "(_", "test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "utils_", "._", "find", "\\u", "JSO", "N", "\\u", "format\\u", "data\\u", "structure_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "string_", "=_", "\"", "ks", "dk", "jn", "sdf", ";", "aj", "nd", "fl", "kj", ";", " ", "x", " ", "=", " ", "{\\\\", "\"", "a", "\\\\\":", " ", "1", "}\\\\", "n", " ", "ks", "jn", "df", "kj", "sd", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "\"", "x", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "found_", "=_", "ok_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "not", "\\u", "found_", "=_", "fail_", "(_", "\"", "shou", "ld", " ", "be", " ", "found", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cann", "ot", "\\u", "parse", "\\u", "JSON_", "=_", "fail_", "(_", "\"", "shou", "dn", "'", "t", " ", "bor", "k", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "find", "\\u", "JSO", "N", "\\u", "format\\u", "data\\u", "structure_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "complex", "\\u", "name", "\\u", "data\\u", "structure_", "(_", "test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "utils_", "._", "find", "\\u", "JSO", "N", "\\u", "format\\u", "data\\u", "structure_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "string_", "=_", "\"", "ks", "dk", "jn", "sdf", ";", "aj", "nd", "fl", "kj", ";", " ", "x", ".", "y", ".", "z", " ", "=", " ", "{\\\\", "\"", "a", "\\\\\":", " ", "1", "}\\\\", "n", " ", "sd", "kf", "jn", "k", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "\"", "x", ".", "y", ".", "z", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "found_", "=_", "ok_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "not", "\\u", "found_", "=_", "fail_", "(_", "\"", "shou", "ld", " ", "be", " ", "found", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cann", "ot", "\\u", "parse", "\\u", "JSON_", "=_", "fail_", "(_", "\"", "shou", "dn", "'", "t", " ", "bor", "k", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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rong number of arguments in a call
murphy214/berrl/berrl/piperealtime.py
[ { "content": "def make_rows2(headers):\n\n\n\tvarblock=[]\n\t# makes a list of rows from a given input header\n\tfor row in headers:\n\n\t\tmaxchared=15\n\n\t\trow1=row\n\t\trow2=row\n\t\tif row==headers[0]:\n\t\t\tnewrow=\"\"\" var popupText = \"<table><tr><th>%s: </th><td>\" + feature.properties['%s']+\"</td></tr>\"; \"\"\" % (row1,row2)\n\t\telse:\n\t\t\tnewrow=\"\"\" var popupText = popupText+ \"<tr><th>%s: </th><td>\" + feature.properties['%s']+\"</td></tr>\"; \"\"\" % (row1,row2)\n\t\tvarblock.append(newrow)\n\t\tif row==headers[-1]:\n\t\t\tnewrow=\"\"\" var popupText = popupText+ \"<tr><th>%s: </th><td>\" + feature.properties['%s']+</td></tr></table>\"; \"\"\" % (row1,row2)\n\treturn varblock\t", "metadata": "root.make_rows2", "header": "['module', '___EOS___']", "index": 16 }, { "content": "def making_blockstr2(varblock):\n\tstart=\"\"\"\tfunction addDataToMap(data, map) {\n \tvar dataLayer = L.geoJson(data, {\n \tonEachFeature: function(feature, layer) {\"\"\"\n\n\tend=\"\"\"\n\t \tlayer.bindPopup(popupText, {autoPan:false, maxHeight:500, maxWidth:350} ); }\n \t});\n \tdataLayer.addTo(map);\\n}\"\"\"\n \ttotal=''\n \tfor row in varblock:\n \t\ttotal+=row\n \treturn start+total+end", "metadata": "root.making_blockstr2", "header": "['module', '___EOS___']", "index": 107 }, { "content": "def make_bindings(headers):\n\tvarblock=make_rows2(headers)\n\tblock=making_blockstr2(varblock)\t\n\treturn block", "metadata": "root.make_bindings", "header": "['module', '___EOS___']", "index": 122 }, { "content": "def making_blockstr2(varblock,count,colorline,element,time):\n\tstart=\"\"\"function addDataToMap%s(data, map) {\n var dataLayer = L.geoJson(data, {\n onEachFeature: function(feature, layer) {\"\"\" % count\n\n\tend=\"\"\"\n\t layer.bindPopup(popupText, {autoPan:false, maxHeight:500, maxWidth:350} ); }\n });\n \tdataLayer.addTo(map);\\n\\t\\tsetTimeout(function() {\\n\\t\\t\\t\\tdataLayer.clearLayers();\\n\\t\\t},%s);\\n\\t}\\n}\\nsetInterval(add%s,%s)\"\"\" % (time,count,time)\n \ttotal=''\n \tfor row in varblock:\n \t\ttotal+=row\n \tif element=='Point':\n \t\treturn start+total+colorline+end\n \telse:\n \t\treturn start+total+'\\n'+colorline+end", "metadata": "root.making_blockstr2", "header": "['module', '___EOS___']", "index": 128 }, { "content": "def make_bindings2(headers,count,colorline,element,time):\n\tvarblock=make_rows2(headers)\n\tblock=making_blockstr2(varblock,count,colorline,element,time)\t\n\treturn block", "metadata": "root.make_bindings2", "header": "['module', '___EOS___']", "index": 146 }, { "content": "def load(lines,filename):\n\n\twith open(filename,'w') as f:\n\t\tf.writelines(lines)\n\n\tf.close()\t\n\tos.system('open -a Safari '+filename)", "metadata": "root.load", "header": "['module', '___EOS___']", "index": 223 }, { "content": "def make_bindings_type2(filenames,color_input,colorkey):\n\tstring=''\n\tblocky=\"\"\"\\nfunction addDataToMap(data, map) {\n var dataLayer = L.geoJson(data);\n dataLayer.addTo(map);\n}\\n\"\"\"\n\tcount=0\n\tfor row in filenames:\n\t\tcount+=1\n\t\tfilename=row\n\t\twith open(row) as data_file: \n \t\t\tdata = json.load(data_file)\n \t\t#pprint(data)\n \t\tdata=data['features']\n \t\tdata=data[0]\n \t\tfeaturetype=data['geometry']\n \t\tfeaturetype=featuretype['type']\n\t\tdata=data['properties']\n\n \t\t\n \t\t#if a point and no entry for color_input\n \t\tif featuretype=='Point' and colorkey=='':\n \t\t\tcolorline=get_colorline_marker(color_input)\n \t\telif not colorkey=='' and featuretype=='Point':\n \t\t\tcolorline=get_colorline_marker(data[str(colorkey)])\n \t\telif not colorkey=='':\n \t\t\tcolorline=get_colorline_marker2(data[str(colorkey)])\n \t\telif colorkey=='':\n \t\t\tcolorline=get_colorline_marker2(str(color_input))\n\n \t\t\n \t\theaders=[]\n \t\tfor row in data:\n \t\t\theaders.append(str(row))\n \t\tblocky=\tblocky=\"\"\"\\nfunction addDataToMap%s(data, map) {\n var dataLayer = L.geoJson(data);\n dataLayer.addTo(map);\n}\\n\"\"\" % count\n\t\tstart='function add() {'\n\t\tloc=\"\"\"\\n$.getJSON('http://localhost:8000/%s',function(data) { addDataToMap%s(data,map); });\"\"\" % (filename,count)\n\t\tif featuretype=='Point':\n\t\t\tstring+=blocky+loc+make_bindings2(headers,count,colorline,featuretype)+'\\n'\n\t\telse:\n\t\t\tstring+=blocky+loc+make_bindings2(headers,count,colorline,featuretype)+'\\n'\n\treturn string", "metadata": "root.make_bindings_type2", "header": "['module', '___EOS___']", "index": 299 }, { "content": "def get_colorline_marker(color_input):\n\tcolorline=\"\"\"\t\t\t\tlayer.setIcon(L.mapbox.marker.icon({'marker-color': '%s','marker-size': 'small'}))\"\"\" % get_colors(color_input)\n\treturn colorline", "metadata": "root.get_colorline_marker", "header": "['module', '___EOS___']", "index": 441 }, { "content": "def get_colorline_marker2(color_input):\n\tcolorline=\"\"\"\t \t\tlayer.setStyle({color: '%s', weight: 5, opacity: 1});\"\"\" % get_colors2(color_input)\n\treturn colorline", "metadata": "root.get_colorline_marker2", "header": "['module', '___EOS___']", "index": 446 } ]
[ { "span": "making_blockstr2(varblock)\t", "start_line": 124, "start_column": 7, "end_line": 124, "end_column": 33 }, { "span": "make_bindings2(headers,count,colorline,featuretype)+", "start_line": 340, "start_column": 22, "end_line": 340, "end_column": 73 }, { "span": "make_bindings2(headers,count,colorline,featuretype)+", "start_line": 342, "start_column": 22, "end_line": 342, "end_column": 73 } ]
[ { "span": "def making_blockstr2(varblock,count,colorline,element,time):", "start_line": 128, "start_column": 0, "end_line": 128, "end_column": 60 }, { "span": "def make_bindings2(headers,count,colorline,element,time):", "start_line": 146, "start_column": 0, "end_line": 146, "end_column": 57 } ]
1
false
[ "[CLS]_", "Wro", "ng_", "number_", "of_", "arguments_", "in_", "a_", "call_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "make", "\\u", "rows", "2_", "(_", "headers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "var", "block_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", "s", " ", "a", " ", "list", " ", "of", " ", "rows", " ", "from", " ", "a", " ", "give", "n", " ", "input", " ", "header_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "row_", "in_", "headers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "maxc", "hare", "d_", "=_", "15_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "row1", "_", "=_", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row2", "_", "=_", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "row_", "==_", "headers_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "newr", "ow_", "=_", "\"\"\"", " ", " ", " ", " ", "var", " ", "popu", "p", "Text", " ", "=", " ", "\"<", "table", "><", "tr", "><", "th", ">", "%", "s", ":", " ", "</", "th", "><", "td", ">\"", " ", "+", " ", "feature", ".", "proper", "ties", "['", "%", "s", "']", "+\"", "</", "td", "><", "/", "tr", ">\"", ";", " ", "\"\"\"_", "%_", "(_", "row1", "_", ",_", "row2", "_", ")_", "\\u\\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_", "newr", "ow_", "=_", "\"\"\"", " ", " ", " ", " ", "var", " ", "popu", "p", "Text", " ", "=", " ", "popu", "p", "Text", "+", " ", "\"<", "tr", "><", "th", ">", "%", "s", ":", " ", "</", "th", "><", "td", ">\"", " ", "+", " ", "feature", ".", "proper", "ties", "['", "%", "s", "']", "+\"", "</", "td", "><", "/", "tr", ">\"", ";", " ", "\"\"\"_", "%_", "(_", "row1", "_", ",_", "row2", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "var", "block_", "._", "append_", "(_", "newr", "ow_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "row_", "==_", "headers_", "[_", "-_", "1_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "newr", "ow_", "=_", "\"\"\"", " ", " ", " ", " ", "var", " ", "popu", "p", "Text", " ", "=", " ", "popu", "p", "Text", "+", " ", "\"<", "tr", "><", "th", ">", "%", "s", ":", " ", "</", "th", "><", "td", ">\"", " ", "+", " ", "feature", ".", "proper", "ties", "['", "%", "s", "']", "+", "</", "td", "><", "/", "tr", "><", "/", "table", ">\"", ";", " ", "\"\"\"_", "%_", "(_", "row1", "_", ",_", "row2", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "var", "block_", "\\u\\u\\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_", "mak", "ing", "\\u", "blockst", "r2_", "(_", "var", "block_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "start_", "=_", "\"\"\"", "\t", "function", " ", "add", "Data", "To", "Map", "(", "data", ",", " ", "map", ")", " ", "{", "\\", "10", ";", " ", " \t", "var", " ", "data", "Layer", " ", "=", " ", "L", ".", "geo", "Js", "on", "(", "data", ",", " ", "{", "\\", "10", ";", " ", " \t", "on", "Ea", "ch", "Feature", ":", " ", "function", "(", "feature", ",", " ", "layer", ")", " ", "{", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "end_", "=_", "\"\"\"", "\\", "10", ";", "\t ", " ", " ", " \t", "layer", ".", "bind", "Pop", "up", "(", "popu", "p", "Text", ",", " ", "{", "auto", "Pan", ":", "fal", "se", ",", " ", "max", "Hei", "ght", ":", "500", ",", " ", "max", "Wid", "th", ":", "350", "}", " ", ");", " ", "}", "\\", "10", ";", " ", " \t", "})", ";", "\\", "10", ";", " ", " \t", "data", "Layer", ".", "add", "To", "(", "map", ");", "\\\\", "n", "}\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "var", "block_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " \t", "\t_", "total_", "+=_", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "start_", "+_", "total_", "+_", "end_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "make", "\\u", "bindings_", "(_", "headers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "var", "block_", "=_", "make", "\\u", "rows", "2_", "(_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "block_", "=_", "mak", "ing", "\\u", "blockst", "r2_", "(_", "var", "block_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "block_", "\\u\\u\\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_", "mak", "ing", "\\u", "blockst", "r2_", "(_", "var", "block_", ",_", "count_", ",_", "color", "line_", ",_", "element_", ",_", "time_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "start_", "=_", "\"\"\"", "function", " ", "add", "Data", "To", "Map", "%", "s", "(", "data", ",", " ", "map", ")", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "var", " ", "data", "Layer", " ", "=", " ", "L", ".", "geo", "Js", "on", "(", "data", ",", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "on", "Ea", "ch", "Feature", ":", " ", "function", "(", "feature", ",", " ", "layer", ")", " ", "{", "\"\"\"_", "%_", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "end_", "=_", "\"\"\"", "\\", "10", ";", "\t ", " ", " ", " ", " ", " ", "layer", ".", "bind", "Pop", "up", "(", "popu", "p", "Text", ",", " ", "{", "auto", "Pan", ":", "fal", "se", ",", " ", "max", "Hei", "ght", ":", "500", ",", " ", "max", "Wid", "th", ":", "350", "}", " ", ");", " ", "}", "\\", "10", ";", " ", " ", " ", " ", "})", ";", "\\", "10", ";", " ", " \t", "data", "Layer", ".", "add", "To", "(", "map", ");", "\\\\", "n", "\\\\", "t", "\\\\", "tse", "t", "Time", "out", "(", "function", "()", " ", "{\\\\", "n", "\\\\", "t", "\\\\", "t", "\\\\", "t", "\\\\", "tdata", "Layer", ".", "clear", "Layer", "s", "();", "\\\\", "n", "\\\\", "t", "\\\\", "t", "},", "%", "s", ");", "\\\\", "n", "\\\\", "t", "}\\\\", "n", "}\\\\", "nse", "t", "Interv", "al", "(", "add", "%", "s", ",%", "s", ")\"\"\"_", "%_", "(_", "time_", ",_", "count_", ",_", "time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "var", "block_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " \t", "\t_", "total_", "+=_", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "element_", "==_", "'", "Point", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " \t", "\t_", "return_", "start_", "+_", "total_", "+_", "color", "line_", "+_", "end_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " \t", "\t_", "return_", "start_", "+_", "total_", "+_", "'\\\\", "n", "'_", "+_", "color", "line_", "+_", "end_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "make", "\\u", "bindi", "ngs", "2_", "(_", "headers_", ",_", "count_", ",_", "color", "line_", ",_", "element_", ",_", "time_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "var", "block_", "=_", "make", "\\u", "rows", "2_", "(_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "block_", "=_", "mak", "ing", "\\u", "blockst", "r2_", "(_", "var", "block_", ",_", "count_", ",_", "color", "line_", ",_", "element_", ",_", "time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "block_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load_", "(_", "lines_", ",_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "with_", "open_", "(_", "filename_", ",_", "'", "w", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "f_", "._", "writelines_", "(_", "lines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "system_", "(_", "'", "open", " ", "-", "a", " ", "Saf", "ari", " ", "'_", "+_", "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_", "def_", "make", "\\u", "bindi", "ngs", "\\u", "type2_", "(_", "filenames_", ",_", "color", "\\u", "input_", ",_", "color", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "string_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "block", "y_", "=_", "\"\"\"", "\\\\", "nf", "uncti", "on", " ", "add", "Data", "To", "Map", "(", "data", ",", " ", "map", ")", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "var", " ", "data", "Layer", " ", "=", " ", "L", ".", "geo", "Js", "on", "(", "data", ");", "\\", "10", ";", " ", " ", " ", " ", "data", "Layer", ".", "add", "To", "(", "map", ");", "\\", "10", ";}", "\\\\", "n", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "filenames_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", "=_", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "row_", ")_", "as_", "data\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " \t\t", "\t_", "data_", "=_", "json_", "._", "load_", "(_", "data\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "ppr", "int", "(", "data", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "=_", "data_", "[_", "'", "features", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "data_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "feature", "type_", "=_", "data_", "[_", "'", "geom", "etry", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "feature", "type_", "=_", "feature", "type_", "[_", "'", "type", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "data_", "[_", "'", "proper", "ties", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "a", " ", "point", " ", "and", " ", "no", " ", "entry", " ", "for", " ", "color", "\\u", "input_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "feature", "type_", "==_", "'", "Point", "'_", "and_", "color", "key_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " \t\t", "\t_", "color", "line_", "=_", "get", "\\u", "color", "line", "\\u", "marker_", "(_", "color", "\\u", "input_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "color", "key_", "==_", "''_", "and_", "feature", "type_", "==_", "'", "Point", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " \t\t", "\t_", "color", "line_", "=_", "get", "\\u", "color", "line", "\\u", "marker_", "(_", "data_", "[_", "str_", "(_", "color", "key_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "color", "key_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " \t\t", "\t_", "color", "line_", "=_", "get", "\\u", "color", "line", "\\u", "marker", "2_", "(_", "data_", "[_", "str_", "(_", "color", "key_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "color", "key_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " \t\t", "\t_", "color", "line_", "=_", "get", "\\u", "color", "line", "\\u", "marker", "2_", "(_", "str_", "(_", "color", "\\u", "input_", ")_", ")_", "\\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_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " \t\t", "\t_", "headers_", "._", "append_", "(_", "str_", "(_", "row_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "block", "y_", "=_", "block", "y_", "=_", "\"\"\"", "\\\\", "nf", "uncti", "on", " ", "add", "Data", "To", "Map", "%", "s", "(", "data", ",", " ", "map", ")", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "var", " ", "data", "Layer", " ", "=", " ", "L", ".", "geo", "Js", "on", "(", "data", ");", "\\", "10", ";", " ", " ", " ", " ", "data", "Layer", ".", "add", "To", "(", "map", ");", "\\", "10", ";}", "\\\\", "n", "\"\"\"_", "%_", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "'", "function", " ", "add", "()", " ", "{'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loc_", "=_", "\"\"\"", "\\\\", "n", "$.", "get", "JSO", "N", "('", "http", "://", "local", "host", ":", "800", "0", "/", "%", "s", "',", "function", "(", "data", ")", " ", "{", " ", "add", "Data", "To", "Map", "%", "s", "(", "data", ",", "map", ");", " ", "})", ";\"\"\"_", "%_", "(_", "filename_", ",_", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "feature", "type_", "==_", "'", "Point", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "string_", "+=_", "block", "y_", "+_", "loc_", "+_", "make", "\\u", "bindi", "ngs", "2_", "(_", "headers_", ",_", "count_", ",_", "color", "line_", ",_", "feature", "type_", ")_", "+_", "'\\\\", "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\t", "\t\t_", "string_", "+=_", "block", "y_", "+_", "loc_", "+_", "make", "\\u", "bindi", "ngs", "2_", "(_", "headers_", ",_", "count_", ",_", "color", "line_", ",_", "feature", "type_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "color", "line", "\\u", "marker_", "(_", "color", "\\u", "input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "color", "line_", "=_", "\"\"\"", "\t\t\t", "\t", "layer", ".", "set", "Ico", "n", "(", "L", ".", "map", "box", ".", "marker", ".", "icon", "({", "'", "marker", "-", "color", "':", " ", "'%", "s", "','", "marker", "-", "size", "':", " ", "'", "small", "'})", ")\"\"\"_", "%_", "get", "\\u", "colors_", "(_", "color", "\\u", "input_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "color", "line_", "\\u\\u\\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", "color", "line", "\\u", "marker", "2_", "(_", "color", "\\u", "input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "color", "line_", "=_", "\"\"\"", "\t ", " \t\t", "layer", ".", "set", "Style", "({", "color", ":", " ", "'%", "s", "',", " ", "weight", ":", " ", "5", ",", " ", "opa", "city", ":", " ", "1", "})", ";\"\"\"_", "%_", "get", "\\u", "colors", "2_", "(_", "color", "\\u", "input_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "color", "line_", "\\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,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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, 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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Imprecise assert
realpython/flask-registration/tests/test_user.py
[ { "content": " def test_correct_login(self):\n # Ensure login behaves correctly with correct credentials.\n with self.client:\n response = self.client.post(\n '/login',\n data=dict(email=\"test@user.com\", password=\"just_a_test_user\"),\n follow_redirects=True\n )\n self.assertTrue(response.status_code == 200)\n self.assertTrue(current_user.email == \"test@user.com\")\n self.assertTrue(current_user.is_active())\n self.assertTrue(current_user.is_authenticated())\n self.assertTemplateUsed('main/index.html')", "metadata": "root.TestUserViews.test_correct_login", "header": "['class', 'TestUserViews', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 66 }, { "content": " def test_incorrect_login(self):\n # Ensure login behaves correctly with incorrect credentials.\n with self.client:\n response = self.client.post(\n '/login',\n data=dict(email=\"not@correct.com\", password=\"incorrect\"),\n follow_redirects=True\n )\n self.assertTrue(response.status_code == 200)\n self.assertIn(b'Invalid email and/or password.', response.data)\n self.assertFalse(current_user.is_active())\n self.assertFalse(current_user.is_authenticated())\n self.assertTemplateUsed('user/login.html')", "metadata": "root.TestUserViews.test_incorrect_login", "header": "['class', 'TestUserViews', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 80 } ]
[ { "span": "self.assertTrue(response.status_code == 200)", "start_line": 74, "start_column": 12, "end_line": 74, "end_column": 56 }, { "span": "self.assertTrue(current_user.email == \"test@user.com\")", "start_line": 75, "start_column": 12, "end_line": 75, "end_column": 66 }, { "span": "self.assertTrue(response.status_code == 200)", "start_line": 88, "start_column": 12, "end_line": 88, "end_column": 56 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "User", "Views_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "correct", "\\u", "login_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ensur", "e", " ", "login", " ", "behave", "s", " ", "correct", "ly", " ", "with", " ", "correct", " ", "cred", "ential", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "client_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'/", "login", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "email_", "=_", "\"", "test", "@", "user", ".", "com", "\"_", ",_", "password_", "=_", "\"", "just", "\\u", "a", "\\u", "test\\u", "user", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "follow", "\\u", "redirects_", "=_", "True_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "current", "\\u", "user_", "._", "email_", "==_", "\"", "test", "@", "user", ".", "com", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "current", "\\u", "user_", "._", "is", "\\u", "active_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "current", "\\u", "user_", "._", "is", "\\u", "authenticated_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Templa", "te", "Used_", "(_", "'", "main", "/", "index", ".", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "User", "Views_", "(_", "Base", "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", "incorrect", "\\u", "login_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ensur", "e", " ", "login", " ", "behave", "s", " ", "correct", "ly", " ", "with", " ", "incorrect", " ", "cred", "ential", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "client_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'/", "login", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "email_", "=_", "\"", "not", "@", "correct", ".", "com", "\"_", ",_", "password_", "=_", "\"", "incorrect", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "follow", "\\u", "redirects_", "=_", "True_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "b", "'", "Inva", "lid", " ", "email", " ", "and", "/", "or", " ", "password", ".'_", ",_", "response_", "._", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "current", "\\u", "user_", "._", "is", "\\u", "active_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "current", "\\u", "user_", "._", "is", "\\u", "authenticated_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Templa", "te", "Used_", "(_", "'", "user", "/", "login", ".", "html", "'_", ")_", "\\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,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2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Testing equality to None
bmander/graphserver/pygs/test/unit_test/test_servicecalendar.py
[ { "content": " def test_basic(self):\n c = ServiceCalendar()\n assert( c.head == None )\n \n assert( c.period_of_or_before(0) == None )\n assert( c.period_of_or_after(0) == None )", "metadata": "root.TestServiceCalendar.test_basic", "header": "['class', 'TestServiceCalendar', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 5 }, { "content": " def test_get_service_id_int(self):\n c = ServiceCalendar()\n assert c.get_service_id_int( \"A\" ) == 0\n assert c.get_service_id_int( \"A\" ) == 0\n assert c.get_service_id_int( \"B\" ) == 1\n try:\n c.get_service_id_int( 1 )\n assert False\n except TypeError:\n pass\n \n c.add_period(0,1000,[\"B\"])\n \n import pickle\n from cStringIO import StringIO\n src = StringIO()\n p = pickle.Pickler(src) \n \n p.dump(c)\n datastream = src.getvalue()\n dst = StringIO(datastream)\n\n upc = pickle.Unpickler(dst).load()\n print c.expound(\"America/Los_Angeles\")\n print upc.expound(\"America/Los_Angeles\")\n assert c.expound(\"America/Los_Angeles\") == upc.expound(\"America/Los_Angeles\"), upc\n for _c in [c, upc]:\n assert _c.get_service_id_string( -1 ) == None\n assert _c.get_service_id_string( 0 ) == \"A\", _c.to_xml()\n assert _c.get_service_id_string( 1 ) == \"B\"\n assert _c.get_service_id_string( 2 ) == None\n try:\n _c.get_service_id_string( \"A\" )\n assert False\n except TypeError:\n pass", "metadata": "root.TestServiceCalendar.test_get_service_id_int", "header": "['class', 'TestServiceCalendar', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 12 }, { "content": " def test_single(self):\n c = ServiceCalendar()\n c.add_period( 0,1000,[\"A\",\"B\",\"C\"] )\n \n assert c.head\n assert c.head.begin_time == 0\n assert c.head.end_time == 1000\n assert c.head.service_ids == [0,1,2]\n \n assert c.period_of_or_before(-1) == None\n assert c.period_of_or_before(0).begin_time==0\n assert c.period_of_or_before(500).begin_time==0\n assert c.period_of_or_before(1000).begin_time==0\n assert c.period_of_or_before(50000).begin_time==0\n \n assert c.period_of_or_after(-1).begin_time==0\n assert c.period_of_or_after(0).begin_time==0\n assert c.period_of_or_after(500).begin_time==0\n assert c.period_of_or_after(1000)==None\n assert c.period_of_or_after(1001) == None", "metadata": "root.TestServiceCalendar.test_single", "header": "['class', 'TestServiceCalendar', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 49 }, { "content": " def test_overlap_a_little(self):\n \n c = ServiceCalendar()\n c.add_period( 0, 1000, [\"A\"] )\n c.add_period( 1000, 2000, [\"B\"] )\n \n assert c.head.begin_time == 0\n assert c.head.end_time == 1000\n \n assert c.period_of_or_before(-1) == None\n assert c.period_of_or_before(0).begin_time==0\n assert c.period_of_or_before(999).begin_time==0\n assert c.period_of_or_before(1000).begin_time==1000\n \n c = ServiceCalendar()\n c.add_period(1000,2000,[\"B\"])\n c.add_period(0,1000,[\"A\"])\n \n assert c.head.begin_time == 0\n assert c.head.end_time == 1000\n \n assert c.period_of_or_before(-1) == None\n assert c.period_of_or_before(0).begin_time==0\n assert c.period_of_or_before(999).begin_time==0\n assert c.period_of_or_before(1000).begin_time==1000\n \n #--==--\n \n sc = ServiceCalendar()\n sc.add_period(0, 1*3600*24, ['A'])\n sc.add_period(1*3600*24,2*3600*24, ['B'])\n \n assert sc.period_of_or_after( 1*3600*24 ).begin_time == 86400", "metadata": "root.TestServiceCalendar.test_overlap_a_little", "header": "['class', 'TestServiceCalendar', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 70 }, { "content": " def test_multiple(self):\n c = ServiceCalendar()\n # out of order\n c.add_period( 1001,2000,[\"C\",\"D\",\"E\"] )\n c.add_period( 0,1000,[\"A\",\"B\",\"C\"] )\n \n assert c.head\n assert c.head.begin_time == 0\n assert c.head.end_time == 1000\n assert c.head.service_ids == [3,4,0]\n \n assert c.head.previous == None\n assert c.head.next.begin_time == 1001\n \n assert c.period_of_or_before(-1) == None\n assert c.period_of_or_before(0).begin_time == 0\n assert c.period_of_or_before(1000).begin_time == 0\n assert c.period_of_or_before(1001).begin_time == 1001\n assert c.period_of_or_before(2000).begin_time == 1001\n assert c.period_of_or_before(2001).begin_time == 1001\n \n assert c.period_of_or_after(-1).begin_time == 0\n assert c.period_of_or_after(0).begin_time == 0\n assert c.period_of_or_after(1000).begin_time == 1001\n assert c.period_of_or_after(1001).begin_time == 1001\n assert c.period_of_or_after(2000) == None\n assert c.period_of_or_after(2001) == None", "metadata": "root.TestServiceCalendar.test_multiple", "header": "['class', 'TestServiceCalendar', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 105 } ]
[ { "span": "c.head == None ", "start_line": 7, "start_column": 16, "end_line": 7, "end_column": 30 }, { "span": "c.period_of_or_before(0) == None ", "start_line": 9, "start_column": 16, "end_line": 9, "end_column": 48 }, { "span": "c.period_of_or_after(0) == None ", "start_line": 10, "start_column": 16, "end_line": 10, "end_column": 47 }, { "span": "_c.get_service_id_string( -1 ) == None", "start_line": 39, "start_column": 19, "end_line": 39, "end_column": 57 }, { "span": "_c.get_service_id_string( 2 ) == None", "start_line": 42, "start_column": 19, "end_line": 42, "end_column": 56 }, { "span": "c.period_of_or_before(-1) == None", "start_line": 58, "start_column": 15, "end_line": 58, "end_column": 48 }, { "span": "c.period_of_or_after(1000)==None", "start_line": 67, "start_column": 15, "end_line": 67, "end_column": 47 }, { "span": "c.period_of_or_after(1001) == None", "start_line": 68, "start_column": 15, "end_line": 68, "end_column": 49 }, { "span": "c.period_of_or_before(-1) == None", "start_line": 79, "start_column": 15, "end_line": 79, "end_column": 48 }, { "span": "c.period_of_or_before(-1) == None", "start_line": 91, "start_column": 15, "end_line": 91, "end_column": 48 }, { "span": "c.head.previous == None", "start_line": 116, "start_column": 15, "end_line": 116, "end_column": 38 }, { "span": "c.period_of_or_before(-1) == None", "start_line": 119, "start_column": 15, "end_line": 119, "end_column": 48 }, { "span": "c.period_of_or_after(2000) == None", "start_line": 130, "start_column": 15, "end_line": 130, "end_column": 49 }, { "span": "c.period_of_or_after(2001) == None", "start_line": 131, "start_column": 15, "end_line": 131, "end_column": 49 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "Test", "Service", "Calendar_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "basic_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "Service", "Calendar_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "c_", "._", "head_", "==_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "(_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "before_", "(_", "0_", ")_", "==_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "after_", "(_", "0_", ")_", "==_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Service", "Calendar_", "(_", "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", "service", "\\u", "id", "\\u", "int_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "Service", "Calendar_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "get", "\\u", "service", "\\u", "id", "\\u", "int_", "(_", "\"", "A", "\"_", ")_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "get", "\\u", "service", "\\u", "id", "\\u", "int_", "(_", "\"", "A", "\"_", ")_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "get", "\\u", "service", "\\u", "id", "\\u", "int_", "(_", "\"", "B", "\"_", ")_", "==_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "._", "get", "\\u", "service", "\\u", "id", "\\u", "int_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c_", "._", "add", "\\u", "period_", "(_", "0_", ",_", "1000_", ",_", "[_", "\"", "B", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "c", "String", "IO_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "src_", "=_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "pickle_", "._", "Pickl", "er_", "(_", "src_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "dump_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datastream", "_", "=_", "src_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dst_", "=_", "String", "IO_", "(_", "datastream", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "upc", "_", "=_", "pickle_", "._", "Unp", "ickle", "r_", "(_", "dst_", ")_", "._", "load_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "c_", "._", "exp", "ound_", "(_", "\"", "Ame", "rica", "/", "Lo", "s", "\\u", "Angel", "es", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "upc", "_", "._", "exp", "ound_", "(_", "\"", "Ame", "rica", "/", "Lo", "s", "\\u", "Angel", "es", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "exp", "ound_", "(_", "\"", "Ame", "rica", "/", "Lo", "s", "\\u", "Angel", "es", "\"_", ")_", "==_", "upc", "_", "._", "exp", "ound_", "(_", "\"", "Ame", "rica", "/", "Lo", "s", "\\u", "Angel", "es", "\"_", ")_", ",_", "upc", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "\\u", "c_", "in_", "[_", "c_", ",_", "upc", "_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "\\u", "c_", "._", "get", "\\u", "service", "\\u", "id", "\\u", "string_", "(_", "-_", "1_", ")_", "==_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "\\u", "c_", "._", "get", "\\u", "service", "\\u", "id", "\\u", "string_", "(_", "0_", ")_", "==_", "\"", "A", "\"_", ",_", "\\u", "c_", "._", "to", "\\u", "xml_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "\\u", "c_", "._", "get", "\\u", "service", "\\u", "id", "\\u", "string_", "(_", "1_", ")_", "==_", "\"", "B", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "\\u", "c_", "._", "get", "\\u", "service", "\\u", "id", "\\u", "string_", "(_", "2_", ")_", "==_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "c_", "._", "get", "\\u", "service", "\\u", "id", "\\u", "string_", "(_", "\"", "A", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Service", "Calendar_", "(_", "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", "single_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "Service", "Calendar_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "add", "\\u", "period_", "(_", "0_", ",_", "1000_", ",_", "[_", "\"", "A", "\"_", ",_", "\"", "B", "\"_", ",_", "\"", "C", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "c_", "._", "head_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "head_", "._", "begin", "\\u", "time_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "head_", "._", "end", "\\u", "time_", "==_", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "head_", "._", "service", "\\u", "ids_", "==_", "[_", "0_", ",_", "1_", ",_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "before_", "(_", "-_", "1_", ")_", "==_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "before_", "(_", "0_", ")_", "._", "begin", "\\u", "time_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "before_", "(_", "500_", ")_", "._", "begin", "\\u", "time_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "before_", "(_", "1000_", ")_", "._", "begin", "\\u", "time_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "before_", "(_", "50000_", ")_", "._", "begin", "\\u", "time_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "after_", "(_", "-_", "1_", ")_", "._", "begin", "\\u", "time_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "after_", "(_", "0_", ")_", "._", "begin", "\\u", "time_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "after_", "(_", "500_", ")_", "._", "begin", "\\u", "time_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "after_", "(_", "1000_", ")_", "==_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "after_", "(_", "1001_", ")_", "==_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Service", "Calendar_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "overl", "ap", "\\u", "a", "\\u", "litt", "le_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "Service", "Calendar_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "add", "\\u", "period_", "(_", "0_", ",_", "1000_", ",_", "[_", "\"", "A", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "add", "\\u", "period_", "(_", "1000_", ",_", "2000_", ",_", "[_", "\"", "B", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "c_", "._", "head_", "._", "begin", "\\u", "time_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "head_", "._", "end", "\\u", "time_", "==_", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "before_", "(_", "-_", "1_", ")_", "==_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "before_", "(_", "0_", ")_", "._", "begin", "\\u", "time_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "before_", "(_", "999_", ")_", "._", "begin", "\\u", "time_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "before_", "(_", "1000_", ")_", "._", "begin", "\\u", "time_", "==_", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "=_", "Service", "Calendar_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "add", "\\u", "period_", "(_", "1000_", ",_", "2000_", ",_", "[_", "\"", "B", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "add", "\\u", "period_", "(_", "0_", ",_", "1000_", ",_", "[_", "\"", "A", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "c_", "._", "head_", "._", "begin", "\\u", "time_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "head_", "._", "end", "\\u", "time_", "==_", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "before_", "(_", "-_", "1_", ")_", "==_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "before_", "(_", "0_", ")_", "._", "begin", "\\u", "time_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "before_", "(_", "999_", ")_", "._", "begin", "\\u", "time_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "before_", "(_", "1000_", ")_", "._", "begin", "\\u", "time_", "==_", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "-=", "=-", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sc_", "=_", "Service", "Calendar_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sc_", "._", "add", "\\u", "period_", "(_", "0_", ",_", "1_", "*_", "3600_", "*_", "24_", ",_", "[_", "'", "A", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sc_", "._", "add", "\\u", "period_", "(_", "1_", "*_", "3600_", "*_", "24_", ",_", "2_", "*_", "3600_", "*_", "24_", ",_", "[_", "'", "B", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "sc_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "after_", "(_", "1_", "*_", "3600_", "*_", "24_", ")_", "._", "begin", "\\u", "time_", "==_", "86400_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Service", "Calendar_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "multiple_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "Service", "Calendar_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "out", " ", "of", " ", "order_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "._", "add", "\\u", "period_", "(_", "1001_", ",_", "2000_", ",_", "[_", "\"", "C", "\"_", ",_", "\"", "D", "\"_", ",_", "\"", "E", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "add", "\\u", "period_", "(_", "0_", ",_", "1000_", ",_", "[_", "\"", "A", "\"_", ",_", "\"", "B", "\"_", ",_", "\"", "C", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "c_", "._", "head_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "head_", "._", "begin", "\\u", "time_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "head_", "._", "end", "\\u", "time_", "==_", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "head_", "._", "service", "\\u", "ids_", "==_", "[_", "3_", ",_", "4_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "c_", "._", "head_", "._", "previous_", "==_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "head_", "._", "next_", "._", "begin", "\\u", "time_", "==_", "1001_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "before_", "(_", "-_", "1_", ")_", "==_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "before_", "(_", "0_", ")_", "._", "begin", "\\u", "time_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "before_", "(_", "1000_", ")_", "._", "begin", "\\u", "time_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "before_", "(_", "1001_", ")_", "._", "begin", "\\u", "time_", "==_", "1001_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "before_", "(_", "2000_", ")_", "._", "begin", "\\u", "time_", "==_", "1001_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "before_", "(_", "2001_", ")_", "._", "begin", "\\u", "time_", "==_", "1001_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "after_", "(_", "-_", "1_", ")_", "._", "begin", "\\u", "time_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "after_", "(_", "0_", ")_", "._", "begin", "\\u", "time_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "after_", "(_", "1000_", ")_", "._", "begin", "\\u", "time_", "==_", "1001_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "after_", "(_", "1001_", ")_", "._", "begin", "\\u", "time_", "==_", "1001_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "after_", "(_", "2000_", ")_", "==_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "period", "\\u", "of", "\\u", "or", "\\u", "after_", "(_", "2001_", ")_", "==_", "None_", "\\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, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 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, 2 ]
Unused local variable
neurodata/ndstore/ingest/mitra/mitrachannel.py
[ { "content": " def upload ( self, channel, sl, imarray ):\n \"\"\"Transfer the array to the database\"\"\"\n\n # and the limits of iteration\n xlimit = (self._ximgsz-1) / self.xcubedim + 1\n ylimit = (self._yimgsz-1) / self.ycubedim + 1\n\n for y in range(ylimit):\n for x in range(xlimit):\n\n # each batch is the last slice in a cube\n z = sl/self.zcubedim\n\n # zindex\n key = zindex.XYZMorton ( [x,y,z] )\n\n # Create a channel cube\n cube = imagecube.ImageCube8 ( [self.xcubedim, self.ycubedim, self.zcubedim] )\n\n # data for this key\n cube.data = imarray[:,y*self.ycubedim:(y+1)*self.ycubedim,x*self.xcubedim:(x+1)*self.xcubedim]\n # compress the cube\n npz = cube.toNPZ ()\n\n # add the cube to the database\n sql = \"INSERT INTO \" + self.proj.getTable(self.resolution) + \"(channel, zindex, cube) VALUES (%s, %s, %s)\"\n try:\n print sql\n #self.cursor.execute ( sql, (channel, key, npz))\n except MySQLdb.Error, e:\n print (\"Error updating data cube: %d: %s. sql=%s\" % (e.args[0], e.args[1], sql))\n raise \n\n self.db.conn.commit()", "metadata": "root.MitraIngest.upload", "header": "['class', 'MitraIngest', ':', '___EOS___']", "index": 107 } ]
[ { "span": "key ", "start_line": 121, "start_column": 8, "end_line": 121, "end_column": 11 }, { "span": "npz ", "start_line": 129, "start_column": 8, "end_line": 129, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Mit", "ra", "Ing", "est_", ":_", "\\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_", "upload_", "(_", "self_", ",_", "channel_", ",_", "sl_", ",_", "ima", "rray_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Transfer", " ", "the", " ", "array", " ", "to", " ", "the", " ", "databa", "se", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "the", " ", "limit", "s", " ", "of", " ", "iteration_", "\\u\\u\\uNL\\u\\u\\u_", "xlim", "it_", "=_", "(_", "self_", "._", "\\u", "xim", "gs", "z_", "-_", "1_", ")_", "/_", "self_", "._", "xc", "ube", "dim_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ylim", "it_", "=_", "(_", "self_", "._", "\\u", "yi", "mg", "sz_", "-_", "1_", ")_", "/_", "self_", "._", "yc", "ube", "dim_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "y_", "in_", "range_", "(_", "ylim", "it_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "x_", "in_", "range_", "(_", "xlim", "it_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "each", " ", "batch", " ", "is", " ", "the", " ", "last", " ", "slice", " ", "in", " ", "a", " ", "cube_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "z_", "=_", "sl_", "/_", "self_", "._", "zc", "ube", "dim_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "zin", "dex_", "\\u\\u\\uNL\\u\\u\\u_", "key_", "=_", "zin", "dex_", "._", "XY", "ZM", "ort", "on_", "(_", "[_", "x_", ",_", "y_", ",_", "z_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "a", " ", "channel", " ", "cube_", "\\u\\u\\uNL\\u\\u\\u_", "cube_", "=_", "image", "cube_", "._", "Image", "Cub", "e8", "_", "(_", "[_", "self_", "._", "xc", "ube", "dim_", ",_", "self_", "._", "yc", "ube", "dim_", ",_", "self_", "._", "zc", "ube", "dim_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "data", " ", "for", " ", "this", " ", "key_", "\\u\\u\\uNL\\u\\u\\u_", "cube_", "._", "data_", "=_", "ima", "rray_", "[_", ":_", ",_", "y_", "*_", "self_", "._", "yc", "ube", "dim_", ":_", "(_", "y_", "+_", "1_", ")_", "*_", "self_", "._", "yc", "ube", "dim_", ",_", "x_", "*_", "self_", "._", "xc", "ube", "dim_", ":_", "(_", "x_", "+_", "1_", ")_", "*_", "self_", "._", "xc", "ube", "dim_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "compress", " ", "the", " ", "cube_", "\\u\\u\\uNL\\u\\u\\u_", "np", "z_", "=_", "cube_", "._", "to", "NP", "Z_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "the", " ", "cube", " ", "to", " ", "the", " ", "database_", "\\u\\u\\uNL\\u\\u\\u_", "sql_", "=_", "\"", "INSERT", " ", "INT", "O", " ", "\"_", "+_", "self_", "._", "proj_", "._", "get", "Table_", "(_", "self_", "._", "resolution_", ")_", "+_", "\"(", "channel", ",", " ", "zin", "dex", ",", " ", "cube", ")", " ", "VALU", "ES", " ", "(%", "s", ",", " ", "%", "s", ",", " ", "%", "s", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "sql_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "cursor", ".", "execute", " ", "(", " ", "sql", ",", " ", "(", "channel", ",", " ", "key", ",", " ", "np", "z", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "My", "SQL", "db_", "._", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Error", " ", "updat", "ing", " ", "data", " ", "cube", ":", " ", "%", "d", ":", " ", "%", "s", ".", " ", "sql", "=", "%", "s", "\"_", "%_", "(_", "e_", "._", "args_", "[_", "0_", "]_", ",_", "e_", "._", "args_", "[_", "1_", "]_", ",_", "sql_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "db_", "._", "conn_", "._", "commit_", "(_", ")_", "\\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,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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 ]
Except block handles 'BaseException'
cloudera/hue/desktop/libs/libsentry/gen-py/sentry_generic_policy_service/ttypes.py
[ { "content": "#\n# Autogenerated by Thrift Compiler (0.9.3)\n#\n# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n#\n# options string: py:new_style\n#\n\nfrom thrift.Thrift import TType, TMessageType, TException, TApplicationException\nimport sentry_common_service.ttypes\nimport sentry_policy_service.ttypes\n\n\nfrom thrift.transport import TTransport\nfrom thrift.protocol import TBinaryProtocol, TProtocol\ntry:\n from thrift.protocol import fastbinary\nexcept:\n fastbinary = None\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "except:", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 7 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Auto", "generat", "ed", " ", "by", " ", "Thri", "ft", " ", "Compil", "er", " ", "(", "0.", "9.3", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "DO", " ", "NOT", " ", "EDIT", " ", "UNL", "ESS", " ", "YOU", " ", "ARE", " ", "SUR", "E", " ", "THA", "T", " ", "YOU", " ", "KN", "OW", " ", "WH", "AT", " ", "YOU", " ", "ARE", " ", "DOI", "NG_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "options", " ", "string", ":", " ", "py", ":", "new", "\\u", "style_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "thrift", "_", "._", "Thri", "ft_", "import_", "TT", "ype_", ",_", "TM", "essage", "Type_", ",_", "TE", "xcept", "ion_", ",_", "TA", "ppl", "ication", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sentry", "\\u", "common", "\\u", "service_", "._", "ttype", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sentry", "\\u", "policy", "\\u", "service_", "._", "ttype", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "thrift", "_", "._", "transport_", "import_", "TT", "rans", "port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "thrift", "_", "._", "protocol_", "import_", "TB", "inary", "Protocol_", ",_", "TP", "roto", "col_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "thrift", "_", "._", "protocol_", "import_", "fastbinary_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fastbinary_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uN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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 ]
Unused local variable
jmg/elixir/tests/test_associable.py
[ { "content": " def test_empty(self):\n class Foo(Entity):\n pass\n\n class Bar(Entity):\n pass\n\n is_fooable = associable(Foo)\n is_barable = associable(Bar)\n\n class Quux(Entity):\n is_fooable()\n is_barable()\n\n setup_all(True)", "metadata": "root.TestOrders.test_empty", "header": "['class', 'TestOrders', '(', 'object', ')', ':', '___EOS___']", "index": 17 }, { "content": " def test_with_forward_ref(self):\n class Checkout(Entity):\n by = ManyToOne('Villian', ondelete='cascade')\n stamp = Field(DateTime)\n\n can_checkout = associable(Checkout, 'checked_out')\n\n class Article(Entity):\n title = Field(String(200))\n content = Field(Text)\n can_checkout('checked_out_by', uselist=False)\n using_options(tablename='article')\n\n class Villian(Entity):\n name = Field(String(50))\n using_options(tablename='villian')\n\n setup_all(True)\n\n art = Article(title='Hope Soars')\n\n session.commit()\n session.expunge_all()", "metadata": "root.TestOrders.test_with_forward_ref", "header": "['class', 'TestOrders', '(', 'object', ')', ':', '___EOS___']", "index": 89 } ]
[ { "span": "Quux(", "start_line": 27, "start_column": 14, "end_line": 27, "end_column": 18 }, { "span": "Villian(", "start_line": 102, "start_column": 14, "end_line": 102, "end_column": 21 }, { "span": "art ", "start_line": 108, "start_column": 8, "end_line": 108, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Order", "s_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "empty_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "Entity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Bar_", "(_", "Entity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "is", "\\u", "foo", "able_", "=_", "associ", "able_", "(_", "Foo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "\\u", "bar", "able_", "=_", "associ", "able_", "(_", "Bar_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Qu", "ux_", "(_", "Entity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "is", "\\u", "foo", "able_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "\\u", "bar", "able_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "setup", "\\u", "all_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Order", "s_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "with", "\\u", "forward", "\\u", "ref_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Check", "out_", "(_", "Entity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "by_", "=_", "Many", "To", "One_", "(_", "'", "Vill", "ian", "'_", ",_", "ondelete_", "=_", "'", "cascade", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stamp_", "=_", "Field_", "(_", "Date", "Time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "can", "\\u", "checkout_", "=_", "associ", "able_", "(_", "Check", "out_", ",_", "'", "checke", "d\\u", "out", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Article_", "(_", "Entity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "title_", "=_", "Field_", "(_", "String_", "(_", "200_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "Field_", "(_", "Text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "can", "\\u", "checkout_", "(_", "'", "checke", "d\\u", "out", "\\u", "by", "'_", ",_", "usel", "ist_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "usi", "ng", "\\u", "options_", "(_", "tablename_", "=_", "'", "article", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Vill", "ian_", "(_", "Entity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "Field_", "(_", "String_", "(_", "50_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "usi", "ng", "\\u", "options_", "(_", "tablename_", "=_", "'", "vil", "lian", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "setup", "\\u", "all_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "art_", "=_", "Article_", "(_", "title_", "=_", "'", "Hop", "e", " ", "So", "ars", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "session_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "exp", "unge", "\\u", "all_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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 ]
Unused import
ReactiveX/RxPY/tests/test_observable/test_publish.py
[ { "content": "import unittest\n\nfrom rx import Observable\nfrom rx.abstractobserver import AbstractObserver\nfrom rx.linq.connectableobservable import ConnectableObservable\nfrom rx.subjects import Subject\nfrom rx.testing import TestScheduler, ReactiveTest, is_prime, MockDisposable\nfrom rx.disposables import Disposable, SerialDisposable\n\non_next = ReactiveTest.on_next\non_completed = ReactiveTest.on_completed\non_error = ReactiveTest.on_error\nsubscribe = ReactiveTest.subscribe\nsubscribed = ReactiveTest.subscribed\ndisposed = ReactiveTest.disposed\ncreated = ReactiveTest.created\n\n\n# Helper function for raising exceptions within lambdas\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class RxException(Exception):\n pass", "metadata": "root.RxException", "header": "['module', '___EOS___']", "index": 17 }, { "content": "def _raise(ex):\n raise RxException(ex)", "metadata": "root._raise", "header": "['module', '___EOS___']", "index": 21 }, { "content": "class MySubject(Observable, AbstractObserver):\n\n\n\n\n", "metadata": "root.MySubject", "header": "['module', '___EOS___']", "index": 24 }, { "content": " def __init__(self):\n\n def subscribe(observer):\n self.subscribe_count += 1\n self.observer = observer\n\n class Duck:\n def __init__(self, this):\n self.this = this\n def dispose(self):\n self.this.disposed = True\n return Duck(self)\n\n super(MySubject, self).__init__(subscribe)\n\n self.dispose_on_map = {}\n self.subscribe_count = 0\n self.disposed = False", "metadata": "root.MySubject.__init__", "header": "['class', 'MySubject', '(', 'Observable', ',', 'AbstractObserver', ')', ':', '___EOS___']", "index": 26 }, { "content": " def dispose_on(self, value, disposable):\n self.dispose_on_map[value] = disposable", "metadata": "root.MySubject.dispose_on", "header": "['class', 'MySubject', '(', 'Observable', ',', 'AbstractObserver', ')', ':', '___EOS___']", "index": 45 }, { "content": " def on_next(self, value):\n self.observer.on_next(value)\n if value in self.dispose_on_map:\n self.dispose_on_map[value].dispose()", "metadata": "root.MySubject.on_next", "header": "['class', 'MySubject', '(', 'Observable', ',', 'AbstractObserver', ')', ':', '___EOS___']", "index": 48 }, { "content": " def on_error(self, exception):\n self.observer.on_error(exception)", "metadata": "root.MySubject.on_error", "header": "['class', 'MySubject', '(', 'Observable', ',', 'AbstractObserver', ')', ':', '___EOS___']", "index": 53 }, { "content": " def on_completed(self):\n self.observer.on_completed()", "metadata": "root.MySubject.on_completed", "header": "['class', 'MySubject', '(', 'Observable', ',', 'AbstractObserver', ')', ':', '___EOS___']", "index": 56 }, { "content": "class TestPublish(unittest.TestCase):\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TestPublish", "header": "['module', '___EOS___']", "index": 59 }, { "content": " def test_publish_cold_zip(self):\n scheduler = TestScheduler()\n xs = scheduler.create_hot_observable(\n on_next(40, 0),\n on_next(90, 1),\n on_next(150, 2),\n on_next(210, 3),\n on_next(240, 4),\n on_next(270, 5),\n on_next(330, 6),\n on_next(340, 7),\n on_completed(390)\n )\n\n def create():\n def selector(ys):\n def result_selector(a, b):\n return a + b\n return ys.zip(ys, result_selector)\n\n return xs.publish(selector=selector)\n results = scheduler.start(create)\n\n results.messages.assert_equal(on_next(210, 6),\n on_next(240, 8),\n on_next(270, 10),\n on_next(330, 12),\n on_next(340, 14), on_completed(390))\n xs.subscriptions.assert_equal(subscribe(200, 390))", "metadata": "root.TestPublish.test_publish_cold_zip", "header": "['class', 'TestPublish', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 61 }, { "content": " def test_ref_count_connects_on_first(self):\n scheduler = TestScheduler()\n xs = scheduler.create_hot_observable(\n on_next(210, 1),\n on_next(220, 2),\n on_next(230, 3),\n on_next(240, 4),\n on_completed(250)\n )\n subject = MySubject()\n conn = ConnectableObservable(xs, subject)\n\n def create():\n return conn.ref_count()\n\n res = scheduler.start(create)\n\n res.messages.assert_equal(\n on_next(210, 1),\n on_next(220, 2),\n on_next(230, 3),\n on_next(240, 4),\n on_completed(250)\n )\n assert(subject.disposed)", "metadata": "root.TestPublish.test_ref_count_connects_on_first", "header": "['class', 'TestPublish', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 91 }, { "content": " def test_ref_count_notconnected(self):\n disconnected = [False]\n count = [0]\n\n def factory():\n count[0] += 1\n\n def create(obs):\n def func():\n disconnected[0] = True\n return func\n\n return Observable.create(create)\n\n xs = Observable.defer(factory)\n\n subject = MySubject()\n conn = ConnectableObservable(xs, subject)\n refd = conn.ref_count()\n dis1 = refd.subscribe()\n self.assertEqual(1, count[0])\n self.assertEqual(1, subject.subscribe_count)\n assert(not disconnected[0])\n dis2 = refd.subscribe()\n self.assertEqual(1, count[0])\n self.assertEqual(2, subject.subscribe_count)\n assert(not disconnected[0])\n dis1.dispose()\n assert(not disconnected[0])\n dis2.dispose()\n assert(disconnected[0])\n disconnected[0] = False\n dis3 = refd.subscribe()\n self.assertEqual(2, count[0])\n self.assertEqual(3, subject.subscribe_count)\n assert(not disconnected[0])\n dis3.dispose()\n assert(disconnected[0])", "metadata": "root.TestPublish.test_ref_count_notconnected", "header": "['class', 'TestPublish', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 117 }, { "content": " def test_publish_basic(self):\n scheduler = TestScheduler()\n xs = scheduler.create_hot_observable(\n on_next(110, 7),\n on_next(220, 3),\n on_next(280, 4),\n on_next(290, 1),\n on_next(340, 8),\n on_next(360, 5),\n on_next(370, 6),\n on_next(390, 7),\n on_next(410, 13),\n on_next(430, 2),\n on_next(450, 9),\n on_next(520, 11),\n on_next(560, 20),\n on_completed(600)\n )\n ys = [None]\n subscription = [None]\n connection = [None]\n results = scheduler.create_observer()\n\n def action0(scheduler, state):\n ys[0] = xs.publish()\n scheduler.schedule_absolute(created, action0)\n\n def action1(scheduler, state):\n subscription[0] = ys[0].subscribe(results)\n scheduler.schedule_absolute(subscribed, action1)\n\n def action2(scheduler, state):\n subscription[0].dispose()\n scheduler.schedule_absolute(disposed, action2)\n\n def action3(scheduler, state):\n connection[0] = ys[0].connect()\n scheduler.schedule_absolute(300, action3)\n\n def action4(scheduler, state):\n connection[0].dispose()\n scheduler.schedule_absolute(400, action4)\n\n def action5(scheduler, state):\n connection[0] = ys[0].connect()\n scheduler.schedule_absolute(500, action5)\n\n def action6(scheduler, state):\n connection[0].dispose()\n scheduler.schedule_absolute(550, action6)\n\n def action7(scheduler, state):\n connection[0] = ys[0].connect()\n scheduler.schedule_absolute(650, action7)\n\n def action8(scheduler, state):\n connection[0].dispose()\n scheduler.schedule_absolute(800, action8)\n\n scheduler.start()\n results.messages.assert_equal(\n on_next(340, 8),\n on_next(360, 5),\n on_next(370, 6),\n on_next(390, 7),\n on_next(520, 11)\n )\n xs.subscriptions.assert_equal(subscribe(300, 400), subscribe(500, 550), subscribe(650, 800))", "metadata": "root.TestPublish.test_publish_basic", "header": "['class', 'TestPublish', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 156 }, { "content": " def test_publish_error(self):\n ex = 'ex'\n scheduler = TestScheduler()\n xs = scheduler.create_hot_observable(\n on_next(110, 7),\n on_next(220, 3),\n on_next(280, 4),\n on_next(290, 1),\n on_next(340, 8),\n on_next(360, 5),\n on_next(370, 6),\n on_next(390, 7),\n on_next(410, 13),\n on_next(430, 2),\n on_next(450, 9),\n on_next(520, 11),\n on_next(560, 20),\n on_error(600, ex))\n\n ys = [None]\n subscription = [None]\n connection = [None]\n results = scheduler.create_observer()\n\n def action0(scheduler, state):\n ys[0] = xs.publish()\n scheduler.schedule_absolute(created, action0)\n\n def action1(scheduler, state):\n subscription[0] = ys[0].subscribe(results)\n scheduler.schedule_absolute(subscribed, action1)\n\n def action2(scheduler, state):\n subscription[0].dispose()\n scheduler.schedule_absolute(disposed, action2)\n\n def action3(scheduler, state):\n connection[0] = ys[0].connect()\n scheduler.schedule_absolute(300, action3)\n\n def action4(scheduler, state):\n connection[0].dispose()\n scheduler.schedule_absolute(400, action4)\n\n def action5(scheduler, state):\n connection[0] = ys[0].connect()\n scheduler.schedule_absolute(500, action5)\n\n def action6(scheduler, state):\n connection[0].dispose()\n scheduler.schedule_absolute(800, action6)\n\n scheduler.start()\n results.messages.assert_equal(\n on_next(340, 8),\n on_next(360, 5),\n on_next(370, 6),\n on_next(390, 7),\n on_next(520, 11),\n on_next(560, 20),\n on_error(600, ex))\n xs.subscriptions.assert_equal(subscribe(300, 400), subscribe(500, 600))", "metadata": "root.TestPublish.test_publish_error", "header": "['class', 'TestPublish', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 225 }, { "content": " def test_publish_complete(self):\n connection = [None]\n subscription = [None]\n ys = [None]\n\n scheduler = TestScheduler()\n xs = scheduler.create_hot_observable(\n on_next(110, 7),\n on_next(220, 3),\n on_next(280, 4),\n on_next(290, 1),\n on_next(340, 8),\n on_next(360, 5),\n on_next(370, 6),\n on_next(390, 7),\n on_next(410, 13),\n on_next(430, 2),\n on_next(450, 9),\n on_next(520, 11),\n on_next(560, 20),\n on_completed(600))\n results = scheduler.create_observer()\n\n def action0(scheduler, state):\n ys[0] = xs.publish()\n scheduler.schedule_absolute(created, action0)\n\n def action1(scheduler, state):\n subscription[0] = ys[0].subscribe(results)\n scheduler.schedule_absolute(subscribed, action1)\n\n def action2(scheduler, state):\n subscription[0].dispose()\n scheduler.schedule_absolute(disposed, action2)\n\n def action3(scheduler, state):\n connection[0] = ys[0].connect()\n scheduler.schedule_absolute(300, action3)\n\n def action4(scheduler, state):\n connection[0].dispose()\n scheduler.schedule_absolute(400, action4)\n\n def action5(scheduler, state):\n connection[0] = ys[0].connect()\n scheduler.schedule_absolute(500, action5)\n\n def action6(scheduler, state):\n connection[0].dispose()\n scheduler.schedule_absolute(800, action6)\n\n scheduler.start()\n results.messages.assert_equal(\n on_next(340, 8),\n on_next(360, 5),\n on_next(370, 6),\n on_next(390, 7),\n on_next(520, 11),\n on_next(560, 20),\n on_completed(600))\n xs.subscriptions.assert_equal(subscribe(300, 400), subscribe(500, 600))", "metadata": "root.TestPublish.test_publish_complete", "header": "['class', 'TestPublish', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 288 }, { "content": " def test_publish_dispose(self):\n connection = [None]\n subscription = [None]\n ys = [None]\n scheduler = TestScheduler()\n xs = scheduler.create_hot_observable(\n on_next(110, 7),\n on_next(220, 3),\n on_next(280, 4),\n on_next(290, 1),\n on_next(340, 8),\n on_next(360, 5),\n on_next(370, 6),\n on_next(390, 7),\n on_next(410, 13),\n on_next(430, 2),\n on_next(450, 9),\n on_next(520, 11),\n on_next(560, 20),\n on_completed(600))\n\n results = scheduler.create_observer()\n\n def action0(scheduler, state):\n ys[0] = xs.publish()\n scheduler.schedule_absolute(created, action0)\n\n def action1(scheduler, state):\n subscription[0] = ys[0].subscribe(results)\n scheduler.schedule_absolute(subscribed, action1)\n\n def action2(scheduler, state):\n subscription[0].dispose()\n scheduler.schedule_absolute(350, action2)\n\n def action3(scheduler, state):\n connection[0] = ys[0].connect()\n scheduler.schedule_absolute(300, action3)\n\n def action4(scheduler, state):\n connection[0].dispose()\n scheduler.schedule_absolute(400, action4)\n\n def action5(scheduler, state):\n connection[0] = ys[0].connect()\n scheduler.schedule_absolute(500, action5)\n\n def action6(scheduler, state):\n connection[0].dispose()\n scheduler.schedule_absolute(550, action6)\n\n def action7(scheduler, state):\n connection[0] = ys[0].connect()\n scheduler.schedule_absolute(650, action7)\n\n def action8(scheduler, state):\n connection[0].dispose()\n scheduler.schedule_absolute(800, action8)\n\n scheduler.start()\n results.messages.assert_equal(on_next(340, 8))\n xs.subscriptions.assert_equal(\n subscribe(300, 400),\n subscribe(500, 550),\n subscribe(650, 800))", "metadata": "root.TestPublish.test_publish_dispose", "header": "['class', 'TestPublish', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 350 }, { "content": " def test_publish_multipleconnections(self):\n xs = Observable.never()\n ys = xs.publish()\n connection1 = ys.connect()\n connection2 = ys.connect()\n assert(connection1 == connection2)\n connection1.dispose()\n connection2.dispose()\n connection3 = ys.connect()\n assert(connection1 != connection3)\n connection3.dispose()", "metadata": "root.TestPublish.test_publish_multipleconnections", "header": "['class', 'TestPublish', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 416 }, { "content": " def test_publish_lambda_zip_complete(self):\n scheduler = TestScheduler()\n xs = scheduler.create_hot_observable(\n on_next(110, 7),\n on_next(220, 3),\n on_next(280, 4),\n on_next(290, 1),\n on_next(340, 8),\n on_next(360, 5),\n on_next(370, 6),\n on_next(390, 7),\n on_next(410, 13),\n on_next(430, 2),\n on_next(450, 9),\n on_next(520, 11),\n on_next(560, 20),\n on_completed(600))\n\n def create():\n def selector(_xs):\n return _xs.zip(_xs.skip(1), lambda prev, cur: cur + prev)\n\n return xs.publish(selector)\n results = scheduler.start(create)\n\n results.messages.assert_equal(\n on_next(280, 7),\n on_next(290, 5),\n on_next(340, 9),\n on_next(360, 13),\n on_next(370, 11),\n on_next(390, 13),\n on_next(410, 20),\n on_next(430, 15),\n on_next(450, 11),\n on_next(520, 20),\n on_next(560, 31),\n on_completed(600))\n xs.subscriptions.assert_equal(subscribe(200, 600))", "metadata": "root.TestPublish.test_publish_lambda_zip_complete", "header": "['class', 'TestPublish', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 428 }, { "content": " def test_publish_lambda_zip_error(self):\n ex = 'ex'\n scheduler = TestScheduler()\n xs = scheduler.create_hot_observable(\n on_next(110, 7),\n on_next(220, 3),\n on_next(280, 4),\n on_next(290, 1),\n on_next(340, 8),\n on_next(360, 5),\n on_next(370, 6),\n on_next(390, 7),\n on_next(410, 13),\n on_next(430, 2),\n on_next(450, 9),\n on_next(520, 11),\n on_next(560, 20),\n on_error(600, ex))\n\n def create():\n def selector(_xs):\n return _xs.zip(_xs.skip(1), lambda prev, cur: cur + prev)\n return xs.publish(selector)\n results = scheduler.start(create)\n\n results.messages.assert_equal(\n on_next(280, 7),\n on_next(290, 5),\n on_next(340, 9),\n on_next(360, 13),\n on_next(370, 11),\n on_next(390, 13),\n on_next(410, 20),\n on_next(430, 15),\n on_next(450, 11),\n on_next(520, 20),\n on_next(560, 31),\n on_error(600, ex))\n xs.subscriptions.assert_equal(subscribe(200, 600))", "metadata": "root.TestPublish.test_publish_lambda_zip_error", "header": "['class', 'TestPublish', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 468 }, { "content": " def test_publish_lambda_zip_dispose(self):\n scheduler = TestScheduler()\n xs = scheduler.create_hot_observable(\n on_next(110, 7),\n on_next(220, 3),\n on_next(280, 4),\n on_next(290, 1),\n on_next(340, 8),\n on_next(360, 5),\n on_next(370, 6),\n on_next(390, 7),\n on_next(410, 13),\n on_next(430, 2),\n on_next(450, 9),\n on_next(520, 11),\n on_next(560, 20),\n on_completed(600))\n\n def create():\n def selector(_xs):\n return _xs.zip(_xs.skip(1), lambda prev, cur: cur + prev)\n return xs.publish(selector)\n\n results = scheduler.start(create, disposed=470)\n results.messages.assert_equal(\n on_next(280, 7),\n on_next(290, 5),\n on_next(340, 9),\n on_next(360, 13),\n on_next(370, 11),\n on_next(390, 13),\n on_next(410, 20),\n on_next(430, 15),\n on_next(450, 11))\n xs.subscriptions.assert_equal(subscribe(200, 470))", "metadata": "root.TestPublish.test_publish_lambda_zip_dispose", "header": "['class', 'TestPublish', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 508 } ]
[ { "span": "from rx.subjects import Subject", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 31 }, { "span": "from rx.testing import TestScheduler, ReactiveTest, is_prime, MockDisposable", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 76 }, { "span": "from rx.disposables import Disposable, SerialDisposable", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 55 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "rx_", "import_", "Observable_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "rx_", "._", "abstract", "observer_", "import_", "Abstract", "Observer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "rx_", "._", "lin", "q_", "._", "connect", "able", "observable_", "import_", "Connect", "able", "Observable_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "rx_", "._", "subjects_", "import_", "Subject_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "rx_", "._", "testing_", "import_", "Test", "Scheduler_", ",_", "React", "ive", "Test_", ",_", "is", "\\u", "prime_", ",_", "Moc", "k", "Dispo", "sab", "le_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "rx_", "._", "dispo", "sab", "les_", "import_", "Dispo", "sab", "le_", ",_", "Ser", "ial", "Dispo", "sab", "le_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "=_", "React", "ive", "Test_", "._", "on", "\\u", "next_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "on", "\\u", "completed_", "=_", "React", "ive", "Test_", "._", "on", "\\u", "completed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "on", "\\u", "error_", "=_", "React", "ive", "Test_", "._", "on", "\\u", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subscribe_", "=_", "React", "ive", "Test_", "._", "subscribe_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subscribed", "_", "=_", "React", "ive", "Test_", "._", "subscribed", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dispose", "d_", "=_", "React", "ive", "Test_", "._", "dispose", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "created_", "=_", "React", "ive", "Test_", "._", "created_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Help", "er", " ", "function", " ", "for", " ", "rais", "ing", " ", "exception", "s", " ", "within", " ", "lambda", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Rx", "Exception_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "raise_", "(_", "ex_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Rx", "Exception_", "(_", "ex_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "My", "Subject_", "(_", "Observable_", ",_", "Abstract", "Observer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "My", "Subject_", "(_", "Observable_", ",_", "Abstract", "Observer_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "subscribe_", "(_", "observer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "subscribe", "\\u", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "observer_", "=_", "observer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Du", "ck_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "this_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "this_", "=_", "this_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dispose", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "this_", "._", "dispose", "d_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Du", "ck_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "super_", "(_", "My", "Subject_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "subscribe_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "dispose", "\\u", "on", "\\u", "map_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "subscribe", "\\u", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dispose", "d_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "My", "Subject_", "(_", "Observable_", ",_", "Abstract", "Observer_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dispose", "\\u", "on_", "(_", "self_", ",_", "value_", ",_", "dispo", "sab", "le_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "dispose", "\\u", "on", "\\u", "map_", "[_", "value_", "]_", "=_", "dispo", "sab", "le_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "My", "Subject_", "(_", "Observable_", ",_", "Abstract", "Observer_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "next_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "observer_", "._", "on", "\\u", "next_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "value_", "in_", "self_", "._", "dispose", "\\u", "on", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "dispose", "\\u", "on", "\\u", "map_", "[_", "value_", "]_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "My", "Subject_", "(_", "Observable_", ",_", "Abstract", "Observer_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "error_", "(_", "self_", ",_", "exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "observer_", "._", "on", "\\u", "error_", "(_", "exception_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "My", "Subject_", "(_", "Observable_", ",_", "Abstract", "Observer_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "completed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "observer_", "._", "on", "\\u", "completed_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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", "Publish", "_", "(_", "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_", "[SEP]_", "class_", "Test", "Publish", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "publi", "sh", "\\u", "cold", "\\u", "zip_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scheduler_", "=_", "Test", "Scheduler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xs_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "40_", ",_", "0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "90_", ",_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "150_", ",_", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "210_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "240_", ",_", "4_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "270_", ",_", "5_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "330_", ",_", "6_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "340_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "completed_", "(_", "390", "_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "create_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "selector_", "(_", "ys_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "result", "\\u", "selector_", "(_", "a_", ",_", "b_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "a_", "+_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ys_", "._", "zip_", "(_", "ys_", ",_", "result", "\\u", "selector_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "xs_", "._", "publish_", "(_", "selector_", "=_", "selector_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "scheduler_", "._", "start_", "(_", "create_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "._", "messages_", "._", "assert", "\\u", "equal_", "(_", "on", "\\u", "next_", "(_", "210_", ",_", "6_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "240_", ",_", "8_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "270_", ",_", "10_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "330_", ",_", "12_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "340_", ",_", "14_", ")_", ",_", "on", "\\u", "completed_", "(_", "390", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xs_", "._", "subscriptions_", "._", "assert", "\\u", "equal_", "(_", "subscribe_", "(_", "200_", ",_", "390", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Publish", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "ref", "\\u", "count", "\\u", "connects", "\\u", "on", "\\u", "first_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scheduler_", "=_", "Test", "Scheduler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xs_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "210_", ",_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "220_", ",_", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "230_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "240_", ",_", "4_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "completed_", "(_", "250_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subject_", "=_", "My", "Subject_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "=_", "Connect", "able", "Observable_", "(_", "xs_", ",_", "subject_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "create_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "conn_", "._", "ref", "\\u", "count_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "scheduler_", "._", "start_", "(_", "create_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "._", "messages_", "._", "assert", "\\u", "equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "210_", ",_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "220_", ",_", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "230_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "240_", ",_", "4_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "completed_", "(_", "250_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "subject_", "._", "dispose", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Publish", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "ref", "\\u", "count", "\\u", "not", "connected_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "disconnected", "_", "=_", "[_", "False_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "factory_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count_", "[_", "0_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "create_", "(_", "obs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "func_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "disconnected", "_", "[_", "0_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Observable_", "._", "create_", "(_", "create_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "xs_", "=_", "Observable_", "._", "defer_", "(_", "factory_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "subject_", "=_", "My", "Subject_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "=_", "Connect", "able", "Observable_", "(_", "xs_", ",_", "subject_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ref", "d_", "=_", "conn_", "._", "ref", "\\u", "count_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dis", "1_", "=_", "ref", "d_", "._", "subscribe_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "count_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "subject_", "._", "subscribe", "\\u", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "not_", "disconnected", "_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dis", "2_", "=_", "ref", "d_", "._", "subscribe_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "count_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "2_", ",_", "subject_", "._", "subscribe", "\\u", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "not_", "disconnected", "_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dis", "1_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "not_", "disconnected", "_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dis", "2_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "disconnected", "_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "disconnected", "_", "[_", "0_", "]_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dis", "3_", "=_", "ref", "d_", "._", "subscribe_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "2_", ",_", "count_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "3_", ",_", "subject_", "._", "subscribe", "\\u", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "not_", "disconnected", "_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dis", "3_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "disconnected", "_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Publish", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "publi", "sh", "\\u", "basic_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scheduler_", "=_", "Test", "Scheduler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xs_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "110_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "220_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "280_", ",_", "4_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "290_", ",_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "340_", ",_", "8_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "360_", ",_", "5_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "370", "_", ",_", "6_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "390", "_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "410", "_", ",_", "13_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "430", "_", ",_", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "450_", ",_", "9_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "520", "_", ",_", "11_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "560", "_", ",_", "20_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "completed_", "(_", "600_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ys_", "=_", "[_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subscription_", "=_", "[_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connection_", "=_", "[_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "scheduler_", "._", "create", "\\u", "observer_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "0_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ys_", "[_", "0_", "]_", "=_", "xs_", "._", "publish_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "created_", ",_", "action", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "1_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subscription_", "[_", "0_", "]_", "=_", "ys_", "[_", "0_", "]_", "._", "subscribe_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "subscribed", "_", ",_", "action", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "2_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subscription_", "[_", "0_", "]_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "dispose", "d_", ",_", "action", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "3_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "[_", "0_", "]_", "=_", "ys_", "[_", "0_", "]_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "300_", ",_", "action", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "4_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "[_", "0_", "]_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "400_", ",_", "action", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "5_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "[_", "0_", "]_", "=_", "ys_", "[_", "0_", "]_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "500_", ",_", "action", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "6_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "[_", "0_", "]_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "550_", ",_", "action", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "7_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "[_", "0_", "]_", "=_", "ys_", "[_", "0_", "]_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "650_", ",_", "action", "7_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "8_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "[_", "0_", "]_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "800_", ",_", "action", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "scheduler_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "messages_", "._", "assert", "\\u", "equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "340_", ",_", "8_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "360_", ",_", "5_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "370", "_", ",_", "6_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "390", "_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "520", "_", ",_", "11_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xs_", "._", "subscriptions_", "._", "assert", "\\u", "equal_", "(_", "subscribe_", "(_", "300_", ",_", "400_", ")_", ",_", "subscribe_", "(_", "500_", ",_", "550_", ")_", ",_", "subscribe_", "(_", "650_", ",_", "800_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Publish", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "publi", "sh", "\\u", "error_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ex_", "=_", "'", "ex", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scheduler_", "=_", "Test", "Scheduler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xs_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "110_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "220_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "280_", ",_", "4_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "290_", ",_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "340_", ",_", "8_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "360_", ",_", "5_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "370", "_", ",_", "6_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "390", "_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "410", "_", ",_", "13_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "430", "_", ",_", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "450_", ",_", "9_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "520", "_", ",_", "11_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "560", "_", ",_", "20_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "error_", "(_", "600_", ",_", "ex_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ys_", "=_", "[_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subscription_", "=_", "[_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connection_", "=_", "[_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "scheduler_", "._", "create", "\\u", "observer_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "0_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ys_", "[_", "0_", "]_", "=_", "xs_", "._", "publish_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "created_", ",_", "action", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "1_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subscription_", "[_", "0_", "]_", "=_", "ys_", "[_", "0_", "]_", "._", "subscribe_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "subscribed", "_", ",_", "action", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "2_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subscription_", "[_", "0_", "]_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "dispose", "d_", ",_", "action", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "3_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "[_", "0_", "]_", "=_", "ys_", "[_", "0_", "]_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "300_", ",_", "action", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "4_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "[_", "0_", "]_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "400_", ",_", "action", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "5_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "[_", "0_", "]_", "=_", "ys_", "[_", "0_", "]_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "500_", ",_", "action", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "6_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "[_", "0_", "]_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "800_", ",_", "action", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "scheduler_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "messages_", "._", "assert", "\\u", "equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "340_", ",_", "8_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "360_", ",_", "5_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "370", "_", ",_", "6_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "390", "_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "520", "_", ",_", "11_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "560", "_", ",_", "20_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "error_", "(_", "600_", ",_", "ex_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xs_", "._", "subscriptions_", "._", "assert", "\\u", "equal_", "(_", "subscribe_", "(_", "300_", ",_", "400_", ")_", ",_", "subscribe_", "(_", "500_", ",_", "600_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Publish", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "publi", "sh", "\\u", "complete_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "=_", "[_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subscription_", "=_", "[_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ys_", "=_", "[_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "scheduler_", "=_", "Test", "Scheduler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xs_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "110_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "220_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "280_", ",_", "4_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "290_", ",_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "340_", ",_", "8_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "360_", ",_", "5_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "370", "_", ",_", "6_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "390", "_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "410", "_", ",_", "13_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "430", "_", ",_", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "450_", ",_", "9_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "520", "_", ",_", "11_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "560", "_", ",_", "20_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "completed_", "(_", "600_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "scheduler_", "._", "create", "\\u", "observer_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "0_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ys_", "[_", "0_", "]_", "=_", "xs_", "._", "publish_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "created_", ",_", "action", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "1_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subscription_", "[_", "0_", "]_", "=_", "ys_", "[_", "0_", "]_", "._", "subscribe_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "subscribed", "_", ",_", "action", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "2_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subscription_", "[_", "0_", "]_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "dispose", "d_", ",_", "action", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "3_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "[_", "0_", "]_", "=_", "ys_", "[_", "0_", "]_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "300_", ",_", "action", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "4_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "[_", "0_", "]_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "400_", ",_", "action", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "5_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "[_", "0_", "]_", "=_", "ys_", "[_", "0_", "]_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "500_", ",_", "action", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "6_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "[_", "0_", "]_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "800_", ",_", "action", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "scheduler_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "messages_", "._", "assert", "\\u", "equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "340_", ",_", "8_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "360_", ",_", "5_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "370", "_", ",_", "6_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "390", "_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "520", "_", ",_", "11_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "560", "_", ",_", "20_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "completed_", "(_", "600_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xs_", "._", "subscriptions_", "._", "assert", "\\u", "equal_", "(_", "subscribe_", "(_", "300_", ",_", "400_", ")_", ",_", "subscribe_", "(_", "500_", ",_", "600_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Publish", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "publi", "sh", "\\u", "dispose", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "=_", "[_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subscription_", "=_", "[_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ys_", "=_", "[_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scheduler_", "=_", "Test", "Scheduler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xs_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "110_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "220_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "280_", ",_", "4_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "290_", ",_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "340_", ",_", "8_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "360_", ",_", "5_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "370", "_", ",_", "6_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "390", "_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "410", "_", ",_", "13_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "430", "_", ",_", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "450_", ",_", "9_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "520", "_", ",_", "11_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "560", "_", ",_", "20_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "completed_", "(_", "600_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "=_", "scheduler_", "._", "create", "\\u", "observer_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "0_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ys_", "[_", "0_", "]_", "=_", "xs_", "._", "publish_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "created_", ",_", "action", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "1_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subscription_", "[_", "0_", "]_", "=_", "ys_", "[_", "0_", "]_", "._", "subscribe_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "subscribed", "_", ",_", "action", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "2_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subscription_", "[_", "0_", "]_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "350_", ",_", "action", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "3_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "[_", "0_", "]_", "=_", "ys_", "[_", "0_", "]_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "300_", ",_", "action", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "4_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "[_", "0_", "]_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "400_", ",_", "action", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "5_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "[_", "0_", "]_", "=_", "ys_", "[_", "0_", "]_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "500_", ",_", "action", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "6_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "[_", "0_", "]_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "550_", ",_", "action", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "7_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "[_", "0_", "]_", "=_", "ys_", "[_", "0_", "]_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "650_", ",_", "action", "7_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action", "8_", "(_", "scheduler_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "[_", "0_", "]_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scheduler_", "._", "schedule", "\\u", "absolute_", "(_", "800_", ",_", "action", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "scheduler_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "messages_", "._", "assert", "\\u", "equal_", "(_", "on", "\\u", "next_", "(_", "340_", ",_", "8_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xs_", "._", "subscriptions_", "._", "assert", "\\u", "equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "subscribe_", "(_", "300_", ",_", "400_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "subscribe_", "(_", "500_", ",_", "550_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "subscribe_", "(_", "650_", ",_", "800_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Publish", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "publi", "sh", "\\u", "multiple", "connections_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xs_", "=_", "Observable_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ys_", "=_", "xs_", "._", "publish_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connecti", "on1", "_", "=_", "ys_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connecti", "on2", "_", "=_", "ys_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "connecti", "on1", "_", "==_", "connecti", "on2", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connecti", "on1", "_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connecti", "on2", "_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connecti", "on", "3_", "=_", "ys_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "connecti", "on1", "_", "!=_", "connecti", "on", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connecti", "on", "3_", "._", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Publish", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "publi", "sh", "\\u", "lambda", "\\u", "zip", "\\u", "complete_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scheduler_", "=_", "Test", "Scheduler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xs_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "110_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "220_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "280_", ",_", "4_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "290_", ",_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "340_", ",_", "8_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "360_", ",_", "5_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "370", "_", ",_", "6_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "390", "_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "410", "_", ",_", "13_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "430", "_", ",_", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "450_", ",_", "9_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "520", "_", ",_", "11_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "560", "_", ",_", "20_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "completed_", "(_", "600_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "create_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "selector_", "(_", "\\u", "xs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u", "xs_", "._", "zip_", "(_", "\\u", "xs_", "._", "skip_", "(_", "1_", ")_", ",_", "lambda_", "prev_", ",_", "cur_", ":_", "cur_", "+_", "prev_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "xs_", "._", "publish_", "(_", "selector_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "scheduler_", "._", "start_", "(_", "create_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "._", "messages_", "._", "assert", "\\u", "equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "280_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "290_", ",_", "5_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "340_", ",_", "9_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "360_", ",_", "13_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "370", "_", ",_", "11_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "390", "_", ",_", "13_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "410", "_", ",_", "20_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "430", "_", ",_", "15_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "450_", ",_", "11_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "520", "_", ",_", "20_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "560", "_", ",_", "31_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "completed_", "(_", "600_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xs_", "._", "subscriptions_", "._", "assert", "\\u", "equal_", "(_", "subscribe_", "(_", "200_", ",_", "600_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Publish", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "publi", "sh", "\\u", "lambda", "\\u", "zip", "\\u", "error_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ex_", "=_", "'", "ex", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scheduler_", "=_", "Test", "Scheduler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xs_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "110_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "220_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "280_", ",_", "4_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "290_", ",_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "340_", ",_", "8_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "360_", ",_", "5_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "370", "_", ",_", "6_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "390", "_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "410", "_", ",_", "13_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "430", "_", ",_", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "450_", ",_", "9_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "520", "_", ",_", "11_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "560", "_", ",_", "20_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "error_", "(_", "600_", ",_", "ex_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "create_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "selector_", "(_", "\\u", "xs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u", "xs_", "._", "zip_", "(_", "\\u", "xs_", "._", "skip_", "(_", "1_", ")_", ",_", "lambda_", "prev_", ",_", "cur_", ":_", "cur_", "+_", "prev_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "xs_", "._", "publish_", "(_", "selector_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "scheduler_", "._", "start_", "(_", "create_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "._", "messages_", "._", "assert", "\\u", "equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "280_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "290_", ",_", "5_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "340_", ",_", "9_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "360_", ",_", "13_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "370", "_", ",_", "11_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "390", "_", ",_", "13_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "410", "_", ",_", "20_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "430", "_", ",_", "15_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "450_", ",_", "11_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "520", "_", ",_", "20_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "560", "_", ",_", "31_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "error_", "(_", "600_", ",_", "ex_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xs_", "._", "subscriptions_", "._", "assert", "\\u", "equal_", "(_", "subscribe_", "(_", "200_", ",_", "600_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Publish", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "publi", "sh", "\\u", "lambda", "\\u", "zip", "\\u", "dispose", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scheduler_", "=_", "Test", "Scheduler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xs_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "110_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "220_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "280_", ",_", "4_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "290_", ",_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "340_", ",_", "8_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "360_", ",_", "5_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "370", "_", ",_", "6_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "390", "_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "410", "_", ",_", "13_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "430", "_", ",_", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "450_", ",_", "9_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "520", "_", ",_", "11_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "560", "_", ",_", "20_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "completed_", "(_", "600_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "create_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "selector_", "(_", "\\u", "xs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u", "xs_", "._", "zip_", "(_", "\\u", "xs_", "._", "skip_", "(_", "1_", ")_", ",_", "lambda_", "prev_", ",_", "cur_", ":_", "cur_", "+_", "prev_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "xs_", "._", "publish_", "(_", "selector_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "scheduler_", "._", "start_", "(_", "create_", ",_", "dispose", "d_", "=_", "470", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "messages_", "._", "assert", "\\u", "equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "280_", ",_", "7_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "290_", ",_", "5_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "340_", ",_", "9_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "360_", ",_", "13_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "370", "_", ",_", "11_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "390", "_", ",_", "13_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "410", "_", ",_", "20_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "430", "_", ",_", "15_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "next_", "(_", "450_", ",_", "11_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xs_", "._", "subscriptions_", "._", "assert", "\\u", "equal_", "(_", "subscribe_", "(_", "200_", ",_", "470", "_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/casehandlers/api.py
[ { "content": "\"\"\"\n\n.. _`openmdao.lib.casehandler.api.py`:\n\nA central place to access all of the OpenMDAO case recorders, case\niterators, and case filters in the standard library.\n\"\"\"\n\nfrom openmdao.lib.casehandlers.caseset import CaseArray, CaseSet, caseiter_to_caseset\n\nfrom openmdao.lib.casehandlers.csvcase import CSVCaseIterator, CSVCaseRecorder\nfrom openmdao.lib.casehandlers.dbcase import DBCaseIterator, DBCaseRecorder, \\\n case_db_to_dict\nfrom openmdao.lib.casehandlers.dumpcase import DumpCaseRecorder\n\nfrom openmdao.lib.casehandlers.jsoncase import JSONCaseRecorder, \\\n BSONCaseRecorder, verify_json\n\nfrom openmdao.lib.casehandlers.listcase import ListCaseRecorder, \\\n ListCaseIterator\n\nfrom openmdao.lib.casehandlers.caseset import CaseArray, CaseSet, \\\n caseiter_to_caseset\n\nfrom openmdao.lib.casehandlers.filters import SequenceCaseFilter, \\\n SliceCaseFilter, ExprCaseFilter\n\nfrom openmdao.lib.casehandlers.query import CaseDataset\n\nfrom openmdao.lib.casehandlers.csv_post_processor import caseset_query_to_csv\nfrom openmdao.lib.casehandlers.dump_post_processor import caseset_query_dump\nfrom openmdao.lib.casehandlers.html_post_processor import caseset_query_to_html\n\ntry:\n from openmdao.lib.casehandlers.query_hdf5 import CaseDatasetHDF5\n from openmdao.lib.casehandlers.hdf5case import HDF5CaseRecorder\nexcept ImportError:\n pass\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from openmdao.lib.casehandlers.caseset import CaseArray, CaseSet, caseiter_to_caseset", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 85 }, { "span": "from openmdao.lib.casehandlers.csvcase import CSVCaseIterator, CSVCaseRecorder", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 78 }, { "span": "from openmdao.lib.casehandlers.dbcase import DBCaseIterator, DBCaseRecorder, \\\n case_db_to_dict", "start_line": 11, "start_column": 0, "end_line": 12, "end_column": 60 }, { "span": "from openmdao.lib.casehandlers.dumpcase import DumpCaseRecorder", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 63 }, { "span": "from openmdao.lib.casehandlers.jsoncase import JSONCaseRecorder, \\\n BSONCaseRecorder, verify_json", "start_line": 15, "start_column": 0, "end_line": 16, "end_column": 76 }, { "span": "from openmdao.lib.casehandlers.listcase import ListCaseRecorder, \\\n ListCaseIterator", "start_line": 18, "start_column": 0, "end_line": 19, "end_column": 63 }, { "span": "from openmdao.lib.casehandlers.caseset import CaseArray, CaseSet, \\\n caseiter_to_caseset", "start_line": 21, "start_column": 0, "end_line": 22, "end_column": 65 }, { "span": "from openmdao.lib.casehandlers.filters import SequenceCaseFilter, \\\n SliceCaseFilter, ExprCaseFilter", "start_line": 24, "start_column": 0, "end_line": 25, "end_column": 77 }, { "span": "from openmdao.lib.casehandlers.query import CaseDataset", "start_line": 27, "start_column": 0, "end_line": 27, "end_column": 55 }, { "span": "from openmdao.lib.casehandlers.csv_post_processor import caseset_query_to_csv", "start_line": 29, "start_column": 0, "end_line": 29, "end_column": 77 }, { "span": "from openmdao.lib.casehandlers.dump_post_processor import caseset_query_dump", "start_line": 30, "start_column": 0, "end_line": 30, "end_column": 76 }, { "span": "from openmdao.lib.casehandlers.html_post_processor import caseset_query_to_html", "start_line": 31, "start_column": 0, "end_line": 31, "end_column": 79 }, { "span": "from openmdao.lib.casehandlers.query_hdf5 import CaseDatasetHDF5", "start_line": 34, "start_column": 4, "end_line": 34, "end_column": 68 }, { "span": "from openmdao.lib.casehandlers.hdf5case import HDF5CaseRecorder", "start_line": 35, "start_column": 4, "end_line": 35, "end_column": 67 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "\\", "10", ";", "..", " ", "\\u`", "openm", "dao", ".", "lib", ".", "case", "handler", ".", "api", ".", "py", "`", ":", "\\", "10", ";", "\\", "10", ";", "A", " ", "central", " ", "place", " ", "to", " ", "access", " ", "all", " ", "of", " ", "the", " ", "Open", "MD", "AO", " ", "case", " ", "recorde", "rs", ",", " ", "case", "\\", "10", ";", "iterators", ",", " ", "and", " ", "case", " ", "filter", "s", " ", "in", " ", "the", " ", "standard", " ", "librar", "y", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "openm", "dao_", "._", "lib_", "._", "case", "handlers_", "._", "case", "set_", "import_", "Case", "Array_", ",_", "Case", "Set_", ",_", "case", "iter", "\\u", "to", "\\u", "case", "set_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "openm", "dao_", "._", "lib_", "._", "case", "handlers_", "._", "csv", "case_", "import_", "CSV", "Case", "Iterator_", ",_", "CSV", "Case", "Recorder", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openm", "dao_", "._", "lib_", "._", "case", "handlers_", "._", "dbc", "ase_", "import_", "DB", "Case", "Iterator_", ",_", "DB", "Case", "Recorder", "_", ",_", "case", "\\u", "db", "\\u", "to", "\\u", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openm", "dao_", "._", "lib_", "._", "case", "handlers_", "._", "dump", "case_", "import_", "Dump", "Case", "Recorder", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "openm", "dao_", "._", "lib_", "._", "case", "handlers_", "._", "json", "case_", "import_", "JSO", "NC", "ase", "Recorder", "_", ",_", "BS", "ON", "Case", "Recorder", "_", ",_", "verify", "\\u", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "openm", "dao_", "._", "lib_", "._", "case", "handlers_", "._", "list", "case_", "import_", "List", "Case", "Recorder", "_", ",_", "List", "Case", "Iterator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "openm", "dao_", "._", "lib_", "._", "case", "handlers_", "._", "case", "set_", "import_", "Case", "Array_", ",_", "Case", "Set_", ",_", "case", "iter", "\\u", "to", "\\u", "case", "set_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "openm", "dao_", "._", "lib_", "._", "case", "handlers_", "._", "filters_", "import_", "Sequ", "ence", "Case", "Filter_", ",_", "Slice", "Case", "Filter_", ",_", "Exp", "r", "Case", "Filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "openm", "dao_", "._", "lib_", "._", "case", "handlers_", "._", "query_", "import_", "Case", "Dataset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "openm", "dao_", "._", "lib_", "._", "case", "handlers_", "._", "csv", "\\u", "post", "\\u", "processor_", "import_", "case", "set\\u", "query", "\\u", "to", "\\u", "csv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openm", "dao_", "._", "lib_", "._", "case", "handlers_", "._", "dump", "\\u", "post", "\\u", "processor_", "import_", "case", "set\\u", "query", "\\u", "dump_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openm", "dao_", "._", "lib_", "._", "case", "handlers_", "._", "html", "\\u", "post", "\\u", "processor_", "import_", "case", "set\\u", "query", "\\u", "to", "\\u", "html_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "openm", "dao_", "._", "lib_", "._", "case", "handlers_", "._", "query", "\\u", "hdf5", "_", "import_", "Case", "Datas", "et", "HDF", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openm", "dao_", "._", "lib_", "._", "case", "handlers_", "._", "hdf5", "case_", "import_", "HDF", "5", "Case", "Recorder", "_", "\\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\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 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, 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, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
mimecuvalo/helloworld/controllers/push.py
[ { "content": "from base import BaseHandler\n\nimport feedparser\nimport tornado.web\n\nfrom logic import content_remote\n\n# monkeypatch\nfeedparser._HTMLSanitizer.acceptable_elements = \\\n feedparser._HTMLSanitizer.acceptable_elements + ['iframe']\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class PushHandler(BaseHandler):\n\n # tornado & python rock\n", "metadata": "root.PushHandler", "header": "['module', '___EOS___']", "index": 11 }, { "content": " def get(self):\n self.write(self.get_argument('hub.challenge'))", "metadata": "root.PushHandler.get", "header": "['class', 'PushHandler', '(', 'BaseHandler', ')', ':', '___EOS___']", "index": 12 }, { "content": " def check_xsrf_cookie(self):\n pass", "metadata": "root.PushHandler.check_xsrf_cookie", "header": "['class', 'PushHandler', '(', 'BaseHandler', ')', ':', '___EOS___']", "index": 16 }, { "content": " def post(self):\n user = self.models.users.get(username=self.breadcrumbs[\"profile\"])[0]\n\n if not user:\n return\n\n feed_doc = feedparser.parse(self.request.body)\n profile_url = feed_doc.feed['link']\n remote_user = self.models.users_remote.get(local_username=user.username,\n profile_url=profile_url)[0]\n\n if not remote_user:\n return\n\n content_remote.parse_feed(self.models, remote_user,\n parsed_feed=self.request.body,\n max_days_old=self.constants['feed_max_days_old'])", "metadata": "root.PushHandler.post", "header": "['class', 'PushHandler', '(', 'BaseHandler', ')', ':', '___EOS___']", "index": 19 } ]
[ { "span": "import tornado.web", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 18 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "base_", "import_", "Base", "Handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "feed", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tornado_", "._", "web_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "logic_", "import_", "content", "\\u", "remote_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "monkeypatch_", "\\u\\u\\uNL\\u\\u\\u_", "feed", "parser_", "._", "\\u", "HTM", "LS", "ani", "tize", "r_", "._", "acceptabl", "e\\u", "elements_", "=_", "feed", "parser_", "._", "\\u", "HTM", "LS", "ani", "tize", "r_", "._", "acceptabl", "e\\u", "elements_", "+_", "[_", "'", "iframe", "'_", "]_", "\\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_", "Push", "Handler_", "(_", "Base", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "torn", "ado", " ", "&", " ", "python", " ", "rock", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Push", "Handler_", "(_", "Base", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "write_", "(_", "self_", "._", "get", "\\u", "argument_", "(_", "'", "hub", ".", "chall", "enge", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Push", "Handler_", "(_", "Base", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "xsrf", "\\u", "cookie_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Push", "Handler_", "(_", "Base", "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 ", " _", "user_", "=_", "self_", "._", "models_", "._", "users_", "._", "get_", "(_", "username_", "=_", "self_", "._", "breadcrumb", "s_", "[_", "\"", "profile", "\"_", "]_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "user_", ":_", "\\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_", "feed", "\\u", "doc_", "=_", "feed", "parser_", "._", "parse_", "(_", "self_", "._", "request_", "._", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "profile", "\\u", "url_", "=_", "feed", "\\u", "doc_", "._", "feed_", "[_", "'", "link", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "remote", "\\u", "user_", "=_", "self_", "._", "models_", "._", "users", "\\u", "remote_", "._", "get_", "(_", "local", "\\u", "username_", "=_", "user_", "._", "username_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "profile", "\\u", "url_", "=_", "profile", "\\u", "url_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "remote", "\\u", "user_", ":_", "\\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_", "content", "\\u", "remote_", "._", "parse", "\\u", "feed_", "(_", "self_", "._", "models_", ",_", "remote", "\\u", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "parsed", "\\u", "feed_", "=_", "self_", "._", "request_", "._", "body_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "day", "s", "\\u", "old_", "=_", "self_", "._", "constants_", "[_", "'", "feed", "\\u", "max", "\\u", "day", "s", "\\u", "old", "'_", "]_", ")_" ]
[ 4, 4, 4, 4, 4, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
dtmilano/AndroidViewClient/examples/temperature-converter-get-conversion.py
[ { "content": "#! /usr/bin/env python\n'''\nCopyright (C) 2012 Diego Torres Milano\nCreated on Feb 3, 2012\n\nThis example starts the TemperatureConverter activity then type '123' into the 'Celsius' field.\nThen a ViewClient is created to obtain the view dump and the current values of the views with\nid/celsius and id/fahrenheit are obtained and the conversion printed to stdout.\nFinally, the fields are obtained by using their tags and again, conversion printed to stdout.\n\nIf --localViewServer is passed in the command line then LocalViewServer provided by\nTemperatureConverter is used. This is very useful when the device is secure and ViewServer\ncannot be started.\n\n@author: diego\n'''\n\n\nimport re\nimport sys\nimport os\nimport time\n\n# PyDev sets PYTHONPATH, use it\ntry:\n for p in os.environ['PYTHONPATH'].split(':'):\n if not p in sys.path:\n sys.path.append(p)\nexcept:\n pass\n\ntry:\n sys.path.append(os.path.join(os.environ['ANDROID_VIEW_CLIENT_HOME'], 'src'))\nexcept:\n pass\n\nfrom com.dtmilano.android.viewclient import ViewClient\n\nlocalViewServer = False\nif len(sys.argv) > 1 and sys.argv[1] == '--localViewServer':\n localViewServer = True\n sys.argv.pop(1)\n\ndevice, serialno = ViewClient.connectToDeviceOrExit(ignoresecuredevice=localViewServer)\n\nFLAG_ACTIVITY_NEW_TASK = 0x10000000\npackage = 'com.example.i2at.tc'\nactivity = '.TemperatureConverterActivity'\ncomponentName = package + \"/\" + activity\n\ndevice.startActivity(component=componentName, flags=FLAG_ACTIVITY_NEW_TASK)\ntime.sleep(5)\n\n\ndevice.type(\"123\")\ntime.sleep(3)\n\nvc = ViewClient(device, serialno, startviewserver=(not localViewServer))\n\nif vc.build['ro.build.version.sdk'] >= 16:\n # obtain the views by contentDescription\n celsius = vc.findViewWithContentDescriptionOrRaise(\"celsius\")\n fahrenheit = vc.findViewWithContentDescriptionOrRaise(\"fahrenheit\")\nelse:\n # obtain the views by id\n celsius = vc.findViewByIdOrRaise(\"id/celsius\")\n fahrenheit = vc.findViewByIdOrRaise(\"id/fahrenheit\")\n\nct = celsius.getText()\nif ct:\n c = float(ct)\nelse:\n print >> sys.stderr, \"Celsius is empty\"\n sys.exit(1)\nft = fahrenheit.getText()\nif ft:\n f = float(ft)\nelse:\n print >> sys.stderr, \"Fahrenheit is empty\"\n sys.exit(1)\nprint \"by id: %.2f C => %.2f F\" % (c, f)\n\n# obtain the views by tag\n#celsius = vc.findViewByTagOrRaise(\"celsius\")\n#fahrenheit = vc.findViewByTagOrRaise(\"fahrenheit\")\n#\n#c = float(celsius.getText())\n#f = float(fahrenheit.getText())\n#print \"by tag: %.2f C => %.2f F\" % (c, f)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import re", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", " ", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "\\", "10", ";", "Copy", "right", " ", "(", "C", ")", " ", "2012", " ", " ", "Die", "go", " ", "Tor", "res", " ", "Mil", "ano", "\\", "10", ";", "Creat", "ed", " ", "on", " ", "Fe", "b", " ", "3", ",", " ", "2012", "\\", "10", ";", "\\", "10", ";", "Thi", "s", " ", "example", " ", "starts", " ", "the", " ", "Tempe", "ratur", "e", "Converte", "r", " ", "activit", "y", " ", "then", " ", "type", " ", "'", "123", "'", " ", "int", "o", " ", "the", " ", "'", "Cel", "sius", "'", " ", "field", ".", "\\", "10", ";", "The", "n", " ", "a", " ", "View", "Client", " ", "is", " ", "created", " ", "to", " ", "obtain", " ", "the", " ", "view", " ", "dump", " ", "and", " ", "the", " ", "current", " ", "values", " ", "of", " ", "the", " ", "views", " ", "with", "\\", "10", ";", "id", "/", "cel", "sius", " ", "and", " ", "id", "/", "fa", "hre", "nhe", "it", " ", "are", " ", "obtain", "ed", " ", "and", " ", "the", " ", "conve", "rsi", "on", " ", "printed", " ", "to", " ", "stdout", ".", "\\", "10", ";", "Final", "ly", ",", " ", "the", " ", "fields", " ", "are", " ", "obtain", "ed", " ", "by", " ", "usi", "ng", " ", "thei", "r", " ", "tags", " ", "and", " ", "again", ",", " ", "conve", "rsi", "on", " ", "printed", " ", "to", " ", "stdout", ".", "\\", "10", ";", "\\", "10", ";", "If", " ", "--", "local", "View", "Server", " ", "is", " ", "pass", "ed", " ", "in", " ", "the", " ", "command", " ", "line", " ", "then", " ", "Local", "View", "Server", " ", "provided", " ", "by", "\\", "10", ";", "Tempe", "ratur", "e", "Converte", "r", " ", "is", " ", "used", ".", " ", "Thi", "s", " ", "is", " ", "very", " ", "usef", "ul", " ", "whe", "n", " ", "the", " ", "device", " ", "is", " ", "secure", " ", "and", " ", "View", "Server", "\\", "10", ";", "cann", "ot", " ", "be", " ", "start", "ed", ".", "\\", "10", ";", "\\", "10", ";", "@", "author", ":", " ", "die", "go", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Py", "Dev", " ", "sets", " ", "PYTHON", "PATH", ",", " ", "use", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "p_", "in_", "os_", "._", "environ_", "[_", "'", "PYTHON", "PATH", "'_", "]_", "._", "split_", "(_", "':'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "p_", "in_", "sys_", "._", "path_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "path_", "._", "append_", "(_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "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 ", " _", "sys_", "._", "path_", "._", "append_", "(_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "environ_", "[_", "'", "ANDROID", "\\u", "VIEW", "\\u", "CLIENT", "\\u", "HOM", "E", "'_", "]_", ",_", "'", "src", "'_", ")_", ")_", "\\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_", "com_", "._", "dtm", "ila", "no_", "._", "android", "_", "._", "view", "client_", "import_", "View", "Client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "local", "View", "Server_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "sys_", "._", "argv_", ")_", ">_", "1_", "and_", "sys_", "._", "argv_", "[_", "1_", "]_", "==_", "'--", "local", "View", "Server", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "View", "Server_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "argv_", "._", "pop_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "device_", ",_", "serial", "no_", "=_", "View", "Client_", "._", "connect", "To", "Dev", "ice", "Or", "Exit_", "(_", "ignores", "ecu", "rede", "vice", "_", "=_", "local", "View", "Server_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "FLAG", "\\u", "ACTIVITY", "\\u", "NEW", "\\u", "TASK", "_", "=_", "0x10000", "000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "package_", "=_", "'", "com", ".", "example", ".", "i2", "at", ".", "tc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "activity_", "=_", "'.", "Tempe", "ratur", "e", "Converte", "r", "Activ", "it", "y", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "component", "Name_", "=_", "package_", "+_", "\"/\"_", "+_", "activity_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "device_", "._", "start", "Activity_", "(_", "component_", "=_", "component", "Name_", ",_", "flags_", "=_", "FLAG", "\\u", "ACTIVITY", "\\u", "NEW", "\\u", "TASK", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "device_", "._", "type_", "(_", "\"", "123", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "vc_", "=_", "View", "Client_", "(_", "device_", ",_", "serial", "no_", ",_", "start", "views", "erver_", "=_", "(_", "not_", "local", "View", "Server_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "vc_", "._", "build_", "[_", "'", "ro", ".", "build", ".", "version", ".", "sd", "k", "'_", "]_", ">=_", "16_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "obtain", " ", "the", " ", "views", " ", "by", " ", "content", "Description_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cel", "sius", "_", "=_", "vc_", "._", "find", "View", "With", "Conten", "t", "Descripti", "on", "Or", "Raise_", "(_", "\"", "cel", "sius", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fa", "hre", "nhe", "it_", "=_", "vc_", "._", "find", "View", "With", "Conten", "t", "Descripti", "on", "Or", "Raise_", "(_", "\"", "fa", "hre", "nhe", "it", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "obtain", " ", "the", " ", "views", " ", "by", " ", "id_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cel", "sius", "_", "=_", "vc_", "._", "find", "View", "By", "Id", "Or", "Raise_", "(_", "\"", "id", "/", "cel", "sius", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fa", "hre", "nhe", "it_", "=_", "vc_", "._", "find", "View", "By", "Id", "Or", "Raise_", "(_", "\"", "id", "/", "fa", "hre", "nhe", "it", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ct_", "=_", "cel", "sius", "_", "._", "get", "Text_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ct_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "float_", "(_", "ct_", ")_", "\\u\\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_", ">>_", "sys_", "._", "stderr_", ",_", "\"", "Cel", "sius", " ", "is", " ", "empty", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ft_", "=_", "fa", "hre", "nhe", "it_", "._", "get", "Text_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ft_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "float_", "(_", "ft_", ")_", "\\u\\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_", ">>_", "sys_", "._", "stderr_", ",_", "\"", "Fa", "hre", "nhe", "it", " ", "is", " ", "empty", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "by", " ", "id", ":", " ", "%", ".2", "f", " ", "C", " ", "=>", " ", "%", ".2", "f", " ", "F", "\"_", "%_", "(_", "c_", ",_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "obtain", " ", "the", " ", "views", " ", "by", " ", "tag_", "\\u\\u\\uNL\\u\\u\\u_", "#", "cel", "sius", " ", "=", " ", "vc", ".", "find", "View", "By", "Ta", "g", "Or", "Rai", "se", "(\"", "cel", "sius", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "fa", "hre", "nhe", "it", " ", "=", " ", "vc", ".", "find", "View", "By", "Ta", "g", "Or", "Rai", "se", "(\"", "fa", "hre", "nhe", "it", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "c", " ", "=", " ", "float", "(", "cel", "sius", ".", "get", "Text", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "f", " ", "=", " ", "float", "(", "fa", "hre", "nhe", "it", ".", "get", "Text", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"", "by", " ", "tag", ":", " ", "%", ".2", "f", " ", "C", " ", "=>", " ", "%", ".2", "f", " ", "F", "\"", " ", "%", " ", "(", "c", ",", " ", "f", ")_", "\\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,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
AppScale/appscale/AppServer/lib/django-1.4/tests/regressiontests/managers_regress/tests.py
[ { "content": " def test_managers(self):\n a1 = Child1.objects.create(name='fred', data='a1')\n a2 = Child1.objects.create(name='barney', data='a2')\n b1 = Child2.objects.create(name='fred', data='b1', value=1)\n b2 = Child2.objects.create(name='barney', data='b2', value=42)\n c1 = Child3.objects.create(name='fred', data='c1', comment='yes')\n c2 = Child3.objects.create(name='barney', data='c2', comment='no')\n d1 = Child4.objects.create(name='fred', data='d1')\n d2 = Child4.objects.create(name='barney', data='d2')\n e1 = Child5.objects.create(name='fred', comment='yes')\n e2 = Child5.objects.create(name='barney', comment='no')\n f1 = Child6.objects.create(name='fred', data='f1', value=42)\n f2 = Child6.objects.create(name='barney', data='f2', value=42)\n g1 = Child7.objects.create(name='fred')\n g2 = Child7.objects.create(name='barney')\n\n self.assertQuerysetEqual(Child1.manager1.all(), [\"<Child1: a1>\"])\n self.assertQuerysetEqual(Child1.manager2.all(), [\"<Child1: a2>\"])\n self.assertQuerysetEqual(Child1._default_manager.all(), [\"<Child1: a1>\"])\n\n self.assertQuerysetEqual(Child2._default_manager.all(), [\"<Child2: b1>\"])\n self.assertQuerysetEqual(Child2.restricted.all(), [\"<Child2: b2>\"])\n\n self.assertQuerysetEqual(Child3._default_manager.all(), [\"<Child3: c1>\"])\n self.assertQuerysetEqual(Child3.manager1.all(), [\"<Child3: c1>\"])\n self.assertQuerysetEqual(Child3.manager2.all(), [\"<Child3: c2>\"])\n\n # Since Child6 inherits from Child4, the corresponding rows from f1 and\n # f2 also appear here. This is the expected result.\n self.assertQuerysetEqual(Child4._default_manager.order_by('data'), [\n \"<Child4: d1>\",\n \"<Child4: d2>\",\n \"<Child4: f1>\",\n \"<Child4: f2>\"\n ]\n )\n self.assertQuerysetEqual(Child4.manager1.all(), [\n \"<Child4: d1>\",\n \"<Child4: f1>\"\n ]\n )\n self.assertQuerysetEqual(Child5._default_manager.all(), [\"<Child5: fred>\"])\n self.assertQuerysetEqual(Child6._default_manager.all(), [\"<Child6: f1>\"])\n self.assertQuerysetEqual(Child7._default_manager.order_by('name'), [\n \"<Child7: barney>\",\n \"<Child7: fred>\"\n ]\n )", "metadata": "root.ManagersRegressionTests.test_managers", "header": "['class', 'ManagersRegressionTests', '(', 'TestCase', ')', ':', '___EOS___']", "index": 8 } ]
[ { "span": "a1 ", "start_line": 9, "start_column": 8, "end_line": 9, "end_column": 10 }, { "span": "a2 ", "start_line": 10, "start_column": 8, "end_line": 10, "end_column": 10 }, { "span": "b1 ", "start_line": 11, "start_column": 8, "end_line": 11, "end_column": 10 }, { "span": "b2 ", "start_line": 12, "start_column": 8, "end_line": 12, "end_column": 10 }, { "span": "c1 ", "start_line": 13, "start_column": 8, "end_line": 13, "end_column": 10 }, { "span": "c2 ", "start_line": 14, "start_column": 8, "end_line": 14, "end_column": 10 }, { "span": "d1 ", "start_line": 15, "start_column": 8, "end_line": 15, "end_column": 10 }, { "span": "d2 ", "start_line": 16, "start_column": 8, "end_line": 16, "end_column": 10 }, { "span": "e1 ", "start_line": 17, "start_column": 8, "end_line": 17, "end_column": 10 }, { "span": "e2 ", "start_line": 18, "start_column": 8, "end_line": 18, "end_column": 10 }, { "span": "f1 ", "start_line": 19, "start_column": 8, "end_line": 19, "end_column": 10 }, { "span": "f2 ", "start_line": 20, "start_column": 8, "end_line": 20, "end_column": 10 }, { "span": "g1 ", "start_line": 21, "start_column": 8, "end_line": 21, "end_column": 10 }, { "span": "g2 ", "start_line": 22, "start_column": 8, "end_line": 22, "end_column": 10 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Manager", "s", "Regr", "ession", "Tests_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "managers_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a1_", "=_", "Chil", "d1_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "fre", "d", "'_", ",_", "data_", "=_", "'", "a1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a2_", "=_", "Chil", "d1_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "bar", "ne", "y", "'_", ",_", "data_", "=_", "'", "a2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b1_", "=_", "Chil", "d2_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "fre", "d", "'_", ",_", "data_", "=_", "'", "b1", "'_", ",_", "value_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b2_", "=_", "Chil", "d2_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "bar", "ne", "y", "'_", ",_", "data_", "=_", "'", "b2", "'_", ",_", "value_", "=_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "=_", "Chil", "d3_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "fre", "d", "'_", ",_", "data_", "=_", "'", "c1", "'_", ",_", "comment_", "=_", "'", "ye", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "Chil", "d3_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "bar", "ne", "y", "'_", ",_", "data_", "=_", "'", "c2", "'_", ",_", "comment_", "=_", "'", "no", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d1_", "=_", "Chil", "d4", "_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "fre", "d", "'_", ",_", "data_", "=_", "'", "d1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d2_", "=_", "Chil", "d4", "_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "bar", "ne", "y", "'_", ",_", "data_", "=_", "'", "d2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e1_", "=_", "Chil", "d5", "_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "fre", "d", "'_", ",_", "comment_", "=_", "'", "ye", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e2_", "=_", "Chil", "d5", "_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "bar", "ne", "y", "'_", ",_", "comment_", "=_", "'", "no", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f1_", "=_", "Chil", "d6", "_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "fre", "d", "'_", ",_", "data_", "=_", "'", "f1", "'_", ",_", "value_", "=_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f2_", "=_", "Chil", "d6", "_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "bar", "ne", "y", "'_", ",_", "data_", "=_", "'", "f2", "'_", ",_", "value_", "=_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g1_", "=_", "Chil", "d7", "_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "fre", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g2_", "=_", "Chil", "d7", "_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "bar", "ne", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "Chil", "d1_", "._", "manage", "r1_", "._", "all_", "(_", ")_", ",_", "[_", "\"<", "Chil", "d1", ":", " ", "a1", ">\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "Chil", "d1_", "._", "manage", "r2_", "._", "all_", "(_", ")_", ",_", "[_", "\"<", "Chil", "d1", ":", " ", "a2", ">\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "Chil", "d1_", "._", "\\u", "default", "\\u", "manager_", "._", "all_", "(_", ")_", ",_", "[_", "\"<", "Chil", "d1", ":", " ", "a1", ">\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "Chil", "d2_", "._", "\\u", "default", "\\u", "manager_", "._", "all_", "(_", ")_", ",_", "[_", "\"<", "Chil", "d2", ":", " ", "b1", ">\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "Chil", "d2_", "._", "restricted_", "._", "all_", "(_", ")_", ",_", "[_", "\"<", "Chil", "d2", ":", " ", "b2", ">\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "Chil", "d3_", "._", "\\u", "default", "\\u", "manager_", "._", "all_", "(_", ")_", ",_", "[_", "\"<", "Chil", "d3", ":", " ", "c1", ">\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "Chil", "d3_", "._", "manage", "r1_", "._", "all_", "(_", ")_", ",_", "[_", "\"<", "Chil", "d3", ":", " ", "c1", ">\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "Chil", "d3_", "._", "manage", "r2_", "._", "all_", "(_", ")_", ",_", "[_", "\"<", "Chil", "d3", ":", " ", "c2", ">\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sin", "ce", " ", "Chil", "d6", " ", "inherits", " ", "from", " ", "Chil", "d4", ",", " ", "the", " ", "correspond", "ing", " ", "rows", " ", "from", " ", "f1", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "f2", " ", "als", "o", " ", "appear", " ", "here", ".", " ", "Thi", "s", " ", "is", " ", "the", " ", "expected", " ", "result", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "Chil", "d4", "_", "._", "\\u", "default", "\\u", "manager_", "._", "order", "\\u", "by_", "(_", "'", "data", "'_", ")_", ",_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\"<", "Chil", "d4", ":", " ", "d1", ">\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"<", "Chil", "d4", ":", " ", "d2", ">\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"<", "Chil", "d4", ":", " ", "f1", ">\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"<", "Chil", "d4", ":", " ", "f2", ">\"_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "Chil", "d4", "_", "._", "manage", "r1_", "._", "all_", "(_", ")_", ",_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\"<", "Chil", "d4", ":", " ", "d1", ">\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"<", "Chil", "d4", ":", " ", "f1", ">\"_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "Chil", "d5", "_", "._", "\\u", "default", "\\u", "manager_", "._", "all_", "(_", ")_", ",_", "[_", "\"<", "Chil", "d5", ":", " ", "fre", "d", ">\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "Chil", "d6", "_", "._", "\\u", "default", "\\u", "manager_", "._", "all_", "(_", ")_", ",_", "[_", "\"<", "Chil", "d6", ":", " ", "f1", ">\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "Chil", "d7", "_", "._", "\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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 ]
Unused import
globocom/database-as-a-service/dbaas/dbaas_services/analyzing/migrations/0001_initial.py
[ { "content": "# -*- coding: utf-8 -*-\nfrom south.utils import datetime_utils as 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 u'analyzing.analyzerepository': {\n 'Meta': {'unique_together': \"(('analyzed_at', 'instance_name'),)\", 'object_name': 'AnalyzeRepository'},\n 'analyzed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),\n 'cpu_alarm': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),\n 'database_name': ('django.db.models.fields.CharField', [], {'max_length': '60'}),\n 'engine_name': ('django.db.models.fields.CharField', [], {'max_length': '20'}),\n 'environment_name': ('django.db.models.fields.CharField', [], {'max_length': '30'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'instance_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'memory_alarm': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})\n }\n }\n\n complete_apps = ['analyzing']", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 7 }, { "content": " def forwards(self, orm):\n # Adding model 'AnalyzeRepository'\n db.create_table(u'analyzing_analyzerepository', (\n (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),\n ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),\n ('updated_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),\n ('analyzed_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),\n ('database_name', self.gf('django.db.models.fields.CharField')(max_length=60)),\n ('instance_name', self.gf('django.db.models.fields.CharField')(max_length=100)),\n ('engine_name', self.gf('django.db.models.fields.CharField')(max_length=20)),\n ('environment_name', self.gf('django.db.models.fields.CharField')(max_length=30)),\n ('cpu_alarm', self.gf('django.db.models.fields.BooleanField')(default=False)),\n ('memory_alarm', self.gf('django.db.models.fields.BooleanField')(default=False)),\n ))\n db.send_create_signal(u'analyzing', ['AnalyzeRepository'])\n\n # Adding unique constraint on 'AnalyzeRepository', fields ['analyzed_at', 'instance_name']\n db.create_unique(u'analyzing_analyzerepository', ['analyzed_at', 'instance_name'])", "metadata": "root.Migration.forwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 9 }, { "content": " def backwards(self, orm):\n # Removing unique constraint on 'AnalyzeRepository', fields ['analyzed_at', 'instance_name']\n db.delete_unique(u'analyzing_analyzerepository', ['analyzed_at', 'instance_name'])\n\n # Deleting model 'AnalyzeRepository'\n db.delete_table(u'analyzing_analyzerepository')", "metadata": "root.Migration.backwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 29 } ]
[ { "span": "from south.utils import datetime_utils as datetime", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 50 }, { "span": "from django.db import models", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 28 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "south_", "._", "utils_", "import_", "datetime", "\\u", "utils_", "as_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "db_", "import_", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "v2_", "import_", "Schema", "Migration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "models_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "analy", "zin", "g", ".", "analyze", "repos", "itor", "y", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "analyze", "d\\u", "at", "',", " ", "'", "instance", "\\u", "name", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Analy", "ze", "Repos", "itor", "y", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "analyze", "d\\u", "at", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "\\u", "add", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cpu", "\\u", "alarm", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "\\u", "at", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "\\u", "add", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "databa", "se", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "60", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "eng", "ine", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "20", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "environ", "ment", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "instance", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "memory", "\\u", "alarm", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", "d\\u", "at", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "complete", "\\u", "apps_", "=_", "[_", "'", "analy", "zin", "g", "'_", "]_", "[SEP]_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "forwards_", "(_", "self_", ",_", "orm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", "ing", " ", "model", " ", "'", "Analy", "ze", "Repos", "itor", "y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "create", "\\u", "table_", "(_", "u", "'", "analy", "zin", "g", "\\u", "analyze", "repos", "itor", "y", "'_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "u", "'", "id", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ")_", "(_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "created", "\\u", "at", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ")_", "(_", "auto", "\\u", "now", "\\u", "add_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "update", "d\\u", "at", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ")_", "(_", "auto", "\\u", "now_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "analyze", "d\\u", "at", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ")_", "(_", "auto", "\\u", "now", "\\u", "add_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "databa", "se", "\\u", "name", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "60_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "instance", "\\u", "name", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "100_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "eng", "ine", "\\u", "name", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "20_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "environ", "ment", "\\u", "name", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "30_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "cpu", "\\u", "alarm", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ")_", "(_", "default_", "=_", "False_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "memory", "\\u", "alarm", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ")_", "(_", "default_", "=_", "False_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "send", "\\u", "create", "\\u", "signal_", "(_", "u", "'", "analy", "zin", "g", "'_", ",_", "[_", "'", "Analy", "ze", "Repos", "itor", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "unique", " ", "constraint", " ", "on", " ", "'", "Analy", "ze", "Repos", "itor", "y", "',", " ", "fields", " ", "['", "analyze", "d\\u", "at", "',", " ", "'", "instance", "\\u", "name", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "create", "\\u", "unique_", "(_", "u", "'", "analy", "zin", "g", "\\u", "analyze", "repos", "itor", "y", "'_", ",_", "[_", "'", "analyze", "d\\u", "at", "'_", ",_", "'", "instance", "\\u", "name", "'_", "]_", ")_", "\\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_", "#", " ", "Remo", "ving", " ", "unique", " ", "constraint", " ", "on", " ", "'", "Analy", "ze", "Repos", "itor", "y", "',", " ", "fields", " ", "['", "analyze", "d\\u", "at", "',", " ", "'", "instance", "\\u", "name", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "delete", "\\u", "unique_", "(_", "u", "'", "analy", "zin", "g", "\\u", "analyze", "repos", "itor", "y", "'_", ",_", "[_", "'", "analyze", "d\\u", "at", "'_", ",_", "'", "instance", "\\u", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "model", " ", "'", "Analy", "ze", "Repos", "itor", "y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "table_", "(_", "u", "'", "analy", "zin", "g", "\\u", "analyze", "repos", "itor", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 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,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True(self.db.set('name', 'charlie'))\n self.assertEqual(self.db.get('name'), 'charlie')\n self.assertIsNone(self.db.get('not-exist'))\n\n self.assertFalse(self.db.setnx('name', 'huey'))\n self.db.setnx('friend', 'zaizee')\n self.assertEqual(self.db['name'], 'charlie')\n self.assertEqual(self.db['friend'], 'zaizee')\n\n self.assertTrue(self.db.mset({'k1': 'v1', 'k2': 'v2'}))\n res = self.db.mget('k1', 'k2')\n self.assertEqual(res, ['v1', 'v2'])\n\n self.db.append('k1', 'xx')\n self.assertEqual(self.db['k1'], 'v1xx')\n\n del self.db['counter']\n self.assertEqual(self.db.incr('counter'), 1)\n self.assertEqual(self.db.incr('counter', 5), 6)\n self.assertEqual(self.db.decr('counter', 2), 4)\n\n self.assertEqual(self.db.getrange('name', 3, 5), 'rli')\n self.assertEqual(self.db.getset('k2', 'baze'), 'v2')\n self.assertEqual(self.db['k2'], 'baze')\n self.assertEqual(self.db.strlen('name'), 7)\n\n self.db['data'] = '\\x07'\n self.assertEqual(self.db.bitcount('data'), 3)\n\n del self.db['name']\n self.assertIsNone(self.db.get('name'))\n self.assertRaises(KeyError, lambda: self.db['name'])\n\n self.assertFalse('name' in self.db)\n self.assertTrue('k1' in self.db)", "metadata": "root.TestHelper.test_simple_string_ops", "header": "['class', 'TestHelper', '(', 'object', ')', ':', '___EOS___']", "index": 6 }, { "content": " def test_simple_hash(self):\n h = self.db.Hash('hash_obj')\n h.clear()\n\n h['k1'] = 'v1'\n h.update({'k2': 'v2', 'k3': 'v3'})\n self.assertEqual(h.as_dict(), {'k1': 'v1', 'k2': 'v2', 'k3': 'v3'})\n\n self.assertEqual(h['k2'], 'v2')\n self.assertIsNone(h['k4'])\n self.assertTrue('k2' in h)\n self.assertFalse('k4' in h)\n\n del h['k2']\n del h['k4']\n self.assertEqual(sorted(h.keys()), ['k1', 'k3'])\n self.assertEqual(sorted(h.values()), ['v1', 'v3'])\n self.assertEqual(len(h), 2)\n\n self.assertEqual(h['k1', 'k2', 'k3'], ['v1', None, 'v3'])\n\n self.assertEqual(h.incr('counter'), 1)\n self.assertEqual(h.incr('counter', 3), 4)", "metadata": "root.TestHelper.test_simple_hash", "header": "['class', 'TestHelper', '(', 'object', ')', ':', '___EOS___']", "index": 43 }, { "content": " def test_simple_set(self):\n s = self.db.Set('set_obj')\n s.clear()\n\n self.assertTrue(s.add('charlie'))\n self.assertFalse(s.add('charlie'))\n s.add('huey', 'mickey')\n self.assertEqual(len(s), 3)\n self.assertTrue('huey' in s)\n self.assertFalse('xx' in s)\n self.assertEqual(s.members(), set(['charlie', 'huey', 'mickey']))\n\n del s['huey']\n del s['xx']\n self.assertEqual(s.members(), set(['charlie', 'mickey']))\n\n n1 = self.db.Set('n1')\n n2 = self.db.Set('n2')\n n1.add(*range(5))\n n2.add(*range(3, 7))\n\n self.assertEqual(n1 - n2, set(['0', '1', '2']))\n self.assertEqual(n2 - n1, set(['5', '6']))\n self.assertEqual(n1 | n2, set(map(str, range(7))))\n self.assertEqual(n1 & n2, set(['3', '4']))\n\n n1.diffstore('ndiff', n2)\n ndiff = self.db.Set('ndiff')\n self.assertEqual(ndiff.members(), set(['0', '1', '2']))\n\n n1.interstore('ninter', n2)\n ninter = self.db.Set('ninter')\n self.assertEqual(ninter.members(), set(['3', '4']))", "metadata": "root.TestHelper.test_simple_set", "header": "['class', 'TestHelper', '(', 'object', ')', ':', '___EOS___']", "index": 93 }, { "content": " def test_zset(self):\n zs = self.db.ZSet('zset_obj')\n zs.clear()\n\n zs.add('charlie', 31, 'huey', 3, 'mickey', 6, 'zaizee', 3, 'nuggie', 0)\n self.assertEqual(zs[1], ['huey'])\n self.assertEqual(zs[1, True], [('huey', 3)])\n\n self.assertEqual(\n zs[:],\n ['nuggie', 'huey', 'zaizee', 'mickey', 'charlie'])\n self.assertEqual(zs[:2], ['nuggie', 'huey'])\n self.assertEqual(zs[1:3, True], [('huey', 3), ('zaizee', 3)])\n self.assertEqual(zs['huey':'charlie'], ['huey', 'zaizee', 'mickey'])\n\n self.assertEqual(len(zs), 5)\n self.assertTrue('charlie' in zs)\n self.assertFalse('xx' in zs)\n\n self.assertEqual(zs.score('charlie'), 31.)\n self.assertIsNone(zs.score('xx'))\n\n self.assertEqual(zs.rank('mickey'), 3)\n self.assertIsNone(zs.rank('xx'))\n\n self.assertEqual(zs.count(0, 5), 3)\n self.assertEqual(zs.count(6, 31), 2)\n self.assertEqual(zs.count(6, 30), 1)\n\n zs.incr('mickey')\n self.assertEqual(zs.score('mickey'), 7.)\n\n self.assertEqual(zs.range_by_score(0, 5), ['nuggie', 'huey', 'zaizee'])\n\n zs.remove('nuggie')\n self.assertEqual(zs[:2], ['huey', 'zaizee'])\n\n del zs['mickey']\n self.assertEqual(zs[:], ['huey', 'zaizee', 'charlie'])\n self.assertEqual(len(zs), 3)\n\n zs.remove_by_score(2, 4)\n self.assertEqual(zs[:], ['charlie'])\n\n zs.add('huey', 4, 'zaizee', 3, 'beanie', 8)\n zs.remove_by_rank(2)\n self.assertEqual(zs[:], ['zaizee', 'huey', 'charlie'])\n\n self.assertRaises(KeyError, lambda: zs['xx':])\n\n z1 = self.db.ZSet('z1')\n z2 = self.db.ZSet('z2')\n z1.add(1, 1, 2, 2, 3, 3)\n z2.add(3, 3, 4, 4, 5, 5)\n z3 = z1.unionstore('z3', z2)\n self.assertEqual(z3[:], ['1', '2', '4', '5', '3'])\n\n z3 = z1.interstore('z3', z2)\n self.assertEqual(z3[:], ['3'])", "metadata": "root.TestHelper.test_zset", "header": "['class', 'TestHelper', '(', 'object', ')', ':', '___EOS___']", "index": 127 } ]
[ { "span": "self.assertFalse('name' in self.db)", "start_line": 40, "start_column": 8, "end_line": 40, "end_column": 43 }, { "span": "self.assertTrue('k1' in self.db)", "start_line": 41, "start_column": 8, "end_line": 41, "end_column": 40 }, { "span": "self.assertTrue('k2' in h)", "start_line": 53, "start_column": 8, "end_line": 53, "end_column": 34 }, { "span": "self.assertFalse('k4' in h)", "start_line": 54, "start_column": 8, "end_line": 54, "end_column": 35 }, { "span": "self.assertTrue('huey' in s)", "start_line": 101, "start_column": 8, "end_line": 101, "end_column": 36 }, { "span": "self.assertFalse('xx' in s)", "start_line": 102, "start_column": 8, "end_line": 102, "end_column": 35 }, { "span": "self.assertTrue('charlie' in zs)", "start_line": 143, "start_column": 8, "end_line": 143, "end_column": 40 }, { "span": "self.assertFalse('xx' in zs)", "start_line": 144, "start_column": 8, "end_line": 144, "end_column": 36 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Helper_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "simple", "\\u", "string", "\\u", "ops_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "self_", "._", "db_", "._", "set_", "(_", "'", "name", "'_", ",_", "'", "charl", "ie", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "db_", "._", "get_", "(_", "'", "name", "'_", ")_", ",_", "'", "charl", "ie", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "self_", "._", "db_", "._", "get_", "(_", "'", "not", "-", "exist", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "self_", "._", "db_", "._", "setn", "x_", "(_", "'", "name", "'_", ",_", "'", "hue", "y", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db_", "._", "setn", "x_", "(_", "'", "frie", "nd", "'_", ",_", "'", "za", "ize", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "db_", "[_", "'", "name", "'_", "]_", ",_", "'", "charl", "ie", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "db_", "[_", "'", "frie", "nd", "'_", "]_", ",_", "'", "za", "ize", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "db_", "._", "mse", "t_", "(_", "{_", "'", "k", "1", "'_", ":_", "'", "v1", "'_", ",_", "'", "k2", "'_", ":_", "'", "v2", "'_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "self_", "._", "db_", "._", "mg", "et_", "(_", "'", "k", "1", "'_", ",_", "'", "k2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "res_", ",_", "[_", "'", "v1", "'_", ",_", "'", "v2", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db_", "._", "append_", "(_", "'", "k", "1", "'_", ",_", "'", "xx", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "db_", "[_", "'", "k", "1", "'_", "]_", ",_", "'", "v1", "xx", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "del_", "self_", "._", "db_", "[_", "'", "counter", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "db_", "._", "incr_", "(_", "'", "counter", "'_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "db_", "._", "incr_", "(_", "'", "counter", "'_", ",_", "5_", ")_", ",_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "db_", "._", "dec", "r_", "(_", "'", "counter", "'_", ",_", "2_", ")_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "db_", "._", "getra", "nge_", "(_", "'", "name", "'_", ",_", "3_", ",_", "5_", ")_", ",_", "'", "rli", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "db_", "._", "gets", "et_", "(_", "'", "k2", "'_", ",_", "'", "ba", "ze", "'_", ")_", ",_", "'", "v2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "db_", "[_", "'", "k2", "'_", "]_", ",_", "'", "ba", "ze", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "db_", "._", "strl", "en_", "(_", "'", "name", "'_", ")_", ",_", "7_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db_", "[_", "'", "data", "'_", "]_", "=_", "'\\\\", "x0", "7", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "db_", "._", "bit", "count_", "(_", "'", "data", "'_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "del_", "self_", "._", "db_", "[_", "'", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "self_", "._", "db_", "._", "get_", "(_", "'", "name", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Key", "Error_", ",_", "lambda_", ":_", "self_", "._", "db_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "name", "'_", "in_", "self_", "._", "db_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "k", "1", "'_", "in_", "self_", "._", "db_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Helper_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "simple", "\\u", "hash_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h_", "=_", "self_", "._", "db_", "._", "Hash_", "(_", "'", "hash", "\\u", "obj", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "h_", "[_", "'", "k", "1", "'_", "]_", "=_", "'", "v1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "update_", "(_", "{_", "'", "k2", "'_", ":_", "'", "v2", "'_", ",_", "'", "k3", "'_", ":_", "'", "v", "3", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "h_", "._", "as", "\\u", "dict_", "(_", ")_", ",_", "{_", "'", "k", "1", "'_", ":_", "'", "v1", "'_", ",_", "'", "k2", "'_", ":_", "'", "v2", "'_", ",_", "'", "k3", "'_", ":_", "'", "v", "3", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "h_", "[_", "'", "k2", "'_", "]_", ",_", "'", "v2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "h_", "[_", "'", "k", "4", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "k2", "'_", "in_", "h_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "k", "4", "'_", "in_", "h_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "del_", "h_", "[_", "'", "k2", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "h_", "[_", "'", "k", "4", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "sorted_", "(_", "h_", "._", "keys_", "(_", ")_", ")_", ",_", "[_", "'", "k", "1", "'_", ",_", "'", "k3", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "sorted_", "(_", "h_", "._", "values_", "(_", ")_", ")_", ",_", "[_", "'", "v1", "'_", ",_", "'", "v", "3", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "h_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "h_", "[_", "'", "k", "1", "'_", ",_", "'", "k2", "'_", ",_", "'", "k3", "'_", "]_", ",_", "[_", "'", "v1", "'_", ",_", "None_", ",_", "'", "v", "3", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "h_", "._", "incr_", "(_", "'", "counter", "'_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "h_", "._", "incr_", "(_", "'", "counter", "'_", ",_", "3_", ")_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Helper_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "simple", "\\u", "set_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "self_", "._", "db_", "._", "Set_", "(_", "'", "set\\u", "obj", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "s_", "._", "add_", "(_", "'", "charl", "ie", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "s_", "._", "add_", "(_", "'", "charl", "ie", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "add_", "(_", "'", "hue", "y", "'_", ",_", "'", "mic", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "s_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "hue", "y", "'_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "xx", "'_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "._", "members_", "(_", ")_", ",_", "set_", "(_", "[_", "'", "charl", "ie", "'_", ",_", "'", "hue", "y", "'_", ",_", "'", "mic", "key", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "del_", "s_", "[_", "'", "hue", "y", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "s_", "[_", "'", "xx", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "._", "members_", "(_", ")_", ",_", "set_", "(_", "[_", "'", "charl", "ie", "'_", ",_", "'", "mic", "key", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "n1_", "=_", "self_", "._", "db_", "._", "Set_", "(_", "'", "n1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n2_", "=_", "self_", "._", "db_", "._", "Set_", "(_", "'", "n2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n1_", "._", "add_", "(_", "*_", "range_", "(_", "5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n2_", "._", "add_", "(_", "*_", "range_", "(_", "3_", ",_", "7_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "n1_", "-_", "n2_", ",_", "set_", "(_", "[_", "'", "0", "'_", ",_", "'", "1", "'_", ",_", "'", "2", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "n2_", "-_", "n1_", ",_", "set_", "(_", "[_", "'", "5", "'_", ",_", "'", "6", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "n1_", "|_", "n2_", ",_", "set_", "(_", "map_", "(_", "str_", ",_", "range_", "(_", "7_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "n1_", "&_", "n2_", ",_", "set_", "(_", "[_", "'", "3", "'_", ",_", "'", "4", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "n1_", "._", "diffs", "tore_", "(_", "'", "ndi", "ff", "'_", ",_", "n2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ndi", "ff_", "=_", "self_", "._", "db_", "._", "Set_", "(_", "'", "ndi", "ff", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "ndi", "ff_", "._", "members_", "(_", ")_", ",_", "set_", "(_", "[_", "'", "0", "'_", ",_", "'", "1", "'_", ",_", "'", "2", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "n1_", "._", "inters", "tore_", "(_", "'", "nin", "ter", "'_", ",_", "n2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nin", "ter_", "=_", "self_", "._", "db_", "._", "Set_", "(_", "'", "nin", "ter", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "nin", "ter_", "._", "members_", "(_", ")_", ",_", "set_", "(_", "[_", "'", "3", "'_", ",_", "'", "4", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Helper_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "zs", "et_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "zs_", "=_", "self_", "._", "db_", "._", "ZS", "et_", "(_", "'", "zs", "et", "\\u", "obj", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zs_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "zs_", "._", "add_", "(_", "'", "charl", "ie", "'_", ",_", "31_", ",_", "'", "hue", "y", "'_", ",_", "3_", ",_", "'", "mic", "key", "'_", ",_", "6_", ",_", "'", "za", "ize", "e", "'_", ",_", "3_", ",_", "'", "nu", "ggi", "e", "'_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zs_", "[_", "1_", "]_", ",_", "[_", "'", "hue", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zs_", "[_", "1_", ",_", "True_", "]_", ",_", "[_", "(_", "'", "hue", "y", "'_", ",_", "3_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "zs_", "[_", ":_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "nu", "ggi", "e", "'_", ",_", "'", "hue", "y", "'_", ",_", "'", "za", "ize", "e", "'_", ",_", "'", "mic", "key", "'_", ",_", "'", "charl", "ie", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zs_", "[_", ":_", "2_", "]_", ",_", "[_", "'", "nu", "ggi", "e", "'_", ",_", "'", "hue", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zs_", "[_", "1_", ":_", "3_", ",_", "True_", "]_", ",_", "[_", "(_", "'", "hue", "y", "'_", ",_", "3_", ")_", ",_", "(_", "'", "za", "ize", "e", "'_", ",_", "3_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zs_", "[_", "'", "hue", "y", "'_", ":_", "'", "charl", "ie", "'_", "]_", ",_", "[_", "'", "hue", "y", "'_", ",_", "'", "za", "ize", "e", "'_", ",_", "'", "mic", "key", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "zs_", ")_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "charl", "ie", "'_", "in_", "zs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "xx", "'_", "in_", "zs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zs_", "._", "score_", "(_", "'", "charl", "ie", "'_", ")_", ",_", "31.", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "zs_", "._", "score_", "(_", "'", "xx", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zs_", "._", "rank_", "(_", "'", "mic", "key", "'_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "zs_", "._", "rank_", "(_", "'", "xx", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zs_", "._", "count_", "(_", "0_", ",_", "5_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zs_", "._", "count_", "(_", "6_", ",_", "31_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zs_", "._", "count_", "(_", "6_", ",_", "30_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "zs_", "._", "incr_", "(_", "'", "mic", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zs_", "._", "score_", "(_", "'", "mic", "key", "'_", ")_", ",_", "7._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zs_", "._", "range", "\\u", "by", "\\u", "score_", "(_", "0_", ",_", "5_", ")_", ",_", "[_", "'", "nu", "ggi", "e", "'_", ",_", "'", "hue", "y", "'_", ",_", "'", "za", "ize", "e", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "zs_", "._", "remove_", "(_", "'", "nu", "ggi", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zs_", "[_", ":_", "2_", "]_", ",_", "[_", "'", "hue", "y", "'_", ",_", "'", "za", "ize", "e", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "del_", "zs_", "[_", "'", "mic", "key", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zs_", "[_", ":_", "]_", ",_", "[_", "'", "hue", "y", "'_", ",_", "'", "za", "ize", "e", "'_", ",_", "'", "charl", "ie", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "zs_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "zs_", "._", "remove", "\\u", "by", "\\u", "score_", "(_", "2_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zs_", "[_", ":_", "]_", ",_", "[_", "'", "charl", "ie", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "zs_", "._", "add_", "(_", "'", "hue", "y", "'_", ",_", "4_", ",_", "'", "za", "ize", "e", "'_", ",_", "3_", ",_", "'", "bean", "ie", "'_", ",_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zs_", "._", "remove", "\\u", "by", "\\u", "rank_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zs_", "[_", ":_", "]_", ",_", "[_", "'", "za", "ize", "e", "'_", ",_", "'", "hue", "y", "'_", ",_", "'", "charl", "ie", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Key", "Error_", ",_", "lambda_", ":_", "zs_", "[_", "'", "xx", "'_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "z1_", "=_", "self_", "._", "db_", "._", "ZS", "et_", "(_", "'", "z", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z2_", "=_", "self_", "._", "db_", "._", "ZS", "et_", "(_", "'", "z", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z1_", "._", "add_", "(_", "1_", ",_", "1_", ",_", "2_", ",_", "2_", ",_", "3_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z2_", "._", "add_", "(_", "3_", ",_", "3_", ",_", "4_", ",_", "4_", ",_", "5_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z3", "_", "=_", "z1_", "._", "uni", "ons", "tore_", "(_", "'", "z3", "'_", ",_", "z2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "z3", "_", "[_", ":_", "]_", ",_", "[_", "'", "1", "'_", ",_", "'", "2", "'_", ",_", "'", "4", "'_", ",_", "'", "5", "'_", ",_", "'", "3", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "z3", "_", "=_", "z1_", "._", "inters", "tore_", "(_", "'", "z3", "'_", ",_", "z2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "z3", "_", "[_", ":_", "]_", ",_", "[_", "'", "3", "'_", "]_", ")_", "\\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,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
EasyCTF/easyctf-2015/api/api/__init__.py
[ { "content": "import api.annotations\nimport api.auth\nimport api.cache\nimport api.common\nimport api.findteam\nimport api.group\nimport api.password_recovery\nimport api.problem\nimport api.programming\nimport api.schemas\nimport api.scoreboard\nimport api.stats\nimport api.team\nimport api.updates\nimport api.user\n\nimport api.config", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import api.annotations", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 22 }, { "span": "import api.auth", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 15 }, { "span": "import api.cache", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 16 }, { "span": "import api.common", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 17 }, { "span": "import api.findteam", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 19 }, { "span": "import api.group", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 16 }, { "span": "import api.password_recovery", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 28 }, { "span": "import api.problem", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 18 }, { "span": "import api.programming", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 22 }, { "span": "import api.schemas", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 18 }, { "span": "import api.scoreboard", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 21 }, { "span": "import api.stats", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 16 }, { "span": "import api.team", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 15 }, { "span": "import api.updates", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 18 }, { "span": "import api.user", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 15 }, { "span": "import api.config", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 17 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "api_", "._", "annotations_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "api_", "._", "auth_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "api_", "._", "cache_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "api_", "._", "common_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "api_", "._", "find", "team_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "api_", "._", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "api_", "._", "password", "\\u", "recover", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "api_", "._", "problem_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "api_", "._", "program", "ming", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "api_", "._", "schemas_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "api_", "._", "score", "board_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "api_", "._", "stats_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "api_", "._", "team_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "api_", "._", "updates_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "api_", "._", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "api_", "._", "config_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 2, 0, 1, 1, 1 ]
Except block handles 'BaseException'
StackStorm/st2/st2common/st2common/rbac/migrations.py
[ { "content": "def delete_mistyped_role():\n \"\"\"\n Delete \" system_admin\" role which was fat fingered.\n \"\"\"\n # Note: Space is significant here since we want to remove a bad role\n role_name = ' system_admin'\n assert(role_name.startswith(' '))\n\n try:\n role_db = Role.get_by_name(role_name)\n except:\n return\n\n if not role_db:\n return\n\n try:\n Role.delete(role_db)\n except:\n return", "metadata": "root.delete_mistyped_role", "header": "['module', '___EOS___']", "index": 53 } ]
[ { "span": "except:", "start_line": 63, "start_column": 4, "end_line": 63, "end_column": 11 }, { "span": "except:", "start_line": 71, "start_column": 4, "end_line": 71, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "mist", "ype", "d\\u", "role_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Delete", " ", "\"", " ", "system", "\\u", "admin", "\"", " ", "role", " ", "whi", "ch", " ", "was", " ", "fat", " ", "finger", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", "e", ":", " ", "Spac", "e", " ", "is", " ", "significant", " ", "here", " ", "sinc", "e", " ", "we", " ", "want", " ", "to", " ", "remove", " ", "a", " ", "bad", " ", "role_", "\\u\\u\\uNL\\u\\u\\u_", "role", "\\u", "name_", "=_", "'", " ", "system", "\\u", "admin", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "role", "\\u", "name_", "._", "startswith_", "(_", "'", " ", "'_", ")_", ")_", "\\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 ", " _", "role", "\\u", "db_", "=_", "Role_", "._", "get", "\\u", "by", "\\u", "name_", "(_", "role", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "role", "\\u", "db_", ":_", "\\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_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Role_", "._", "delete_", "(_", "role", "\\u", "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 ", " _", "return_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 1, 2, 2, 2, 2 ]
Redundant assignment
XiaoMi/minos/supervisor/superlance/tests/httpok_test.py
[ { "content": " def _makeOnePopulated(self, programs, any, response=None, exc=None,\n gcore=None, coredir=None, eager=True):\n if response is None:\n response = DummyResponse()\n rpc = DummyRPCServer()\n sendmail = 'cat - > /dev/null'\n email = 'chrism@plope.com'\n url = 'http://foo/bar'\n timeout = 10\n status = '200'\n inbody = None\n gcore = gcore\n coredir = coredir\n prog = self._makeOne(rpc, programs, any, url, timeout, status,\n inbody, email, sendmail, coredir, gcore, eager)\n prog.stdin = StringIO()\n prog.stdout = StringIO()\n prog.stderr = StringIO()\n prog.connclass = make_connection(response, exc=exc)\n return prog", "metadata": "root.HTTPOkTests._makeOnePopulated", "header": "['class', 'HTTPOkTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 58 } ]
[ { "span": "gcore = gcore", "start_line": 69, "start_column": 8, "end_line": 69, "end_column": 21 }, { "span": "coredir = coredir", "start_line": 70, "start_column": 8, "end_line": 70, "end_column": 25 } ]
[]
1
true
[ "[CLS]_", "Redu", "ndan", "t_", "assignment_", "[SEP]_", "class_", "HTTP", "Ok", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "make", "One", "Populate", "d_", "(_", "self_", ",_", "programs_", ",_", "any_", ",_", "response_", "=_", "None_", ",_", "exc_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "gco", "re_", "=_", "None_", ",_", "core", "dir_", "=_", "None_", ",_", "eager_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "response_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "Du", "mm", "y", "Response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rpc_", "=_", "Du", "mm", "y", "RP", "CS", "erver_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sendmail_", "=_", "'", "cat", " ", "-", " ", ">", " ", "/", "dev", "/", "null", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "email_", "=_", "'", "chris", "m", "@", "plo", "pe", ".", "com", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "'", "http", "://", "foo", "/", "bar", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timeout_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "'", "200", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inb", "ody", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gco", "re_", "=_", "gco", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "core", "dir_", "=_", "core", "dir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prog_", "=_", "self_", "._", "\\u", "make", "One_", "(_", "rpc_", ",_", "programs_", ",_", "any_", ",_", "url_", ",_", "timeout_", ",_", "status_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "inb", "ody", "_", ",_", "email_", ",_", "sendmail_", ",_", "core", "dir_", ",_", "gco", "re_", ",_", "eager_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prog_", "._", "stdin_", "=_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prog_", "._", "stdout_", "=_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prog_", "._", "stderr_", "=_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prog_", "._", "conn", "class_", "=_", "make", "\\u", "connection_", "(_", "response_", ",_", "exc_", "=_", "exc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "prog_", "\\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, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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'
enthought/traitsui/traitsui/undo.py
[ { "content": " def undo ( self ):\n \"\"\" Undoes the change.\n \"\"\"\n try:\n setattr( self.object, self.name, self.old_value )\n except:\n pass", "metadata": "root.UndoItem.undo", "header": "['class', 'UndoItem', '(', 'AbstractUndoItem', ')', ':', '___EOS___']", "index": 117 }, { "content": " def redo ( self ):\n \"\"\" Re-does the change.\n \"\"\"\n try:\n setattr( self.object, self.name, self.new_value )\n except:\n pass", "metadata": "root.UndoItem.redo", "header": "['class', 'UndoItem', '(', 'AbstractUndoItem', ')', ':', '___EOS___']", "index": 129 }, { "content": " def merge_undo ( self, undo_item ):\n \"\"\" Merges two undo items if possible.\n \"\"\"\n # Undo items are potentially mergeable only if they are of the same\n # class and refer to the same object trait, so check that first:\n if (isinstance( undo_item, self.__class__ ) and\n (self.object is undo_item.object) and\n (self.name == undo_item.name)):\n v1 = self.new_value\n v2 = undo_item.new_value\n t1 = type( v1 )\n if t1 is type( v2 ):\n\n if isinstance(t1, basestring):\n # Merge two undo items if they have new values which are\n # strings which only differ by one character (corresponding\n # to a single character insertion, deletion or replacement\n # operation in a text editor):\n n1 = len( v1 )\n n2 = len( v2 )\n n = min( n1, n2 )\n i = 0\n while (i < n) and (v1[i] == v2[i]):\n i += 1\n if v1[i + (n2 <= n1):] == v2[i + (n2 >= n1):]:\n self.new_value = v2\n return True\n\n elif isinstance(v1, collections.Sequence):\n # Merge sequence types only if a single element has changed\n # from the 'original' value, and the element type is a\n # simple Python type:\n v1 = self.old_value\n if isinstance(v1, collections.Sequence):\n # Note: wxColour says it's a sequence type, but it\n # doesn't support 'len', so we handle the exception\n # just in case other classes have similar behavior:\n try:\n if len( v1 ) == len( v2 ):\n diffs = 0\n for i, item in enumerate( v1 ):\n titem = type( item )\n item2 = v2[i]\n if ((titem not in SimpleTypes) or\n (titem is not type( item2 )) or\n (item != item2)):\n diffs += 1\n if diffs >= 2:\n return False\n if diffs == 0:\n return False\n self.new_value = v2\n return True\n except:\n pass\n\n elif t1 in NumericTypes:\n # Always merge simple numeric trait changes:\n self.new_value = v2\n return True\n return False", "metadata": "root.UndoItem.merge_undo", "header": "['class', 'UndoItem', '(', 'AbstractUndoItem', ')', ':', '___EOS___']", "index": 141 }, { "content": " def undo ( self ):\n \"\"\" Undoes the change.\n \"\"\"\n try:\n list = getattr( self.object, self.name )\n list[ self.index: (self.index + len( self.added )) ] = self.removed\n except:\n pass", "metadata": "root.ListUndoItem.undo", "header": "['class', 'ListUndoItem', '(', 'AbstractUndoItem', ')', ':', '___EOS___']", "index": 241 }, { "content": " def redo ( self ):\n \"\"\" Re-does the change.\n \"\"\"\n try:\n list = getattr( self.object, self.name )\n list[ self.index: (self.index + len( self.removed )) ] = self.added\n except:\n pass", "metadata": "root.ListUndoItem.redo", "header": "['class', 'ListUndoItem', '(', 'AbstractUndoItem', ')', ':', '___EOS___']", "index": 254 } ]
[ { "span": "except:", "start_line": 122, "start_column": 8, "end_line": 122, "end_column": 15 }, { "span": "except:", "start_line": 134, "start_column": 8, "end_line": 134, "end_column": 15 }, { "span": "except:", "start_line": 194, "start_column": 24, "end_line": 194, "end_column": 31 }, { "span": "except:", "start_line": 247, "start_column": 8, "end_line": 247, "end_column": 15 }, { "span": "except:", "start_line": 260, "start_column": 8, "end_line": 260, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Und", "o", "Item_", "(_", "Abstract", "Und", "o", "Item_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "undo_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Und", "oes", " ", "the", " ", "change", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "self_", "._", "object_", ",_", "self_", "._", "name_", ",_", "self_", "._", "old", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Und", "o", "Item_", "(_", "Abstract", "Und", "o", "Item_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "redo", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Re", "-", "doe", "s", " ", "the", " ", "change", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "self_", "._", "object_", ",_", "self_", "._", "name_", ",_", "self_", "._", "new", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Und", "o", "Item_", "(_", "Abstract", "Und", "o", "Item_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "merge", "\\u", "undo_", "(_", "self_", ",_", "undo", "\\u", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Merge", "s", " ", "two", " ", "undo", " ", "items", " ", "if", " ", "possib", "le", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Und", "o", " ", "items", " ", "are", " ", "potenti", "ally", " ", "merge", "able", " ", "only", " ", "if", " ", "the", "y", " ", "are", " ", "of", " ", "the", " ", "same_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "and", " ", "refer", " ", "to", " ", "the", " ", "same", " ", "object", " ", "tra", "it", ",", " ", "so", " ", "check", " ", "tha", "t", " ", "first", ":_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "isinstance_", "(_", "undo", "\\u", "item_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "object_", "is_", "undo", "\\u", "item_", "._", "object_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "name_", "==_", "undo", "\\u", "item_", "._", "name_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v1_", "=_", "self_", "._", "new", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v2_", "=_", "undo", "\\u", "item_", "._", "new", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t1_", "=_", "type_", "(_", "v1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "t1_", "is_", "type_", "(_", "v2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "t1_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Merge", " ", "two", " ", "undo", " ", "items", " ", "if", " ", "the", "y", " ", "have", " ", "new", " ", "values", " ", "whi", "ch", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "string", "s", " ", "whi", "ch", " ", "only", " ", "differ", " ", "by", " ", "one", " ", "character", " ", "(", "correspond", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "a", " ", "single", " ", "character", " ", "insertion", ",", " ", "deletion", " ", "or", " ", "replacement_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "operati", "on", " ", "in", " ", "a", " ", "text", " ", "editor", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "n1_", "=_", "len_", "(_", "v1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n2_", "=_", "len_", "(_", "v2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "min_", "(_", "n1_", ",_", "n2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "(_", "i_", "<_", "n_", ")_", "and_", "(_", "v1_", "[_", "i_", "]_", "==_", "v2_", "[_", "i_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "v1_", "[_", "i_", "+_", "(_", "n2_", "<=_", "n1_", ")_", ":_", "]_", "==_", "v2_", "[_", "i_", "+_", "(_", "n2_", ">=_", "n1_", ")_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "new", "\\u", "value_", "=_", "v2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "v1_", ",_", "collections_", "._", "Sequence_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Merge", " ", "sequence", " ", "types", " ", "only", " ", "if", " ", "a", " ", "single", " ", "element", " ", "has", " ", "changed_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "the", " ", "'", "original", "'", " ", "value", ",", " ", "and", " ", "the", " ", "element", " ", "type", " ", "is", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "simple", " ", "Pyth", "on", " ", "type", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v1_", "=_", "self_", "._", "old", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "v1_", ",_", "collections_", "._", "Sequence_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", "e", ":", " ", "wx", "Colo", "ur", " ", "say", "s", " ", "it", "'", "s", " ", "a", " ", "sequence", " ", "type", ",", " ", "but", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "doe", "sn", "'", "t", " ", "support", " ", "'", "len", "',", " ", "so", " ", "we", " ", "handle", " ", "the", " ", "exception_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "just", " ", "in", " ", "case", " ", "other", " ", "classe", "s", " ", "have", " ", "similar", " ", "behavior", ":_", "\\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 ", " ", " _", "if_", "len_", "(_", "v1_", ")_", "==_", "len_", "(_", "v2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "diffs_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "item_", "in_", "enumerate_", "(_", "v1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "tit", "em_", "=_", "type_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item2_", "=_", "v2_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "(_", "tit", "em_", "not_", "in_", "Simple", "Types_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "tit", "em_", "is_", "not_", "type_", "(_", "item2_", ")_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "item_", "!=_", "item2_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "diffs_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "diffs_", ">=_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "diffs_", "==_", "0_", ":_", "\\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_", "self_", "._", "new", "\\u", "value_", "=_", "v2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "t1_", "in_", "Numer", "ic", "Types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Al", "way", "s", " ", "merge", " ", "simple", " ", "numeri", "c", " ", "tra", "it", " ", "change", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "new", "\\u", "value_", "=_", "v2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "List", "Und", "o", "Item_", "(_", "Abstract", "Und", "o", "Item_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "undo_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Und", "oes", " ", "the", " ", "change", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "list_", "=_", "getattr_", "(_", "self_", "._", "object_", ",_", "self_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list_", "[_", "self_", "._", "index_", ":_", "(_", "self_", "._", "index_", "+_", "len_", "(_", "self_", "._", "added_", ")_", ")_", "]_", "=_", "self_", "._", "removed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "List", "Und", "o", "Item_", "(_", "Abstract", "Und", "o", "Item_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "redo", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Re", "-", "doe", "s", " ", "the", " ", "change", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "list_", "=_", "getattr_", "(_", "self_", "._", "object_", ",_", "self_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list_", "[_", "self_", "._", "index_", ":_", "(_", "self_", "._", "index_", "+_", "len_", "(_", "self_", "._", "removed_", ")_", ")_", "]_", "=_", "self_", "._", "added_", "\\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_" ]
[ 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,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 2 ]
Constant in conditional expression or statement
gavinwahl/sdb/sdb/passwords.py
[ { "content": "def gpg_exception_factory(returncode, message):\n if returncode == 2:\n if b'decryption failed: bad key' in message:\n return IncorrectPasswordException(message)\n if b'CRC error;' in message:\n return FileCorruptionException(message)\n if b'fatal: zlib inflate problem: invalid distance' in message:\n return FileCorruptionException(message)\n if b'decryption failed: invalid packet' in message:\n return FileCorruptionException(message)\n if b'no valid OpenPGP data found':\n return InvalidEncryptedFileException(message)\n return Exception(\"unkown error\", returncode, message)", "metadata": "root.gpg_exception_factory", "header": "['module', '___EOS___']", "index": 127 } ]
[ { "span": "b'no valid OpenPGP data found':", "start_line": 137, "start_column": 11, "end_line": 137, "end_column": 41 } ]
[]
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_", "gpg", "\\u", "exception", "\\u", "factory_", "(_", "returncode_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "returncode_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "b", "'", "decrypt", "ion", " ", "fail", "ed", ":", " ", "bad", " ", "key", "'_", "in_", "message_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Inco", "rrect", "Passw", "ord", "Exception_", "(_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "b", "'", "CR", "C", " ", "error", ";'_", "in_", "message_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "File", "Corr", "upti", "on", "Exception_", "(_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "b", "'", "fat", "al", ":", " ", "zli", "b", " ", "infla", "te", " ", "problem", ":", " ", "invalid", " ", "distance", "'_", "in_", "message_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "File", "Corr", "upti", "on", "Exception_", "(_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "b", "'", "decrypt", "ion", " ", "fail", "ed", ":", " ", "invalid", " ", "packet", "'_", "in_", "message_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "File", "Corr", "upti", "on", "Exception_", "(_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "b", "'", "no", " ", "valid", " ", "Open", "PGP", " ", "data", " ", "found", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Inva", "lid", "Encrypt", "ed", "File", "Exception_", "(_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Exception_", "(_", "\"", "unk", "own", " ", "error", "\"_", ",_", "returncode_", ",_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Duplicate key in dict literal
VisTrails/VisTrails/scripts/gen_vtk_examples/vtk_to_vt.py
[ { "content": "class VTK2VT(object):\n vtk_data_url = 'http://www.vtk.org/files/release/5.0/vtkdata-5.0.4.zip'\n package_name = 'edu.utah.sci.vistrails.vtk'\n basic_name = 'edu.utah.sci.vistrails.basic'\n pythoncalc_name = 'edu.utah.sci.vistrails.pythoncalc'\n http_name = 'edu.utah.sci.vistrails.http'\n variant_sigstring ='(edu.utah.sci.vistrails.basic:Tuple)'\n unused_functions = set(['Update', \n 'Read', \n 'Write', \n 'Start', \n 'Initialize',\n 'Render', \n 'PlaceWidget', \n 'AddObserver',\n 'SetSize',\n ])\n translate_ports = {'SetInputConnection': {None: 'SetInputConnection0'},\n 'GetOutputPort': {None: 'GetOutputPort0'},\n 'SetRenderWindow': {None: 'SetVTKCell'},\n 'SetInteractorStyle': {None: 'InteractorStyle'},\n 'ResetCamera': {None: 'ResetCamera'},\n 'AddInput': {None: 'AddInput',\n 'vtkXYPlotActor': 'AddInput_2'},\n 'SetInput': {None: 'SetInput',\n 'vtkPolyDataNormals': 'SetInput_1',\n 'vtkGlyph3D': 'SetInput_1',\n 'vtkDelaunay2D': 'SetInput_1',\n 'vtkDelaunay3D': 'SetInput_1',\n 'vtkWarpVector': 'SetInput_1',\n 'vtkContourFilter': 'SetInput_1',\n 'vtkTubeFilter': 'SetInput_1',\n 'vtkThresholdPoints': 'SetInput_1',\n 'vtkProbeFilter': 'SetInput_1',\n 'vtkTriangleFilter': 'SetInput_1',\n 'vtkBandedPolyDataContourFilter': \\\n 'SetInput_1',\n 'vtkWarpScalar': 'SetInput_1'},\n 'SetSourceConnection': {None: 'SetSourceConnection',\n 'vtkGlyph3D': \\\n 'SetSourceConnection_2'},\n 'AddFunction': {None: 'AddFunction',\n ('vtkImplicitSum', 'vtkPlane'): \\\n 'AddFunction_2',\n ('vtkImplicitSum', 'Tuple'): \\\n 'AddFunction_1'},\n 'SetColor': {None: 'SetColor',\n ('vtkVolumeProperty', \n 'vtkColorTransferFunction'): \\\n 'SetColor_4',\n ('vtkVolumeProperty', \n 'vtkPiecewiseFunction'): \\\n 'SetColor_2'},\n 'SetScalarOpacity': {None: 'SetScalarOpacity',\n 'vtkVolumeProperty': \\\n 'SetScalarOpacity_2'},\n 'SetSource': {None: 'SetSource',\n 'vtkGlyph3D': 'SetSource_1'},\n }\n\n inspector_functions = {'GetScalarRange': 'vtkDataSetInspector',\n 'GetCenter': 'vtkDataSetInspector',\n 'GetNumberOfCells': 'vtkDataSetInspector',\n 'GetNumberOfPoints': 'vtkDataSetInspector',\n 'GetLength': 'vtkDataSetInspector',\n 'GetBounds': 'vtkDataSetInspector',\n 'GetPointData': 'vtkDataSetInspector',\n 'GetCellData': 'vtkDataSetInspector',\n 'GetVerts': 'vtkPolyDataInspector',\n 'GetPoints': 'vtkPolyDataInspector',\n 'GetLines': 'vtkPolyDataInspector',\n 'GetStrips': 'vtkPolyDataInspector',\n 'GetPoints': 'vtkPolyDataInspector',\n 'GetNumberOfVerts': 'vtkPolyDataInspector',\n 'GetNumberOfPoints': 'vtkPolyDataInspector',\n 'GetNumberOfPolys': 'vtkPolyDataInspector',\n 'GetNumberOfStrips': 'vtkPolyDataInspector',\n 'GetScalars': 'vtkDataSetAttributesInspector',\n 'GetVectors': 'vtkDataSetAttributesInspector',\n 'GetNormals': 'vtkDataSetAttributesInspector',\n 'GetTCoords': 'vtkDataSetAttributesInspector',\n 'GetTensors': 'vtkDataSetAttributesInspector',\n 'GetGlobalIds': 'vtkDataSetAttributesInspector',\n 'GetPedigreeIds': 'vtkDataSetAttributesInspector',\n 'GetMaxNorm': 'vtkDataArrayInspector',\n 'GetRange': 'vtkDataArrayInspector',\n }\n \n getters = {'GetProperty': {None: ('SetProperty', 'vtkProperty', None),\n 'vtkXYPlotActor': ('SetProperty',\n 'vtkProperty2D', None)}, \n 'GetActiveCamera': {None: ('SetActiveCamera', \n 'vtkCamera', None)},\n 'GetTitleTextProperty':{None: ('SetTitleTextProperty', \n 'vtkTextProperty',\n [('BoldOn',),\n ('ItalicOn',),\n ('ShadowOn',),\n ('SetFontFamilyToArial',)])},\n 'GetTextProperty': {None: ('SetTextProperty', \n 'vtkTextProperty', None)},\n 'GetPointData': {None: ('SetPointData', 'vtkPointData', None)},\n 'GetCellData': {None: ('SetCellData', 'vtkCellData', None)},\n 'GetPointIds': {None: ('SetPointIds', 'vtkIdList', None),\n 'vtkVoxel': ('SetPointIds', 'vtkIdList',\n [('SetNumberOfIds', 8)]),\n 'vtkHexahedron': ('SetPointIds', 'vtkIdList',\n [('SetNumberOfIds', 8)]),\n 'vtkTetra': ('SetPointIds', 'vtkIdList',\n [('SetNumberOfIds', 4)]),\n 'vtkWedge': ('SetPointIds', 'vtkIdList',\n [('SetNumberOfIds', 6)]),\n 'vtkPyramid': ('SetPointIds', 'vtkIdList',\n [('SetNumberOfIds', 5)]),\n 'vtkPixel': ('SetPointIds', 'vtkIdList',\n [('SetNumberOfIds', 4)]), \n 'vtkQuad': ('SetPointIds', 'vtkIdList',\n [('SetNumberOfIds', 4)]), \n 'vtkTriangle': ('SetPointIds', 'vtkIdList',\n [('SetNumberOfIds', 3)]), \n 'vtkLine': ('SetPointIds', 'vtkIdList',\n [('SetNumberOfIds', 2)]), \n 'vtkVertex': ('SetPointIds', 'vtkIdList',\n [('SetNumberOfIds', 1)]), \n },\n 'GetRenderWindow': {None: ('SetVTKCell', 'VTKCell', None)},\n }\n\n set_file_name_pattern = re.compile('Set.*FileName$')\n\n\n\n \n \n \n \n\n\n\n\n # end get_parameters\n \n\n \n", "metadata": "root.VTK2VT", "header": "['module', '___EOS___']", "index": 52 } ]
[ { "span": "'GetNumberOfPoints':", "start_line": 115, "start_column": 27, "end_line": 115, "end_column": 46 }, { "span": "'GetPoints':", "start_line": 121, "start_column": 27, "end_line": 121, "end_column": 38 } ]
[ { "span": "'GetPoints':", "start_line": 124, "start_column": 27, "end_line": 124, "end_column": 38 }, { "span": "'GetNumberOfPoints':", "start_line": 126, "start_column": 27, "end_line": 126, "end_column": 46 } ]
1
true
[ "[CLS]_", "Duplicate", "_", "key_", "in_", "dict_", "literal_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "VT", "K2", "VT", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vtk", "\\u", "data\\u", "url_", "=_", "'", "http", "://", "www", ".", "vtk", ".", "org", "/", "files", "/", "release", "/", "5.0", "/", "vtk", "data", "-", "5.0", ".4", ".", "zip", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "package", "\\u", "name_", "=_", "'", "edu", ".", "uta", "h", ".", "sci", ".", "vist", "rail", "s", ".", "vtk", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "basic", "\\u", "name_", "=_", "'", "edu", ".", "uta", "h", ".", "sci", ".", "vist", "rail", "s", ".", "basic", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "python", "calc", "\\u", "name_", "=_", "'", "edu", ".", "uta", "h", ".", "sci", ".", "vist", "rail", "s", ".", "python", "calc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http", "\\u", "name_", "=_", "'", "edu", ".", "uta", "h", ".", "sci", ".", "vist", "rail", "s", ".", "http", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "variant", "\\u", "sig", "string_", "=_", "'(", "edu", ".", "uta", "h", ".", "sci", ".", "vist", "rail", "s", ".", "basic", ":", "Tup", "le", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unu", "sed", "\\u", "functions_", "=_", "set_", "(_", "[_", "'", "Update", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Read", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Write", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Start", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Initializ", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Render", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Place", "Wid", "get", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Add", "Observer", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Set", "Size", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "translat", "e\\u", "ports_", "=_", "{_", "'", "Set", "Inp", "ut", "Connect", "ion", "'_", ":_", "{_", "None_", ":_", "'", "Set", "Inp", "ut", "Connect", "ion", "0", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Output", "Port", "'_", ":_", "{_", "None_", ":_", "'", "Get", "Output", "Port", "0", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Set", "Render", "Window", "'_", ":_", "{_", "None_", ":_", "'", "Set", "VT", "KC", "ell", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Set", "Interact", "or", "Style", "'_", ":_", "{_", "None_", ":_", "'", "Interact", "or", "Style", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Reset", "Came", "ra", "'_", ":_", "{_", "None_", ":_", "'", "Reset", "Came", "ra", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Add", "Inp", "ut", "'_", ":_", "{_", "None_", ":_", "'", "Add", "Inp", "ut", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "XY", "Plot", "Act", "or", "'_", ":_", "'", "Add", "Inp", "ut", "\\u", "2", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Set", "Inp", "ut", "'_", ":_", "{_", "None_", ":_", "'", "Set", "Inp", "ut", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Poly", "Data", "Normal", "s", "'_", ":_", "'", "Set", "Inp", "ut", "\\u", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Gl", "yp", "h", "3", "D", "'_", ":_", "'", "Set", "Inp", "ut", "\\u", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Del", "au", "na", "y2", "D", "'_", ":_", "'", "Set", "Inp", "ut", "\\u", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Del", "au", "na", "y", "3", "D", "'_", ":_", "'", "Set", "Inp", "ut", "\\u", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "War", "p", "Vector", "'_", ":_", "'", "Set", "Inp", "ut", "\\u", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Contour", "Filter", "'_", ":_", "'", "Set", "Inp", "ut", "\\u", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Tu", "be", "Filter", "'_", ":_", "'", "Set", "Inp", "ut", "\\u", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Thresh", "old", "Point", "s", "'_", ":_", "'", "Set", "Inp", "ut", "\\u", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Probe", "Filter", "'_", ":_", "'", "Set", "Inp", "ut", "\\u", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Triangle", "Filter", "'_", ":_", "'", "Set", "Inp", "ut", "\\u", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Band", "ed", "Poly", "Data", "Contour", "Filter", "'_", ":_", "'", "Set", "Inp", "ut", "\\u", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "War", "p", "Scala", "r", "'_", ":_", "'", "Set", "Inp", "ut", "\\u", "1", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Set", "Sou", "rce", "Connect", "ion", "'_", ":_", "{_", "None_", ":_", "'", "Set", "Sou", "rce", "Connect", "ion", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Gl", "yp", "h", "3", "D", "'_", ":_", "'", "Set", "Sou", "rce", "Connect", "ion", "\\u", "2", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Add", "Function", "'_", ":_", "{_", "None_", ":_", "'", "Add", "Function", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "vtk", "Implicit", "Sum", "'_", ",_", "'", "vtk", "Plan", "e", "'_", ")_", ":_", "'", "Add", "Function", "\\u", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "vtk", "Implicit", "Sum", "'_", ",_", "'", "Tup", "le", "'_", ")_", ":_", "'", "Add", "Function", "\\u", "1", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Set", "Color", "'_", ":_", "{_", "None_", ":_", "'", "Set", "Color", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "vtk", "Volume", "Proper", "ty", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Color", "Transfer", "Function", "'_", ")_", ":_", "'", "Set", "Color", "\\u", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "vtk", "Volume", "Proper", "ty", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Piece", "wis", "e", "Function", "'_", ")_", ":_", "'", "Set", "Color", "\\u", "2", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Set", "Scala", "r", "Opa", "city", "'_", ":_", "{_", "None_", ":_", "'", "Set", "Scala", "r", "Opa", "city", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Volume", "Proper", "ty", "'_", ":_", "'", "Set", "Scala", "r", "Opa", "city", "\\u", "2", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Set", "Sou", "rce", "'_", ":_", "{_", "None_", ":_", "'", "Set", "Sou", "rce", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Gl", "yp", "h", "3", "D", "'_", ":_", "'", "Set", "Sou", "rce", "\\u", "1", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "inspector", "\\u", "functions_", "=_", "{_", "'", "Get", "Scala", "r", "Range", "'_", ":_", "'", "vtk", "Data", "Set", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Center", "'_", ":_", "'", "vtk", "Data", "Set", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Number", "Of", "Cel", "ls", "'_", ":_", "'", "vtk", "Data", "Set", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Number", "Of", "Point", "s", "'_", ":_", "'", "vtk", "Data", "Set", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Length", "'_", ":_", "'", "vtk", "Data", "Set", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Bound", "s", "'_", ":_", "'", "vtk", "Data", "Set", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Point", "Data", "'_", ":_", "'", "vtk", "Data", "Set", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Cel", "l", "Data", "'_", ":_", "'", "vtk", "Data", "Set", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Vert", "s", "'_", ":_", "'", "vtk", "Poly", "Data", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Point", "s", "'_", ":_", "'", "vtk", "Poly", "Data", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Line", "s", "'_", ":_", "'", "vtk", "Poly", "Data", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Strip", "s", "'_", ":_", "'", "vtk", "Poly", "Data", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Point", "s", "'_", ":_", "'", "vtk", "Poly", "Data", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Number", "Of", "Vert", "s", "'_", ":_", "'", "vtk", "Poly", "Data", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Number", "Of", "Point", "s", "'_", ":_", "'", "vtk", "Poly", "Data", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Number", "Of", "Poly", "s", "'_", ":_", "'", "vtk", "Poly", "Data", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Number", "Of", "Strip", "s", "'_", ":_", "'", "vtk", "Poly", "Data", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Scala", "rs", "'_", ":_", "'", "vtk", "Data", "Set", "Attribute", "s", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Vector", "s", "'_", ":_", "'", "vtk", "Data", "Set", "Attribute", "s", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Normal", "s", "'_", ":_", "'", "vtk", "Data", "Set", "Attribute", "s", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "TC", "oor", "ds", "'_", ":_", "'", "vtk", "Data", "Set", "Attribute", "s", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Tensor", "s", "'_", ":_", "'", "vtk", "Data", "Set", "Attribute", "s", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Global", "Id", "s", "'_", ":_", "'", "vtk", "Data", "Set", "Attribute", "s", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Pedi", "gree", "Id", "s", "'_", ":_", "'", "vtk", "Data", "Set", "Attribute", "s", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Max", "Norm", "'_", ":_", "'", "vtk", "Data", "Array", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Range", "'_", ":_", "'", "vtk", "Data", "Array", "Inspector", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "getter", "s_", "=_", "{_", "'", "Get", "Proper", "ty", "'_", ":_", "{_", "None_", ":_", "(_", "'", "Set", "Proper", "ty", "'_", ",_", "'", "vtk", "Proper", "ty", "'_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "XY", "Plot", "Act", "or", "'_", ":_", "(_", "'", "Set", "Proper", "ty", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Proper", "ty", "2", "D", "'_", ",_", "None_", ")_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Activ", "e", "Came", "ra", "'_", ":_", "{_", "None_", ":_", "(_", "'", "Set", "Activ", "e", "Came", "ra", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Came", "ra", "'_", ",_", "None_", ")_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Tit", "le", "Text", "Proper", "ty", "'_", ":_", "{_", "None_", ":_", "(_", "'", "Set", "Tit", "le", "Text", "Proper", "ty", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Text", "Proper", "ty", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "'", "Bol", "d", "On", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Italic", "On", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Shad", "ow", "On", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Set", "Font", "Famil", "y", "To", "Ari", "al", "'_", ",_", ")_", "]_", ")_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Text", "Proper", "ty", "'_", ":_", "{_", "None_", ":_", "(_", "'", "Set", "Text", "Proper", "ty", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Text", "Proper", "ty", "'_", ",_", "None_", ")_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Point", "Data", "'_", ":_", "{_", "None_", ":_", "(_", "'", "Set", "Point", "Data", "'_", ",_", "'", "vtk", "Point", "Data", "'_", ",_", "None_", ")_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Cel", "l", "Data", "'_", ":_", "{_", "None_", ":_", "(_", "'", "Set", "Cel", "l", "Data", "'_", ",_", "'", "vtk", "Cel", "l", "Data", "'_", ",_", "None_", ")_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Point", "Id", "s", "'_", ":_", "{_", "None_", ":_", "(_", "'", "Set", "Point", "Id", "s", "'_", ",_", "'", "vtk", "Id", "List", "'_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Vo", "xel", "'_", ":_", "(_", "'", "Set", "Point", "Id", "s", "'_", ",_", "'", "vtk", "Id", "List", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "'", "Set", "Number", "Of", "Id", "s", "'_", ",_", "8_", ")_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Hex", "ahe", "dro", "n", "'_", ":_", "(_", "'", "Set", "Point", "Id", "s", "'_", ",_", "'", "vtk", "Id", "List", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "'", "Set", "Number", "Of", "Id", "s", "'_", ",_", "8_", ")_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Tet", "ra", "'_", ":_", "(_", "'", "Set", "Point", "Id", "s", "'_", ",_", "'", "vtk", "Id", "List", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "'", "Set", "Number", "Of", "Id", "s", "'_", ",_", "4_", ")_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "We", "dge", "'_", ":_", "(_", "'", "Set", "Point", "Id", "s", "'_", ",_", "'", "vtk", "Id", "List", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "'", "Set", "Number", "Of", "Id", "s", "'_", ",_", "6_", ")_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Pyr", "amid", "'_", ":_", "(_", "'", "Set", "Point", "Id", "s", "'_", ",_", "'", "vtk", "Id", "List", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "'", "Set", "Number", "Of", "Id", "s", "'_", ",_", "5_", ")_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Pix", "el", "'_", ":_", "(_", "'", "Set", "Point", "Id", "s", "'_", ",_", "'", "vtk", "Id", "List", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "'", "Set", "Number", "Of", "Id", "s", "'_", ",_", "4_", ")_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Quad", "'_", ":_", "(_", "'", "Set", "Point", "Id", "s", "'_", ",_", "'", "vtk", "Id", "List", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "'", "Set", "Number", "Of", "Id", "s", "'_", ",_", "4_", ")_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Triangle", "'_", ":_", "(_", "'", "Set", "Point", "Id", "s", "'_", ",_", "'", "vtk", "Id", "List", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "'", "Set", "Number", "Of", "Id", "s", "'_", ",_", "3_", ")_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Line", "'_", ":_", "(_", "'", "Set", "Point", "Id", "s", "'_", ",_", "'", "vtk", "Id", "List", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "'", "Set", "Number", "Of", "Id", "s", "'_", ",_", "2_", ")_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vtk", "Vertex", "'_", ":_", "(_", "'", "Set", "Point", "Id", "s", "'_", ",_", "'", "vtk", "Id", "List", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "'", "Set", "Number", "Of", "Id", "s", "'_", ",_", "1_", ")_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Get", "Render", "Window", "'_", ":_", "{_", "None_", ":_", "(_", "'", "Set", "VT", "KC", "ell", "'_", ",_", "'", "VT", "KC", "ell", "'_", ",_", "None_", ")_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "set\\u", "file", "\\u", "name", "\\u", "pattern_", "=_", "re_", "._", "compile_", "(_", "'", "Set", ".*", "File", "Name", "$'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "#", " ", "end", " ", "get", "\\u", "parameters_", "\\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_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unreachable code
enthought/envisage/envisage/developer/code_browser/namespace.py
[ { "content": " def is_trait(self, name):\n \"\"\" Attempt to resolve a name to see if it is a trait. \"\"\"\n\n # fixme: We might want to be a bit cleverer than this ;^)\n return True\n\n # Try the namespace's locals first.\n if name in self.locals:\n # These are the definitive traits markers!\n if name in ['TraitFactory', 'Trait', 'Instance']:\n is_trait = True\n\n # The name won't be in the '_is_trait' dictionary if it was not\n # defined by an assignment i.e., it is a class or function!\n elif not self._is_trait.get(name, False):\n is_trait = False\n\n else:\n next = self.locals[name]\n if len(next.source) > 0:\n is_trait = self.is_trait(next.source)\n\n else:\n is_trait = False\n\n # Is the name imported?\n elif self.is_imported(name):\n module_name = self.get_next_module_name(name)\n module = self.get_next_module(module_name)\n\n if module is not None:\n components = name.split('.')\n is_trait = module.is_trait(components[-1])\n\n else:\n is_trait = False\n\n # If we have a parent namespace then try that.\n elif self.namespace is not None:\n is_trait = self.namespace.is_trait(name)\n\n # Otherwise give up!\n else:\n is_trait = False\n\n return is_trait", "metadata": "root.Namespace.is_trait", "header": "['class', 'Namespace', '(', 'HasTraits', ')', ':', '___EOS___']", "index": 29 } ]
[ { "span": "if name in self.locals:", "start_line": 36, "start_column": 8, "end_line": 36, "end_column": 31 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "class_", "Namespace_", "(_", "Has", "Trait", "s_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "is", "\\u", "trait_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Atte", "mpt", " ", "to", " ", "resolve", " ", "a", " ", "name", " ", "to", " ", "see", " ", "if", " ", "it", " ", "is", " ", "a", " ", "tra", "it", ".", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fix", "me", ":", " ", "We", " ", "mig", "ht", " ", "want", " ", "to", " ", "be", " ", "a", " ", "bit", " ", "clev", "ere", "r", " ", "than", " ", "this", " ", ";", "^", ")_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tr", "y", " ", "the", " ", "namespace", "'", "s", " ", "locals", " ", "first", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "name_", "in_", "self_", "._", "locals_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "se", " ", "are", " ", "the", " ", "definit", "ive", " ", "traits", " ", "marker", "s", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "in_", "[_", "'", "Trait", "Factor", "y", "'_", ",_", "'", "Trait", "'_", ",_", "'", "Insta", "nce", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "is", "\\u", "trait_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "won", "'", "t", " ", "be", " ", "in", " ", "the", " ", "'\\u", "is", "\\u", "tra", "it", "'", " ", "dictionar", "y", " ", "if", " ", "it", " ", "was", " ", "not_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "defin", "ed", " ", "by", " ", "an", " ", "assign", "ment", " ", "i", ".", "e", ".,", " ", "it", " ", "is", " ", "a", " ", "class", " ", "or", " ", "function", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "self_", "._", "\\u", "is", "\\u", "trait_", "._", "get_", "(_", "name_", ",_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "is", "\\u", "trait_", "=_", "False_", "\\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 ", " _", "next_", "=_", "self_", "._", "locals_", "[_", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "next_", "._", "source_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "is", "\\u", "trait_", "=_", "self_", "._", "is", "\\u", "trait_", "(_", "next_", "._", "source_", ")_", "\\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 ", " ", "_", "is", "\\u", "trait_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Is", " ", "the", " ", "name", " ", "import", "ed", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "is", "\\u", "imported_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "module", "\\u", "name_", "=_", "self_", "._", "get", "\\u", "next", "\\u", "module", "\\u", "name_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module_", "=_", "self_", "._", "get", "\\u", "next", "\\u", "module_", "(_", "module", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "module_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "components_", "=_", "name_", "._", "split_", "(_", "'.'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "\\u", "trait_", "=_", "module_", "._", "is", "\\u", "trait_", "(_", "components_", "[_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "is", "\\u", "trait_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "we", " ", "have", " ", "a", " ", "parent", " ", "namespace", " ", "then", " ", "try", " ", "tha", "t", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "namespace_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "is", "\\u", "trait_", "=_", "self_", "._", "namespace_", "._", "is", "\\u", "trait_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ot", "her", "wis", "e", " ", "give", " ", "up", "!", "_", "\\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 ", " _", "is", "\\u", "trait_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "is", "\\u", "trait_", "\\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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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 ]
Except block handles 'BaseException'
dbcli/pgcli/tests/utils.py
[ { "content": "import pytest\nimport psycopg2\nimport psycopg2.extras\nfrom pgcli.main import format_output\nfrom pgcli.pgexecute import register_json_typecasters\n\n# TODO: should this be somehow be divined from environment?\nPOSTGRES_USER, POSTGRES_HOST = 'postgres', 'localhost'\n\n\n\n\ntry:\n conn = db_connection()\n CAN_CONNECT_TO_DB = True\n SERVER_VERSION = conn.server_version\n json_types = register_json_typecasters(conn, lambda x: x)\n JSON_AVAILABLE = 'json' in json_types\n JSONB_AVAILABLE = 'jsonb' in json_types\nexcept:\n CAN_CONNECT_TO_DB = JSON_AVAILABLE = JSONB_AVAILABLE = False\n SERVER_VERSION = 0\n\n\ndbtest = pytest.mark.skipif(\n not CAN_CONNECT_TO_DB,\n reason=\"Need a postgres instance at localhost accessible by user 'postgres'\")\n\n\nrequires_json = pytest.mark.skipif(\n not JSON_AVAILABLE,\n reason='Postgres server unavailable or json type not defined')\n\n\nrequires_jsonb = pytest.mark.skipif(\n not JSONB_AVAILABLE,\n reason='Postgres server unavailable or jsonb type not defined')\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def create_db(dbname):\n with db_connection().cursor() as cur:\n try:\n cur.execute('''CREATE DATABASE _test_db''')\n except:\n pass", "metadata": "root.create_db", "header": "['module', '___EOS___']", "index": 43 } ]
[ { "span": "except:", "start_line": 23, "start_column": 0, "end_line": 23, "end_column": 7 }, { "span": "except:", "start_line": 47, "start_column": 8, "end_line": 47, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "pytest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "psycopg2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "psycopg2_", "._", "extras_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pg", "cli_", "._", "main_", "import_", "format\\u", "output_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pg", "cli_", "._", "pge", "xec", "ute", "_", "import_", "register", "\\u", "json", "\\u", "typec", "aster", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "shou", "ld", " ", "this", " ", "be", " ", "some", "how", " ", "be", " ", "divi", "ned", " ", "from", " ", "environ", "ment", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "POST", "GRES", "\\u", "USER_", ",_", "POST", "GRES", "\\u", "HOST_", "=_", "'", "postgres", "'_", ",_", "'", "local", "host", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn_", "=_", "db", "\\u", "connection_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CAN", "\\u", "CONNECT", "\\u", "TO", "\\u", "DB_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SERVER", "\\u", "VERSION_", "=_", "conn_", "._", "server", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "types_", "=_", "register", "\\u", "json", "\\u", "typec", "aster", "s_", "(_", "conn_", ",_", "lambda_", "x_", ":_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "JSO", "N", "\\u", "AVAILABLE_", "=_", "'", "json", "'_", "in_", "json", "\\u", "types_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "JSO", "NB", "\\u", "AVAILABLE_", "=_", "'", "json", "b", "'_", "in_", "json", "\\u", "types_", "\\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 ", " _", "CAN", "\\u", "CONNECT", "\\u", "TO", "\\u", "DB_", "=_", "JSO", "N", "\\u", "AVAILABLE_", "=_", "JSO", "NB", "\\u", "AVAILABLE_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SERVER", "\\u", "VERSION_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dbt", "est_", "=_", "pytest_", "._", "mark_", "._", "skipif_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "CAN", "\\u", "CONNECT", "\\u", "TO", "\\u", "DB_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reason_", "=_", "\"", "Ne", "ed", " ", "a", " ", "postgres", " ", "instance", " ", "at", " ", "local", "host", " ", "accessible", " ", "by", " ", "user", " ", "'", "postgres", "'\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "require", "s", "\\u", "json_", "=_", "pytest_", "._", "mark_", "._", "skipif_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "JSO", "N", "\\u", "AVAILABLE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reason_", "=_", "'", "Post", "gres", " ", "server", " ", "unava", "ilab", "le", " ", "or", " ", "json", " ", "type", " ", "not", " ", "defin", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "require", "s", "\\u", "json", "b_", "=_", "pytest_", "._", "mark_", "._", "skipif_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "JSO", "NB", "\\u", "AVAILABLE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reason_", "=_", "'", "Post", "gres", " ", "server", " ", "unava", "ilab", "le", " ", "or", " ", "json", "b", " ", "type", " ", "not", " ", "defin", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "create", "\\u", "db_", "(_", "dbname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "db", "\\u", "connection_", "(_", ")_", "._", "cursor_", "(_", ")_", "as_", "cur_", ":_", "\\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 ", " _", "cur_", "._", "execute_", "(_", "'''", "CREATE", " ", "DATA", "BASE", " ", "\\u", "test\\u", "db", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2 ]
Imprecise assert
charanpald/APGL/apgl/io/test/CsvGraphReaderTest.py
[ { "content": " def testReadFromFile(self):\n vertex1Indices = [0, 2, 3, 4, 5]\n vertex2Indices = [1, 6, 7, 8, 9]\n\n def genderConv(x):\n genderDict = {'\"M\"': 0, '\"F\"': 1}\n return genderDict[x]\n\n def orientConv(x):\n orientDict = {'\"HT\"': 0, '\"HB\"': 1}\n return orientDict[x]\n\n converters = {2: genderConv, 6: genderConv, 3:orientConv, 7:orientConv}\n\n csvGraphReader = CsvGraphReader(vertex1Indices, vertex2Indices, converters)\n\n dir = PathDefaults.getDataDir()\n fileName = dir + \"test/infect5.csv\"\n\n graph = csvGraphReader.readFromFile(fileName)\n\n self.assertTrue((graph.getVertex(0) == numpy.array([0, 0, 28, 1])).all())\n self.assertTrue((graph.getVertex(1) == numpy.array([1, 0, 26, 1])).all())\n self.assertTrue((graph.getVertex(2) == numpy.array([0, 1, 42, 2])).all())\n self.assertTrue((graph.getVertex(3) == numpy.array([1, 0, 33, 1])).all())\n self.assertTrue((graph.getVertex(4) == numpy.array([0, 1, 35, 37])).all())\n\n self.assertTrue(graph.getEdge(0, 1) == 1)\n self.assertTrue(graph.getEdge(2, 3) == 1)\n self.assertTrue(graph.getEdge(4, 6) == 1)\n self.assertTrue(graph.getEdge(6, 7) == 1)\n self.assertTrue(graph.getEdge(5, 8) == 1)\n\n self.assertEquals(graph.getNumEdges(), 5)\n self.assertTrue(graph.isUndirected())\n\n #Test a directed graph\n csvGraphReader = CsvGraphReader(vertex1Indices, vertex2Indices, converters, undirected=False)\n graph = csvGraphReader.readFromFile(fileName)\n\n self.assertTrue(graph.getEdge(1, 0) == None)\n self.assertTrue(graph.getEdge(3, 2) == None)\n self.assertTrue(graph.getEdge(6, 4) == None)\n self.assertTrue(graph.getEdge(7, 6) == None)\n self.assertTrue(graph.getEdge(8, 5) == None)\n\n self.assertEquals(graph.getNumEdges(), 5)\n self.assertFalse(graph.isUndirected())\n\n #Test graph with no vertex information\n vertex1Indices = [0]\n vertex2Indices = [1]\n fileName = dir + \"test/infect5-0.csv\"\n csvGraphReader = CsvGraphReader(vertex1Indices, vertex2Indices, {})\n graph = csvGraphReader.readFromFile(fileName)\n\n self.assertTrue(graph.getEdge(0, 1) == 1)\n self.assertTrue(graph.getEdge(2, 3) == 1)\n self.assertTrue(graph.getEdge(4, 6) == 1)\n self.assertTrue(graph.getEdge(6, 7) == 1)\n self.assertTrue(graph.getEdge(5, 8) == 1)\n\n self.assertEquals(graph.getNumEdges(), 5)\n self.assertTrue(graph.isUndirected())\n self.assertEquals(graph.getVertexList().getNumFeatures(), 0)", "metadata": "root.CsvGraphReaderTest.testReadFromFile", "header": "['class', 'CsvGraphReaderTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 13 } ]
[ { "span": "self.assertTrue(graph.getEdge(0, 1) == 1)", "start_line": 40, "start_column": 8, "end_line": 40, "end_column": 49 }, { "span": "self.assertTrue(graph.getEdge(2, 3) == 1)", "start_line": 41, "start_column": 8, "end_line": 41, "end_column": 49 }, { "span": "self.assertTrue(graph.getEdge(4, 6) == 1)", "start_line": 42, "start_column": 8, "end_line": 42, "end_column": 49 }, { "span": "self.assertTrue(graph.getEdge(6, 7) == 1)", "start_line": 43, "start_column": 8, "end_line": 43, "end_column": 49 }, { "span": "self.assertTrue(graph.getEdge(5, 8) == 1)", "start_line": 44, "start_column": 8, "end_line": 44, "end_column": 49 }, { "span": "self.assertTrue(graph.getEdge(1, 0) == None)", "start_line": 53, "start_column": 8, "end_line": 53, "end_column": 52 }, { "span": "self.assertTrue(graph.getEdge(3, 2) == None)", "start_line": 54, "start_column": 8, "end_line": 54, "end_column": 52 }, { "span": "self.assertTrue(graph.getEdge(6, 4) == None)", "start_line": 55, "start_column": 8, "end_line": 55, "end_column": 52 }, { "span": "self.assertTrue(graph.getEdge(7, 6) == None)", "start_line": 56, "start_column": 8, "end_line": 56, "end_column": 52 }, { "span": "self.assertTrue(graph.getEdge(8, 5) == None)", "start_line": 57, "start_column": 8, "end_line": 57, "end_column": 52 }, { "span": "self.assertTrue(graph.getEdge(0, 1) == 1)", "start_line": 69, "start_column": 8, "end_line": 69, "end_column": 49 }, { "span": "self.assertTrue(graph.getEdge(2, 3) == 1)", "start_line": 70, "start_column": 8, "end_line": 70, "end_column": 49 }, { "span": "self.assertTrue(graph.getEdge(4, 6) == 1)", "start_line": 71, "start_column": 8, "end_line": 71, "end_column": 49 }, { "span": "self.assertTrue(graph.getEdge(6, 7) == 1)", "start_line": 72, "start_column": 8, "end_line": 72, "end_column": 49 }, { "span": "self.assertTrue(graph.getEdge(5, 8) == 1)", "start_line": 73, "start_column": 8, "end_line": 73, "end_column": 49 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Cs", "v", "Graph", "Read", "er", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Read", "Fro", "m", "File_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vertex", "1", "Indices_", "=_", "[_", "0_", ",_", "2_", ",_", "3_", ",_", "4_", ",_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vertex", "2", "Indices_", "=_", "[_", "1_", ",_", "6_", ",_", "7_", ",_", "8_", ",_", "9_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "gender", "Conv", "_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gender", "Dict_", "=_", "{_", "'\"", "M", "\"'_", ":_", "0_", ",_", "'\"", "F", "\"'_", ":_", "1_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "gender", "Dict_", "[_", "x_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "orient", "Conv", "_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "orient", "Dict_", "=_", "{_", "'\"", "HT", "\"'_", ":_", "0_", ",_", "'\"", "HB", "\"'_", ":_", "1_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "orient", "Dict_", "[_", "x_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "converters_", "=_", "{_", "2_", ":_", "gender", "Conv", "_", ",_", "6_", ":_", "gender", "Conv", "_", ",_", "3_", ":_", "orient", "Conv", "_", ",_", "7_", ":_", "orient", "Conv", "_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "csv", "Graph", "Reader_", "=_", "Cs", "v", "Graph", "Reader_", "(_", "vertex", "1", "Indices_", ",_", "vertex", "2", "Indices_", ",_", "converters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dir_", "=_", "Path", "Defaults_", "._", "get", "Data", "Dir_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "Name_", "=_", "dir_", "+_", "\"", "test", "/", "infect", "5", ".", "csv", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "graph_", "=_", "csv", "Graph", "Reader_", "._", "read", "Fro", "m", "File_", "(_", "file", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "graph_", "._", "get", "Vertex_", "(_", "0_", ")_", "==_", "numpy_", "._", "array_", "(_", "[_", "0_", ",_", "0_", ",_", "28_", ",_", "1_", "]_", ")_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "graph_", "._", "get", "Vertex_", "(_", "1_", ")_", "==_", "numpy_", "._", "array_", "(_", "[_", "1_", ",_", "0_", ",_", "26_", ",_", "1_", "]_", ")_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "graph_", "._", "get", "Vertex_", "(_", "2_", ")_", "==_", "numpy_", "._", "array_", "(_", "[_", "0_", ",_", "1_", ",_", "42_", ",_", "2_", "]_", ")_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "graph_", "._", "get", "Vertex_", "(_", "3_", ")_", "==_", "numpy_", "._", "array_", "(_", "[_", "1_", ",_", "0_", ",_", "33_", ",_", "1_", "]_", ")_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "graph_", "._", "get", "Vertex_", "(_", "4_", ")_", "==_", "numpy_", "._", "array_", "(_", "[_", "0_", ",_", "1_", ",_", "35_", ",_", "37_", "]_", ")_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "graph_", "._", "get", "Edge_", "(_", "0_", ",_", "1_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "graph_", "._", "get", "Edge_", "(_", "2_", ",_", "3_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "graph_", "._", "get", "Edge_", "(_", "4_", ",_", "6_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "graph_", "._", "get", "Edge_", "(_", "6_", ",_", "7_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "graph_", "._", "get", "Edge_", "(_", "5_", ",_", "8_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "graph_", "._", "get", "Num", "Edges_", "(_", ")_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "graph_", "._", "is", "Und", "irect", "ed_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Test", " ", "a", " ", "direct", "ed", " ", "graph_", "\\u\\u\\uNL\\u\\u\\u_", "csv", "Graph", "Reader_", "=_", "Cs", "v", "Graph", "Reader_", "(_", "vertex", "1", "Indices_", ",_", "vertex", "2", "Indices_", ",_", "converters_", ",_", "undi", "rect", "ed_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "graph_", "=_", "csv", "Graph", "Reader_", "._", "read", "Fro", "m", "File_", "(_", "file", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "graph_", "._", "get", "Edge_", "(_", "1_", ",_", "0_", ")_", "==_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "graph_", "._", "get", "Edge_", "(_", "3_", ",_", "2_", ")_", "==_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "graph_", "._", "get", "Edge_", "(_", "6_", ",_", "4_", ")_", "==_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "graph_", "._", "get", "Edge_", "(_", "7_", ",_", "6_", ")_", "==_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "graph_", "._", "get", "Edge_", "(_", "8_", ",_", "5_", ")_", "==_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "graph_", "._", "get", "Num", "Edges_", "(_", ")_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "graph_", "._", "is", "Und", "irect", "ed_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Test", " ", "graph", " ", "with", " ", "no", " ", "vertex", " ", "information_", "\\u\\u\\uNL\\u\\u\\u_", "vertex", "1", "Indices_", "=_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vertex", "2", "Indices_", "=_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "Name_", "=_", "dir_", "+_", "\"", "test", "/", "infect", "5", "-0", ".", "csv", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "csv", "Graph", "Reader_", "=_", "Cs", "v", "Graph", "Reader_", "(_", "vertex", "1", "Indices_", ",_", "vertex", "2", "Indices_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "graph_", "=_", "csv", "Graph", "Reader_", "._", "read", "Fro", "m", "File_", "(_", "file", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "graph_", "._", "get", "Edge_", "(_", "0_", ",_", "1_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "graph_", "._", "get", "Edge_", "(_", "2_", ",_", "3_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "graph_", "._", "get", "Edge_", "(_", "4_", ",_", "6_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "graph_", "._", "get", "Edge_", "(_", "6_", ",_", "7_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "graph_", "._", "get", "Edge_", "(_", "5_", ",_", "8_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "graph_", "._", "get", "Num", "Edges_", "(_", ")_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "graph_", "._", "is", "Und", "irect", "ed_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "graph_", "._", "get", "Vertex", "List_", "(_", ")_", "._", "get", "Num", "Features_", "(_", ")_", ",_", "0_", ")_", "\\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, 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, 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
OpenKMIP/PyKMIP/kmip/tests/unit/pie/objects/test_opaque_object.py
[ { "content": " def test_equal_on_equal(self):\n \"\"\"\n Test that the equality operator returns True when comparing two\n OpaqueObject objects with the same data.\n \"\"\"\n a = OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n b = OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n self.assertTrue(a == b)\n self.assertTrue(b == a)", "metadata": "root.TestOpaqueObject.test_equal_on_equal", "header": "['class', 'TestOpaqueObject', '(', 'testtools', '.', 'TestCase', ')', ':', '___EOS___']", "index": 122 }, { "content": " def test_equal_on_not_equal_value(self):\n \"\"\"\n Test that the equality operator returns False when comparing two\n OpaqueObject objects with different data.\n \"\"\"\n a = OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n b = OpaqueObject(self.bytes_b, enums.OpaqueDataType.NONE)\n self.assertFalse(a == b)\n self.assertFalse(b == a)", "metadata": "root.TestOpaqueObject.test_equal_on_not_equal_value", "header": "['class', 'TestOpaqueObject', '(', 'testtools', '.', 'TestCase', ')', ':', '___EOS___']", "index": 132 }, { "content": " def test_equal_on_not_equal_data_type(self):\n \"\"\"\n Test that the equality operator returns False when comparing two\n OpaqueObject objects with different data.\n \"\"\"\n a = OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n b = OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n b.opaque_type = \"invalid\"\n self.assertFalse(a == b)\n self.assertFalse(b == a)", "metadata": "root.TestOpaqueObject.test_equal_on_not_equal_data_type", "header": "['class', 'TestOpaqueObject', '(', 'testtools', '.', 'TestCase', ')', ':', '___EOS___']", "index": 142 }, { "content": " def test_equal_on_type_mismatch(self):\n \"\"\"\n Test that the equality operator returns False when comparing a\n OpaqueObject object to a non-OpaqueObject object.\n \"\"\"\n a = OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n b = \"invalid\"\n self.assertFalse(a == b)\n self.assertFalse(b == a)", "metadata": "root.TestOpaqueObject.test_equal_on_type_mismatch", "header": "['class', 'TestOpaqueObject', '(', 'testtools', '.', 'TestCase', ')', ':', '___EOS___']", "index": 153 }, { "content": " def test_not_equal_on_equal(self):\n \"\"\"\n Test that the inequality operator returns False when comparing\n two OpaqueObject objects with the same internal data.\n \"\"\"\n a = OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n b = OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n self.assertFalse(a != b)\n self.assertFalse(b != a)", "metadata": "root.TestOpaqueObject.test_not_equal_on_equal", "header": "['class', 'TestOpaqueObject', '(', 'testtools', '.', 'TestCase', ')', ':', '___EOS___']", "index": 163 }, { "content": " def test_not_equal_on_not_equal_value(self):\n \"\"\"\n Test that the equality operator returns True when comparing two\n OpaqueObject objects with different data.\n \"\"\"\n a = OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n b = OpaqueObject(self.bytes_b, enums.OpaqueDataType.NONE)\n self.assertTrue(a != b)\n self.assertTrue(b != a)", "metadata": "root.TestOpaqueObject.test_not_equal_on_not_equal_value", "header": "['class', 'TestOpaqueObject', '(', 'testtools', '.', 'TestCase', ')', ':', '___EOS___']", "index": 173 }, { "content": " def test_not_equal_on_not_equal_data_type(self):\n \"\"\"\n Test that the equality operator returns True when comparing two\n OpaqueObject objects with different data.\n \"\"\"\n a = OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n b = OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n b.opaque_type = \"invalid\"\n self.assertTrue(a != b)\n self.assertTrue(b != a)", "metadata": "root.TestOpaqueObject.test_not_equal_on_not_equal_data_type", "header": "['class', 'TestOpaqueObject', '(', 'testtools', '.', 'TestCase', ')', ':', '___EOS___']", "index": 183 }, { "content": " def test_not_equal_on_type_mismatch(self):\n \"\"\"\n Test that the equality operator returns True when comparing a\n OpaqueObject object to a non-OpaqueObject object.\n \"\"\"\n a = OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n b = \"invalid\"\n self.assertTrue(a != b)\n self.assertTrue(b != a)", "metadata": "root.TestOpaqueObject.test_not_equal_on_type_mismatch", "header": "['class', 'TestOpaqueObject', '(', 'testtools', '.', 'TestCase', ')', ':', '___EOS___']", "index": 194 } ]
[ { "span": "self.assertTrue(a == b)", "start_line": 129, "start_column": 8, "end_line": 129, "end_column": 31 }, { "span": "self.assertTrue(b == a)", "start_line": 130, "start_column": 8, "end_line": 130, "end_column": 31 }, { "span": "self.assertFalse(a == b)", "start_line": 139, "start_column": 8, "end_line": 139, "end_column": 32 }, { "span": "self.assertFalse(b == a)", "start_line": 140, "start_column": 8, "end_line": 140, "end_column": 32 }, { "span": "self.assertFalse(a == b)", "start_line": 150, "start_column": 8, "end_line": 150, "end_column": 32 }, { "span": "self.assertFalse(b == a)", "start_line": 151, "start_column": 8, "end_line": 151, "end_column": 32 }, { "span": "self.assertFalse(a == b)", "start_line": 160, "start_column": 8, "end_line": 160, "end_column": 32 }, { "span": "self.assertFalse(b == a)", "start_line": 161, "start_column": 8, "end_line": 161, "end_column": 32 }, { "span": "self.assertFalse(a != b)", "start_line": 170, "start_column": 8, "end_line": 170, "end_column": 32 }, { "span": "self.assertFalse(b != a)", "start_line": 171, "start_column": 8, "end_line": 171, "end_column": 32 }, { "span": "self.assertTrue(a != b)", "start_line": 180, "start_column": 8, "end_line": 180, "end_column": 31 }, { "span": "self.assertTrue(b != a)", "start_line": 181, "start_column": 8, "end_line": 181, "end_column": 31 }, { "span": "self.assertTrue(a != b)", "start_line": 191, "start_column": 8, "end_line": 191, "end_column": 31 }, { "span": "self.assertTrue(b != a)", "start_line": 192, "start_column": 8, "end_line": 192, "end_column": 31 }, { "span": "self.assertTrue(a != b)", "start_line": 201, "start_column": 8, "end_line": 201, "end_column": 31 }, { "span": "self.assertTrue(b != a)", "start_line": 202, "start_column": 8, "end_line": 202, "end_column": 31 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Opa", "que", "Object_", "(_", "testtools_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "equal", "\\u", "on", "\\u", "equal_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tha", "t", " ", "the", " ", "equality", " ", "opera", "tor", " ", "return", "s", " ", "Tru", "e", " ", "whe", "n", " ", "compa", "ring", " ", "two", "\\", "10", ";", " ", " ", " ", " ", "Opa", "que", "Object", " ", "object", "s", " ", "with", " ", "the", " ", "same", " ", "data", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "Opa", "que", "Object_", "(_", "self_", "._", "bytes", "\\u", "a_", ",_", "enums_", "._", "Opa", "que", "Data", "Type_", "._", "NONE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "Opa", "que", "Object_", "(_", "self_", "._", "bytes", "\\u", "a_", ",_", "enums_", "._", "Opa", "que", "Data", "Type_", "._", "NONE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "a_", "==_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "b_", "==_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Opa", "que", "Object_", "(_", "testtools_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "equal", "\\u", "on", "\\u", "not", "\\u", "equal", "\\u", "value_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tha", "t", " ", "the", " ", "equality", " ", "opera", "tor", " ", "return", "s", " ", "Fal", "se", " ", "whe", "n", " ", "compa", "ring", " ", "two", "\\", "10", ";", " ", " ", " ", " ", "Opa", "que", "Object", " ", "object", "s", " ", "with", " ", "different", " ", "data", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "Opa", "que", "Object_", "(_", "self_", "._", "bytes", "\\u", "a_", ",_", "enums_", "._", "Opa", "que", "Data", "Type_", "._", "NONE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "Opa", "que", "Object_", "(_", "self_", "._", "bytes", "\\u", "b_", ",_", "enums_", "._", "Opa", "que", "Data", "Type_", "._", "NONE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "a_", "==_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "b_", "==_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Opa", "que", "Object_", "(_", "testtools_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "equal", "\\u", "on", "\\u", "not", "\\u", "equal", "\\u", "data\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tha", "t", " ", "the", " ", "equality", " ", "opera", "tor", " ", "return", "s", " ", "Fal", "se", " ", "whe", "n", " ", "compa", "ring", " ", "two", "\\", "10", ";", " ", " ", " ", " ", "Opa", "que", "Object", " ", "object", "s", " ", "with", " ", "different", " ", "data", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "Opa", "que", "Object_", "(_", "self_", "._", "bytes", "\\u", "a_", ",_", "enums_", "._", "Opa", "que", "Data", "Type_", "._", "NONE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "Opa", "que", "Object_", "(_", "self_", "._", "bytes", "\\u", "a_", ",_", "enums_", "._", "Opa", "que", "Data", "Type_", "._", "NONE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "opaque", "\\u", "type_", "=_", "\"", "invalid", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "a_", "==_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "b_", "==_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Opa", "que", "Object_", "(_", "testtools_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "equal", "\\u", "on", "\\u", "type", "\\u", "mismatch_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tha", "t", " ", "the", " ", "equality", " ", "opera", "tor", " ", "return", "s", " ", "Fal", "se", " ", "whe", "n", " ", "compa", "ring", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "Opa", "que", "Object", " ", "object", " ", "to", " ", "a", " ", "non", "-", "Opa", "que", "Object", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "Opa", "que", "Object_", "(_", "self_", "._", "bytes", "\\u", "a_", ",_", "enums_", "._", "Opa", "que", "Data", "Type_", "._", "NONE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "\"", "invalid", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "a_", "==_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "b_", "==_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Opa", "que", "Object_", "(_", "testtools_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "not", "\\u", "equal", "\\u", "on", "\\u", "equal_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tha", "t", " ", "the", " ", "inequal", "it", "y", " ", "opera", "tor", " ", "return", "s", " ", "Fal", "se", " ", "whe", "n", " ", "compa", "ring", "\\", "10", ";", " ", " ", " ", " ", "two", " ", "Opa", "que", "Object", " ", "object", "s", " ", "with", " ", "the", " ", "same", " ", "internal", " ", "data", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "Opa", "que", "Object_", "(_", "self_", "._", "bytes", "\\u", "a_", ",_", "enums_", "._", "Opa", "que", "Data", "Type_", "._", "NONE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "Opa", "que", "Object_", "(_", "self_", "._", "bytes", "\\u", "a_", ",_", "enums_", "._", "Opa", "que", "Data", "Type_", "._", "NONE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "a_", "!=_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "b_", "!=_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Opa", "que", "Object_", "(_", "testtools_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "not", "\\u", "equal", "\\u", "on", "\\u", "not", "\\u", "equal", "\\u", "value_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tha", "t", " ", "the", " ", "equality", " ", "opera", "tor", " ", "return", "s", " ", "Tru", "e", " ", "whe", "n", " ", "compa", "ring", " ", "two", "\\", "10", ";", " ", " ", " ", " ", "Opa", "que", "Object", " ", "object", "s", " ", "with", " ", "different", " ", "data", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "Opa", "que", "Object_", "(_", "self_", "._", "bytes", "\\u", "a_", ",_", "enums_", "._", "Opa", "que", "Data", "Type_", "._", "NONE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "Opa", "que", "Object_", "(_", "self_", "._", "bytes", "\\u", "b_", ",_", "enums_", "._", "Opa", "que", "Data", "Type_", "._", "NONE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "a_", "!=_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "b_", "!=_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Opa", "que", "Object_", "(_", "testtools_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "not", "\\u", "equal", "\\u", "on", "\\u", "not", "\\u", "equal", "\\u", "data\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tha", "t", " ", "the", " ", "equality", " ", "opera", "tor", " ", "return", "s", " ", "Tru", "e", " ", "whe", "n", " ", "compa", "ring", " ", "two", "\\", "10", ";", " ", " ", " ", " ", "Opa", "que", "Object", " ", "object", "s", " ", "with", " ", "different", " ", "data", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "Opa", "que", "Object_", "(_", "self_", "._", "bytes", "\\u", "a_", ",_", "enums_", "._", "Opa", "que", "Data", "Type_", "._", "NONE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "Opa", "que", "Object_", "(_", "self_", "._", "bytes", "\\u", "a_", ",_", "enums_", "._", "Opa", "que", "Data", "Type_", "._", "NONE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "opaque", "\\u", "type_", "=_", "\"", "invalid", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "a_", "!=_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "b_", "!=_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Opa", "que", "Object_", "(_", "testtools_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "not", "\\u", "equal", "\\u", "on", "\\u", "type", "\\u", "mismatch_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tha", "t", " ", "the", " ", "equality", " ", "opera", "tor", " ", "return", "s", " ", "Tru", "e", " ", "whe", "n", " ", "compa", "ring", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "Opa", "que", "Object", " ", "object", " ", "to", " ", "a", " ", "non", "-", "Opa", "que", "Object", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "Opa", "que", "Object_", "(_", "self_", "._", "bytes", "\\u", "a_", ",_", "enums_", "._", "Opa", "que", "Data", "Type_", "._", "NONE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "\"", "invalid", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "a_", "!=_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "b_", "!=_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Except block handles 'BaseException'
panoptes/POCS/scripts/read_weather.py
[ { "content": " def __init__(self, serial_address=None):\n super().__init__()\n\n # Make logger\n logger = logging.getLogger('AAG_cloud_sensor')\n if len(logger.handlers) == 0:\n logger.setLevel(logging.DEBUG)\n # Set up console output\n LogConsoleHandler = logging.StreamHandler()\n LogConsoleHandler.setLevel(logging.INFO)\n LogFormat = logging.Formatter('%(asctime)23s %(levelname)8s: %(message)s')\n LogConsoleHandler.setFormatter(LogFormat)\n logger.addHandler(LogConsoleHandler)\n # Set up file output\n LogFilePath = os.path.join('/', 'var', 'panoptes', 'logs', 'PanoptesWeather')\n\n if not os.path.exists(LogFilePath):\n os.mkdir(LogFilePath)\n\n now = dt.utcnow()\n LogFileName = now.strftime('AAGCloudSensor.log')\n LogFile = os.path.join(LogFilePath, LogFileName)\n LogFileHandler = logging.handlers.TimedRotatingFileHandler(LogFile,\n when='midnight', interval=1, utc=True)\n LogFileHandler.setLevel(logging.DEBUG)\n LogFileHandler.setFormatter(LogFormat)\n logger.addHandler(LogFileHandler)\n\n self.logger = logger\n\n # Read configuration\n self.cfg = load_config()['weather']['aag_cloud']\n\n # Initialize Serial Connection\n if not serial_address:\n serial_address = self.cfg.get('serial_port', '/dev/ttyUSB0')\n\n if self.logger:\n self.logger.debug('Using serial address: {}'.format(serial_address))\n\n if serial_address:\n if self.logger:\n self.logger.info('Connecting to AAG Cloud Sensor')\n try:\n self.AAG = serial.Serial(serial_address, 9600, timeout=2)\n self.logger.info(\" Connected to Cloud Sensor on {}\".format(serial_address))\n except OSError as e:\n self.logger.error('Unable to connect to AAG Cloud Sensor')\n self.logger.error(' {}'.format(e.errno))\n self.logger.error(' {}'.format(e.strerror))\n self.AAG = None\n except:\n self.logger.error(\"Unable to connect to AAG Cloud Sensor\")\n self.AAG = None\n else:\n self.AAG = None\n\n # Thresholds\n\n # Initialize Values\n self.last_update = None\n self.safe = None\n self.ambient_temp = None\n self.sky_temp = None\n self.wind_speed = None\n self.internal_voltage = None\n self.LDR_resistance = None\n self.rain_sensor_temp = None\n self.PWM = None\n self.errors = None\n self.switch = None\n self.safe_dict = None\n self.hibernate = 0.500 # time to wait after failed query\n\n # Set Up Heater\n if 'heater' in self.cfg:\n self.heater_cfg = self.cfg['heater']\n else:\n self.heater_cfg = {\n 'low_temp': 0,\n 'low_delta': 6,\n 'high_temp': 20,\n 'high_delta': 4,\n 'min_power': 10,\n 'impulse_temp': 10,\n 'impulse_duration': 60,\n 'impulse_cycle': 600,\n }\n self.heater_PID = PID(Kp=3.0, Ki=0.02, Kd=200.0,\n max_age=300,\n output_limits=[self.heater_cfg['min_power'], 100])\n\n self.impulse_heating = None\n self.impulse_start = None\n\n # Command Translation\n self.commands = {'!A': 'Get internal name',\n '!B': 'Get firmware version',\n '!C': 'Get values',\n '!D': 'Get internal errors',\n '!E': 'Get rain frequency',\n '!F': 'Get switch status',\n '!G': 'Set switch open',\n '!H': 'Set switch closed',\n 'P\\d\\d\\d\\d!': 'Set PWM value',\n '!Q': 'Get PWM value',\n '!S': 'Get sky IR temperature',\n '!T': 'Get sensor temperature',\n '!z': 'Reset RS232 buffer pointers',\n '!K': 'Get serial number',\n 'v!': 'Query if anemometer enabled',\n 'V!': 'Get wind speed',\n 'M!': 'Get electrical constants',\n '!Pxxxx': 'Set PWM value to xxxx',\n }\n self.expects = {'!A': '!N\\s+(\\w+)!',\n '!B': '!V\\s+([\\d\\.\\-]+)!',\n '!C': '!6\\s+([\\d\\.\\-]+)!4\\s+([\\d\\.\\-]+)!5\\s+([\\d\\.\\-]+)!',\n '!D': '!E1\\s+([\\d\\.]+)!E2\\s+([\\d\\.]+)!E3\\s+([\\d\\.]+)!E4\\s+([\\d\\.]+)!',\n '!E': '!R\\s+([\\d\\.\\-]+)!',\n '!F': '!Y\\s+([\\d\\.\\-]+)!',\n 'P\\d\\d\\d\\d!': '!Q\\s+([\\d\\.\\-]+)!',\n '!Q': '!Q\\s+([\\d\\.\\-]+)!',\n '!S': '!1\\s+([\\d\\.\\-]+)!',\n '!T': '!2\\s+([\\d\\.\\-]+)!',\n '!K': '!K(\\d+)\\s*\\\\x00!',\n 'v!': '!v\\s+([\\d\\.\\-]+)!',\n 'V!': '!w\\s+([\\d\\.\\-]+)!',\n 'M!': '!M(.{12})',\n }\n self.delays = {\n '!E': 0.350,\n }\n\n if self.AAG:\n # Query Device Name\n result = self.query('!A')\n if result:\n self.name = result[0].strip()\n if self.logger:\n self.logger.info(' Device Name is \"{}\"'.format(self.name))\n else:\n self.name = ''\n if self.logger:\n self.logger.warning(' Failed to get Device Name')\n sys.exit(1)\n\n # Query Firmware Version\n result = self.query('!B')\n if result:\n self.firmware_version = result[0].strip()\n if self.logger:\n self.logger.info(' Firmware Version = {}'.format(self.firmware_version))\n else:\n self.firmware_version = ''\n if self.logger:\n self.logger.warning(' Failed to get Firmware Version')\n sys.exit(1)\n\n # Query Serial Number\n result = self.query('!K')\n if result:\n self.serial_number = result[0].strip()\n if self.logger:\n self.logger.info(' Serial Number: {}'.format(self.serial_number))\n else:\n self.serial_number = ''\n if self.logger:\n self.logger.warning(' Failed to get Serial Number')\n sys.exit(1)", "metadata": "root.AAGCloudSensor.__init__", "header": "['class', 'AAGCloudSensor', '(', 'WeatherStation', ')', ':', '___EOS___']", "index": 109 }, { "content": " def get_ambient_temperature(self, n=5):\n '''\n Populates the self.ambient_temp property\n\n Calculation is taken from Rs232_Comms_v100.pdf section \"Converting values\n sent by the device to meaningful units\" item 5.\n '''\n if self.logger:\n self.logger.info('Getting ambient temperature')\n values = []\n for i in range(0, n):\n try:\n value = float(self.query('!T')[0]) / 100.\n except:\n pass\n else:\n if self.logger:\n self.logger.debug(' Ambient Temperature Query = {:.1f}'.format(value))\n values.append(value)\n if len(values) >= n - 1:\n self.ambient_temp = np.median(values) * u.Celsius\n if self.logger:\n self.logger.info(' Ambient Temperature = {:.1f}'.format(self.ambient_temp))\n else:\n self.ambient_temp = None\n if self.logger:\n self.logger.info(' Failed to Read Ambient Temperature')\n return self.ambient_temp", "metadata": "root.AAGCloudSensor.get_ambient_temperature", "header": "['class', 'AAGCloudSensor', '(', 'WeatherStation', ')', ':', '___EOS___']", "index": 350 }, { "content": " def get_sky_temperature(self, n=9):\n '''\n Populates the self.sky_temp property\n\n Calculation is taken from Rs232_Comms_v100.pdf section \"Converting values\n sent by the device to meaningful units\" item 1.\n\n Does this n times as recommended by the \"Communication operational\n recommendations\" section in Rs232_Comms_v100.pdf\n '''\n if self.logger:\n self.logger.info('Getting sky temperature')\n values = []\n for i in range(0, n):\n try:\n value = float(self.query('!S')[0]) / 100.\n except:\n pass\n else:\n if self.logger:\n self.logger.debug(' Sky Temperature Query = {:.1f}'.format(value))\n values.append(value)\n if len(values) >= n - 1:\n self.sky_temp = np.median(values) * u.Celsius\n if self.logger:\n self.logger.info(' Sky Temperature = {:.1f}'.format(self.sky_temp))\n else:\n self.sky_temp = None\n if self.logger:\n self.logger.info(' Failed to Read Sky Temperature')\n return self.sky_temp", "metadata": "root.AAGCloudSensor.get_sky_temperature", "header": "['class', 'AAGCloudSensor', '(', 'WeatherStation', ')', ':', '___EOS___']", "index": 379 }, { "content": " def get_values(self, n=5):\n '''\n Populates the self.internal_voltage, self.LDR_resistance, and\n self.rain_sensor_temp properties\n\n Calculation is taken from Rs232_Comms_v100.pdf section \"Converting values\n sent by the device to meaningful units\" items 4, 6, 7.\n '''\n if self.logger:\n self.logger.info('Getting \"values\"')\n ZenerConstant = 3\n LDRPullupResistance = 56.\n RainPullUpResistance = 1\n RainResAt25 = 1\n RainBeta = 3450.\n ABSZERO = 273.15\n internal_voltages = []\n LDR_resistances = []\n rain_sensor_temps = []\n for i in range(0, n):\n responses = self.query('!C')\n try:\n internal_voltage = 1023 * ZenerConstant / float(responses[0])\n internal_voltages.append(internal_voltage)\n LDR_resistance = LDRPullupResistance / ((1023. / float(responses[1])) - 1.)\n LDR_resistances.append(LDR_resistance)\n r = np.log(RainPullUpResistance / ((1023. / float(responses[2])) - 1.) / RainResAt25)\n rain_sensor_temp = 1. / (r / RainBeta + 1. / (ABSZERO + 25.)) - ABSZERO\n rain_sensor_temps.append(rain_sensor_temp)\n except:\n pass\n\n # Median Results\n if len(internal_voltages) >= n - 1:\n self.internal_voltage = np.median(internal_voltages) * u.volt\n if self.logger:\n self.logger.info(' Internal Voltage = {:.2f}'.format(self.internal_voltage))\n else:\n self.internal_voltage = None\n if self.logger:\n self.logger.info(' Failed to read Internal Voltage')\n\n if len(LDR_resistances) >= n - 1:\n self.LDR_resistance = np.median(LDR_resistances) * u.kohm\n if self.logger:\n self.logger.info(' LDR Resistance = {:.0f}'.format(self.LDR_resistance))\n else:\n self.LDR_resistance = None\n if self.logger:\n self.logger.info(' Failed to read LDR Resistance')\n\n if len(rain_sensor_temps) >= n - 1:\n self.rain_sensor_temp = np.median(rain_sensor_temps) * u.Celsius\n if self.logger:\n self.logger.info(' Rain Sensor Temp = {:.1f}'.format(self.rain_sensor_temp))\n else:\n self.rain_sensor_temp = None\n if self.logger:\n self.logger.info(' Failed to read Rain Sensor Temp')\n\n return (self.internal_voltage, self.LDR_resistance, self.rain_sensor_temp)", "metadata": "root.AAGCloudSensor.get_values", "header": "['class', 'AAGCloudSensor', '(', 'WeatherStation', ')', ':', '___EOS___']", "index": 411 }, { "content": " def get_rain_frequency(self, n=5):\n '''\n Populates the self.rain_frequency property\n '''\n if self.logger:\n self.logger.info('Getting rain frequency')\n values = []\n for i in range(0, n):\n try:\n value = float(self.query('!E')[0]) * 100. / 1023.\n if self.logger:\n self.logger.debug(' Rain Freq Query = {:.1f}'.format(value))\n values.append(value)\n except:\n pass\n if len(values) >= n - 1:\n self.rain_frequency = np.median(values)\n if self.logger:\n self.logger.info(' Rain Frequency = {:.1f}'.format(self.rain_frequency))\n else:\n self.rain_frequency = None\n if self.logger:\n self.logger.info(' Failed to read Rain Frequency')\n return self.rain_frequency", "metadata": "root.AAGCloudSensor.get_rain_frequency", "header": "['class', 'AAGCloudSensor', '(', 'WeatherStation', ')', ':', '___EOS___']", "index": 473 }, { "content": " def get_PWM(self):\n '''\n Populates the self.PWM property.\n\n Calculation is taken from Rs232_Comms_v100.pdf section \"Converting values\n sent by the device to meaningful units\" item 3.\n '''\n if self.logger:\n self.logger.info('Getting PWM value')\n try:\n value = self.query('!Q')[0]\n self.PWM = float(value) * 100. / 1023.\n if self.logger:\n self.logger.info(' PWM Value = {:.1f}'.format(self.PWM))\n except:\n self.PWM = None\n if self.logger:\n self.logger.info(' Failed to read PWM Value')\n return self.PWM", "metadata": "root.AAGCloudSensor.get_PWM", "header": "['class', 'AAGCloudSensor', '(', 'WeatherStation', ')', ':', '___EOS___']", "index": 498 }, { "content": " def wind_speed_enabled(self):\n '''\n Method returns true or false depending on whether the device supports\n wind speed measurements.\n '''\n if self.logger:\n self.logger.debug('Checking if wind speed is enabled')\n try:\n enabled = bool(self.query('v!')[0])\n if enabled:\n if self.logger:\n self.logger.debug(' Anemometer enabled')\n else:\n if self.logger:\n self.logger.debug(' Anemometer not enabled')\n except:\n enabled = None\n return enabled", "metadata": "root.AAGCloudSensor.wind_speed_enabled", "header": "['class', 'AAGCloudSensor', '(', 'WeatherStation', ')', ':', '___EOS___']", "index": 601 }, { "content": " def update_weather(self, update_mongo=True):\n '''\n '''\n data = {}\n data['Device Name'] = self.name\n data['Firmware Version'] = self.firmware_version\n data['Device Serial Number'] = self.serial_number\n if self.get_sky_temperature():\n data['Sky Temperature (C)'] = self.sky_temp.value\n if self.get_ambient_temperature():\n data['Ambient Temperature (C)'] = self.ambient_temp.value\n self.get_values()\n if self.internal_voltage:\n data['Internal Voltage (V)'] = self.internal_voltage.value\n if self.LDR_resistance:\n data['LDR Resistance (ohm)'] = self.LDR_resistance.value\n if self.rain_sensor_temp:\n data['Rain Sensor Temp (C)'] = self.rain_sensor_temp.value\n if self.get_rain_frequency():\n data['Rain Frequency'] = self.rain_frequency\n if self.get_PWM():\n data['PWM Value'] = self.PWM\n if self.get_errors():\n data['Errors'] = self.errors\n# if self.get_switch():\n# data['Switch Status'] = self.switch\n if self.get_wind_speed():\n data['Wind Speed (km/h)'] = self.wind_speed.value\n # Make Safety Decision\n self.safe_dict = make_safety_decision(self.cfg, logger=self.logger)\n data['Safe'] = self.safe_dict['Safe']\n data['Sky Condition'] = self.safe_dict['Sky']\n data['Wind Condition'] = self.safe_dict['Wind']\n data['Gust Condition'] = self.safe_dict['Gust']\n data['Rain Condition'] = self.safe_dict['Rain']\n\n if update_mongo:\n try:\n # Connect to sensors collection\n db = PanMongo()\n if self.logger:\n self.logger.info('Connected to mongo')\n\n db.insert_current('weather', data)\n\n if self.logger:\n self.logger.info(' Updated current status document')\n except:\n if self.logger:\n self.logger.warning('Failed to update mongo database')\n else:\n print('{:>26s}: {}'.format('Date and Time',\n dt.utcnow().strftime('%Y/%m/%d %H:%M:%S')))\n for key in ['Ambient Temperature (C)', 'Sky Temperature (C)',\n 'PWM Value', 'Rain Frequency', 'Safe']:\n if key in data.keys():\n print('{:>26s}: {}'.format(key, data[key]))\n else:\n print('{:>26s}: {}'.format(key, 'no data'))\n print('')\n\n return self.safe", "metadata": "root.AAGCloudSensor.update_weather", "header": "['class', 'AAGCloudSensor', '(', 'WeatherStation', ')', ':', '___EOS___']", "index": 650 }, { "content": "def plot_weather(date_string):\n import matplotlib as mpl\n mpl.use('Agg')\n from matplotlib import pyplot as plt\n from matplotlib.dates import HourLocator, MinuteLocator, DateFormatter\n plt.ioff()\n\n dpi = 100\n plt.figure(figsize=(16, 9), dpi=dpi)\n\n hours = HourLocator(byhour=range(24), interval=1)\n hours_fmt = DateFormatter('%H')\n mins = MinuteLocator(range(0, 60, 15))\n mins_fmt = DateFormatter('%H:%M')\n\n if not date_string:\n today = True\n date = dt.utcnow()\n date_string = date.strftime('%Y%m%dUT')\n else:\n today = False\n date = dt.strptime('{} 23:59:59'.format(date_string), '%Y%m%dUT %H:%M:%S')\n\n start = dt(date.year, date.month, date.day, 0, 0, 0, 0)\n end = dt(date.year, date.month, date.day, 23, 59, 59, 0)\n\n # ------------------------------------------------------------------------\n # determine sunrise and sunset times\n # ------------------------------------------------------------------------\n cfg = load_config()['location']\n loc = EarthLocation(\n lat=cfg['latitude'],\n lon=cfg['longitude'],\n height=cfg['elevation'],\n )\n obs = Observer(location=loc, name='PANOPTES', timezone=cfg['timezone'])\n\n sunset = obs.sun_set_time(Time(start), which='next').datetime\n evening_civil_twilight = obs.twilight_evening_civil(Time(start), which='next').datetime\n evening_nautical_twilight = obs.twilight_evening_nautical(Time(start), which='next').datetime\n evening_astronomical_twilight = obs.twilight_evening_astronomical(Time(start), which='next').datetime\n morning_astronomical_twilight = obs.twilight_morning_astronomical(Time(start), which='next').datetime\n morning_nautical_twilight = obs.twilight_morning_nautical(Time(start), which='next').datetime\n morning_civil_twilight = obs.twilight_morning_civil(Time(start), which='next').datetime\n sunrise = obs.sun_rise_time(Time(start), which='next').datetime\n\n print('start: {}'.format(Time(start)))\n print(obs.is_night(Time(start)))\n print('sunset: {}'.format(sunset))\n print('evening_civil_twilight: {}'.format(evening_civil_twilight))\n print('evening_nautical_twilight: {}'.format(evening_nautical_twilight))\n print('evening_astronomical_twilight: {}'.format(evening_astronomical_twilight))\n print('morning_astronomical_twilight: {}'.format(morning_astronomical_twilight))\n print('morning_nautical_twilight: {}'.format(morning_nautical_twilight))\n print('morning_civil_twilight: {}'.format(morning_civil_twilight))\n\n # -------------------------------------------------------------------------\n # Plot a day's weather\n # -------------------------------------------------------------------------\n plot_positions = [([0.000, 0.835, 0.700, 0.170], [0.720, 0.835, 0.280, 0.170]),\n ([0.000, 0.635, 0.700, 0.170], [0.720, 0.635, 0.280, 0.170]),\n ([0.000, 0.450, 0.700, 0.170], [0.720, 0.450, 0.280, 0.170]),\n ([0.000, 0.265, 0.700, 0.170], [0.720, 0.265, 0.280, 0.170]),\n ([0.000, 0.185, 0.700, 0.065], [0.720, 0.185, 0.280, 0.065]),\n ([0.000, 0.000, 0.700, 0.170], [0.720, 0.000, 0.280, 0.170]),\n ]\n\n # Connect to sensors collection\n db = PanMongo()\n entries = [x for x in db.weather.find({'date': {'$gt': start, '$lt': end}}).sort([('date', pymongo.ASCENDING)])]\n if today:\n current_values = [x for x in db.current.find({\"type\": \"weather\"})][0]\n else:\n current_values = None\n\n print('Plot Ambient Temperature vs. Time')\n # -------------------------------------------------------------------------\n # Plot Ambient Temperature vs. Time\n t_axes = plt.axes(plot_positions[0][0])\n if today:\n time_title = date\n else:\n time_title = end\n plt.title('Weather for {} at {}'.format(date_string, time_title.strftime('%H:%M:%S UT')))\n amb_temp = [x['data']['Ambient Temperature (C)']\n for x in entries\n if 'Ambient Temperature (C)' in x['data'].keys()]\n time = [x['date'] for x in entries\n if 'Ambient Temperature (C)' in x['data'].keys()]\n t_axes.plot_date(time, amb_temp, 'ko',\n markersize=2, markeredgewidth=0,\n drawstyle=\"default\")\n try:\n max_temp = max(amb_temp)\n min_temp = min(amb_temp)\n label_time = end - tdelta(0, 7 * 60 * 60)\n label_temp = 28\n t_axes.annotate('Low: {:4.1f} $^\\circ$C, High: {:4.1f} $^\\circ$C'.format(\n min_temp, max_temp),\n xy=(label_time, max_temp),\n xytext=(label_time, label_temp),\n size=16,\n )\n except:\n pass\n plt.ylabel(\"Ambient Temp. (C)\")\n plt.grid(which='major', color='k')\n plt.yticks(range(-100, 100, 10))\n plt.xlim(start, end)\n plt.ylim(-5, 35)\n t_axes.xaxis.set_major_locator(hours)\n t_axes.xaxis.set_major_formatter(hours_fmt)\n\n if obs.is_night(Time(start)):\n plt.axvspan(start, morning_astronomical_twilight, ymin=0, ymax=1, color='blue', alpha=0.5)\n plt.axvspan(morning_astronomical_twilight, morning_nautical_twilight, ymin=0, ymax=1, color='blue', alpha=0.3)\n plt.axvspan(morning_nautical_twilight, morning_civil_twilight, ymin=0, ymax=1, color='blue', alpha=0.2)\n plt.axvspan(morning_civil_twilight, sunrise, ymin=0, ymax=1, color='blue', alpha=0.1)\n plt.axvspan(sunset, evening_civil_twilight, ymin=0, ymax=1, color='blue', alpha=0.1)\n plt.axvspan(evening_civil_twilight, evening_nautical_twilight, ymin=0, ymax=1, color='blue', alpha=0.2)\n plt.axvspan(evening_nautical_twilight, evening_astronomical_twilight, ymin=0, ymax=1, color='blue', alpha=0.3)\n plt.axvspan(evening_astronomical_twilight, end, ymin=0, ymax=1, color='blue', alpha=0.5)\n else:\n plt.axvspan(sunset, evening_civil_twilight, ymin=0, ymax=1, color='blue', alpha=0.1)\n plt.axvspan(evening_civil_twilight, evening_nautical_twilight, ymin=0, ymax=1, color='blue', alpha=0.2)\n plt.axvspan(evening_nautical_twilight, evening_astronomical_twilight, ymin=0, ymax=1, color='blue', alpha=0.3)\n plt.axvspan(evening_astronomical_twilight, morning_astronomical_twilight,\n ymin=0, ymax=1, color='blue', alpha=0.5)\n plt.axvspan(morning_astronomical_twilight, morning_nautical_twilight, ymin=0, ymax=1, color='blue', alpha=0.3)\n plt.axvspan(morning_nautical_twilight, morning_civil_twilight, ymin=0, ymax=1, color='blue', alpha=0.2)\n plt.axvspan(morning_civil_twilight, sunrise, ymin=0, ymax=1, color='blue', alpha=0.1)\n\n tlh_axes = plt.axes(plot_positions[0][1])\n plt.title('Last Hour')\n tlh_axes.plot_date(time, amb_temp, 'ko',\n markersize=4, markeredgewidth=0,\n drawstyle=\"default\")\n try:\n current_amb_temp = current_values['data']['Ambient Temperature (C)']\n current_time = current_values['date']\n label_time = current_time - tdelta(0, 30 * 60)\n label_temp = 28 # current_amb_temp + 7\n tlh_axes.annotate('Currently: {:.1f} $^\\circ$C'.format(current_amb_temp),\n xy=(current_time, current_amb_temp),\n xytext=(label_time, label_temp),\n size=16,\n )\n except:\n pass\n plt.grid(which='major', color='k')\n plt.yticks(range(-100, 100, 10))\n tlh_axes.xaxis.set_major_locator(mins)\n tlh_axes.xaxis.set_major_formatter(mins_fmt)\n tlh_axes.yaxis.set_ticklabels([])\n plt.xlim(date - tdelta(0, 60 * 60), date + tdelta(0, 5 * 60))\n plt.ylim(-5, 35)\n\n print('Plot Temperature Difference vs. Time')\n # -------------------------------------------------------------------------\n # Plot Temperature Difference vs. Time\n td_axes = plt.axes(plot_positions[1][0])\n temp_diff = [x['data']['Sky Temperature (C)'] - x['data']['Ambient Temperature (C)']\n for x in entries\n if 'Sky Temperature (C)' in x['data'].keys() and 'Ambient Temperature (C)' in x['data'].keys() and 'Sky Condition' in x['data'].keys()]\n time = [x['date'] for x in entries\n if 'Sky Temperature (C)' in x['data'].keys() and 'Ambient Temperature (C)' in x['data'].keys() and 'Sky Condition' in x['data'].keys()]\n sky_condition = [x['data']['Sky Condition']\n for x in entries\n if 'Sky Temperature (C)' in x['data'].keys() and 'Ambient Temperature (C)' in x['data'].keys() and 'Sky Condition' in x['data'].keys()]\n td_axes.plot_date(time, temp_diff, 'ko-', label='Cloudiness',\n markersize=2, markeredgewidth=0,\n drawstyle=\"default\")\n td_axes.fill_between(time, -60, temp_diff, where=np.array(sky_condition) == 'Clear',\n color='green', alpha=0.5)\n td_axes.fill_between(time, -60, temp_diff, where=np.array(sky_condition) == 'Cloudy',\n color='yellow', alpha=0.5)\n td_axes.fill_between(time, -60, temp_diff, where=np.array(sky_condition) == 'Very Cloudy',\n color='red', alpha=0.5)\n plt.ylabel(\"Cloudiness\")\n plt.grid(which='major', color='k')\n plt.yticks(range(-100, 100, 10))\n plt.xlim(start, end)\n plt.ylim(-60, 10)\n td_axes.xaxis.set_major_locator(hours)\n td_axes.xaxis.set_major_formatter(hours_fmt)\n td_axes.xaxis.set_ticklabels([])\n\n tdlh_axes = plt.axes(plot_positions[1][1])\n tdlh_axes.plot_date(time, temp_diff, 'ko-', label='Cloudiness',\n markersize=4, markeredgewidth=0,\n drawstyle=\"default\")\n tdlh_axes.fill_between(time, -60, temp_diff, where=np.array(sky_condition) == 'Clear',\n color='green', alpha=0.5)\n tdlh_axes.fill_between(time, -60, temp_diff, where=np.array(sky_condition) == 'Cloudy',\n color='yellow', alpha=0.5)\n tdlh_axes.fill_between(time, -60, temp_diff, where=np.array(sky_condition) == 'Very Cloudy',\n color='red', alpha=0.5)\n plt.grid(which='major', color='k')\n plt.yticks(range(-100, 100, 10))\n plt.xlim(date - tdelta(0, 60 * 60), date + tdelta(0, 5 * 60))\n plt.ylim(-60, 10)\n tdlh_axes.xaxis.set_major_locator(mins)\n tdlh_axes.xaxis.set_major_formatter(mins_fmt)\n tdlh_axes.xaxis.set_ticklabels([])\n tdlh_axes.yaxis.set_ticklabels([])\n\n print('Plot Wind Speed vs. Time')\n # -------------------------------------------------------------------------\n # Plot Wind Speed vs. Time\n w_axes = plt.axes(plot_positions[2][0])\n wind_speed = [x['data']['Wind Speed (km/h)']\n for x in entries\n if 'Wind Speed (km/h)' in x['data'].keys() and\n 'Wind Condition' in x['data'].keys() and\n 'Gust Condition' in x['data'].keys()]\n wind_mavg = movingaverage(wind_speed, 10)\n trans = {'Calm': 0, 'Windy': 1, 'Gusty': 1, 'Very Windy': 10, 'Very Gusty': 10}\n wind_condition = [trans[x['data']['Wind Condition']] + trans[x['data']['Gust Condition']]\n for x in entries\n if 'Wind Speed (km/h)' in x['data'].keys() and\n 'Wind Condition' in x['data'].keys() and\n 'Gust Condition' in x['data'].keys()]\n time = [x['date'] for x in entries\n if 'Wind Speed (km/h)' in x['data'].keys() and\n 'Wind Condition' in x['data'].keys() and\n 'Gust Condition' in x['data'].keys()]\n w_axes.plot_date(time, wind_speed, 'ko', alpha=0.5,\n markersize=2, markeredgewidth=0,\n drawstyle=\"default\")\n w_axes.plot_date(time, wind_mavg, 'b-',\n label='Wind Speed',\n markersize=3, markeredgewidth=0,\n linewidth=3, alpha=0.5,\n drawstyle=\"default\")\n w_axes.plot_date([start, end], [0, 0], 'k-', ms=1)\n w_axes.fill_between(time, -5, wind_speed,\n where=np.array(wind_condition) == 0,\n color='green', alpha=0.5)\n w_axes.fill_between(time, -5, wind_speed,\n where=(np.array(wind_condition) > 0) & (np.array(wind_condition) < 10),\n color='yellow', alpha=0.5)\n w_axes.fill_between(time, -5, wind_speed,\n where=np.array(wind_condition) > 10,\n color='red', alpha=0.5)\n try:\n max_wind = max(wind_speed)\n label_time = end - tdelta(0, 6 * 60 * 60)\n label_wind = 61\n w_axes.annotate('Max Gust: {:.1f} (km/h)'.format(max_wind),\n xy=(label_time, max_wind),\n xytext=(label_time, label_wind),\n size=16,\n )\n except:\n pass\n plt.ylabel(\"Wind (km/h)\")\n plt.grid(which='major', color='k')\n plt.yticks(range(-100, 100, 10))\n plt.xlim(start, end)\n wind_max = max([45, np.ceil(max(wind_speed) / 5.) * 5.])\n plt.ylim(0, 75)\n w_axes.xaxis.set_major_locator(hours)\n w_axes.xaxis.set_major_formatter(hours_fmt)\n w_axes.xaxis.set_ticklabels([])\n\n wlh_axes = plt.axes(plot_positions[2][1])\n wlh_axes.plot_date(time, wind_speed, 'ko', alpha=0.7,\n markersize=4, markeredgewidth=0,\n drawstyle=\"default\")\n wlh_axes.plot_date(time, wind_mavg, 'b-',\n label='Wind Speed',\n markersize=2, markeredgewidth=0,\n linewidth=3, alpha=0.5,\n drawstyle=\"default\")\n wlh_axes.plot_date([start, end], [0, 0], 'k-', ms=1)\n wlh_axes.fill_between(time, -5, wind_speed,\n where=np.array(wind_condition) == 0,\n color='green', alpha=0.5)\n wlh_axes.fill_between(time, -5, wind_speed,\n where=(np.array(wind_condition) > 0) & (np.array(wind_condition) < 10),\n color='yellow', alpha=0.5)\n wlh_axes.fill_between(time, -5, wind_speed,\n where=np.array(wind_condition) > 10,\n color='red', alpha=0.5)\n try:\n current_wind = current_values['data']['Wind Speed (km/h)']\n current_time = current_values['date']\n label_time = current_time - tdelta(0, 30 * 60)\n label_wind = 61\n wlh_axes.annotate('Currently: {:.0f} km/h'.format(current_wind),\n xy=(current_time, current_wind),\n xytext=(label_time, label_wind),\n size=16,\n )\n except:\n pass\n plt.grid(which='major', color='k')\n plt.yticks(range(-100, 100, 10))\n plt.xlim(date - tdelta(0, 60 * 60), date + tdelta(0, 5 * 60))\n wind_max = max([45, np.ceil(max(wind_speed) / 5.) * 5.])\n plt.ylim(0, 75)\n wlh_axes.xaxis.set_major_locator(mins)\n wlh_axes.xaxis.set_major_formatter(mins_fmt)\n wlh_axes.xaxis.set_ticklabels([])\n wlh_axes.yaxis.set_ticklabels([])\n\n print('Plot Rain Frequency vs. Time')\n # -------------------------------------------------------------------------\n # Plot Rain Frequency vs. Time\n rf_axes = plt.axes(plot_positions[3][0])\n rf_value = [x['data']['Rain Frequency']\n for x in entries\n if 'Rain Frequency' in x['data'].keys() and\n 'Rain Condition' in x['data'].keys()]\n rain_condition = [x['data']['Rain Condition']\n for x in entries\n if 'Rain Frequency' in x['data'].keys() and\n 'Rain Condition' in x['data'].keys()]\n time = [x['date'] for x in entries\n if 'Rain Frequency' in x['data'].keys() and\n 'Rain Condition' in x['data'].keys()]\n rf_axes.plot_date(time, rf_value, 'ko-', label='Rain',\n markersize=2, markeredgewidth=0,\n drawstyle=\"default\")\n rf_axes.fill_between(time, 0, rf_value, where=np.array(rain_condition) == 'Dry',\n color='green', alpha=0.5)\n rf_axes.fill_between(time, 0, rf_value, where=np.array(rain_condition) == 'Rain',\n color='red', alpha=0.5)\n plt.ylabel(\"Rain Sensor\")\n plt.grid(which='major', color='k')\n plt.ylim(120, 275)\n plt.xlim(start, end)\n rf_axes.xaxis.set_major_locator(hours)\n rf_axes.xaxis.set_major_formatter(hours_fmt)\n rf_axes.xaxis.set_ticklabels([])\n rf_axes.yaxis.set_ticklabels([])\n\n rflh_axes = plt.axes(plot_positions[3][1])\n rflh_axes.plot_date(time, rf_value, 'ko-', label='Rain',\n markersize=4, markeredgewidth=0,\n drawstyle=\"default\")\n rflh_axes.fill_between(time, 0, rf_value, where=np.array(rain_condition) == 'Dry',\n color='green', alpha=0.5)\n rflh_axes.fill_between(time, 0, rf_value, where=np.array(rain_condition) == 'Rain',\n color='red', alpha=0.5)\n plt.grid(which='major', color='k')\n plt.ylim(120, 275)\n plt.xlim(date - tdelta(0, 60 * 60), date + tdelta(0, 5 * 60))\n rflh_axes.xaxis.set_major_locator(mins)\n rflh_axes.xaxis.set_major_formatter(mins_fmt)\n rflh_axes.xaxis.set_ticklabels([])\n rflh_axes.yaxis.set_ticklabels([])\n\n print('Plot Safe/Unsafe vs. Time')\n # -------------------------------------------------------------------------\n # Safe/Unsafe vs. Time\n safe_axes = plt.axes(plot_positions[4][0])\n safe_value = [int(x['data']['Safe'])\n for x in entries\n if 'Safe' in x['data'].keys()]\n safe_time = [x['date'] for x in entries\n if 'Safe' in x['data'].keys()]\n safe_axes.plot_date(safe_time, safe_value, 'ko',\n markersize=2, markeredgewidth=0,\n drawstyle=\"default\")\n safe_axes.fill_between(safe_time, -1, safe_value, where=np.array(safe_value) == 1,\n color='green', alpha=0.5)\n safe_axes.fill_between(safe_time, -1, safe_value, where=np.array(safe_value) == 0,\n color='red', alpha=0.5)\n plt.ylabel(\"Safe\")\n plt.xlim(start, end)\n plt.ylim(-0.1, 1.1)\n plt.yticks([0, 1])\n plt.grid(which='major', color='k')\n safe_axes.xaxis.set_major_locator(hours)\n safe_axes.xaxis.set_major_formatter(hours_fmt)\n safe_axes.xaxis.set_ticklabels([])\n safe_axes.yaxis.set_ticklabels([])\n\n safelh_axes = plt.axes(plot_positions[4][1])\n safelh_axes.plot_date(safe_time, safe_value, 'ko-',\n markersize=4, markeredgewidth=0,\n drawstyle=\"default\")\n safelh_axes.fill_between(safe_time, -1, safe_value, where=np.array(safe_value) == 1,\n color='green', alpha=0.5)\n safelh_axes.fill_between(safe_time, -1, safe_value, where=np.array(safe_value) == 0,\n color='red', alpha=0.5)\n plt.ylim(-0.1, 1.1)\n plt.yticks([0, 1])\n plt.grid(which='major', color='k')\n plt.xlim(date - tdelta(0, 60 * 60), date + tdelta(0, 5 * 60))\n safelh_axes.xaxis.set_major_locator(mins)\n safelh_axes.xaxis.set_major_formatter(mins_fmt)\n safelh_axes.xaxis.set_ticklabels([])\n safelh_axes.yaxis.set_ticklabels([])\n\n print('Plot PWM Value vs. Time')\n # -------------------------------------------------------------------------\n # Plot PWM Value vs. Time\n pwm_axes = plt.axes(plot_positions[5][0])\n plt.ylabel(\"Heater (%)\")\n plt.ylim(-5, 105)\n plt.yticks([0, 25, 50, 75, 100])\n plt.xlim(start, end)\n plt.grid(which='major', color='k')\n rst_axes = pwm_axes.twinx()\n plt.ylim(-1, 21)\n plt.xlim(start, end)\n pwm_value = [x['data']['PWM Value']\n for x in entries\n if 'PWM Value' in x['data'].keys() and\n 'Rain Sensor Temp (C)' in x['data'].keys() and\n 'Ambient Temperature (C)' in x['data'].keys()]\n rst_delta = [x['data']['Rain Sensor Temp (C)'] - x['data']['Ambient Temperature (C)']\n for x in entries\n if 'PWM Value' in x['data'].keys() and\n 'Rain Sensor Temp (C)' in x['data'].keys() and\n 'Ambient Temperature (C)' in x['data'].keys()]\n time = [x['date'] for x in entries\n if 'PWM Value' in x['data'].keys() and\n 'Rain Sensor Temp (C)' in x['data'].keys() and\n 'Ambient Temperature (C)' in x['data'].keys()]\n rst_axes.plot_date(time, rst_delta, 'ro-', alpha=0.5,\n label='RST Delta (C)',\n markersize=2, markeredgewidth=0,\n drawstyle=\"default\")\n pwm_axes.plot_date(time, pwm_value, 'bo', label='Heater',\n markersize=2, markeredgewidth=0,\n drawstyle=\"default\")\n pwm_axes.xaxis.set_major_locator(hours)\n pwm_axes.xaxis.set_major_formatter(hours_fmt)\n\n pwmlh_axes = plt.axes(plot_positions[5][1])\n plt.ylim(-5, 105)\n plt.yticks([0, 25, 50, 75, 100])\n plt.xlim(date - tdelta(0, 60 * 60), date + tdelta(0, 5 * 60))\n plt.grid(which='major', color='k')\n rstlh_axes = pwmlh_axes.twinx()\n plt.ylim(-1, 21)\n plt.xlim(date - tdelta(0, 60 * 60), date + tdelta(0, 5 * 60))\n rstlh_axes.plot_date(time, rst_delta, 'ro-', alpha=0.5,\n label='RST Delta (C)',\n markersize=4, markeredgewidth=0,\n drawstyle=\"default\")\n rstlh_axes.xaxis.set_ticklabels([])\n rstlh_axes.yaxis.set_ticklabels([])\n pwmlh_axes.plot_date(time, pwm_value, 'bo', label='Heater',\n markersize=4, markeredgewidth=0,\n drawstyle=\"default\")\n pwmlh_axes.xaxis.set_major_locator(mins)\n pwmlh_axes.xaxis.set_major_formatter(mins_fmt)\n pwmlh_axes.yaxis.set_ticklabels([])\n\n # -------------------------------------------------------------------------\n # Plot Brightness vs. Time\n# ldr_axes = plt.axes(plot_positions[3][0])\n# max_ldr = 28587999.99999969\n# ldr_value = [x['data']['LDR Resistance (ohm)']\\\n# for x in entries\\\n# if 'LDR Resistance (ohm)' in x['data'].keys()]\n# brightness = [10.**(2. - 2.*x/max_ldr) for x in ldr_value]\n# time = [x['date'] for x in entries\\\n# if 'LDR Resistance (ohm)' in x['data'].keys()]\n# ldr_axes.plot_date(time, brightness, 'ko',\\\n# markersize=2, markeredgewidth=0,\\\n# drawstyle=\"default\")\n# plt.ylabel(\"Brightness (%)\")\n# plt.yticks(range(-100,100,10))\n# plt.ylim(-5,105)\n# plt.grid(which='major', color='k')\n# ldr_axes.xaxis.set_major_locator(hours)\n# ldr_axes.xaxis.set_major_formatter(hours_fmt)\n# plt.xlim(start, end)\n#\n# if obs.is_night(start):\n# plt.axvspan(start, morning_astronomical_twilight, ymin=0, ymax=1, color='blue', alpha=0.5)\n# plt.axvspan(morning_astronomical_twilight, morning_nautical_twilight, ymin=0, ymax=1, color='blue', alpha=0.3)\n# plt.axvspan(morning_nautical_twilight, morning_civil_twilight, ymin=0, ymax=1, color='blue', alpha=0.2)\n# plt.axvspan(morning_civil_twilight, sunrise, ymin=0, ymax=1, color='blue', alpha=0.1)\n# plt.axvspan(sunset, evening_civil_twilight, ymin=0, ymax=1, color='blue', alpha=0.1)\n# plt.axvspan(evening_civil_twilight, evening_nautical_twilight, ymin=0, ymax=1, color='blue', alpha=0.2)\n# plt.axvspan(evening_nautical_twilight, evening_astronomical_twilight, ymin=0, ymax=1, color='blue', alpha=0.3)\n# plt.axvspan(evening_astronomical_twilight, end, ymin=0, ymax=1, color='blue', alpha=0.5)\n# else:\n# plt.axvspan(sunset, evening_civil_twilight, ymin=0, ymax=1, color='blue', alpha=0.1)\n# plt.axvspan(evening_civil_twilight, evening_nautical_twilight, ymin=0, ymax=1, color='blue', alpha=0.2)\n# plt.axvspan(evening_nautical_twilight, evening_astronomical_twilight, ymin=0, ymax=1, color='blue', alpha=0.3)\n# plt.axvspan(evening_astronomical_twilight, morning_astronomical_twilight, ymin=0, ymax=1, color='blue', alpha=0.5)\n# plt.axvspan(morning_astronomical_twilight, morning_nautical_twilight, ymin=0, ymax=1, color='blue', alpha=0.3)\n# plt.axvspan(morning_nautical_twilight, morning_civil_twilight, ymin=0, ymax=1, color='blue', alpha=0.2)\n# plt.axvspan(morning_civil_twilight, sunrise, ymin=0, ymax=1, color='blue', alpha=0.1)\n\n # -------------------------------------------------------------------------\n plot_filename = '{}.png'.format(date_string)\n plot_file = os.path.expanduser('/var/panoptes/weather_plots/{}'.format(plot_filename))\n print('Save Figure: {}'.format(plot_file))\n plt.savefig(plot_file, dpi=dpi, bbox_inches='tight', pad_inches=0.10)\n # Link\n today_name = '/var/panoptes/weather_plots/today.png'\n if os.path.exists(today_name):\n os.remove(today_name)\n\n os.symlink(plot_file, today_name)", "metadata": "root.plot_weather", "header": "['module', '___EOS___']", "index": 1022 } ]
[ { "span": "except:", "start_line": 160, "start_column": 12, "end_line": 160, "end_column": 19 }, { "span": "except:", "start_line": 363, "start_column": 12, "end_line": 363, "end_column": 19 }, { "span": "except:", "start_line": 395, "start_column": 12, "end_line": 395, "end_column": 19 }, { "span": "except:", "start_line": 440, "start_column": 12, "end_line": 440, "end_column": 19 }, { "span": "except:", "start_line": 486, "start_column": 12, "end_line": 486, "end_column": 19 }, { "span": "except:", "start_line": 512, "start_column": 8, "end_line": 512, "end_column": 15 }, { "span": "except:", "start_line": 616, "start_column": 8, "end_line": 616, "end_column": 15 }, { "span": "except:", "start_line": 697, "start_column": 12, "end_line": 697, "end_column": 19 }, { "span": "except:", "start_line": 1125, "start_column": 4, "end_line": 1125, "end_column": 11 }, { "span": "except:", "start_line": 1169, "start_column": 4, "end_line": 1169, "end_column": 11 }, { "span": "except:", "start_line": 1275, "start_column": 4, "end_line": 1275, "end_column": 11 }, { "span": "except:", "start_line": 1316, "start_column": 4, "end_line": 1316, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "AAG", "Cloud", "Sensor_", "(_", "Wea", "ther", "Station_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "serial", "\\u", "address_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "logger_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "AAG", "\\u", "cloud", "\\u", "sensor", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "logger_", "._", "handlers_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "set", "Level_", "(_", "logging_", "._", "DEBUG_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Set", " ", "up", " ", "console", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "Log", "Cons", "ole", "Handler_", "=_", "logging_", "._", "Stream", "Handler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Log", "Cons", "ole", "Handler_", "._", "set", "Level_", "(_", "logging_", "._", "INFO_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Log", "Format_", "=_", "logging_", "._", "Formatter_", "(_", "'%", "(", "asc", "time", ")", "23", "s", " ", "%", "(", "level", "name", ")", "8s", ":", " ", "%", "(", "message", ")", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Log", "Cons", "ole", "Handler_", "._", "set", "Formatter_", "(_", "Log", "Format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "add", "Handler_", "(_", "Log", "Cons", "ole", "Handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Set", " ", "up", " ", "file", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "Log", "File", "Path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "'/'_", ",_", "'", "var", "'_", ",_", "'", "pano", "pte", "s", "'_", ",_", "'", "logs", "'_", ",_", "'", "Pan", "opt", "es", "Wea", "ther", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "Log", "File", "Path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "mkdir_", "(_", "Log", "File", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "now_", "=_", "dt_", "._", "utcnow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Log", "File", "Name_", "=_", "now_", "._", "strftime_", "(_", "'", "AAG", "Cloud", "Sen", "sor", ".", "log", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Log", "File_", "=_", "os_", "._", "path_", "._", "join_", "(_", "Log", "File", "Path_", ",_", "Log", "File", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Log", "File", "Handler_", "=_", "logging_", "._", "handlers_", "._", "Time", "d", "Rot", "ati", "ng", "File", "Handler_", "(_", "Log", "File_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "when_", "=_", "'", "mid", "night", "'_", ",_", "interval_", "=_", "1_", ",_", "utc_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Log", "File", "Handler_", "._", "set", "Level_", "(_", "logging_", "._", "DEBUG_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Log", "File", "Handler_", "._", "set", "Formatter_", "(_", "Log", "Format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "add", "Handler_", "(_", "Log", "File", "Handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "logger_", "=_", "logger_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Read", " ", "configuration_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg_", "=_", "load", "\\u", "config_", "(_", ")_", "[_", "'", "wea", "ther", "'_", "]_", "[_", "'", "aa", "g", "\\u", "cloud", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initializ", "e", " ", "Ser", "ial", " ", "Connection_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "serial", "\\u", "address_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "serial", "\\u", "address_", "=_", "self_", "._", "cfg_", "._", "get_", "(_", "'", "serial", "\\u", "port", "'_", ",_", "'/", "dev", "/", "tt", "y", "USB", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "debug_", "(_", "'", "Us", "ing", " ", "serial", " ", "address", ":", " ", "{}'_", "._", "format_", "(_", "serial", "\\u", "address_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "serial", "\\u", "address_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", "Connect", "ing", " ", "to", " ", "AAG", " ", "Cloud", " ", "Sen", "sor", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "AAG", "_", "=_", "serial_", "._", "Serial_", "(_", "serial", "\\u", "address_", ",_", "9600", "_", ",_", "timeout_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logger_", "._", "info_", "(_", "\"", " ", " ", "Connect", "ed", " ", "to", " ", "Cloud", " ", "Sen", "sor", " ", "on", " ", "{}\"_", "._", "format_", "(_", "serial", "\\u", "address_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "OSE", "rror_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "error_", "(_", "'", "Una", "ble", " ", "to", " ", "connect", " ", "to", " ", "AAG", " ", "Cloud", " ", "Sen", "sor", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logger_", "._", "error_", "(_", "'", " ", " ", "{}'_", "._", "format_", "(_", "e_", "._", "errno_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logger_", "._", "error_", "(_", "'", " ", " ", "{}'_", "._", "format_", "(_", "e_", "._", "strerror_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "AAG", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "error_", "(_", "\"", "Una", "ble", " ", "to", " ", "connect", " ", "to", " ", "AAG", " ", "Cloud", " ", "Sen", "sor", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "AAG", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "AAG", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thresh", "olds", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initializ", "e", " ", "Values_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "last", "\\u", "update_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "safe_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ambient", "\\u", "temp_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sky", "\\u", "temp_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wind", "\\u", "speed_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "internal", "\\u", "voltage_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "LD", "R", "\\u", "resistance", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rain", "\\u", "sensor", "\\u", "temp_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "PWM", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "switch_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "safe", "\\u", "dict_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hib", "erna", "te_", "=_", "0.50", "0_", "#", " ", "time", " ", "to", " ", "wait", " ", "after", " ", "fail", "ed", " ", "query_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "Up", " ", "Heat", "er_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "heater", "'_", "in_", "self_", "._", "cfg_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "heater", "\\u", "cfg_", "=_", "self_", "._", "cfg_", "[_", "'", "heater", "'_", "]_", "\\u\\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_", "._", "heater", "\\u", "cfg_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "low", "\\u", "temp", "'_", ":_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "low", "\\u", "delta", "'_", ":_", "6_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "high", "\\u", "temp", "'_", ":_", "20_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "high", "\\u", "delta", "'_", ":_", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "min", "\\u", "power", "'_", ":_", "10_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "impu", "lse", "\\u", "temp", "'_", ":_", "10_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "impu", "lse", "\\u", "duration", "'_", ":_", "60_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "impu", "lse", "\\u", "cycle", "'_", ":_", "600_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "heater", "\\u", "PID_", "=_", "PID_", "(_", "Kp", "_", "=_", "3.0_", ",_", "Ki", "_", "=_", "0.02_", ",_", "Kd", "_", "=_", "200.", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "age_", "=_", "300_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "output", "\\u", "limits_", "=_", "[_", "self_", "._", "heater", "\\u", "cfg_", "[_", "'", "min", "\\u", "power", "'_", "]_", ",_", "100_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "impu", "lse", "\\u", "heating", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "impu", "lse", "\\u", "start_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Command", " ", "Translation_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "commands_", "=_", "{_", "'!", "A", "'_", ":_", "'", "Get", " ", "internal", " ", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "B", "'_", ":_", "'", "Get", " ", "firmware", " ", "version", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "C", "'_", ":_", "'", "Get", " ", "values", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "D", "'_", ":_", "'", "Get", " ", "internal", " ", "error", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "E", "'_", ":_", "'", "Get", " ", "rain", " ", "freque", "nc", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "F", "'_", ":_", "'", "Get", " ", "switch", " ", "status", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "G", "'_", ":_", "'", "Set", " ", "switch", " ", "open", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "H", "'_", ":_", "'", "Set", " ", "switch", " ", "close", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "P", "\\\\", "d", "\\\\", "d", "\\\\", "d", "\\\\", "d", "!'_", ":_", "'", "Set", " ", "PWM", " ", "value", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "Q", "'_", ":_", "'", "Get", " ", "PWM", " ", "value", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "S", "'_", ":_", "'", "Get", " ", "sky", " ", "IR", " ", "tempe", "ratur", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "T", "'_", ":_", "'", "Get", " ", "sensor", " ", "tempe", "ratur", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "z", "'_", ":_", "'", "Reset", " ", "RS", "232", " ", "buffer", " ", "pointers", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "K", "'_", ":_", "'", "Get", " ", "serial", " ", "number", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "v", "!'_", ":_", "'", "Query", " ", "if", " ", "ane", "mom", "eter", " ", "enable", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "V", "!'_", ":_", "'", "Get", " ", "wind", " ", "speed", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "M", "!'_", ":_", "'", "Get", " ", "electric", "al", " ", "constant", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "Px", "xxx", "'_", ":_", "'", "Set", " ", "PWM", " ", "value", " ", "to", " ", "xxx", "x", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "expect", "s_", "=_", "{_", "'!", "A", "'_", ":_", "'!", "N", "\\\\", "s", "+(", "\\\\", "w", "+)", "!'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "B", "'_", ":_", "'!", "V", "\\\\", "s", "+([", "\\\\", "d", "\\\\.\\\\", "-]+)", "!'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "C", "'_", ":_", "'!", "6", "\\\\", "s", "+([", "\\\\", "d", "\\\\.\\\\", "-]+)", "!", "4", "\\\\", "s", "+([", "\\\\", "d", "\\\\.\\\\", "-]+)", "!", "5", "\\\\", "s", "+([", "\\\\", "d", "\\\\.\\\\", "-]+)", "!'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "D", "'_", ":_", "'!", "E1", "\\\\", "s", "+([", "\\\\", "d", "\\\\.]", "+)", "!", "E2", "\\\\", "s", "+([", "\\\\", "d", "\\\\.]", "+)", "!", "E3", "\\\\", "s", "+([", "\\\\", "d", "\\\\.]", "+)", "!", "E4", "\\\\", "s", "+([", "\\\\", "d", "\\\\.]", "+)", "!'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "E", "'_", ":_", "'!", "R", "\\\\", "s", "+([", "\\\\", "d", "\\\\.\\\\", "-]+)", "!'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "F", "'_", ":_", "'!", "Y", "\\\\", "s", "+([", "\\\\", "d", "\\\\.\\\\", "-]+)", "!'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "P", "\\\\", "d", "\\\\", "d", "\\\\", "d", "\\\\", "d", "!'_", ":_", "'!", "Q", "\\\\", "s", "+([", "\\\\", "d", "\\\\.\\\\", "-]+)", "!'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "Q", "'_", ":_", "'!", "Q", "\\\\", "s", "+([", "\\\\", "d", "\\\\.\\\\", "-]+)", "!'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "S", "'_", ":_", "'!", "1", "\\\\", "s", "+([", "\\\\", "d", "\\\\.\\\\", "-]+)", "!'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "T", "'_", ":_", "'!", "2", "\\\\", "s", "+([", "\\\\", "d", "\\\\.\\\\", "-]+)", "!'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "K", "'_", ":_", "'!", "K", "(\\\\", "d", "+)\\\\", "s", "*\\\\\\\\", "x0", "0", "!'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "v", "!'_", ":_", "'!", "v", "\\\\", "s", "+([", "\\\\", "d", "\\\\.\\\\", "-]+)", "!'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "V", "!'_", ":_", "'!", "w", "\\\\", "s", "+([", "\\\\", "d", "\\\\.\\\\", "-]+)", "!'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "M", "!'_", ":_", "'!", "M", "(.", "{", "1", "2", "})'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "delays", "_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "E", "'_", ":_", "0.35", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "AAG", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Query", " ", "Dev", "ice", " ", "Name_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "query_", "(_", "'!", "A", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "=_", "result_", "[_", "0_", "]_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "logger_", "._", "info_", "(_", "'", " ", " ", "Dev", "ice", " ", "Name", " ", "is", " ", "\"{}\"'_", "._", "format_", "(_", "self_", "._", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "logger_", "._", "warning_", "(_", "'", " ", " ", "Fail", "ed", " ", "to", " ", "get", " ", "Dev", "ice", " ", "Name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Query", " ", "Firm", "ware", " ", "Version_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "self_", "._", "query_", "(_", "'!", "B", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "firmware", "\\u", "version_", "=_", "result_", "[_", "0_", "]_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "logger_", "._", "info_", "(_", "'", " ", " ", "Firm", "ware", " ", "Version", " ", "=", " ", "{}'_", "._", "format_", "(_", "self_", "._", "firmware", "\\u", "version_", ")_", ")_", "\\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_", "._", "firmware", "\\u", "version_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "logger_", "._", "warning_", "(_", "'", " ", " ", "Fail", "ed", " ", "to", " ", "get", " ", "Firm", "ware", " ", "Version", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Query", " ", "Ser", "ial", " ", "Number_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "self_", "._", "query_", "(_", "'!", "K", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "serial", "\\u", "number_", "=_", "result_", "[_", "0_", "]_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "logger_", "._", "info_", "(_", "'", " ", " ", "Ser", "ial", " ", "Number", ":", " ", "{}'_", "._", "format_", "(_", "self_", "._", "serial", "\\u", "number_", ")_", ")_", "\\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_", "._", "serial", "\\u", "number_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "logger_", "._", "warning_", "(_", "'", " ", " ", "Fail", "ed", " ", "to", " ", "get", " ", "Ser", "ial", " ", "Number", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "AAG", "Cloud", "Sensor_", "(_", "Wea", "ther", "Station_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "ambient", "\\u", "temperature_", "(_", "self_", ",_", "n_", "=_", "5_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Populate", "s", " ", "the", " ", "self", ".", "ambient", "\\u", "temp", " ", "property", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Calculat", "ion", " ", "is", " ", "take", "n", " ", "from", " ", "Rs", "232", "\\u", "Comm", "s", "\\u", "v1", "00", ".", "pdf", " ", "section", " ", "\"", "Converti", "ng", " ", "values", "\\", "10", ";", " ", " ", " ", " ", "sent", " ", "by", " ", "the", " ", "device", " ", "to", " ", "meaning", "ful", " ", "unit", "s", "\"", " ", "item", " ", "5", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", "Get", "ting", " ", "ambient", " ", "tempe", "ratur", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "values_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "n_", ")_", ":_", "\\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 ", " _", "value_", "=_", "float_", "(_", "self_", "._", "query_", "(_", "'!", "T", "'_", ")_", "[_", "0_", "]_", ")_", "/_", "100._", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "logger_", "._", "debug_", "(_", "'", " ", " ", "Ambi", "ent", " ", "Tempe", "ratur", "e", " ", "Query", " ", "=", " ", "{:", ".1", "f", "}'_", "._", "format_", "(_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "values_", "._", "append_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "values_", ")_", ">=_", "n_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "ambient", "\\u", "temp_", "=_", "np_", "._", "median_", "(_", "values_", ")_", "*_", "u_", "._", "Cel", "sius", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", " ", " ", "Ambi", "ent", " ", "Tempe", "ratur", "e", " ", "=", " ", "{:", ".1", "f", "}'_", "._", "format_", "(_", "self_", "._", "ambient", "\\u", "temp_", ")_", ")_", "\\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_", "._", "ambient", "\\u", "temp_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", " ", " ", "Fail", "ed", " ", "to", " ", "Read", " ", "Ambi", "ent", " ", "Tempe", "ratur", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "ambient", "\\u", "temp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "AAG", "Cloud", "Sensor_", "(_", "Wea", "ther", "Station_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "sky", "\\u", "temperature_", "(_", "self_", ",_", "n_", "=_", "9_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Populate", "s", " ", "the", " ", "self", ".", "sky", "\\u", "temp", " ", "property", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Calculat", "ion", " ", "is", " ", "take", "n", " ", "from", " ", "Rs", "232", "\\u", "Comm", "s", "\\u", "v1", "00", ".", "pdf", " ", "section", " ", "\"", "Converti", "ng", " ", "values", "\\", "10", ";", " ", " ", " ", " ", "sent", " ", "by", " ", "the", " ", "device", " ", "to", " ", "meaning", "ful", " ", "unit", "s", "\"", " ", "item", " ", "1", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Do", "es", " ", "this", " ", "n", " ", "times", " ", "as", " ", "recommende", "d", " ", "by", " ", "the", " ", "\"", "Communication", " ", "operati", "onal", "\\", "10", ";", " ", " ", " ", " ", "recommendations", "\"", " ", "section", " ", "in", " ", "Rs", "232", "\\u", "Comm", "s", "\\u", "v1", "00", ".", "pdf", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", "Get", "ting", " ", "sky", " ", "tempe", "ratur", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "values_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "n_", ")_", ":_", "\\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 ", " _", "value_", "=_", "float_", "(_", "self_", "._", "query_", "(_", "'!", "S", "'_", ")_", "[_", "0_", "]_", ")_", "/_", "100._", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "logger_", "._", "debug_", "(_", "'", " ", " ", "Sky", " ", "Tempe", "ratur", "e", " ", "Query", " ", "=", " ", "{:", ".1", "f", "}'_", "._", "format_", "(_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "values_", "._", "append_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "values_", ")_", ">=_", "n_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "sky", "\\u", "temp_", "=_", "np_", "._", "median_", "(_", "values_", ")_", "*_", "u_", "._", "Cel", "sius", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", " ", " ", "Sky", " ", "Tempe", "ratur", "e", " ", "=", " ", "{:", ".1", "f", "}'_", "._", "format_", "(_", "self_", "._", "sky", "\\u", "temp_", ")_", ")_", "\\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_", "._", "sky", "\\u", "temp_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", " ", " ", "Fail", "ed", " ", "to", " ", "Read", " ", "Sky", " ", "Tempe", "ratur", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "sky", "\\u", "temp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "AAG", "Cloud", "Sensor_", "(_", "Wea", "ther", "Station_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "values_", "(_", "self_", ",_", "n_", "=_", "5_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Populate", "s", " ", "the", " ", "self", ".", "internal", "\\u", "voltage", ",", " ", "self", ".", "LD", "R", "\\u", "resistance", ",", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "self", ".", "rain", "\\u", "sensor", "\\u", "temp", " ", "proper", "ties", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Calculat", "ion", " ", "is", " ", "take", "n", " ", "from", " ", "Rs", "232", "\\u", "Comm", "s", "\\u", "v1", "00", ".", "pdf", " ", "section", " ", "\"", "Converti", "ng", " ", "values", "\\", "10", ";", " ", " ", " ", " ", "sent", " ", "by", " ", "the", " ", "device", " ", "to", " ", "meaning", "ful", " ", "unit", "s", "\"", " ", "items", " ", "4", ",", " ", "6", ",", " ", "7", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", "Get", "ting", " ", "\"", "values", "\"'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Ze", "ner", "Constant_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LD", "RP", "ull", "up", "Resist", "ance_", "=_", "56.", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Rain", "Pul", "l", "Up", "Resist", "ance_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Rain", "Res", "At", "25_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Rain", "Beta", "_", "=_", "345", "0._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ABS", "ZERO_", "=_", "273", ".15_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "internal", "\\u", "voltage", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LD", "R", "\\u", "resistance", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rain", "\\u", "sensor", "\\u", "temps_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "responses_", "=_", "self_", "._", "query_", "(_", "'!", "C", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "internal", "\\u", "voltage_", "=_", "1023", "_", "*_", "Ze", "ner", "Constant_", "/_", "float_", "(_", "responses_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "internal", "\\u", "voltage", "s_", "._", "append_", "(_", "internal", "\\u", "voltage_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LD", "R", "\\u", "resistance", "_", "=_", "LD", "RP", "ull", "up", "Resist", "ance_", "/_", "(_", "(_", "1023", "._", "/_", "float_", "(_", "responses_", "[_", "1_", "]_", ")_", ")_", "-_", "1._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LD", "R", "\\u", "resistance", "s_", "._", "append_", "(_", "LD", "R", "\\u", "resistance", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "np_", "._", "log_", "(_", "Rain", "Pul", "l", "Up", "Resist", "ance_", "/_", "(_", "(_", "1023", "._", "/_", "float_", "(_", "responses_", "[_", "2_", "]_", ")_", ")_", "-_", "1._", ")_", "/_", "Rain", "Res", "At", "25_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rain", "\\u", "sensor", "\\u", "temp_", "=_", "1._", "/_", "(_", "r_", "/_", "Rain", "Beta", "_", "+_", "1._", "/_", "(_", "ABS", "ZERO_", "+_", "25.", "_", ")_", ")_", "-_", "ABS", "ZERO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rain", "\\u", "sensor", "\\u", "temps_", "._", "append_", "(_", "rain", "\\u", "sensor", "\\u", "temp_", ")_", "\\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_", "#", " ", "Media", "n", " ", "Results_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "internal", "\\u", "voltage", "s_", ")_", ">=_", "n_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "internal", "\\u", "voltage_", "=_", "np_", "._", "median_", "(_", "internal", "\\u", "voltage", "s_", ")_", "*_", "u_", "._", "volt", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", " ", " ", "Intern", "al", " ", "Volt", "age", " ", "=", " ", "{:", ".2", "f", "}'_", "._", "format_", "(_", "self_", "._", "internal", "\\u", "voltage_", ")_", ")_", "\\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_", "._", "internal", "\\u", "voltage_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", " ", " ", "Fail", "ed", " ", "to", " ", "read", " ", "Intern", "al", " ", "Volt", "age", "'_", ")_", "\\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_", "len_", "(_", "LD", "R", "\\u", "resistance", "s_", ")_", ">=_", "n_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "LD", "R", "\\u", "resistance", "_", "=_", "np_", "._", "median_", "(_", "LD", "R", "\\u", "resistance", "s_", ")_", "*_", "u_", "._", "ko", "hm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", " ", " ", "LD", "R", " ", "Resist", "anc", "e", " ", "=", " ", "{:", ".0", "f", "}'_", "._", "format_", "(_", "self_", "._", "LD", "R", "\\u", "resistance", "_", ")_", ")_", "\\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_", "._", "LD", "R", "\\u", "resistance", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", " ", " ", "Fail", "ed", " ", "to", " ", "read", " ", "LD", "R", " ", "Resist", "anc", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "rain", "\\u", "sensor", "\\u", "temps_", ")_", ">=_", "n_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "rain", "\\u", "sensor", "\\u", "temp_", "=_", "np_", "._", "median_", "(_", "rain", "\\u", "sensor", "\\u", "temps_", ")_", "*_", "u_", "._", "Cel", "sius", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", " ", " ", "Rain", " ", "Sen", "sor", " ", "Temp", " ", "=", " ", "{:", ".1", "f", "}'_", "._", "format_", "(_", "self_", "._", "rain", "\\u", "sensor", "\\u", "temp_", ")_", ")_", "\\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_", "._", "rain", "\\u", "sensor", "\\u", "temp_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", " ", " ", "Fail", "ed", " ", "to", " ", "read", " ", "Rain", " ", "Sen", "sor", " ", "Temp", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "self_", "._", "internal", "\\u", "voltage_", ",_", "self_", "._", "LD", "R", "\\u", "resistance", "_", ",_", "self_", "._", "rain", "\\u", "sensor", "\\u", "temp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "AAG", "Cloud", "Sensor_", "(_", "Wea", "ther", "Station_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "rain", "\\u", "frequency_", "(_", "self_", ",_", "n_", "=_", "5_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Populate", "s", " ", "the", " ", "self", ".", "rain", "\\u", "freque", "nc", "y", " ", "property", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", "Get", "ting", " ", "rain", " ", "freque", "nc", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "values_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "n_", ")_", ":_", "\\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 ", " _", "value_", "=_", "float_", "(_", "self_", "._", "query_", "(_", "'!", "E", "'_", ")_", "[_", "0_", "]_", ")_", "*_", "100._", "/_", "1023", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "logger_", "._", "debug_", "(_", "'", " ", " ", "Rain", " ", "Freq", " ", "Query", " ", "=", " ", "{:", ".1", "f", "}'_", "._", "format_", "(_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "values_", "._", "append_", "(_", "value_", ")_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "values_", ")_", ">=_", "n_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "rain", "\\u", "frequency_", "=_", "np_", "._", "median_", "(_", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", " ", " ", "Rain", " ", "Freq", "uenc", "y", " ", "=", " ", "{:", ".1", "f", "}'_", "._", "format_", "(_", "self_", "._", "rain", "\\u", "frequency_", ")_", ")_", "\\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_", "._", "rain", "\\u", "frequency_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", " ", " ", "Fail", "ed", " ", "to", " ", "read", " ", "Rain", " ", "Freq", "uenc", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "rain", "\\u", "frequency_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "AAG", "Cloud", "Sensor_", "(_", "Wea", "ther", "Station_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "PWM", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Populate", "s", " ", "the", " ", "self", ".", "PWM", " ", "property", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Calculat", "ion", " ", "is", " ", "take", "n", " ", "from", " ", "Rs", "232", "\\u", "Comm", "s", "\\u", "v1", "00", ".", "pdf", " ", "section", " ", "\"", "Converti", "ng", " ", "values", "\\", "10", ";", " ", " ", " ", " ", "sent", " ", "by", " ", "the", " ", "device", " ", "to", " ", "meaning", "ful", " ", "unit", "s", "\"", " ", "item", " ", "3", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", "Get", "ting", " ", "PWM", " ", "value", "'_", ")_", "\\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 ", " _", "value_", "=_", "self_", "._", "query_", "(_", "'!", "Q", "'_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "PWM", "_", "=_", "float_", "(_", "value_", ")_", "*_", "100._", "/_", "1023", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", " ", " ", "PWM", " ", "Value", " ", "=", " ", "{:", ".1", "f", "}'_", "._", "format_", "(_", "self_", "._", "PWM", "_", ")_", ")_", "\\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 ", " _", "self_", "._", "PWM", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", " ", " ", "Fail", "ed", " ", "to", " ", "read", " ", "PWM", " ", "Value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "PWM", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "AAG", "Cloud", "Sensor_", "(_", "Wea", "ther", "Station_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wind", "\\u", "speed", "\\u", "enabled_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Meth", "od", " ", "return", "s", " ", "true", " ", "or", " ", "fal", "se", " ", "depend", "ing", " ", "on", " ", "whe", "ther", " ", "the", " ", "device", " ", "support", "s", "\\", "10", ";", " ", " ", " ", " ", "wind", " ", "speed", " ", "measure", "ment", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "debug_", "(_", "'", "Check", "ing", " ", "if", " ", "wind", " ", "speed", " ", "is", " ", "enable", "d", "'_", ")_", "\\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 ", " _", "enabled_", "=_", "bool_", "(_", "self_", "._", "query_", "(_", "'", "v", "!'_", ")_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "enabled_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "logger_", "._", "debug_", "(_", "'", " ", " ", "An", "emo", "mete", "r", " ", "enable", "d", "'_", ")_", "\\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_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "logger_", "._", "debug_", "(_", "'", " ", " ", "An", "emo", "mete", "r", " ", "not", " ", "enable", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "enabled_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "enabled_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "AAG", "Cloud", "Sensor_", "(_", "Wea", "ther", "Station_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "\\u", "weather_", "(_", "self_", ",_", "update", "\\u", "mongo_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "Dev", "ice", " ", "Name", "'_", "]_", "=_", "self_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "Firm", "ware", " ", "Version", "'_", "]_", "=_", "self_", "._", "firmware", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "Dev", "ice", " ", "Ser", "ial", " ", "Number", "'_", "]_", "=_", "self_", "._", "serial", "\\u", "number_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "get", "\\u", "sky", "\\u", "temperature_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "'", "Sky", " ", "Tempe", "ratur", "e", " ", "(", "C", ")'_", "]_", "=_", "self_", "._", "sky", "\\u", "temp_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "get", "\\u", "ambient", "\\u", "temperature_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "'", "Ambi", "ent", " ", "Tempe", "ratur", "e", " ", "(", "C", ")'_", "]_", "=_", "self_", "._", "ambient", "\\u", "temp_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "get", "\\u", "values_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "internal", "\\u", "voltage_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "'", "Intern", "al", " ", "Volt", "age", " ", "(", "V", ")'_", "]_", "=_", "self_", "._", "internal", "\\u", "voltage_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "LD", "R", "\\u", "resistance", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "'", "LD", "R", " ", "Resist", "anc", "e", " ", "(", "oh", "m", ")'_", "]_", "=_", "self_", "._", "LD", "R", "\\u", "resistance", "_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "rain", "\\u", "sensor", "\\u", "temp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "'", "Rain", " ", "Sen", "sor", " ", "Temp", " ", "(", "C", ")'_", "]_", "=_", "self_", "._", "rain", "\\u", "sensor", "\\u", "temp_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "get", "\\u", "rain", "\\u", "frequency_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "'", "Rain", " ", "Freq", "uenc", "y", "'_", "]_", "=_", "self_", "._", "rain", "\\u", "frequency_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "get", "\\u", "PWM", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "'", "PWM", " ", "Value", "'_", "]_", "=_", "self_", "._", "PWM", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "get", "\\u", "errors_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "'", "Error", "s", "'_", "]_", "=_", "self_", "._", "errors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "if", " ", "self", ".", "get", "\\u", "switch", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "data", "['", "Switch", " ", "Status", "']", " ", "=", " ", "self", ".", "switch_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "get", "\\u", "wind", "\\u", "speed_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "'", "Wind", " ", "Spee", "d", " ", "(", "km", "/", "h", ")'_", "]_", "=_", "self_", "._", "wind", "\\u", "speed_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Make", " ", "Safe", "ty", " ", "Deci", "sion_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "safe", "\\u", "dict_", "=_", "make", "\\u", "safety", "\\u", "decision_", "(_", "self_", "._", "cfg_", ",_", "logger_", "=_", "self_", "._", "logger_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "Safe", "'_", "]_", "=_", "self_", "._", "safe", "\\u", "dict_", "[_", "'", "Safe", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "Sky", " ", "Cond", "ition", "'_", "]_", "=_", "self_", "._", "safe", "\\u", "dict_", "[_", "'", "Sky", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "Wind", " ", "Cond", "ition", "'_", "]_", "=_", "self_", "._", "safe", "\\u", "dict_", "[_", "'", "Wind", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "Gu", "st", " ", "Cond", "ition", "'_", "]_", "=_", "self_", "._", "safe", "\\u", "dict_", "[_", "'", "Gu", "st", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "Rain", " ", "Cond", "ition", "'_", "]_", "=_", "self_", "._", "safe", "\\u", "dict_", "[_", "'", "Rain", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "update", "\\u", "mongo_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Connect", " ", "to", " ", "sensor", "s", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "=_", "Pan", "Mon", "go_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "logger_", "._", "info_", "(_", "'", "Connect", "ed", " ", "to", " ", "mongo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "db_", "._", "insert", "\\u", "current_", "(_", "'", "wea", "ther", "'_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "logger_", "._", "info_", "(_", "'", " ", " ", "Update", "d", " ", "current", " ", "status", " ", "document", "'_", ")_", "\\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 ", " _", "if_", "self_", "._", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "logger_", "._", "warning_", "(_", "'", "Fail", "ed", " ", "to", " ", "update", " ", "mongo", " ", "databa", "se", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'{:", ">", "2", "6", "s", "}:", " ", "{}'_", "._", "format_", "(_", "'", "Date", " ", "and", " ", "Time", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dt_", "._", "utcnow_", "(_", ")_", "._", "strftime_", "(_", "'%", "Y", "/", "%", "m", "/", "%", "d", " ", "%", "H", ":", "%", "M", ":", "%", "S", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", "in_", "[_", "'", "Ambi", "ent", " ", "Tempe", "ratur", "e", " ", "(", "C", ")'_", ",_", "'", "Sky", " ", "Tempe", "ratur", "e", " ", "(", "C", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PWM", " ", "Value", "'_", ",_", "'", "Rain", " ", "Freq", "uenc", "y", "'_", ",_", "'", "Safe", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "key_", "in_", "data_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "(_", "'{:", ">", "2", "6", "s", "}:", " ", "{}'_", "._", "format_", "(_", "key_", ",_", "data_", "[_", "key_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "(_", "'{:", ">", "2", "6", "s", "}:", " ", "{}'_", "._", "format_", "(_", "key_", ",_", "'", "no", " ", "data", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "safe_", "\\u\\u\\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_", "plot", "\\u", "weather_", "(_", "date", "\\u", "string_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "matplotlib_", "as_", "mpl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mpl_", "._", "use_", "(_", "'", "Agg", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "matplotlib_", "import_", "pyplot_", "as_", "plt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "matplotlib_", "._", "dates_", "import_", "Hour", "Locator_", ",_", "Minute", "Locator_", ",_", "Date", "Formatter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "io", "ff_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dpi_", "=_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "figure_", "(_", "figsize_", "=_", "(_", "16_", ",_", "9_", ")_", ",_", "dpi_", "=_", "dpi_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "hours_", "=_", "Hour", "Locator_", "(_", "by", "hour_", "=_", "range_", "(_", "24_", ")_", ",_", "interval_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hour", "s", "\\u", "fmt_", "=_", "Date", "Formatter_", "(_", "'%", "H", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mins_", "=_", "Minute", "Locator_", "(_", "range_", "(_", "0_", ",_", "60_", ",_", "15_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mins", "\\u", "fmt_", "=_", "Date", "Formatter_", "(_", "'%", "H", ":", "%", "M", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "date", "\\u", "string_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "today_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "date_", "=_", "dt_", "._", "utcnow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "date", "\\u", "string_", "=_", "date_", "._", "strftime_", "(_", "'%", "Y", "%", "m", "%", "d", "UT", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "today_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "date_", "=_", "dt_", "._", "strptime_", "(_", "'{}", " ", "23", ":", "5", "9", ":", "5", "9", "'_", "._", "format_", "(_", "date", "\\u", "string_", ")_", ",_", "'%", "Y", "%", "m", "%", "d", "UT", " ", "%", "H", ":", "%", "M", ":", "%", "S", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "start_", "=_", "dt_", "(_", "date_", "._", "year_", ",_", "date_", "._", "month_", ",_", "date_", "._", "day_", ",_", "0_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end_", "=_", "dt_", "(_", "date_", "._", "year_", ",_", "date_", "._", "month_", ",_", "date_", "._", "day_", ",_", "23_", ",_", "59_", ",_", "59_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "--", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "dete", "rmin", "e", " ", "sun", "rise", " ", "and", " ", "suns", "et", " ", "times_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "--", "_", "\\u\\u\\uNL\\u\\u\\u_", "cfg_", "=_", "load", "\\u", "config_", "(_", ")_", "[_", "'", "location", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loc_", "=_", "Ear", "th", "Location_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "lat_", "=_", "cfg_", "[_", "'", "latitude", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lon_", "=_", "cfg_", "[_", "'", "longitude", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "height_", "=_", "cfg_", "[_", "'", "elevat", "ion", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obs_", "=_", "Observer_", "(_", "location_", "=_", "loc_", ",_", "name_", "=_", "'", "PAN", "OPT", "ES", "'_", ",_", "timezone_", "=_", "cfg_", "[_", "'", "timezon", "e", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "suns", "et_", "=_", "obs_", "._", "sun", "\\u", "set\\u", "time_", "(_", "Time_", "(_", "start_", ")_", ",_", "which_", "=_", "'", "next", "'_", ")_", "._", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "even", "ing", "\\u", "civi", "l\\u", "twi", "light_", "=_", "obs_", "._", "twi", "light", "\\u", "even", "ing", "\\u", "civi", "l_", "(_", "Time_", "(_", "start_", ")_", ",_", "which_", "=_", "'", "next", "'_", ")_", "._", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "even", "ing", "\\u", "naut", "ical", "\\u", "twi", "light_", "=_", "obs_", "._", "twi", "light", "\\u", "even", "ing", "\\u", "naut", "ical_", "(_", "Time_", "(_", "start_", ")_", ",_", "which_", "=_", "'", "next", "'_", ")_", "._", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "even", "ing", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light_", "=_", "obs_", "._", "twi", "light", "\\u", "even", "ing", "\\u", "astro", "nomi", "cal_", "(_", "Time_", "(_", "start_", ")_", ",_", "which_", "=_", "'", "next", "'_", ")_", "._", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mor", "ning", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light_", "=_", "obs_", "._", "twi", "light", "\\u", "mor", "ning", "\\u", "astro", "nomi", "cal_", "(_", "Time_", "(_", "start_", ")_", ",_", "which_", "=_", "'", "next", "'_", ")_", "._", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mor", "ning", "\\u", "naut", "ical", "\\u", "twi", "light_", "=_", "obs_", "._", "twi", "light", "\\u", "mor", "ning", "\\u", "naut", "ical_", "(_", "Time_", "(_", "start_", ")_", ",_", "which_", "=_", "'", "next", "'_", ")_", "._", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mor", "ning", "\\u", "civi", "l\\u", "twi", "light_", "=_", "obs_", "._", "twi", "light", "\\u", "mor", "ning", "\\u", "civi", "l_", "(_", "Time_", "(_", "start_", ")_", ",_", "which_", "=_", "'", "next", "'_", ")_", "._", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sun", "rise", "_", "=_", "obs_", "._", "sun", "\\u", "rise", "\\u", "time_", "(_", "Time_", "(_", "start_", ")_", ",_", "which_", "=_", "'", "next", "'_", ")_", "._", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "'", "start", ":", " ", " ", " ", "{}'_", "._", "format_", "(_", "Time_", "(_", "start_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "obs_", "._", "is", "\\u", "night", "_", "(_", "Time_", "(_", "start_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "suns", "et", ":", " ", " ", "{}'_", "._", "format_", "(_", "suns", "et_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "even", "ing", "\\u", "civi", "l\\u", "twi", "light", ":", " ", " ", " ", " ", "{}'_", "._", "format_", "(_", "even", "ing", "\\u", "civi", "l\\u", "twi", "light_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "even", "ing", "\\u", "naut", "ical", "\\u", "twi", "light", ":", " ", "{}'_", "._", "format_", "(_", "even", "ing", "\\u", "naut", "ical", "\\u", "twi", "light_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "even", "ing", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light", ":", " ", "{}'_", "._", "format_", "(_", "even", "ing", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "mor", "ning", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light", ":", " ", "{}'_", "._", "format_", "(_", "mor", "ning", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "mor", "ning", "\\u", "naut", "ical", "\\u", "twi", "light", ":", " ", "{}'_", "._", "format_", "(_", "mor", "ning", "\\u", "naut", "ical", "\\u", "twi", "light_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "mor", "ning", "\\u", "civi", "l\\u", "twi", "light", ":", " ", " ", " ", " ", "{}'_", "._", "format_", "(_", "mor", "ning", "\\u", "civi", "l\\u", "twi", "light_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Plot", " ", "a", " ", "day", "'", "s", " ", "weather_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "plot", "\\u", "positions_", "=_", "[_", "(_", "[_", "0.000_", ",_", "0.83", "5_", ",_", "0.70", "0_", ",_", "0.17", "0_", "]_", ",_", "[_", "0.72", "0_", ",_", "0.83", "5_", ",_", "0.28", "0_", ",_", "0.17", "0_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "[_", "0.000_", ",_", "0.63", "5_", ",_", "0.70", "0_", ",_", "0.17", "0_", "]_", ",_", "[_", "0.72", "0_", ",_", "0.63", "5_", ",_", "0.28", "0_", ",_", "0.17", "0_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "[_", "0.000_", ",_", "0.45", "0_", ",_", "0.70", "0_", ",_", "0.17", "0_", "]_", ",_", "[_", "0.72", "0_", ",_", "0.45", "0_", ",_", "0.28", "0_", ",_", "0.17", "0_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "[_", "0.000_", ",_", "0.26", "5_", ",_", "0.70", "0_", ",_", "0.17", "0_", "]_", ",_", "[_", "0.72", "0_", ",_", "0.26", "5_", ",_", "0.28", "0_", ",_", "0.17", "0_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "[_", "0.000_", ",_", "0.18", "5_", ",_", "0.70", "0_", ",_", "0.06", "5_", "]_", ",_", "[_", "0.72", "0_", ",_", "0.18", "5_", ",_", "0.28", "0_", ",_", "0.06", "5_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "[_", "0.000_", ",_", "0.000_", ",_", "0.70", "0_", ",_", "0.17", "0_", "]_", ",_", "[_", "0.72", "0_", ",_", "0.000_", ",_", "0.28", "0_", ",_", "0.17", "0_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Connect", " ", "to", " ", "sensor", "s", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "=_", "Pan", "Mon", "go_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entries_", "=_", "[_", "x_", "for_", "x_", "in_", "db_", "._", "weather_", "._", "find_", "(_", "{_", "'", "date", "'_", ":_", "{_", "'$", "gt", "'_", ":_", "start_", ",_", "'$", "lt", "'_", ":_", "end_", "}_", "}_", ")_", "._", "sort_", "(_", "[_", "(_", "'", "date", "'_", ",_", "pymongo_", "._", "ASC", "ENDING_", ")_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "today_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "current", "\\u", "values_", "=_", "[_", "x_", "for_", "x_", "in_", "db_", "._", "current_", "._", "find_", "(_", "{_", "\"", "type", "\"_", ":_", "\"", "wea", "ther", "\"_", "}_", ")_", "]_", "[_", "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 ", " _", "current", "\\u", "values_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "'", "Plot", " ", "Ambi", "ent", " ", "Tempe", "ratur", "e", " ", "vs", ".", " ", "Time", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Plot", " ", "Ambi", "ent", " ", "Tempe", "ratur", "e", " ", "vs", ".", " ", "Time_", "\\u\\u\\uNL\\u\\u\\u_", "t", "\\u", "axes_", "=_", "plt_", "._", "axes_", "(_", "plot", "\\u", "positions_", "[_", "0_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "today_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time", "\\u", "title_", "=_", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time", "\\u", "title_", "=_", "end_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "title_", "(_", "'", "Wea", "ther", " ", "for", " ", "{}", " ", "at", " ", "{}'_", "._", "format_", "(_", "date", "\\u", "string_", ",_", "time", "\\u", "title_", "._", "strftime_", "(_", "'%", "H", ":", "%", "M", ":", "%", "S", " ", "UT", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "amb", "\\u", "temp_", "=_", "[_", "x_", "[_", "'", "data", "'_", "]_", "[_", "'", "Ambi", "ent", " ", "Tempe", "ratur", "e", " ", "(", "C", ")'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "entries_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "Ambi", "ent", " ", "Tempe", "ratur", "e", " ", "(", "C", ")'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "=_", "[_", "x_", "[_", "'", "date", "'_", "]_", "for_", "x_", "in_", "entries_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "Ambi", "ent", " ", "Tempe", "ratur", "e", " ", "(", "C", ")'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "\\u", "axes_", "._", "plot", "\\u", "date_", "(_", "time_", ",_", "amb", "\\u", "temp_", ",_", "'", "ko", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "markersize_", "=_", "2_", ",_", "marker", "edge", "width_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draws", "tyle_", "=_", "\"", "default", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "max", "\\u", "temp_", "=_", "max_", "(_", "amb", "\\u", "temp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "min", "\\u", "temp_", "=_", "min_", "(_", "amb", "\\u", "temp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "time_", "=_", "end_", "-_", "tde", "lta", "_", "(_", "0_", ",_", "7_", "*_", "60_", "*_", "60_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "temp_", "=_", "28_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "\\u", "axes_", "._", "annotate_", "(_", "'", "Lo", "w", ":", " ", "{:", "4.1", "f", "}", " ", "$", "^", "\\\\", "circ", "$", "C", ",", " ", "Hig", "h", ":", " ", "{:", "4.1", "f", "}", " ", "$", "^", "\\\\", "circ", "$", "C", "'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "temp_", ",_", "max", "\\u", "temp_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "xy_", "=_", "(_", "label", "\\u", "time_", ",_", "max", "\\u", "temp_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "xy", "text_", "=_", "(_", "label", "\\u", "time_", ",_", "label", "\\u", "temp_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "size_", "=_", "16_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "ylabel_", "(_", "\"", "Ambi", "ent", " ", "Temp", ".", " ", "(", "C", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "grid_", "(_", "which_", "=_", "'", "major", "'_", ",_", "color_", "=_", "'", "k", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "yticks_", "(_", "range_", "(_", "-_", "100_", ",_", "100_", ",_", "10_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xlim_", "(_", "start_", ",_", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylim_", "(_", "-_", "5_", ",_", "35_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "locator_", "(_", "hours_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "formatter_", "(_", "hour", "s", "\\u", "fmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "obs_", "._", "is", "\\u", "night", "_", "(_", "Time_", "(_", "start_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plt_", "._", "ax", "vsp", "an_", "(_", "start_", ",_", "mor", "ning", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light_", ",_", "ymin_", "=_", "0_", ",_", "ymax_", "=_", "1_", ",_", "color_", "=_", "'", "blue", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ax", "vsp", "an_", "(_", "mor", "ning", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light_", ",_", "mor", "ning", "\\u", "naut", "ical", "\\u", "twi", "light_", ",_", "ymin_", "=_", "0_", ",_", "ymax_", "=_", "1_", ",_", "color_", "=_", "'", "blue", "'_", ",_", "alpha_", "=_", "0.3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ax", "vsp", "an_", "(_", "mor", "ning", "\\u", "naut", "ical", "\\u", "twi", "light_", ",_", "mor", "ning", "\\u", "civi", "l\\u", "twi", "light_", ",_", "ymin_", "=_", "0_", ",_", "ymax_", "=_", "1_", ",_", "color_", "=_", "'", "blue", "'_", ",_", "alpha_", "=_", "0.2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ax", "vsp", "an_", "(_", "mor", "ning", "\\u", "civi", "l\\u", "twi", "light_", ",_", "sun", "rise", "_", ",_", "ymin_", "=_", "0_", ",_", "ymax_", "=_", "1_", ",_", "color_", "=_", "'", "blue", "'_", ",_", "alpha_", "=_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ax", "vsp", "an_", "(_", "suns", "et_", ",_", "even", "ing", "\\u", "civi", "l\\u", "twi", "light_", ",_", "ymin_", "=_", "0_", ",_", "ymax_", "=_", "1_", ",_", "color_", "=_", "'", "blue", "'_", ",_", "alpha_", "=_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ax", "vsp", "an_", "(_", "even", "ing", "\\u", "civi", "l\\u", "twi", "light_", ",_", "even", "ing", "\\u", "naut", "ical", "\\u", "twi", "light_", ",_", "ymin_", "=_", "0_", ",_", "ymax_", "=_", "1_", ",_", "color_", "=_", "'", "blue", "'_", ",_", "alpha_", "=_", "0.2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ax", "vsp", "an_", "(_", "even", "ing", "\\u", "naut", "ical", "\\u", "twi", "light_", ",_", "even", "ing", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light_", ",_", "ymin_", "=_", "0_", ",_", "ymax_", "=_", "1_", ",_", "color_", "=_", "'", "blue", "'_", ",_", "alpha_", "=_", "0.3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ax", "vsp", "an_", "(_", "even", "ing", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light_", ",_", "end_", ",_", "ymin_", "=_", "0_", ",_", "ymax_", "=_", "1_", ",_", "color_", "=_", "'", "blue", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plt_", "._", "ax", "vsp", "an_", "(_", "suns", "et_", ",_", "even", "ing", "\\u", "civi", "l\\u", "twi", "light_", ",_", "ymin_", "=_", "0_", ",_", "ymax_", "=_", "1_", ",_", "color_", "=_", "'", "blue", "'_", ",_", "alpha_", "=_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ax", "vsp", "an_", "(_", "even", "ing", "\\u", "civi", "l\\u", "twi", "light_", ",_", "even", "ing", "\\u", "naut", "ical", "\\u", "twi", "light_", ",_", "ymin_", "=_", "0_", ",_", "ymax_", "=_", "1_", ",_", "color_", "=_", "'", "blue", "'_", ",_", "alpha_", "=_", "0.2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ax", "vsp", "an_", "(_", "even", "ing", "\\u", "naut", "ical", "\\u", "twi", "light_", ",_", "even", "ing", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light_", ",_", "ymin_", "=_", "0_", ",_", "ymax_", "=_", "1_", ",_", "color_", "=_", "'", "blue", "'_", ",_", "alpha_", "=_", "0.3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ax", "vsp", "an_", "(_", "even", "ing", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light_", ",_", "mor", "ning", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ymin_", "=_", "0_", ",_", "ymax_", "=_", "1_", ",_", "color_", "=_", "'", "blue", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ax", "vsp", "an_", "(_", "mor", "ning", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light_", ",_", "mor", "ning", "\\u", "naut", "ical", "\\u", "twi", "light_", ",_", "ymin_", "=_", "0_", ",_", "ymax_", "=_", "1_", ",_", "color_", "=_", "'", "blue", "'_", ",_", "alpha_", "=_", "0.3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ax", "vsp", "an_", "(_", "mor", "ning", "\\u", "naut", "ical", "\\u", "twi", "light_", ",_", "mor", "ning", "\\u", "civi", "l\\u", "twi", "light_", ",_", "ymin_", "=_", "0_", ",_", "ymax_", "=_", "1_", ",_", "color_", "=_", "'", "blue", "'_", ",_", "alpha_", "=_", "0.2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ax", "vsp", "an_", "(_", "mor", "ning", "\\u", "civi", "l\\u", "twi", "light_", ",_", "sun", "rise", "_", ",_", "ymin_", "=_", "0_", ",_", "ymax_", "=_", "1_", ",_", "color_", "=_", "'", "blue", "'_", ",_", "alpha_", "=_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tl", "h", "\\u", "axes_", "=_", "plt_", "._", "axes_", "(_", "plot", "\\u", "positions_", "[_", "0_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "title_", "(_", "'", "Las", "t", " ", "Hour", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tl", "h", "\\u", "axes_", "._", "plot", "\\u", "date_", "(_", "time_", ",_", "amb", "\\u", "temp_", ",_", "'", "ko", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "markersize_", "=_", "4_", ",_", "marker", "edge", "width_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draws", "tyle_", "=_", "\"", "default", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "current", "\\u", "amb", "\\u", "temp_", "=_", "current", "\\u", "values_", "[_", "'", "data", "'_", "]_", "[_", "'", "Ambi", "ent", " ", "Tempe", "ratur", "e", " ", "(", "C", ")'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "\\u", "time_", "=_", "current", "\\u", "values_", "[_", "'", "date", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "time_", "=_", "current", "\\u", "time_", "-_", "tde", "lta", "_", "(_", "0_", ",_", "30_", "*_", "60_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "temp_", "=_", "28_", "#", " ", "current", "\\u", "amb", "\\u", "temp", " ", "+", " ", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tl", "h", "\\u", "axes_", "._", "annotate_", "(_", "'", "Curr", "ent", "ly", ":", " ", "{:", ".1", "f", "}", " ", "$", "^", "\\\\", "circ", "$", "C", "'_", "._", "format_", "(_", "current", "\\u", "amb", "\\u", "temp_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "xy_", "=_", "(_", "current", "\\u", "time_", ",_", "current", "\\u", "amb", "\\u", "temp_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "xy", "text_", "=_", "(_", "label", "\\u", "time_", ",_", "label", "\\u", "temp_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "size_", "=_", "16_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "grid_", "(_", "which_", "=_", "'", "major", "'_", ",_", "color_", "=_", "'", "k", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "yticks_", "(_", "range_", "(_", "-_", "100_", ",_", "100_", ",_", "10_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tl", "h", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "locator_", "(_", "mins_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tl", "h", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "formatter_", "(_", "mins", "\\u", "fmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tl", "h", "\\u", "axes_", "._", "yaxis_", "._", "set\\u", "tickl", "abels_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xlim_", "(_", "date_", "-_", "tde", "lta", "_", "(_", "0_", ",_", "60_", "*_", "60_", ")_", ",_", "date_", "+_", "tde", "lta", "_", "(_", "0_", ",_", "5_", "*_", "60_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylim_", "(_", "-_", "5_", ",_", "35_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "'", "Plot", " ", "Tempe", "ratur", "e", " ", "Difference", " ", "vs", ".", " ", "Time", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Plot", " ", "Tempe", "ratur", "e", " ", "Difference", " ", "vs", ".", " ", "Time_", "\\u\\u\\uNL\\u\\u\\u_", "td", "\\u", "axes_", "=_", "plt_", "._", "axes_", "(_", "plot", "\\u", "positions_", "[_", "1_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp", "\\u", "diff_", "=_", "[_", "x_", "[_", "'", "data", "'_", "]_", "[_", "'", "Sky", " ", "Tempe", "ratur", "e", " ", "(", "C", ")'_", "]_", "-_", "x_", "[_", "'", "data", "'_", "]_", "[_", "'", "Ambi", "ent", " ", "Tempe", "ratur", "e", " ", "(", "C", ")'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "entries_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "Sky", " ", "Tempe", "ratur", "e", " ", "(", "C", ")'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "'", "Ambi", "ent", " ", "Tempe", "ratur", "e", " ", "(", "C", ")'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "'", "Sky", " ", "Cond", "ition", "'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "=_", "[_", "x_", "[_", "'", "date", "'_", "]_", "for_", "x_", "in_", "entries_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "Sky", " ", "Tempe", "ratur", "e", " ", "(", "C", ")'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "'", "Ambi", "ent", " ", "Tempe", "ratur", "e", " ", "(", "C", ")'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "'", "Sky", " ", "Cond", "ition", "'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sky", "\\u", "condition_", "=_", "[_", "x_", "[_", "'", "data", "'_", "]_", "[_", "'", "Sky", " ", "Cond", "ition", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "entries_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "Sky", " ", "Tempe", "ratur", "e", " ", "(", "C", ")'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "'", "Ambi", "ent", " ", "Tempe", "ratur", "e", " ", "(", "C", ")'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "'", "Sky", " ", "Cond", "ition", "'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "td", "\\u", "axes_", "._", "plot", "\\u", "date_", "(_", "time_", ",_", "temp", "\\u", "diff_", ",_", "'", "ko", "-'_", ",_", "label_", "=_", "'", "Cloud", "iness", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "markersize_", "=_", "2_", ",_", "marker", "edge", "width_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draws", "tyle_", "=_", "\"", "default", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "td", "\\u", "axes_", "._", "fill", "\\u", "between_", "(_", "time_", ",_", "-_", "60_", ",_", "temp", "\\u", "diff_", ",_", "where_", "=_", "np_", "._", "array_", "(_", "sky", "\\u", "condition_", ")_", "==_", "'", "Clear", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "'", "green", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "td", "\\u", "axes_", "._", "fill", "\\u", "between_", "(_", "time_", ",_", "-_", "60_", ",_", "temp", "\\u", "diff_", ",_", "where_", "=_", "np_", "._", "array_", "(_", "sky", "\\u", "condition_", ")_", "==_", "'", "Cloud", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "'", "yell", "ow", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "td", "\\u", "axes_", "._", "fill", "\\u", "between_", "(_", "time_", ",_", "-_", "60_", ",_", "temp", "\\u", "diff_", ",_", "where_", "=_", "np_", "._", "array_", "(_", "sky", "\\u", "condition_", ")_", "==_", "'", "Ver", "y", " ", "Cloud", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "'", "red", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylabel_", "(_", "\"", "Cloud", "iness", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "grid_", "(_", "which_", "=_", "'", "major", "'_", ",_", "color_", "=_", "'", "k", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "yticks_", "(_", "range_", "(_", "-_", "100_", ",_", "100_", ",_", "10_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xlim_", "(_", "start_", ",_", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylim_", "(_", "-_", "60_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "td", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "locator_", "(_", "hours_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "td", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "formatter_", "(_", "hour", "s", "\\u", "fmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "td", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "tickl", "abels_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "td", "lh", "\\u", "axes_", "=_", "plt_", "._", "axes_", "(_", "plot", "\\u", "positions_", "[_", "1_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "td", "lh", "\\u", "axes_", "._", "plot", "\\u", "date_", "(_", "time_", ",_", "temp", "\\u", "diff_", ",_", "'", "ko", "-'_", ",_", "label_", "=_", "'", "Cloud", "iness", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "markersize_", "=_", "4_", ",_", "marker", "edge", "width_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draws", "tyle_", "=_", "\"", "default", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "td", "lh", "\\u", "axes_", "._", "fill", "\\u", "between_", "(_", "time_", ",_", "-_", "60_", ",_", "temp", "\\u", "diff_", ",_", "where_", "=_", "np_", "._", "array_", "(_", "sky", "\\u", "condition_", ")_", "==_", "'", "Clear", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "'", "green", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "td", "lh", "\\u", "axes_", "._", "fill", "\\u", "between_", "(_", "time_", ",_", "-_", "60_", ",_", "temp", "\\u", "diff_", ",_", "where_", "=_", "np_", "._", "array_", "(_", "sky", "\\u", "condition_", ")_", "==_", "'", "Cloud", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "'", "yell", "ow", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "td", "lh", "\\u", "axes_", "._", "fill", "\\u", "between_", "(_", "time_", ",_", "-_", "60_", ",_", "temp", "\\u", "diff_", ",_", "where_", "=_", "np_", "._", "array_", "(_", "sky", "\\u", "condition_", ")_", "==_", "'", "Ver", "y", " ", "Cloud", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "'", "red", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "grid_", "(_", "which_", "=_", "'", "major", "'_", ",_", "color_", "=_", "'", "k", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "yticks_", "(_", "range_", "(_", "-_", "100_", ",_", "100_", ",_", "10_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xlim_", "(_", "date_", "-_", "tde", "lta", "_", "(_", "0_", ",_", "60_", "*_", "60_", ")_", ",_", "date_", "+_", "tde", "lta", "_", "(_", "0_", ",_", "5_", "*_", "60_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylim_", "(_", "-_", "60_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "td", "lh", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "locator_", "(_", "mins_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "td", "lh", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "formatter_", "(_", "mins", "\\u", "fmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "td", "lh", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "tickl", "abels_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "td", "lh", "\\u", "axes_", "._", "yaxis_", "._", "set\\u", "tickl", "abels_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "'", "Plot", " ", "Wind", " ", "Spee", "d", " ", "vs", ".", " ", "Time", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Plot", " ", "Wind", " ", "Spee", "d", " ", "vs", ".", " ", "Time_", "\\u\\u\\uNL\\u\\u\\u_", "w", "\\u", "axes_", "=_", "plt_", "._", "axes_", "(_", "plot", "\\u", "positions_", "[_", "2_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wind", "\\u", "speed_", "=_", "[_", "x_", "[_", "'", "data", "'_", "]_", "[_", "'", "Wind", " ", "Spee", "d", " ", "(", "km", "/", "h", ")'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "entries_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "Wind", " ", "Spee", "d", " ", "(", "km", "/", "h", ")'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Wind", " ", "Cond", "ition", "'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Gu", "st", " ", "Cond", "ition", "'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wind", "\\u", "mav", "g_", "=_", "movin", "ga", "vera", "ge_", "(_", "wind", "\\u", "speed_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trans_", "=_", "{_", "'", "Cal", "m", "'_", ":_", "0_", ",_", "'", "Wind", "y", "'_", ":_", "1_", ",_", "'", "Gu", "sty", "'_", ":_", "1_", ",_", "'", "Ver", "y", " ", "Wind", "y", "'_", ":_", "10_", ",_", "'", "Ver", "y", " ", "Gu", "sty", "'_", ":_", "10_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wind", "\\u", "condition_", "=_", "[_", "trans_", "[_", "x_", "[_", "'", "data", "'_", "]_", "[_", "'", "Wind", " ", "Cond", "ition", "'_", "]_", "]_", "+_", "trans_", "[_", "x_", "[_", "'", "data", "'_", "]_", "[_", "'", "Gu", "st", " ", "Cond", "ition", "'_", "]_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "entries_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "Wind", " ", "Spee", "d", " ", "(", "km", "/", "h", ")'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Wind", " ", "Cond", "ition", "'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Gu", "st", " ", "Cond", "ition", "'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "=_", "[_", "x_", "[_", "'", "date", "'_", "]_", "for_", "x_", "in_", "entries_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "Wind", " ", "Spee", "d", " ", "(", "km", "/", "h", ")'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Wind", " ", "Cond", "ition", "'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Gu", "st", " ", "Cond", "ition", "'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w", "\\u", "axes_", "._", "plot", "\\u", "date_", "(_", "time_", ",_", "wind", "\\u", "speed_", ",_", "'", "ko", "'_", ",_", "alpha_", "=_", "0.5_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "markersize_", "=_", "2_", ",_", "marker", "edge", "width_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draws", "tyle_", "=_", "\"", "default", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w", "\\u", "axes_", "._", "plot", "\\u", "date_", "(_", "time_", ",_", "wind", "\\u", "mav", "g_", ",_", "'", "b", "-'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "'", "Wind", " ", "Spee", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "markersize_", "=_", "3_", ",_", "marker", "edge", "width_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "linewidth_", "=_", "3_", ",_", "alpha_", "=_", "0.5_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draws", "tyle_", "=_", "\"", "default", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w", "\\u", "axes_", "._", "plot", "\\u", "date_", "(_", "[_", "start_", ",_", "end_", "]_", ",_", "[_", "0_", ",_", "0_", "]_", ",_", "'", "k", "-'_", ",_", "ms_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w", "\\u", "axes_", "._", "fill", "\\u", "between_", "(_", "time_", ",_", "-_", "5_", ",_", "wind", "\\u", "speed_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "where_", "=_", "np_", "._", "array_", "(_", "wind", "\\u", "condition_", ")_", "==_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "'", "green", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w", "\\u", "axes_", "._", "fill", "\\u", "between_", "(_", "time_", ",_", "-_", "5_", ",_", "wind", "\\u", "speed_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "where_", "=_", "(_", "np_", "._", "array_", "(_", "wind", "\\u", "condition_", ")_", ">_", "0_", ")_", "&_", "(_", "np_", "._", "array_", "(_", "wind", "\\u", "condition_", ")_", "<_", "10_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "'", "yell", "ow", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w", "\\u", "axes_", "._", "fill", "\\u", "between_", "(_", "time_", ",_", "-_", "5_", ",_", "wind", "\\u", "speed_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "where_", "=_", "np_", "._", "array_", "(_", "wind", "\\u", "condition_", ")_", ">_", "10_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "'", "red", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "max", "\\u", "wind_", "=_", "max_", "(_", "wind", "\\u", "speed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "time_", "=_", "end_", "-_", "tde", "lta", "_", "(_", "0_", ",_", "6_", "*_", "60_", "*_", "60_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "wind_", "=_", "61_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w", "\\u", "axes_", "._", "annotate_", "(_", "'", "Max", " ", "Gu", "st", ":", " ", "{:", ".1", "f", "}", " ", "(", "km", "/", "h", ")'_", "._", "format_", "(_", "max", "\\u", "wind_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "xy_", "=_", "(_", "label", "\\u", "time_", ",_", "max", "\\u", "wind_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "xy", "text_", "=_", "(_", "label", "\\u", "time_", ",_", "label", "\\u", "wind_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "size_", "=_", "16_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "ylabel_", "(_", "\"", "Wind", " ", "(", "km", "/", "h", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "grid_", "(_", "which_", "=_", "'", "major", "'_", ",_", "color_", "=_", "'", "k", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "yticks_", "(_", "range_", "(_", "-_", "100_", ",_", "100_", ",_", "10_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xlim_", "(_", "start_", ",_", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wind", "\\u", "max_", "=_", "max_", "(_", "[_", "45_", ",_", "np_", "._", "ceil_", "(_", "max_", "(_", "wind", "\\u", "speed_", ")_", "/_", "5._", ")_", "*_", "5._", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylim_", "(_", "0_", ",_", "75_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "locator_", "(_", "hours_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "formatter_", "(_", "hour", "s", "\\u", "fmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "tickl", "abels_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "wl", "h", "\\u", "axes_", "=_", "plt_", "._", "axes_", "(_", "plot", "\\u", "positions_", "[_", "2_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wl", "h", "\\u", "axes_", "._", "plot", "\\u", "date_", "(_", "time_", ",_", "wind", "\\u", "speed_", ",_", "'", "ko", "'_", ",_", "alpha_", "=_", "0.7_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "markersize_", "=_", "4_", ",_", "marker", "edge", "width_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draws", "tyle_", "=_", "\"", "default", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wl", "h", "\\u", "axes_", "._", "plot", "\\u", "date_", "(_", "time_", ",_", "wind", "\\u", "mav", "g_", ",_", "'", "b", "-'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "'", "Wind", " ", "Spee", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "markersize_", "=_", "2_", ",_", "marker", "edge", "width_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "linewidth_", "=_", "3_", ",_", "alpha_", "=_", "0.5_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draws", "tyle_", "=_", "\"", "default", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wl", "h", "\\u", "axes_", "._", "plot", "\\u", "date_", "(_", "[_", "start_", ",_", "end_", "]_", ",_", "[_", "0_", ",_", "0_", "]_", ",_", "'", "k", "-'_", ",_", "ms_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wl", "h", "\\u", "axes_", "._", "fill", "\\u", "between_", "(_", "time_", ",_", "-_", "5_", ",_", "wind", "\\u", "speed_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "where_", "=_", "np_", "._", "array_", "(_", "wind", "\\u", "condition_", ")_", "==_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "'", "green", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wl", "h", "\\u", "axes_", "._", "fill", "\\u", "between_", "(_", "time_", ",_", "-_", "5_", ",_", "wind", "\\u", "speed_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "where_", "=_", "(_", "np_", "._", "array_", "(_", "wind", "\\u", "condition_", ")_", ">_", "0_", ")_", "&_", "(_", "np_", "._", "array_", "(_", "wind", "\\u", "condition_", ")_", "<_", "10_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "'", "yell", "ow", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wl", "h", "\\u", "axes_", "._", "fill", "\\u", "between_", "(_", "time_", ",_", "-_", "5_", ",_", "wind", "\\u", "speed_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "where_", "=_", "np_", "._", "array_", "(_", "wind", "\\u", "condition_", ")_", ">_", "10_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "'", "red", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "current", "\\u", "wind_", "=_", "current", "\\u", "values_", "[_", "'", "data", "'_", "]_", "[_", "'", "Wind", " ", "Spee", "d", " ", "(", "km", "/", "h", ")'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "\\u", "time_", "=_", "current", "\\u", "values_", "[_", "'", "date", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "time_", "=_", "current", "\\u", "time_", "-_", "tde", "lta", "_", "(_", "0_", ",_", "30_", "*_", "60_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "wind_", "=_", "61_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wl", "h", "\\u", "axes_", "._", "annotate_", "(_", "'", "Curr", "ent", "ly", ":", " ", "{:", ".0", "f", "}", " ", "km", "/", "h", "'_", "._", "format_", "(_", "current", "\\u", "wind_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "xy_", "=_", "(_", "current", "\\u", "time_", ",_", "current", "\\u", "wind_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "xy", "text_", "=_", "(_", "label", "\\u", "time_", ",_", "label", "\\u", "wind_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "size_", "=_", "16_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "grid_", "(_", "which_", "=_", "'", "major", "'_", ",_", "color_", "=_", "'", "k", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "yticks_", "(_", "range_", "(_", "-_", "100_", ",_", "100_", ",_", "10_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xlim_", "(_", "date_", "-_", "tde", "lta", "_", "(_", "0_", ",_", "60_", "*_", "60_", ")_", ",_", "date_", "+_", "tde", "lta", "_", "(_", "0_", ",_", "5_", "*_", "60_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wind", "\\u", "max_", "=_", "max_", "(_", "[_", "45_", ",_", "np_", "._", "ceil_", "(_", "max_", "(_", "wind", "\\u", "speed_", ")_", "/_", "5._", ")_", "*_", "5._", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylim_", "(_", "0_", ",_", "75_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wl", "h", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "locator_", "(_", "mins_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wl", "h", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "formatter_", "(_", "mins", "\\u", "fmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wl", "h", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "tickl", "abels_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wl", "h", "\\u", "axes_", "._", "yaxis_", "._", "set\\u", "tickl", "abels_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "'", "Plot", " ", "Rain", " ", "Freq", "uenc", "y", " ", "vs", ".", " ", "Time", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Plot", " ", "Rain", " ", "Freq", "uenc", "y", " ", "vs", ".", " ", "Time_", "\\u\\u\\uNL\\u\\u\\u_", "rf", "\\u", "axes_", "=_", "plt_", "._", "axes_", "(_", "plot", "\\u", "positions_", "[_", "3_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rf", "\\u", "value_", "=_", "[_", "x_", "[_", "'", "data", "'_", "]_", "[_", "'", "Rain", " ", "Freq", "uenc", "y", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "entries_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "Rain", " ", "Freq", "uenc", "y", "'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Rain", " ", "Cond", "ition", "'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rain", "\\u", "condition_", "=_", "[_", "x_", "[_", "'", "data", "'_", "]_", "[_", "'", "Rain", " ", "Cond", "ition", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "entries_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "Rain", " ", "Freq", "uenc", "y", "'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Rain", " ", "Cond", "ition", "'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "=_", "[_", "x_", "[_", "'", "date", "'_", "]_", "for_", "x_", "in_", "entries_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "Rain", " ", "Freq", "uenc", "y", "'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Rain", " ", "Cond", "ition", "'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rf", "\\u", "axes_", "._", "plot", "\\u", "date_", "(_", "time_", ",_", "rf", "\\u", "value_", ",_", "'", "ko", "-'_", ",_", "label_", "=_", "'", "Rain", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "markersize_", "=_", "2_", ",_", "marker", "edge", "width_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draws", "tyle_", "=_", "\"", "default", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rf", "\\u", "axes_", "._", "fill", "\\u", "between_", "(_", "time_", ",_", "0_", ",_", "rf", "\\u", "value_", ",_", "where_", "=_", "np_", "._", "array_", "(_", "rain", "\\u", "condition_", ")_", "==_", "'", "Dry", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "'", "green", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rf", "\\u", "axes_", "._", "fill", "\\u", "between_", "(_", "time_", ",_", "0_", ",_", "rf", "\\u", "value_", ",_", "where_", "=_", "np_", "._", "array_", "(_", "rain", "\\u", "condition_", ")_", "==_", "'", "Rain", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "'", "red", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylabel_", "(_", "\"", "Rain", " ", "Sen", "sor", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "grid_", "(_", "which_", "=_", "'", "major", "'_", ",_", "color_", "=_", "'", "k", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylim_", "(_", "120_", ",_", "275_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xlim_", "(_", "start_", ",_", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rf", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "locator_", "(_", "hours_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rf", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "formatter_", "(_", "hour", "s", "\\u", "fmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rf", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "tickl", "abels_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rf", "\\u", "axes_", "._", "yaxis_", "._", "set\\u", "tickl", "abels_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rfl", "h", "\\u", "axes_", "=_", "plt_", "._", "axes_", "(_", "plot", "\\u", "positions_", "[_", "3_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rfl", "h", "\\u", "axes_", "._", "plot", "\\u", "date_", "(_", "time_", ",_", "rf", "\\u", "value_", ",_", "'", "ko", "-'_", ",_", "label_", "=_", "'", "Rain", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "markersize_", "=_", "4_", ",_", "marker", "edge", "width_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draws", "tyle_", "=_", "\"", "default", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rfl", "h", "\\u", "axes_", "._", "fill", "\\u", "between_", "(_", "time_", ",_", "0_", ",_", "rf", "\\u", "value_", ",_", "where_", "=_", "np_", "._", "array_", "(_", "rain", "\\u", "condition_", ")_", "==_", "'", "Dry", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "'", "green", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rfl", "h", "\\u", "axes_", "._", "fill", "\\u", "between_", "(_", "time_", ",_", "0_", ",_", "rf", "\\u", "value_", ",_", "where_", "=_", "np_", "._", "array_", "(_", "rain", "\\u", "condition_", ")_", "==_", "'", "Rain", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "'", "red", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "grid_", "(_", "which_", "=_", "'", "major", "'_", ",_", "color_", "=_", "'", "k", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylim_", "(_", "120_", ",_", "275_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xlim_", "(_", "date_", "-_", "tde", "lta", "_", "(_", "0_", ",_", "60_", "*_", "60_", ")_", ",_", "date_", "+_", "tde", "lta", "_", "(_", "0_", ",_", "5_", "*_", "60_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rfl", "h", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "locator_", "(_", "mins_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rfl", "h", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "formatter_", "(_", "mins", "\\u", "fmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rfl", "h", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "tickl", "abels_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rfl", "h", "\\u", "axes_", "._", "yaxis_", "._", "set\\u", "tickl", "abels_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "'", "Plot", " ", "Safe", "/", "Uns", "afe", " ", "vs", ".", " ", "Time", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Safe", "/", "Uns", "afe", " ", "vs", ".", " ", "Time_", "\\u\\u\\uNL\\u\\u\\u_", "safe", "\\u", "axes_", "=_", "plt_", "._", "axes_", "(_", "plot", "\\u", "positions_", "[_", "4_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "\\u", "value_", "=_", "[_", "int_", "(_", "x_", "[_", "'", "data", "'_", "]_", "[_", "'", "Safe", "'_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "entries_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "Safe", "'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "\\u", "time_", "=_", "[_", "x_", "[_", "'", "date", "'_", "]_", "for_", "x_", "in_", "entries_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "Safe", "'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "\\u", "axes_", "._", "plot", "\\u", "date_", "(_", "safe", "\\u", "time_", ",_", "safe", "\\u", "value_", ",_", "'", "ko", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "markersize_", "=_", "2_", ",_", "marker", "edge", "width_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draws", "tyle_", "=_", "\"", "default", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "\\u", "axes_", "._", "fill", "\\u", "between_", "(_", "safe", "\\u", "time_", ",_", "-_", "1_", ",_", "safe", "\\u", "value_", ",_", "where_", "=_", "np_", "._", "array_", "(_", "safe", "\\u", "value_", ")_", "==_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "'", "green", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "\\u", "axes_", "._", "fill", "\\u", "between_", "(_", "safe", "\\u", "time_", ",_", "-_", "1_", ",_", "safe", "\\u", "value_", ",_", "where_", "=_", "np_", "._", "array_", "(_", "safe", "\\u", "value_", ")_", "==_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "'", "red", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylabel_", "(_", "\"", "Safe", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xlim_", "(_", "start_", ",_", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylim_", "(_", "-_", "0.1_", ",_", "1.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "yticks_", "(_", "[_", "0_", ",_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "grid_", "(_", "which_", "=_", "'", "major", "'_", ",_", "color_", "=_", "'", "k", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "locator_", "(_", "hours_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "formatter_", "(_", "hour", "s", "\\u", "fmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "tickl", "abels_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "\\u", "axes_", "._", "yaxis_", "._", "set\\u", "tickl", "abels_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "safe", "lh", "\\u", "axes_", "=_", "plt_", "._", "axes_", "(_", "plot", "\\u", "positions_", "[_", "4_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "lh", "\\u", "axes_", "._", "plot", "\\u", "date_", "(_", "safe", "\\u", "time_", ",_", "safe", "\\u", "value_", ",_", "'", "ko", "-'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "markersize_", "=_", "4_", ",_", "marker", "edge", "width_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draws", "tyle_", "=_", "\"", "default", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "lh", "\\u", "axes_", "._", "fill", "\\u", "between_", "(_", "safe", "\\u", "time_", ",_", "-_", "1_", ",_", "safe", "\\u", "value_", ",_", "where_", "=_", "np_", "._", "array_", "(_", "safe", "\\u", "value_", ")_", "==_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "'", "green", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "lh", "\\u", "axes_", "._", "fill", "\\u", "between_", "(_", "safe", "\\u", "time_", ",_", "-_", "1_", ",_", "safe", "\\u", "value_", ",_", "where_", "=_", "np_", "._", "array_", "(_", "safe", "\\u", "value_", ")_", "==_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "'", "red", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylim_", "(_", "-_", "0.1_", ",_", "1.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "yticks_", "(_", "[_", "0_", ",_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "grid_", "(_", "which_", "=_", "'", "major", "'_", ",_", "color_", "=_", "'", "k", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xlim_", "(_", "date_", "-_", "tde", "lta", "_", "(_", "0_", ",_", "60_", "*_", "60_", ")_", ",_", "date_", "+_", "tde", "lta", "_", "(_", "0_", ",_", "5_", "*_", "60_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "lh", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "locator_", "(_", "mins_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "lh", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "formatter_", "(_", "mins", "\\u", "fmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "lh", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "tickl", "abels_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "lh", "\\u", "axes_", "._", "yaxis_", "._", "set\\u", "tickl", "abels_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "'", "Plot", " ", "PWM", " ", "Value", " ", "vs", ".", " ", "Time", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Plot", " ", "PWM", " ", "Value", " ", "vs", ".", " ", "Time_", "\\u\\u\\uNL\\u\\u\\u_", "pwm", "\\u", "axes_", "=_", "plt_", "._", "axes_", "(_", "plot", "\\u", "positions_", "[_", "5_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylabel_", "(_", "\"", "Heat", "er", " ", "(%", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylim_", "(_", "-_", "5_", ",_", "105_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "yticks_", "(_", "[_", "0_", ",_", "25_", ",_", "50_", ",_", "75_", ",_", "100_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xlim_", "(_", "start_", ",_", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "grid_", "(_", "which_", "=_", "'", "major", "'_", ",_", "color_", "=_", "'", "k", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rst", "\\u", "axes_", "=_", "pwm", "\\u", "axes_", "._", "twin", "x_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylim_", "(_", "-_", "1_", ",_", "21_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xlim_", "(_", "start_", ",_", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pwm", "\\u", "value_", "=_", "[_", "x_", "[_", "'", "data", "'_", "]_", "[_", "'", "PWM", " ", "Value", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "entries_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "PWM", " ", "Value", "'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Rain", " ", "Sen", "sor", " ", "Temp", " ", "(", "C", ")'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Ambi", "ent", " ", "Tempe", "ratur", "e", " ", "(", "C", ")'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rst", "\\u", "delta_", "=_", "[_", "x_", "[_", "'", "data", "'_", "]_", "[_", "'", "Rain", " ", "Sen", "sor", " ", "Temp", " ", "(", "C", ")'_", "]_", "-_", "x_", "[_", "'", "data", "'_", "]_", "[_", "'", "Ambi", "ent", " ", "Tempe", "ratur", "e", " ", "(", "C", ")'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "entries_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "PWM", " ", "Value", "'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Rain", " ", "Sen", "sor", " ", "Temp", " ", "(", "C", ")'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Ambi", "ent", " ", "Tempe", "ratur", "e", " ", "(", "C", ")'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "=_", "[_", "x_", "[_", "'", "date", "'_", "]_", "for_", "x_", "in_", "entries_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "PWM", " ", "Value", "'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Rain", " ", "Sen", "sor", " ", "Temp", " ", "(", "C", ")'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Ambi", "ent", " ", "Tempe", "ratur", "e", " ", "(", "C", ")'_", "in_", "x_", "[_", "'", "data", "'_", "]_", "._", "keys_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rst", "\\u", "axes_", "._", "plot", "\\u", "date_", "(_", "time_", ",_", "rst", "\\u", "delta_", ",_", "'", "ro", "-'_", ",_", "alpha_", "=_", "0.5_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "'", "RST", " ", "Del", "ta", " ", "(", "C", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "markersize_", "=_", "2_", ",_", "marker", "edge", "width_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draws", "tyle_", "=_", "\"", "default", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pwm", "\\u", "axes_", "._", "plot", "\\u", "date_", "(_", "time_", ",_", "pwm", "\\u", "value_", ",_", "'", "bo", "'_", ",_", "label_", "=_", "'", "Heat", "er", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "markersize_", "=_", "2_", ",_", "marker", "edge", "width_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draws", "tyle_", "=_", "\"", "default", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pwm", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "locator_", "(_", "hours_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pwm", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "formatter_", "(_", "hour", "s", "\\u", "fmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pwm", "lh", "\\u", "axes_", "=_", "plt_", "._", "axes_", "(_", "plot", "\\u", "positions_", "[_", "5_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylim_", "(_", "-_", "5_", ",_", "105_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "yticks_", "(_", "[_", "0_", ",_", "25_", ",_", "50_", ",_", "75_", ",_", "100_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xlim_", "(_", "date_", "-_", "tde", "lta", "_", "(_", "0_", ",_", "60_", "*_", "60_", ")_", ",_", "date_", "+_", "tde", "lta", "_", "(_", "0_", ",_", "5_", "*_", "60_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "grid_", "(_", "which_", "=_", "'", "major", "'_", ",_", "color_", "=_", "'", "k", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rst", "lh", "\\u", "axes_", "=_", "pwm", "lh", "\\u", "axes_", "._", "twin", "x_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylim_", "(_", "-_", "1_", ",_", "21_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xlim_", "(_", "date_", "-_", "tde", "lta", "_", "(_", "0_", ",_", "60_", "*_", "60_", ")_", ",_", "date_", "+_", "tde", "lta", "_", "(_", "0_", ",_", "5_", "*_", "60_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rst", "lh", "\\u", "axes_", "._", "plot", "\\u", "date_", "(_", "time_", ",_", "rst", "\\u", "delta_", ",_", "'", "ro", "-'_", ",_", "alpha_", "=_", "0.5_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "'", "RST", " ", "Del", "ta", " ", "(", "C", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "markersize_", "=_", "4_", ",_", "marker", "edge", "width_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draws", "tyle_", "=_", "\"", "default", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rst", "lh", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "tickl", "abels_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rst", "lh", "\\u", "axes_", "._", "yaxis_", "._", "set\\u", "tickl", "abels_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pwm", "lh", "\\u", "axes_", "._", "plot", "\\u", "date_", "(_", "time_", ",_", "pwm", "\\u", "value_", ",_", "'", "bo", "'_", ",_", "label_", "=_", "'", "Heat", "er", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "markersize_", "=_", "4_", ",_", "marker", "edge", "width_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draws", "tyle_", "=_", "\"", "default", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pwm", "lh", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "locator_", "(_", "mins_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pwm", "lh", "\\u", "axes_", "._", "xaxis_", "._", "set\\u", "major", "\\u", "formatter_", "(_", "mins", "\\u", "fmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pwm", "lh", "\\u", "axes_", "._", "yaxis_", "._", "set\\u", "tickl", "abels_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Plot", " ", "Bright", "ness", " ", "vs", ".", " ", "Time_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ldr", "\\u", "axes", " ", "=", " ", "plt", ".", "axes", "(", "plot", "\\u", "position", "s", "[", "3", "][", "0", "])", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "max", "\\u", "ldr", " ", "=", " ", "285", "879", "99.", "999999", "69_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ldr", "\\u", "value", " ", "=", " ", "[", "x", "['", "data", "']", "['", "LD", "R", " ", "Resist", "anc", "e", " ", "(", "oh", "m", ")'", "]\\\\", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "x", " ", "in", " ", "entri", "es", "\\\\_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "'", "LD", "R", " ", "Resist", "anc", "e", " ", "(", "oh", "m", ")'", " ", "in", " ", "x", "['", "data", "']", ".", "keys", "()]", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bright", "ness", " ", "=", " ", "[", "10.", "**", "(", "2", ".", " ", "-", " ", "2", ".*", "x", "/", "max", "\\u", "ldr", ")", " ", "for", " ", "x", " ", "in", " ", "ldr", "\\u", "value", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "time", " ", "=", " ", "[", "x", "['", "date", "']", " ", "for", " ", "x", " ", "in", " ", "entri", "es", "\\\\_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "if", " ", "'", "LD", "R", " ", "Resist", "anc", "e", " ", "(", "oh", "m", ")'", " ", "in", " ", "x", "['", "data", "']", ".", "keys", "()]", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ldr", "\\u", "axes", ".", "plot", "\\u", "date", "(", "time", ",", " ", "bright", "ness", ",", " ", "'", "ko", "',", "\\\\_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "marker", "size", "=", "2", ",", " ", "marker", "edge", "widt", "h", "=", "0", ",\\\\", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "draws", "tyl", "e", "=\"", "default", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "plt", ".", "ylabel", "(\"", "Bright", "ness", " ", "(%", ")\"", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "plt", ".", "ytick", "s", "(", "range", "(-", "100", ",", "100", ",", "10", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "plt", ".", "ylim", "(-", "5", ",", "105", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "plt", ".", "grid", "(", "whi", "ch", "='", "major", "',", " ", "color", "='", "k", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ldr", "\\u", "axes", ".", "xaxis", ".", "set\\u", "major", "\\u", "locator", "(", "hour", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ldr", "\\u", "axes", ".", "xaxis", ".", "set\\u", "major", "\\u", "formatter", "(", "hour", "s", "\\u", "fmt", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "plt", ".", "xlim", "(", "start", ",", " ", "end", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "obs", ".", "is", "\\u", "night", "(", "start", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "plt", ".", "ax", "vsp", "an", "(", "start", ",", " ", "mor", "ning", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light", ",", " ", "ymin", "=", "0", ",", " ", "ymax", "=", "1", ",", " ", "color", "='", "blue", "',", " ", "alpha", "=", "0.", "5", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "plt", ".", "ax", "vsp", "an", "(", "mor", "ning", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light", ",", " ", "mor", "ning", "\\u", "naut", "ical", "\\u", "twi", "light", ",", " ", "ymin", "=", "0", ",", " ", "ymax", "=", "1", ",", " ", "color", "='", "blue", "',", " ", "alpha", "=", "0.", "3", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "plt", ".", "ax", "vsp", "an", "(", "mor", "ning", "\\u", "naut", "ical", "\\u", "twi", "light", ",", " ", "mor", "ning", "\\u", "civi", "l\\u", "twi", "light", ",", " ", "ymin", "=", "0", ",", " ", "ymax", "=", "1", ",", " ", "color", "='", "blue", "',", " ", "alpha", "=", "0.", "2", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "plt", ".", "ax", "vsp", "an", "(", "mor", "ning", "\\u", "civi", "l\\u", "twi", "light", ",", " ", "sun", "rise", ",", " ", "ymin", "=", "0", ",", " ", "ymax", "=", "1", ",", " ", "color", "='", "blue", "',", " ", "alpha", "=", "0.", "1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "plt", ".", "ax", "vsp", "an", "(", "suns", "et", ",", " ", "even", "ing", "\\u", "civi", "l\\u", "twi", "light", ",", " ", "ymin", "=", "0", ",", " ", "ymax", "=", "1", ",", " ", "color", "='", "blue", "',", " ", "alpha", "=", "0.", "1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "plt", ".", "ax", "vsp", "an", "(", "even", "ing", "\\u", "civi", "l\\u", "twi", "light", ",", " ", "even", "ing", "\\u", "naut", "ical", "\\u", "twi", "light", ",", " ", "ymin", "=", "0", ",", " ", "ymax", "=", "1", ",", " ", "color", "='", "blue", "',", " ", "alpha", "=", "0.", "2", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "plt", ".", "ax", "vsp", "an", "(", "even", "ing", "\\u", "naut", "ical", "\\u", "twi", "light", ",", " ", "even", "ing", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light", ",", " ", "ymin", "=", "0", ",", " ", "ymax", "=", "1", ",", " ", "color", "='", "blue", "',", " ", "alpha", "=", "0.", "3", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "plt", ".", "ax", "vsp", "an", "(", "even", "ing", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light", ",", " ", "end", ",", " ", "ymin", "=", "0", ",", " ", "ymax", "=", "1", ",", " ", "color", "='", "blue", "',", " ", "alpha", "=", "0.", "5", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "plt", ".", "ax", "vsp", "an", "(", "suns", "et", ",", " ", "even", "ing", "\\u", "civi", "l\\u", "twi", "light", ",", " ", "ymin", "=", "0", ",", " ", "ymax", "=", "1", ",", " ", "color", "='", "blue", "',", " ", "alpha", "=", "0.", "1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "plt", ".", "ax", "vsp", "an", "(", "even", "ing", "\\u", "civi", "l\\u", "twi", "light", ",", " ", "even", "ing", "\\u", "naut", "ical", "\\u", "twi", "light", ",", " ", "ymin", "=", "0", ",", " ", "ymax", "=", "1", ",", " ", "color", "='", "blue", "',", " ", "alpha", "=", "0.", "2", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "plt", ".", "ax", "vsp", "an", "(", "even", "ing", "\\u", "naut", "ical", "\\u", "twi", "light", ",", " ", "even", "ing", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light", ",", " ", "ymin", "=", "0", ",", " ", "ymax", "=", "1", ",", " ", "color", "='", "blue", "',", " ", "alpha", "=", "0.", "3", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "plt", ".", "ax", "vsp", "an", "(", "even", "ing", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light", ",", " ", "mor", "ning", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light", ",", " ", "ymin", "=", "0", ",", " ", "ymax", "=", "1", ",", " ", "color", "='", "blue", "',", " ", "alpha", "=", "0.", "5", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "plt", ".", "ax", "vsp", "an", "(", "mor", "ning", "\\u", "astro", "nomi", "cal", "\\u", "twi", "light", ",", " ", "mor", "ning", "\\u", "naut", "ical", "\\u", "twi", "light", ",", " ", "ymin", "=", "0", ",", " ", "ymax", "=", "1", ",", " ", "color", "='", "blue", "',", " ", "alpha", "=", "0.", "3", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "plt", ".", "ax", "vsp", "an", "(", "mor", "ning", "\\u", "naut", "ical", "\\u", "twi", "light", ",", " ", "mor", "ning", "\\u", "civi", "l\\u", "twi", "light", ",", " ", "ymin", "=", "0", ",", " ", "ymax", "=", "1", ",", " ", "color", "='", "blue", "',", " ", "alpha", "=", "0.", "2", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "plt", ".", "ax", "vsp", "an", "(", "mor", "ning", "\\u", "civi", "l\\u", "twi", "light", ",", " ", "sun", "rise", ",", " ", "ymin", "=", "0", ",", " ", "ymax", "=", "1", ",", " ", "color", "='", "blue", "',", " ", "alpha", "=", "0.", "1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "plot", "\\u", "filename_", "=_", "'{}", ".", "png", "'_", "._", "format_", "(_", "date", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plot", "\\u", "file_", "=_", "os_", "._", "path_", "._", "expanduser_", "(_", "'/", "var", "/", "pano", "pte", "s", "/", "wea", "ther", "\\u", "plots", "/{}'_", "._", "format_", "(_", "plot", "\\u", "filename_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Save", " ", "Fig", "ure", ":", " ", "{}'_", "._", "format_", "(_", "plot", "\\u", "file_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "savefig_", "(_", "plot", "\\u", "file_", ",_", "dpi_", "=_", "dpi_", ",_", "bbox", "\\u", "inches_", "=_", "'", "tig", "ht", "'_", ",_", "pad", "\\u", "inches_", "=_", "0.10", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Link_", "\\u\\u\\uNL\\u\\u\\u_", "toda", "y", "\\u", "name_", "=_", "'/", "var", "/", "pano", "pte", "s", "/", "wea", "ther", "\\u", "plots", "/", "toda", "y", ".", "png", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "toda", "y", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "remove_", "(_", "toda", "y", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "os_", "._", "symlink_", "(_", "plot", "\\u", "file_", ",_", "toda", "y", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Variable defined multiple times
ofri/Open-Knesset/events/scrapers.py
[ { "content": " def _process_items(self, person, items):\n self._getLogger().info('processing %s items' % len(items))\n for item in items:\n status = item.get('status', None)\n icaluid = item.get('iCalUID', None)\n start_date = dateutil.parser.parse(item['start']['dateTime']) if 'start' in item and 'dateTime' in item['start'] else None\n end_date = dateutil.parser.parse(item['end']['dateTime']) if 'end' in item and 'dateTime' in item['end'] else None\n if not all([start_date, end_date, status, icaluid]):\n self._getLogger().error('invalid start / end date / status / iCalUID')\n elif status == 'cancelled':\n res = Event.objects.filter(icaluid=icaluid)\n if res.count() == 1:\n self._getLogger().info('deleted event')\n res = res[0]\n res.cancelled=True\n res.save()\n else:\n self._getLogger().info('failed to delete event')\n else:\n # assuming timezone is always israel because I can't seem to save timezone to sqlite\n start_date = start_date.replace(tzinfo=None)\n end_date = end_date.replace(tzinfo=None)\n update_date = dateutil.parser.parse(item['updated']).replace(tzinfo=None) if 'updated' in item else None\n link = item['htmlLink'] if 'htmlLink' in item else None\n summary = item['summary'] if 'summary' in item else None\n description = item['description'] if 'description' in item else None\n # it seems that google never returns the color, although the colorId field is documented\n colorId = item['colorId'] if 'colorId' in item else None\n data = unicode(item)\n kwargs = {\n 'when':start_date, 'when_over':end_date, 'link':link, 'what':summary, 'why':description,\n 'update_date': update_date,\n }\n res = Event.objects.filter(icaluid=icaluid)\n event, created = Event.objects.get_or_create(icaluid=icaluid, defaults=kwargs)\n event.who.add(person)\n if created:\n self._getLogger().info('created new event')\n else:\n self._getLogger().info('updated event')", "metadata": "root.PersonsEventsScraper._process_items", "header": "['class', 'PersonsEventsScraper', '(', 'BaseScraper', ')', ':', '___EOS___']", "index": 41 } ]
[ { "span": "res ", "start_line": 74, "start_column": 16, "end_line": 74, "end_column": 19 } ]
[ { "span": "res ", "start_line": 51, "start_column": 16, "end_line": 51, "end_column": 19 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Person", "s", "Event", "s", "Scraper_", "(_", "Base", "Scraper_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "process", "\\u", "items_", "(_", "self_", ",_", "person_", ",_", "items_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "get", "Logger_", "(_", ")_", "._", "info_", "(_", "'", "process", "ing", " ", "%", "s", " ", "items", "'_", "%_", "len_", "(_", "items_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "items_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "status_", "=_", "item_", "._", "get_", "(_", "'", "status", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ical", "uid_", "=_", "item_", "._", "get_", "(_", "'", "i", "Cal", "UI", "D", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "date_", "=_", "dateutil_", "._", "parser_", "._", "parse_", "(_", "item_", "[_", "'", "start", "'_", "]_", "[_", "'", "date", "Time", "'_", "]_", ")_", "if_", "'", "start", "'_", "in_", "item_", "and_", "'", "date", "Time", "'_", "in_", "item_", "[_", "'", "start", "'_", "]_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end", "\\u", "date_", "=_", "dateutil_", "._", "parser_", "._", "parse_", "(_", "item_", "[_", "'", "end", "'_", "]_", "[_", "'", "date", "Time", "'_", "]_", ")_", "if_", "'", "end", "'_", "in_", "item_", "and_", "'", "date", "Time", "'_", "in_", "item_", "[_", "'", "end", "'_", "]_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "all_", "(_", "[_", "start", "\\u", "date_", ",_", "end", "\\u", "date_", ",_", "status_", ",_", "ical", "uid_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "get", "Logger_", "(_", ")_", "._", "error_", "(_", "'", "invalid", " ", "start", " ", "/", " ", "end", " ", "date", " ", "/", " ", "status", " ", "/", " ", "i", "Cal", "UI", "D", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "status_", "==_", "'", "cancel", "led", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "Event_", "._", "objects_", "._", "filter_", "(_", "ical", "uid_", "=_", "ical", "uid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "._", "count_", "(_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "\\u", "get", "Logger_", "(_", ")_", "._", "info_", "(_", "'", "delete", "d", " ", "event", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "res_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "._", "cancelled_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "._", "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 ", " ", "_", "self_", "._", "\\u", "get", "Logger_", "(_", ")_", "._", "info_", "(_", "'", "fail", "ed", " ", "to", " ", "delete", " ", "event", "'_", ")_", "\\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_", "#", " ", "ass", "umi", "ng", " ", "timezon", "e", " ", "is", " ", "alw", "ay", "s", " ", "isr", "ael", " ", "bec", "aus", "e", " ", "I", " ", "can", "'", "t", " ", "see", "m", " ", "to", " ", "save", " ", "timezon", "e", " ", "to", " ", "sqlite_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "date_", "=_", "start", "\\u", "date_", "._", "replace_", "(_", "tzinfo_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end", "\\u", "date_", "=_", "end", "\\u", "date_", "._", "replace_", "(_", "tzinfo_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "\\u", "date_", "=_", "dateutil_", "._", "parser_", "._", "parse_", "(_", "item_", "[_", "'", "update", "d", "'_", "]_", ")_", "._", "replace_", "(_", "tzinfo_", "=_", "None_", ")_", "if_", "'", "update", "d", "'_", "in_", "item_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link_", "=_", "item_", "[_", "'", "html", "Link", "'_", "]_", "if_", "'", "html", "Link", "'_", "in_", "item_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "summary_", "=_", "item_", "[_", "'", "summar", "y", "'_", "]_", "if_", "'", "summar", "y", "'_", "in_", "item_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "description_", "=_", "item_", "[_", "'", "description", "'_", "]_", "if_", "'", "description", "'_", "in_", "item_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "it", " ", "see", "ms", " ", "tha", "t", " ", "google", " ", "neve", "r", " ", "return", "s", " ", "the", " ", "color", ",", " ", "alth", "ou", "gh", " ", "the", " ", "color", "Id", " ", "field", " ", "is", " ", "documente", "d_", "\\u\\u\\uNL\\u\\u\\u_", "color", "Id_", "=_", "item_", "[_", "'", "color", "Id", "'_", "]_", "if_", "'", "color", "Id", "'_", "in_", "item_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "unicode_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "whe", "n", "'_", ":_", "start", "\\u", "date_", ",_", "'", "whe", "n", "\\u", "over", "'_", ":_", "end", "\\u", "date_", ",_", "'", "link", "'_", ":_", "link_", ",_", "'", "what", "'_", ":_", "summary_", ",_", "'", "wh", "y", "'_", ":_", "description_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", "\\u", "date", "'_", ":_", "update", "\\u", "date_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "Event_", "._", "objects_", "._", "filter_", "(_", "ical", "uid_", "=_", "ical", "uid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "event_", ",_", "created_", "=_", "Event_", "._", "objects_", "._", "get", "\\u", "or", "\\u", "create_", "(_", "ical", "uid_", "=_", "ical", "uid_", ",_", "defaults_", "=_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "event_", "._", "who_", "._", "add_", "(_", "person_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "created_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "\\u", "get", "Logger_", "(_", ")_", "._", "info_", "(_", "'", "created", " ", "new", " ", "event", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "\\u", "get", "Logger_", "(_", ")_", "._", "info_", "(_", "'", "update", "d", " ", "event", "'_", ")_", "\\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, 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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, 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 ]
Except block handles 'BaseException'
zunzun/pyeq2/Models_3D/Simple.py
[ { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.power(x_in,b)*numpy.power(y_in,c)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_01.CalculateModelPredictions", "header": "['class', 'SimpleEquation_01', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 58 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n\n try:\n temp = x_in/(a+b*y_in)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_02.CalculateModelPredictions", "header": "['class', 'SimpleEquation_02', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 110 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n\n try:\n temp = y_in/(a+b*x_in)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_03.CalculateModelPredictions", "header": "['class', 'SimpleEquation_03', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 161 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n\n try:\n temp = a*numpy.power(x_in,b*y_in)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_04.CalculateModelPredictions", "header": "['class', 'SimpleEquation_04', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 212 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n\n try:\n temp = a*numpy.power(y_in,b*x_in)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_05.CalculateModelPredictions", "header": "['class', 'SimpleEquation_05', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 263 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n\n try:\n temp = a*numpy.power(x_in,b/y_in)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_06.CalculateModelPredictions", "header": "['class', 'SimpleEquation_06', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 314 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n\n try:\n temp = a*numpy.power(y_in,b/x_in)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_07.CalculateModelPredictions", "header": "['class', 'SimpleEquation_07', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 365 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n PowY_2 = inDataCacheDictionary['PowY_2.0'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n\n try:\n temp = a*x_in+b*PowY_2\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_08.CalculateModelPredictions", "header": "['class', 'SimpleEquation_08', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 416 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n PowX_2 = inDataCacheDictionary['PowX_2.0'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n\n try:\n temp = a*y_in+b*PowX_2\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_09.CalculateModelPredictions", "header": "['class', 'SimpleEquation_09', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 467 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n PowY_2 = inDataCacheDictionary['PowY_2.0'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n\n try:\n temp = x_in/(a+b*PowY_2)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_10.CalculateModelPredictions", "header": "['class', 'SimpleEquation_10', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 518 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n PowX_2 = inDataCacheDictionary['PowX_2.0'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n\n try:\n temp = y_in/(a+b*PowX_2)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_11.CalculateModelPredictions", "header": "['class', 'SimpleEquation_11', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 569 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.power(b,x_in)*numpy.power(y_in,c)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_12.CalculateModelPredictions", "header": "['class', 'SimpleEquation_12', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 620 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.power(b,y_in)*numpy.power(x_in,c)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_13.CalculateModelPredictions", "header": "['class', 'SimpleEquation_13', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 672 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n XY = inDataCacheDictionary['XY'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n\n try:\n temp = a*numpy.power(XY,b)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_14.CalculateModelPredictions", "header": "['class', 'SimpleEquation_14', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 726 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n XOVERY = inDataCacheDictionary['XOVERY'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n\n try:\n temp = a*numpy.power(XOVERY,b)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_15.CalculateModelPredictions", "header": "['class', 'SimpleEquation_15', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 778 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n RecipX = inDataCacheDictionary['RecipX'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*(numpy.power(b,RecipX))*numpy.power(y_in,c)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_16.CalculateModelPredictions", "header": "['class', 'SimpleEquation_16', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 828 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n RecipY = inDataCacheDictionary['RecipY'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.power(b,RecipY)*numpy.power(x_in,c)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_17.CalculateModelPredictions", "header": "['class', 'SimpleEquation_17', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 880 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.power(x_in/b,c)*numpy.exp(y_in/b)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_18.CalculateModelPredictions", "header": "['class', 'SimpleEquation_18', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 934 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.power(y_in/b,c)*numpy.exp(x_in/b)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_19.CalculateModelPredictions", "header": "['class', 'SimpleEquation_19', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 988 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.power(x_in,b+c*y_in)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_20.CalculateModelPredictions", "header": "['class', 'SimpleEquation_20', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 1040 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.power(y_in,b+c*x_in)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_21.CalculateModelPredictions", "header": "['class', 'SimpleEquation_21', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 1092 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.power(x_in,b+c/y_in)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_22.CalculateModelPredictions", "header": "['class', 'SimpleEquation_22', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 1144 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.power(y_in,b+c/x_in)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_23.CalculateModelPredictions", "header": "['class', 'SimpleEquation_23', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 1196 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n LogY = inDataCacheDictionary['LogY'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.power(x_in,b+c*LogY)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_24.CalculateModelPredictions", "header": "['class', 'SimpleEquation_24', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 1248 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n LogX = inDataCacheDictionary['LogX'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.power(y_in,b+c*LogX)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_25.CalculateModelPredictions", "header": "['class', 'SimpleEquation_25', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 1300 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n LogX = inDataCacheDictionary['LogX'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.power(y_in,b+c/LogX)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_26.CalculateModelPredictions", "header": "['class', 'SimpleEquation_26', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 1352 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n LogY = inDataCacheDictionary['LogY'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.power(x_in,b+c/LogY)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_27.CalculateModelPredictions", "header": "['class', 'SimpleEquation_27', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 1404 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n PowY_2 = inDataCacheDictionary['PowY_2.0'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.exp(b*x_in+c*PowY_2)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_28.CalculateModelPredictions", "header": "['class', 'SimpleEquation_28', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 1456 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n PowX_2 = inDataCacheDictionary['PowX_2.0'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.exp(b*y_in+c*PowX_2)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_29.CalculateModelPredictions", "header": "['class', 'SimpleEquation_29', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 1508 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.exp(b/x_in+c*y_in)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_30.CalculateModelPredictions", "header": "['class', 'SimpleEquation_30', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 1560 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.exp(b/y_in+c*x_in)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_31.CalculateModelPredictions", "header": "['class', 'SimpleEquation_31', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 1612 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = (a+x_in)/(b+c*y_in)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_32.CalculateModelPredictions", "header": "['class', 'SimpleEquation_32', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 1664 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = (a+y_in)/(b+c*x_in)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_33.CalculateModelPredictions", "header": "['class', 'SimpleEquation_33', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 1716 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n PowY_2 = inDataCacheDictionary['PowY_2.0'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = (a+x_in)/(b+c*PowY_2)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_34.CalculateModelPredictions", "header": "['class', 'SimpleEquation_34', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 1768 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n PowX_2 = inDataCacheDictionary['PowX_2.0'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = (a+y_in)/(b+c*PowX_2)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_35.CalculateModelPredictions", "header": "['class', 'SimpleEquation_35', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 1820 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*(numpy.exp(b*x_in)-numpy.exp(c*y_in))\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_36.CalculateModelPredictions", "header": "['class', 'SimpleEquation_36', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 1872 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.power(x_in,b*numpy.power(y_in,c))\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_37.CalculateModelPredictions", "header": "['class', 'SimpleEquation_37', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 1924 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.power(y_in,b*numpy.power(x_in,c))\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_38.CalculateModelPredictions", "header": "['class', 'SimpleEquation_38', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 1976 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n PowY05 = inDataCacheDictionary['PowY_0.5'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = x_in/(a+b*y_in+c*PowY05)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_39.CalculateModelPredictions", "header": "['class', 'SimpleEquation_39', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 2029 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n PowX05 = inDataCacheDictionary['PowX_0.5'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = y_in/(a+b*x_in+c*PowX05)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_40.CalculateModelPredictions", "header": "['class', 'SimpleEquation_40', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 2083 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n LogY = inDataCacheDictionary['LogY'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = numpy.exp(a+b/x_in+c*LogY)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_41.CalculateModelPredictions", "header": "['class', 'SimpleEquation_41', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 2136 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n LogX = inDataCacheDictionary['LogX'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = numpy.exp(a+b/y_in+c*LogX)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_42.CalculateModelPredictions", "header": "['class', 'SimpleEquation_42', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 2188 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.power(x_in,b)*numpy.log(y_in+c)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_43.CalculateModelPredictions", "header": "['class', 'SimpleEquation_43', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 2240 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a*numpy.power(y_in,b)*numpy.log(x_in+c)\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimpleEquation_44.CalculateModelPredictions", "header": "['class', 'SimpleEquation_44', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 2292 } ]
[ { "span": "except:", "start_line": 69, "start_column": 8, "end_line": 69, "end_column": 15 }, { "span": "except:", "start_line": 120, "start_column": 8, "end_line": 120, "end_column": 15 }, { "span": "except:", "start_line": 171, "start_column": 8, "end_line": 171, "end_column": 15 }, { "span": "except:", "start_line": 222, "start_column": 8, "end_line": 222, "end_column": 15 }, { "span": "except:", "start_line": 273, "start_column": 8, "end_line": 273, "end_column": 15 }, { "span": "except:", "start_line": 324, "start_column": 8, "end_line": 324, "end_column": 15 }, { "span": "except:", "start_line": 375, "start_column": 8, "end_line": 375, "end_column": 15 }, { "span": "except:", "start_line": 426, "start_column": 8, "end_line": 426, "end_column": 15 }, { "span": "except:", "start_line": 477, "start_column": 8, "end_line": 477, "end_column": 15 }, { "span": "except:", "start_line": 528, "start_column": 8, "end_line": 528, "end_column": 15 }, { "span": "except:", "start_line": 579, "start_column": 8, "end_line": 579, "end_column": 15 }, { "span": "except:", "start_line": 631, "start_column": 8, "end_line": 631, "end_column": 15 }, { "span": "except:", "start_line": 683, "start_column": 8, "end_line": 683, "end_column": 15 }, { "span": "except:", "start_line": 735, "start_column": 8, "end_line": 735, "end_column": 15 }, { "span": "except:", "start_line": 787, "start_column": 8, "end_line": 787, "end_column": 15 }, { "span": "except:", "start_line": 839, "start_column": 8, "end_line": 839, "end_column": 15 }, { "span": "except:", "start_line": 891, "start_column": 8, "end_line": 891, "end_column": 15 }, { "span": "except:", "start_line": 945, "start_column": 8, "end_line": 945, "end_column": 15 }, { "span": "except:", "start_line": 999, "start_column": 8, "end_line": 999, "end_column": 15 }, { "span": "except:", "start_line": 1051, "start_column": 8, "end_line": 1051, "end_column": 15 }, { "span": "except:", "start_line": 1103, "start_column": 8, "end_line": 1103, "end_column": 15 }, { "span": "except:", "start_line": 1155, "start_column": 8, "end_line": 1155, "end_column": 15 }, { "span": "except:", "start_line": 1207, "start_column": 8, "end_line": 1207, "end_column": 15 }, { "span": "except:", "start_line": 1259, "start_column": 8, "end_line": 1259, "end_column": 15 }, { "span": "except:", "start_line": 1311, "start_column": 8, "end_line": 1311, "end_column": 15 }, { "span": "except:", "start_line": 1363, "start_column": 8, "end_line": 1363, "end_column": 15 }, { "span": "except:", "start_line": 1415, "start_column": 8, "end_line": 1415, "end_column": 15 }, { "span": "except:", "start_line": 1467, "start_column": 8, "end_line": 1467, "end_column": 15 }, { "span": "except:", "start_line": 1519, "start_column": 8, "end_line": 1519, "end_column": 15 }, { "span": "except:", "start_line": 1571, "start_column": 8, "end_line": 1571, "end_column": 15 }, { "span": "except:", "start_line": 1623, "start_column": 8, "end_line": 1623, "end_column": 15 }, { "span": "except:", "start_line": 1675, "start_column": 8, "end_line": 1675, "end_column": 15 }, { "span": "except:", "start_line": 1727, "start_column": 8, "end_line": 1727, "end_column": 15 }, { "span": "except:", "start_line": 1779, "start_column": 8, "end_line": 1779, "end_column": 15 }, { "span": "except:", "start_line": 1831, "start_column": 8, "end_line": 1831, "end_column": 15 }, { "span": "except:", "start_line": 1883, "start_column": 8, "end_line": 1883, "end_column": 15 }, { "span": "except:", "start_line": 1935, "start_column": 8, "end_line": 1935, "end_column": 15 }, { "span": "except:", "start_line": 1987, "start_column": 8, "end_line": 1987, "end_column": 15 }, { "span": "except:", "start_line": 2041, "start_column": 8, "end_line": 2041, "end_column": 15 }, { "span": "except:", "start_line": 2095, "start_column": 8, "end_line": 2095, "end_column": 15 }, { "span": "except:", "start_line": 2147, "start_column": 8, "end_line": 2147, "end_column": 15 }, { "span": "except:", "start_line": 2199, "start_column": 8, "end_line": 2199, "end_column": 15 }, { "span": "except:", "start_line": 2251, "start_column": 8, "end_line": 2251, "end_column": 15 }, { "span": "except:", "start_line": 2303, "start_column": 8, "end_line": 2303, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "01_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "x", "\\u", "in_", ",_", "b_", ")_", "*_", "numpy_", "._", "power_", "(_", "y", "\\u", "in_", ",_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "02_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "x", "\\u", "in_", "/_", "(_", "a_", "+_", "b_", "*_", "y", "\\u", "in_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "03_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "y", "\\u", "in_", "/_", "(_", "a_", "+_", "b_", "*_", "x", "\\u", "in_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "04_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "x", "\\u", "in_", ",_", "b_", "*_", "y", "\\u", "in_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "05_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "y", "\\u", "in_", ",_", "b_", "*_", "x", "\\u", "in_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "06_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "x", "\\u", "in_", ",_", "b_", "/_", "y", "\\u", "in_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "07_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "y", "\\u", "in_", ",_", "b_", "/_", "x", "\\u", "in_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "08_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pow", "Y", "\\u", "2_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "Y", "\\u", "2.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "a_", "*_", "x", "\\u", "in_", "+_", "b_", "*_", "Pow", "Y", "\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "09_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Pow", "X", "\\u", "2_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "X", "\\u", "2.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "a_", "*_", "y", "\\u", "in_", "+_", "b_", "*_", "Pow", "X", "\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "10_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pow", "Y", "\\u", "2_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "Y", "\\u", "2.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "x", "\\u", "in_", "/_", "(_", "a_", "+_", "b_", "*_", "Pow", "Y", "\\u", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "11_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Pow", "X", "\\u", "2_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "X", "\\u", "2.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "y", "\\u", "in_", "/_", "(_", "a_", "+_", "b_", "*_", "Pow", "X", "\\u", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "12_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "b_", ",_", "x", "\\u", "in_", ")_", "*_", "numpy_", "._", "power_", "(_", "y", "\\u", "in_", ",_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "13_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "b_", ",_", "y", "\\u", "in_", ")_", "*_", "numpy_", "._", "power_", "(_", "x", "\\u", "in_", ",_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "14_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "XY_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "XY", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "XY_", ",_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "15_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "XO", "VERY", "_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "XO", "VERY", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "XO", "VERY", "_", ",_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "16_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Recip", "X_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Recip", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "(_", "numpy_", "._", "power_", "(_", "b_", ",_", "Recip", "X_", ")_", ")_", "*_", "numpy_", "._", "power_", "(_", "y", "\\u", "in_", ",_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "17_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Recip", "Y_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Recip", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "b_", ",_", "Recip", "Y_", ")_", "*_", "numpy_", "._", "power_", "(_", "x", "\\u", "in_", ",_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "18_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "x", "\\u", "in_", "/_", "b_", ",_", "c_", ")_", "*_", "numpy_", "._", "exp_", "(_", "y", "\\u", "in_", "/_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "19_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "y", "\\u", "in_", "/_", "b_", ",_", "c_", ")_", "*_", "numpy_", "._", "exp_", "(_", "x", "\\u", "in_", "/_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "20_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "x", "\\u", "in_", ",_", "b_", "+_", "c_", "*_", "y", "\\u", "in_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "21_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "y", "\\u", "in_", ",_", "b_", "+_", "c_", "*_", "x", "\\u", "in_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "22_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "x", "\\u", "in_", ",_", "b_", "+_", "c_", "/_", "y", "\\u", "in_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "23_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "y", "\\u", "in_", ",_", "b_", "+_", "c_", "/_", "x", "\\u", "in_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "24_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Log", "Y_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Log", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "x", "\\u", "in_", ",_", "b_", "+_", "c_", "*_", "Log", "Y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "25_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Log", "X_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Log", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "y", "\\u", "in_", ",_", "b_", "+_", "c_", "*_", "Log", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "26_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Log", "X_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Log", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "y", "\\u", "in_", ",_", "b_", "+_", "c_", "/_", "Log", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "27_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Log", "Y_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Log", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "x", "\\u", "in_", ",_", "b_", "+_", "c_", "/_", "Log", "Y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "28_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pow", "Y", "\\u", "2_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "Y", "\\u", "2.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "exp_", "(_", "b_", "*_", "x", "\\u", "in_", "+_", "c_", "*_", "Pow", "Y", "\\u", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "29_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Pow", "X", "\\u", "2_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "X", "\\u", "2.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "exp_", "(_", "b_", "*_", "y", "\\u", "in_", "+_", "c_", "*_", "Pow", "X", "\\u", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "30_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "exp_", "(_", "b_", "/_", "x", "\\u", "in_", "+_", "c_", "*_", "y", "\\u", "in_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "31_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "exp_", "(_", "b_", "/_", "y", "\\u", "in_", "+_", "c_", "*_", "x", "\\u", "in_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "32_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "(_", "a_", "+_", "x", "\\u", "in_", ")_", "/_", "(_", "b_", "+_", "c_", "*_", "y", "\\u", "in_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "33_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "(_", "a_", "+_", "y", "\\u", "in_", ")_", "/_", "(_", "b_", "+_", "c_", "*_", "x", "\\u", "in_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "34_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pow", "Y", "\\u", "2_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "Y", "\\u", "2.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "(_", "a_", "+_", "x", "\\u", "in_", ")_", "/_", "(_", "b_", "+_", "c_", "*_", "Pow", "Y", "\\u", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "35_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Pow", "X", "\\u", "2_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "X", "\\u", "2.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "(_", "a_", "+_", "y", "\\u", "in_", ")_", "/_", "(_", "b_", "+_", "c_", "*_", "Pow", "X", "\\u", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "36_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "(_", "numpy_", "._", "exp_", "(_", "b_", "*_", "x", "\\u", "in_", ")_", "-_", "numpy_", "._", "exp_", "(_", "c_", "*_", "y", "\\u", "in_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "37_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "x", "\\u", "in_", ",_", "b_", "*_", "numpy_", "._", "power_", "(_", "y", "\\u", "in_", ",_", "c_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "38_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "y", "\\u", "in_", ",_", "b_", "*_", "numpy_", "._", "power_", "(_", "x", "\\u", "in_", ",_", "c_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "39_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pow", "Y", "05_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "Y", "\\u", "0.", "5", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "x", "\\u", "in_", "/_", "(_", "a_", "+_", "b_", "*_", "y", "\\u", "in_", "+_", "c_", "*_", "Pow", "Y", "05_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "40_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pow", "X", "05_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "X", "\\u", "0.", "5", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "y", "\\u", "in_", "/_", "(_", "a_", "+_", "b_", "*_", "x", "\\u", "in_", "+_", "c_", "*_", "Pow", "X", "05_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "41_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Log", "Y_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Log", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "numpy_", "._", "exp_", "(_", "a_", "+_", "b_", "/_", "x", "\\u", "in_", "+_", "c_", "*_", "Log", "Y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "42_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Log", "X_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Log", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "numpy_", "._", "exp_", "(_", "a_", "+_", "b_", "/_", "y", "\\u", "in_", "+_", "c_", "*_", "Log", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "43_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "x", "\\u", "in_", ",_", "b_", ")_", "*_", "numpy_", "._", "log_", "(_", "y", "\\u", "in_", "+_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Equation", "\\u", "44_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\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 ", " _", "temp_", "=_", "a_", "*_", "numpy_", "._", "power_", "(_", "y", "\\u", "in_", ",_", "b_", ")_", "*_", "numpy_", "._", "log_", "(_", "x", "\\u", "in_", "+_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\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_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 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 ]
Unused import
zulip/zulip/zerver/lib/upload.py
[ { "content": "from __future__ import absolute_import\n\nfrom django.conf import settings\nfrom django.template.defaultfilters import slugify\nfrom django.utils.encoding import force_text\nfrom django.utils.safestring import mark_safe\nimport unicodedata\n\nfrom zerver.lib.avatar import user_avatar_hash\nfrom zerver.decorator import JsonableError\n\nfrom boto.s3.key import Key\nfrom boto.s3.connection import S3Connection\nfrom mimetypes import guess_type, guess_extension\n\nfrom zerver.models import get_user_profile_by_id\n\nimport base64\nimport os\nimport re\nfrom PIL import Image, ImageOps\nfrom six.moves import cStringIO as StringIO\nimport random\n\n# Performance Note:\n#\n# For writing files to S3, the file could either be stored in RAM\n# (if it is less than 2.5MiB or so) or an actual temporary file on disk.\n#\n# Because we set FILE_UPLOAD_MAX_MEMORY_SIZE to 0, only the latter case\n# should occur in practice.\n#\n# This is great, because passing the pseudofile object that Django gives\n# you to boto would be a pain.\n\n# To come up with a s3 key we randomly generate a \"directory\". The\n# \"file name\" is the original filename provided by the user run\n# through a sanitization function.\n\n\n\n\n\n\n### S3\n\n\n\n\n\n\n\n\n### Local\n\n\n\n\n\n### Common\n\nif settings.LOCAL_UPLOADS_DIR is not None:\n upload_message_image = upload_message_image_local\n upload_avatar_image = upload_avatar_image_local\nelse:\n upload_message_image = upload_message_image_s3\n upload_avatar_image = upload_avatar_image_s3\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def sanitize_name(value):\n \"\"\"\n Sanitizes a value to be safe to store in a Linux filesystem, in\n S3, and in a URL. So unicode is allowed, but not special\n characters other than \".\", \"-\", and \"_\".\n\n This implementation is based on django.utils.text.slugify; it is\n modified by:\n * hardcoding allow_unicode=True.\n * adding '.' and '_' to the list of allowed characters.\n * preserving the case of the value.\n \"\"\"\n value = force_text(value)\n value = unicodedata.normalize('NFKC', value)\n value = re.sub('[^\\w\\s._-]', '', value, flags=re.U).strip()\n return mark_safe(re.sub('[-\\s]+', '-', value, flags=re.U))", "metadata": "root.sanitize_name", "header": "['module', '___EOS___']", "index": 39 }, { "content": "def random_name(bytes=60):\n return base64.urlsafe_b64encode(os.urandom(bytes))", "metadata": "root.random_name", "header": "['module', '___EOS___']", "index": 56 }, { "content": "class BadImageError(JsonableError):\n pass", "metadata": "root.BadImageError", "header": "['module', '___EOS___']", "index": 59 }, { "content": "def resize_avatar(image_data):\n AVATAR_SIZE = 100\n try:\n im = Image.open(StringIO(image_data))\n im = ImageOps.fit(im, (AVATAR_SIZE, AVATAR_SIZE), Image.ANTIALIAS)\n except IOError:\n raise BadImageError(\"Could not decode avatar image; did you upload an image file?\")\n out = StringIO()\n im.save(out, format='png')\n return out.getvalue()", "metadata": "root.resize_avatar", "header": "['module', '___EOS___']", "index": 62 }, { "content": "def get_bucket(conn, bucket_name):\n # Calling get_bucket() with validate=True can apparently lead\n # to expensive S3 bills:\n # http://www.appneta.com/blog/s3-list-get-bucket-default/\n # The benefits of validation aren't completely clear to us, and\n # we want to save on our bills, so we set the validate flag to False.\n # (We think setting validate to True would cause us to fail faster\n # in situations where buckets don't exist, but that shouldn't be\n # an issue for us.)\n bucket = conn.get_bucket(bucket_name, validate=False)\n return bucket", "metadata": "root.get_bucket", "header": "['module', '___EOS___']", "index": 76 }, { "content": "def upload_image_to_s3(\n bucket_name,\n file_name,\n content_type,\n user_profile,\n contents,\n ):\n\n conn = S3Connection(settings.S3_KEY, settings.S3_SECRET_KEY)\n bucket = get_bucket(conn, bucket_name)\n key = Key(bucket)\n key.key = file_name\n key.set_metadata(\"user_profile_id\", str(user_profile.id))\n key.set_metadata(\"realm_id\", str(user_profile.realm.id))\n\n if content_type:\n headers = {'Content-Type': content_type}\n else:\n headers = None\n\n key.set_contents_from_string(contents, headers=headers)", "metadata": "root.upload_image_to_s3", "header": "['module', '___EOS___']", "index": 88 }, { "content": "def get_file_info(request, user_file):\n uploaded_file_name = user_file.name\n content_type = request.GET.get('mimetype')\n if content_type is None:\n content_type = guess_type(uploaded_file_name)[0]\n else:\n uploaded_file_name = uploaded_file_name + guess_extension(content_type)\n return uploaded_file_name, content_type", "metadata": "root.get_file_info", "header": "['module', '___EOS___']", "index": 110 }, { "content": "def upload_message_image_s3(uploaded_file_name, content_type, file_data, user_profile, target_realm=None):\n bucket_name = settings.S3_AUTH_UPLOADS_BUCKET\n s3_file_name = \"/\".join([\n str(target_realm.id if target_realm is not None else user_profile.realm.id),\n random_name(18),\n sanitize_name(uploaded_file_name)\n ])\n url = \"/user_uploads/%s\" % (s3_file_name)\n\n upload_image_to_s3(\n bucket_name,\n s3_file_name,\n content_type,\n user_profile,\n file_data\n )\n return url", "metadata": "root.upload_message_image_s3", "header": "['module', '___EOS___']", "index": 119 }, { "content": "def get_signed_upload_url(path):\n conn = S3Connection(settings.S3_KEY, settings.S3_SECRET_KEY)\n return conn.generate_url(15, 'GET', bucket=settings.S3_AUTH_UPLOADS_BUCKET, key=path)", "metadata": "root.get_signed_upload_url", "header": "['module', '___EOS___']", "index": 137 }, { "content": "def get_realm_for_filename(path):\n conn = S3Connection(settings.S3_KEY, settings.S3_SECRET_KEY)\n key = get_bucket(conn, settings.S3_AUTH_UPLOADS_BUCKET).get_key(path)\n if key is None:\n # This happens if the key does not exist.\n return None\n return get_user_profile_by_id(key.metadata[\"user_profile_id\"]).realm.id", "metadata": "root.get_realm_for_filename", "header": "['module', '___EOS___']", "index": 141 }, { "content": "def upload_avatar_image_s3(user_file, user_profile, email):\n content_type = guess_type(user_file.name)[0]\n bucket_name = settings.S3_AVATAR_BUCKET\n s3_file_name = user_avatar_hash(email)\n\n image_data = user_file.read()\n upload_image_to_s3(\n bucket_name,\n s3_file_name + \".original\",\n content_type,\n user_profile,\n image_data,\n )\n\n resized_data = resize_avatar(image_data)\n upload_image_to_s3(\n bucket_name,\n s3_file_name,\n 'image/png',\n user_profile,\n resized_data,\n )\n # See avatar_url in avatar.py for URL. (That code also handles the case\n # that users use gravatar.)", "metadata": "root.upload_avatar_image_s3", "header": "['module', '___EOS___']", "index": 149 }, { "content": "def mkdirs(path):\n dirname = os.path.dirname(path)\n if not os.path.isdir(dirname):\n os.makedirs(dirname)", "metadata": "root.mkdirs", "header": "['module', '___EOS___']", "index": 176 }, { "content": "def write_local_file(type, path, file_data):\n file_path = os.path.join(settings.LOCAL_UPLOADS_DIR, type, path)\n mkdirs(file_path)\n with open(file_path, 'wb') as f:\n f.write(file_data)", "metadata": "root.write_local_file", "header": "['module', '___EOS___']", "index": 181 }, { "content": "def upload_message_image_local(uploaded_file_name, content_type, file_data, user_profile, target_realm=None):\n # Split into 256 subdirectories to prevent directories from getting too big\n path = \"/\".join([\n str(user_profile.realm.id),\n format(random.randint(0, 255), 'x'),\n random_name(18),\n sanitize_name(uploaded_file_name)\n ])\n\n write_local_file('files', path, file_data)\n\n return '/user_uploads/' + path", "metadata": "root.upload_message_image_local", "header": "['module', '___EOS___']", "index": 187 }, { "content": "def upload_avatar_image_local(user_file, user_profile, email):\n email_hash = user_avatar_hash(email)\n\n image_data = user_file.read()\n write_local_file('avatars', email_hash+'.original', image_data)\n\n resized_data = resize_avatar(image_data)\n write_local_file('avatars', email_hash+'.png', resized_data)", "metadata": "root.upload_avatar_image_local", "header": "['module', '___EOS___']", "index": 200 }, { "content": "def upload_message_image_through_web_client(request, user_file, user_profile):\n uploaded_file_name, content_type = get_file_info(request, user_file)\n return upload_message_image(uploaded_file_name, content_type, user_file.read(), user_profile)", "metadata": "root.upload_message_image_through_web_client", "header": "['module', '___EOS___']", "index": 218 } ]
[ { "span": "from django.template.defaultfilters import slugify", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 50 } ]
[]
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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "._", "default", "filters_", "import_", "slugify_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "encoding_", "import_", "force", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "safe", "string_", "import_", "mark", "\\u", "safe_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unicodedata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "zerver_", "._", "lib_", "._", "avatar_", "import_", "user", "\\u", "avat", "ar", "\\u", "hash_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "zerver_", "._", "decorator_", "import_", "Js", "ona", "ble", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "boto_", "._", "s3_", "._", "key_", "import_", "Key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "boto_", "._", "s3_", "._", "connection_", "import_", "S", "3", "Connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mimetypes_", "import_", "guess", "\\u", "type_", ",_", "guess", "\\u", "extension_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "zerver_", "._", "models_", "import_", "get", "\\u", "user", "\\u", "profile", "\\u", "by", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "base64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "PIL_", "import_", "Image_", ",_", "Image", "Ops_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "six_", "._", "moves_", "import_", "c", "String", "IO_", "as_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Perform", "anc", "e", " ", "Not", "e", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "writ", "ing", " ", "files", " ", "to", " ", "S", "3", ",", " ", "the", " ", "file", " ", "coul", "d", " ", "eit", "her", " ", "be", " ", "store", "d", " ", "in", " ", "RAM", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "if", " ", "it", " ", "is", " ", "less", " ", "than", " ", "2.5", "Mi", "B", " ", "or", " ", "so", ")", " ", "or", " ", "an", " ", "actual", " ", "temporar", "y", " ", "file", " ", "on", " ", "disk", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Be", "caus", "e", " ", "we", " ", "set", " ", "FILE", "\\u", "UPLOAD", "\\u", "MAX", "\\u", "MEM", "ORY", "\\u", "SIZE", " ", "to", " ", "0", ",", " ", "only", " ", "the", " ", "latt", "er", " ", "case_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "shou", "ld", " ", "occur", " ", "in", " ", "practic", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "great", ",", " ", "bec", "aus", "e", " ", "passi", "ng", " ", "the", " ", "pseudo", "file", " ", "object", " ", "tha", "t", " ", "Dj", "ang", "o", " ", "give", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "you", " ", "to", " ", "boto", " ", "wou", "ld", " ", "be", " ", "a", " ", "pain", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "To", " ", "come", " ", "up", " ", "with", " ", "a", " ", "s3", " ", "key", " ", "we", " ", "random", "ly", " ", "generat", "e", " ", "a", " ", "\"", "director", "y", "\".", " ", "The", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "file", " ", "name", "\"", " ", "is", " ", "the", " ", "original", " ", "filename", " ", "provided", " ", "by", " ", "the", " ", "user", " ", "run_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "through", " ", "a", " ", "sani", "ti", "zatio", "n", " ", "function", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "###", " ", "S3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Local_", "\\u\\u\\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_", "###", " ", "Common_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "settings_", "._", "LOCAL", "\\u", "UPLOAD", "S", "\\u", "DIR_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "upload", "\\u", "message", "\\u", "image_", "=_", "upload", "\\u", "message", "\\u", "image", "\\u", "local_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "upload", "\\u", "avat", "ar", "\\u", "image_", "=_", "upload", "\\u", "avat", "ar", "\\u", "image", "\\u", "local_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "upload", "\\u", "message", "\\u", "image_", "=_", "upload", "\\u", "message", "\\u", "image", "\\u", "s3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "upload", "\\u", "avat", "ar", "\\u", "image_", "=_", "upload", "\\u", "avat", "ar", "\\u", "image", "\\u", "s3_", "\\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_", "sanitize", "\\u", "name_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Sanit", "izes", " ", "a", " ", "value", " ", "to", " ", "be", " ", "safe", " ", "to", " ", "store", " ", "in", " ", "a", " ", "Lin", "ux", " ", "filesystem", ",", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "S", "3", ",", " ", "and", " ", "in", " ", "a", " ", "URL", ".", " ", " ", "So", " ", "unicode", " ", "is", " ", "allow", "ed", ",", " ", "but", " ", "not", " ", "special", "\\", "10", ";", " ", " ", " ", " ", "character", "s", " ", "other", " ", "than", " ", "\".", "\",", " ", "\"-", "\",", " ", "and", " ", "\"\\u", "\".\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "implementation", " ", "is", " ", "based", " ", "on", " ", "django", ".", "util", "s", ".", "text", ".", "slug", "if", "y", ";", " ", "it", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "modifi", "ed", " ", "by", ":", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "hard", "codi", "ng", " ", "allow", "\\u", "unicode", "=", "Tru", "e", ".", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "addin", "g", " ", "'.'", " ", "and", " ", "'\\u", "'", " ", "to", " ", "the", " ", "list", " ", "of", " ", "allow", "ed", " ", "character", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "prese", "rvi", "ng", " ", "the", " ", "case", " ", "of", " ", "the", " ", "value", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "force", "\\u", "text_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "unicodedata_", "._", "normalize_", "(_", "'", "NF", "KC", "'_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "re_", "._", "sub_", "(_", "'[", "^", "\\\\", "w", "\\\\", "s", ".\\u", "-]", "'_", ",_", "''_", ",_", "value_", ",_", "flags_", "=_", "re_", "._", "U_", ")_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "mark", "\\u", "safe_", "(_", "re_", "._", "sub_", "(_", "'[", "-\\\\", "s", "]+'_", ",_", "'-'_", ",_", "value_", ",_", "flags_", "=_", "re_", "._", "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_", "random", "\\u", "name_", "(_", "bytes_", "=_", "60_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "base64_", "._", "urlsafe", "\\u", "b64encode_", "(_", "os_", "._", "urandom_", "(_", "bytes_", ")_", ")_", "\\u\\u\\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_", "Ba", "d", "Image", "Error_", "(_", "Js", "ona", "ble", "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_", "def_", "resiz", "e\\u", "avatar_", "(_", "image", "\\u", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "AVA", "TAR", "\\u", "SIZE_", "=_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "im_", "=_", "Image_", "._", "open_", "(_", "String", "IO_", "(_", "image", "\\u", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "im_", "=_", "Image", "Ops_", "._", "fit_", "(_", "im_", ",_", "(_", "AVA", "TAR", "\\u", "SIZE_", ",_", "AVA", "TAR", "\\u", "SIZE_", ")_", ",_", "Image_", "._", "ANTI", "ALIAS_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "IO", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Ba", "d", "Image", "Error_", "(_", "\"", "Cou", "ld", " ", "not", " ", "decode", " ", "avat", "ar", " ", "image", ";", " ", "did", " ", "you", " ", "upload", " ", "an", " ", "image", " ", "file", "?\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "out_", "=_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "im_", "._", "save_", "(_", "out_", ",_", "format_", "=_", "'", "png", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "out_", "._", "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_", "def_", "get", "\\u", "bucket_", "(_", "conn_", ",_", "bucket", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Call", "ing", " ", "get", "\\u", "bucket", "()", " ", "with", " ", "validat", "e", "=", "Tru", "e", " ", "can", " ", "appare", "ntl", "y", " ", "lead_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "expen", "sive", " ", "S", "3", " ", "bill", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "http", "://", "www", ".", "app", "net", "a", ".", "com", "/", "blog", "/", "s3", "-", "list", "-", "get", "-", "bucket", "-", "default", "/_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "benefit", "s", " ", "of", " ", "validation", " ", "are", "n", "'", "t", " ", "complete", "ly", " ", "clear", " ", "to", " ", "us", ",", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "want", " ", "to", " ", "save", " ", "on", " ", "our", " ", "bill", "s", ",", " ", "so", " ", "we", " ", "set", " ", "the", " ", "validat", "e", " ", "flag", " ", "to", " ", "Fal", "se", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "We", " ", "think", " ", "setti", "ng", " ", "validat", "e", " ", "to", " ", "Tru", "e", " ", "wou", "ld", " ", "caus", "e", " ", "us", " ", "to", " ", "fail", " ", "faste", "r_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "in", " ", "situation", "s", " ", "where", " ", "bucket", "s", " ", "don", "'", "t", " ", "exist", ",", " ", "but", " ", "tha", "t", " ", "shou", "ld", "n", "'", "t", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "an", " ", "issue", " ", "for", " ", "us", ".)", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bucket_", "=_", "conn_", "._", "get", "\\u", "bucket_", "(_", "bucket", "\\u", "name_", ",_", "validate_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "bucket_", "\\u\\u\\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_", "upload", "\\u", "image", "\\u", "to", "\\u", "s3_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "bucket", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "file", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "content", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "profile_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "contents_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn_", "=_", "S", "3", "Connection_", "(_", "settings_", "._", "S", "3", "\\u", "KEY_", ",_", "settings_", "._", "S", "3", "\\u", "SEC", "RET", "\\u", "KEY_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bucket_", "=_", "get", "\\u", "bucket_", "(_", "conn_", ",_", "bucket", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "Key_", "(_", "bucket_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "._", "key_", "=_", "file", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "._", "set\\u", "metadata_", "(_", "\"", "user", "\\u", "profile", "\\u", "id", "\"_", ",_", "str_", "(_", "user", "\\u", "profile_", "._", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "._", "set\\u", "metadata_", "(_", "\"", "real", "m", "\\u", "id", "\"_", ",_", "str_", "(_", "user", "\\u", "profile_", "._", "realm_", "._", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "content", "\\u", "type_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "headers_", "=_", "{_", "'", "Conten", "t", "-", "Type", "'_", ":_", "content", "\\u", "type_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "headers_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "key_", "._", "set\\u", "content", "s", "\\u", "from", "\\u", "string_", "(_", "contents_", ",_", "headers_", "=_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "file", "\\u", "info_", "(_", "request_", ",_", "user", "\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "uploade", "d\\u", "file", "\\u", "name_", "=_", "user", "\\u", "file_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content", "\\u", "type_", "=_", "request_", "._", "GET_", "._", "get_", "(_", "'", "mime", "type", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "content", "\\u", "type_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content", "\\u", "type_", "=_", "guess", "\\u", "type_", "(_", "uploade", "d\\u", "file", "\\u", "name_", ")_", "[_", "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 ", " _", "uploade", "d\\u", "file", "\\u", "name_", "=_", "uploade", "d\\u", "file", "\\u", "name_", "+_", "guess", "\\u", "extension_", "(_", "content", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "uploade", "d\\u", "file", "\\u", "name_", ",_", "content", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "upload", "\\u", "message", "\\u", "image", "\\u", "s3_", "(_", "uploade", "d\\u", "file", "\\u", "name_", ",_", "content", "\\u", "type_", ",_", "file", "\\u", "data_", ",_", "user", "\\u", "profile_", ",_", "target", "\\u", "realm_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bucket", "\\u", "name_", "=_", "settings_", "._", "S", "3", "\\u", "AUTH", "\\u", "UPLOAD", "S", "\\u", "BUCKET", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s3", "\\u", "file", "\\u", "name_", "=_", "\"/\"_", "._", "join_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "target", "\\u", "realm_", "._", "id_", "if_", "target", "\\u", "realm_", "is_", "not_", "None_", "else_", "user", "\\u", "profile_", "._", "realm_", "._", "id_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "random", "\\u", "name_", "(_", "18_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sanitize", "\\u", "name_", "(_", "uploade", "d\\u", "file", "\\u", "name_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "\"/", "user", "\\u", "uploads", "/", "%", "s", "\"_", "%_", "(_", "s3", "\\u", "file", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "upload", "\\u", "image", "\\u", "to", "\\u", "s3_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "bucket", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s3", "\\u", "file", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "content", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "profile_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "file", "\\u", "data_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "sign", "ed", "\\u", "upload", "\\u", "url_", "(_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn_", "=_", "S", "3", "Connection_", "(_", "settings_", "._", "S", "3", "\\u", "KEY_", ",_", "settings_", "._", "S", "3", "\\u", "SEC", "RET", "\\u", "KEY_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "conn_", "._", "generat", "e\\u", "url_", "(_", "15_", ",_", "'", "GET", "'_", ",_", "bucket_", "=_", "settings_", "._", "S", "3", "\\u", "AUTH", "\\u", "UPLOAD", "S", "\\u", "BUCKET", "_", ",_", "key_", "=_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "real", "m", "\\u", "for", "\\u", "filename_", "(_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn_", "=_", "S", "3", "Connection_", "(_", "settings_", "._", "S", "3", "\\u", "KEY_", ",_", "settings_", "._", "S", "3", "\\u", "SEC", "RET", "\\u", "KEY_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "get", "\\u", "bucket_", "(_", "conn_", ",_", "settings_", "._", "S", "3", "\\u", "AUTH", "\\u", "UPLOAD", "S", "\\u", "BUCKET", "_", ")_", "._", "get", "\\u", "key_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "key_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "happ", "ens", " ", "if", " ", "the", " ", "key", " ", "doe", "s", " ", "not", " ", "exist", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "get", "\\u", "user", "\\u", "profile", "\\u", "by", "\\u", "id_", "(_", "key_", "._", "metadata_", "[_", "\"", "user", "\\u", "profile", "\\u", "id", "\"_", "]_", ")_", "._", "realm_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "upload", "\\u", "avat", "ar", "\\u", "image", "\\u", "s3_", "(_", "user", "\\u", "file_", ",_", "user", "\\u", "profile_", ",_", "email_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content", "\\u", "type_", "=_", "guess", "\\u", "type_", "(_", "user", "\\u", "file_", "._", "name_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bucket", "\\u", "name_", "=_", "settings_", "._", "S", "3", "\\u", "AVA", "TAR", "\\u", "BUCKET", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s3", "\\u", "file", "\\u", "name_", "=_", "user", "\\u", "avat", "ar", "\\u", "hash_", "(_", "email_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "data_", "=_", "user", "\\u", "file_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "upload", "\\u", "image", "\\u", "to", "\\u", "s3_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "bucket", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s3", "\\u", "file", "\\u", "name_", "+_", "\".", "original", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "content", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "profile_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "data_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resized", "\\u", "data_", "=_", "resiz", "e\\u", "avatar_", "(_", "image", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "upload", "\\u", "image", "\\u", "to", "\\u", "s3_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "bucket", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s3", "\\u", "file", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "/", "png", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "profile_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "resized", "\\u", "data_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "See", " ", "avat", "ar", "\\u", "url", " ", "in", " ", "avat", "ar", ".", "py", " ", "for", " ", "URL", ".", " ", " ", "(", "Tha", "t", " ", "code", " ", "als", "o", " ", "handle", "s", " ", "the", " ", "case_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tha", "t", " ", "users", " ", "use", " ", "gravatar", ".)", "_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "mkd", "irs_", "(_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dirname_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "isdir_", "(_", "dirname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "dirname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "local", "\\u", "file_", "(_", "type_", ",_", "path_", ",_", "file", "\\u", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file", "\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "settings_", "._", "LOCAL", "\\u", "UPLOAD", "S", "\\u", "DIR_", ",_", "type_", ",_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mkd", "irs_", "(_", "file", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "file", "\\u", "path_", ",_", "'", "wb", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "write_", "(_", "file", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "upload", "\\u", "message", "\\u", "image", "\\u", "local_", "(_", "uploade", "d\\u", "file", "\\u", "name_", ",_", "content", "\\u", "type_", ",_", "file", "\\u", "data_", ",_", "user", "\\u", "profile_", ",_", "target", "\\u", "realm_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Split", " ", "int", "o", " ", "256", " ", "subdir", "ector", "ies", " ", "to", " ", "prevent", " ", "director", "ies", " ", "from", " ", "getti", "ng", " ", "too", " ", "big_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", "=_", "\"/\"_", "._", "join_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "user", "\\u", "profile_", "._", "realm_", "._", "id_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "format_", "(_", "random_", "._", "randint_", "(_", "0_", ",_", "255_", ")_", ",_", "'", "x", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "random", "\\u", "name_", "(_", "18_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sanitize", "\\u", "name_", "(_", "uploade", "d\\u", "file", "\\u", "name_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "write", "\\u", "local", "\\u", "file_", "(_", "'", "files", "'_", ",_", "path_", ",_", "file", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "'/", "user", "\\u", "uploads", "/'_", "+_", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "upload", "\\u", "avat", "ar", "\\u", "image", "\\u", "local_", "(_", "user", "\\u", "file_", ",_", "user", "\\u", "profile_", ",_", "email_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "email", "\\u", "hash_", "=_", "user", "\\u", "avat", "ar", "\\u", "hash_", "(_", "email_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "data_", "=_", "user", "\\u", "file_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "\\u", "local", "\\u", "file_", "(_", "'", "avat", "ars", "'_", ",_", "email", "\\u", "hash_", "+_", "'.", "original", "'_", ",_", "image", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resized", "\\u", "data_", "=_", "resiz", "e\\u", "avatar_", "(_", "image", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "\\u", "local", "\\u", "file_", "(_", "'", "avat", "ars", "'_", ",_", "email", "\\u", "hash_", "+_", "'.", "png", "'_", ",_", "resized", "\\u", "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_", "def_", "upload", "\\u", "message", "\\u", "image", "\\u", "through", "\\u", "web", "\\u", "client_", "(_", "request_", ",_", "user", "\\u", "file_", ",_", "user", "\\u", "profile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "uploade", "d\\u", "file", "\\u", "name_", ",_", "content", "\\u", "type_", "=_", "get", "\\u", "file", "\\u", "info_", "(_", "request_", ",_", "user", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "upload", "\\u", "message", "\\u", "image_", "(_", "uploade", "d\\u", "file", "\\u", "name_", ",_", "content", "\\u", "type_", ",_", "user", "\\u", "file_", "._", "read_", "(_", ")_", ",_", "user", "\\u", "profile_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
enthought/pyface/pyface/tests/test_python_editor.py
[ { "content": "from __future__ import absolute_import\n\nimport os\nimport sys\n\nfrom traits.testing.unittest_tools import unittest, UnittestTools\n\nfrom ..gui import GUI\nfrom ..python_editor import PythonEditor\nfrom ..window import Window\n\n\nPYTHON_SCRIPT = os.path.join(os.path.dirname(__file__), 'python_shell_script.py')\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestPythonEditor(unittest.TestCase, UnittestTools):\n\n\n\n\n\n", "metadata": "root.TestPythonEditor", "header": "['module', '___EOS___']", "index": 15 }, { "content": " def setUp(self):\n self.gui = GUI()\n self.window = Window()\n self.window._create()", "metadata": "root.TestPythonEditor.setUp", "header": "['class', 'TestPythonEditor', '(', 'unittest', '.', 'TestCase', ',', 'UnittestTools', ')', ':', '___EOS___']", "index": 17 }, { "content": " def tearDown(self):\n self.widget.destroy()\n self.window.destroy()", "metadata": "root.TestPythonEditor.tearDown", "header": "['class', 'TestPythonEditor', '(', 'unittest', '.', 'TestCase', ',', 'UnittestTools', ')', ':', '___EOS___']", "index": 22 }, { "content": " def test_lifecycle(self):\n # test that destroy works\n self.widget = PythonEditor(self.window.control)\n self.gui.process_events()\n self.assertFalse(self.widget.dirty)\n self.widget.destroy()\n self.gui.process_events()", "metadata": "root.TestPythonEditor.test_lifecycle", "header": "['class', 'TestPythonEditor', '(', 'unittest', '.', 'TestCase', ',', 'UnittestTools', ')', ':', '___EOS___']", "index": 26 }, { "content": " def test_show_line_numbers(self):\n # test that destroy works\n self.widget = PythonEditor(self.window.control, show_line_numbers=False)\n self.gui.process_events()\n self.widget.show_line_numbers = True\n self.gui.process_events()\n self.widget.show_line_numbers = False\n self.gui.process_events()\n self.widget.destroy()\n self.gui.process_events()", "metadata": "root.TestPythonEditor.test_show_line_numbers", "header": "['class', 'TestPythonEditor', '(', 'unittest', '.', 'TestCase', ',', 'UnittestTools', ')', ':', '___EOS___']", "index": 34 }, { "content": " def test_load(self):\n # test that destroy works\n self.widget = PythonEditor(self.window.control)\n self.gui.process_events()\n with self.assertTraitChanges(self.widget, 'changed', count=1):\n self.widget.path = PYTHON_SCRIPT\n self.assertFalse(self.widget.dirty)\n self.widget.destroy()\n self.gui.process_events()", "metadata": "root.TestPythonEditor.test_load", "header": "['class', 'TestPythonEditor', '(', 'unittest', '.', 'TestCase', ',', 'UnittestTools', ')', ':', '___EOS___']", "index": 45 }, { "content": " def test_select_line(self):\n # test that destroy works\n self.widget = PythonEditor(self.window.control, path=PYTHON_SCRIPT)\n self.gui.process_events()\n self.widget.select_line(3)\n self.widget.destroy()\n self.gui.process_events()", "metadata": "root.TestPythonEditor.test_select_line", "header": "['class', 'TestPythonEditor', '(', 'unittest', '.', 'TestCase', ',', 'UnittestTools', ')', ':', '___EOS___']", "index": 55 } ]
[ { "span": "import sys", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 10 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", "\\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_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "traits_", "._", "testing_", "._", "unittest", "\\u", "tools_", "import_", "unittest_", ",_", "Unit", "test", "Tools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "._", "gui_", "import_", "GUI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "python", "\\u", "editor_", "import_", "Pyth", "on", "Editor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "window_", "import_", "Window_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PYTHON", "\\u", "SCRIPT_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", ",_", "'", "python", "\\u", "shell", "\\u", "script", ".", "py", "'_", ")_", "\\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", "Pyth", "on", "Editor_", "(_", "unittest_", "._", "Test", "Case_", ",_", "Unit", "test", "Tools_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\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", "Pyth", "on", "Editor_", "(_", "unittest_", "._", "Test", "Case_", ",_", "Unit", "test", "Tools_", ")_", ":_", "\\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_", "._", "gui_", "=_", "GUI_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "window_", "=_", "Window_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "window_", "._", "\\u", "create_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Pyth", "on", "Editor_", "(_", "unittest_", "._", "Test", "Case_", ",_", "Unit", "test", "Tools_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "widget_", "._", "destroy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "window_", "._", "destroy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Pyth", "on", "Editor_", "(_", "unittest_", "._", "Test", "Case_", ",_", "Unit", "test", "Tools_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "lifecycle", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "tha", "t", " ", "destroy", " ", "works_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "widget_", "=_", "Pyth", "on", "Editor_", "(_", "self_", "._", "window_", "._", "control_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "gui_", "._", "process", "\\u", "events_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "self_", "._", "widget_", "._", "dirty_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "widget_", "._", "destroy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "gui_", "._", "process", "\\u", "events_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Pyth", "on", "Editor_", "(_", "unittest_", "._", "Test", "Case_", ",_", "Unit", "test", "Tools_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "show", "\\u", "line", "\\u", "numbers_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "tha", "t", " ", "destroy", " ", "works_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "widget_", "=_", "Pyth", "on", "Editor_", "(_", "self_", "._", "window_", "._", "control_", ",_", "show", "\\u", "line", "\\u", "numbers_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "gui_", "._", "process", "\\u", "events_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "widget_", "._", "show", "\\u", "line", "\\u", "numbers_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "gui_", "._", "process", "\\u", "events_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "widget_", "._", "show", "\\u", "line", "\\u", "numbers_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "gui_", "._", "process", "\\u", "events_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "widget_", "._", "destroy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "gui_", "._", "process", "\\u", "events_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Pyth", "on", "Editor_", "(_", "unittest_", "._", "Test", "Case_", ",_", "Unit", "test", "Tools_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "tha", "t", " ", "destroy", " ", "works_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "widget_", "=_", "Pyth", "on", "Editor_", "(_", "self_", "._", "window_", "._", "control_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "gui_", "._", "process", "\\u", "events_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Trait", "Changes_", "(_", "self_", "._", "widget_", ",_", "'", "change", "d", "'_", ",_", "count_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "widget_", "._", "path_", "=_", "PYTHON", "\\u", "SCRIPT_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "self_", "._", "widget_", "._", "dirty_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "widget_", "._", "destroy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "gui_", "._", "process", "\\u", "events_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Pyth", "on", "Editor_", "(_", "unittest_", "._", "Test", "Case_", ",_", "Unit", "test", "Tools_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "select", "\\u", "line_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "tha", "t", " ", "destroy", " ", "works_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "widget_", "=_", "Pyth", "on", "Editor_", "(_", "self_", "._", "window_", "._", "control_", ",_", "path_", "=_", "PYTHON", "\\u", "SCRIPT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "gui_", "._", "process", "\\u", "events_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "widget_", "._", "select", "\\u", "line_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "widget_", "._", "destroy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "gui_", "._", "process", "\\u", "events_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
soimort/you-get/src/you_get/extractors/douban.py
[ { "content": "def douban_download(url, output_dir = '.', merge = True, info_only = False, **kwargs):\n html = get_html(url)\n if 'subject' in url:\n titles = re.findall(r'data-title=\"([^\"]*)\">', html)\n song_id = re.findall(r'<li class=\"song-item\" id=\"([^\"]*)\"', html)\n song_ssid = re.findall(r'data-ssid=\"([^\"]*)\"', html)\n get_song_url = 'http://music.douban.com/j/songlist/get_song_url'\n \n for i in range(len(titles)):\n title = titles[i]\n datas = {\n 'sid': song_id[i],\n 'ssid': song_ssid[i]\n }\n post_params = urllib.parse.urlencode(datas).encode('utf-8')\n try:\n resp = urllib.request.urlopen(get_song_url, post_params)\n resp_data = json.loads(resp.read().decode('utf-8'))\n real_url = resp_data['r']\n type, ext, size = url_info(real_url)\n print_info(site_info, title, type, size)\n except:\n pass\n\n if not info_only:\n try:\n download_urls([real_url], title, ext, size, output_dir, merge = merge)\n except:\n pass\n\n else: \n titles = re.findall(r'\"name\":\"([^\"]*)\"', html)\n real_urls = [re.sub('\\\\\\\\/', '/', i) for i in re.findall(r'\"rawUrl\":\"([^\"]*)\"', html)]\n \n for i in range(len(titles)):\n title = titles[i]\n real_url = real_urls[i]\n \n type, ext, size = url_info(real_url)\n \n print_info(site_info, title, type, size)\n if not info_only:\n download_urls([real_url], title, ext, size, output_dir, merge = merge)", "metadata": "root.douban_download", "header": "['module', '___EOS___']", "index": 7 } ]
[ { "span": "except:", "start_line": 28, "start_column": 12, "end_line": 28, "end_column": 19 }, { "span": "except:", "start_line": 34, "start_column": 16, "end_line": 34, "end_column": 23 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "douban", "\\u", "download_", "(_", "url_", ",_", "output", "\\u", "dir_", "=_", "'.'_", ",_", "merge_", "=_", "True_", ",_", "info", "\\u", "only_", "=_", "False_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "html_", "=_", "get", "\\u", "html_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "subject", "'_", "in_", "url_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "titles_", "=_", "re_", "._", "findall_", "(_", "r", "'", "data", "-", "title", "=\"(", "[", "^", "\"]", "*)\"", ">'_", ",_", "html_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "song", "\\u", "id_", "=_", "re_", "._", "findall_", "(_", "r", "'<", "li", " ", "class", "=\"", "song", "-", "item", "\"", " ", "id", "=\"(", "[", "^", "\"]", "*)\"", "'_", ",_", "html_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "song", "\\u", "ssid_", "=_", "re_", "._", "findall_", "(_", "r", "'", "data", "-", "ssid", "=\"(", "[", "^", "\"]", "*)\"", "'_", ",_", "html_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "\\u", "song", "\\u", "url_", "=_", "'", "http", "://", "music", ".", "douban", ".", "com", "/", "j", "/", "song", "list", "/", "get", "\\u", "song", "\\u", "url", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "titles_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "title_", "=_", "titles_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datas_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sid", "'_", ":_", "song", "\\u", "id_", "[_", "i_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ssid", "'_", ":_", "song", "\\u", "ssid_", "[_", "i_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post", "\\u", "params_", "=_", "urllib_", "._", "parse_", "._", "urlencode_", "(_", "datas_", ")_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "urllib_", "._", "request_", "._", "urlopen_", "(_", "get", "\\u", "song", "\\u", "url_", ",_", "post", "\\u", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp", "\\u", "data_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "read_", "(_", ")_", "._", "decode_", "(_", "'", "utf", "-", "8", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "real", "\\u", "url_", "=_", "resp", "\\u", "data_", "[_", "'", "r", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "type_", ",_", "ext_", ",_", "size_", "=_", "url", "\\u", "info_", "(_", "real", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print", "\\u", "info_", "(_", "site", "\\u", "info_", ",_", "title_", ",_", "type_", ",_", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "info", "\\u", "only_", ":_", "\\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 ", " ", "_", "download", "\\u", "urls_", "(_", "[_", "real", "\\u", "url_", "]_", ",_", "title_", ",_", "ext_", ",_", "size_", ",_", "output", "\\u", "dir_", ",_", "merge_", "=_", "merge_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "titles_", "=_", "re_", "._", "findall_", "(_", "r", "'\"", "name", "\":\"", "([", "^", "\"]", "*)\"", "'_", ",_", "html_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "real", "\\u", "urls_", "=_", "[_", "re_", "._", "sub_", "(_", "'\\\\\\\\\\\\\\\\", "/'_", ",_", "'/'_", ",_", "i_", ")_", "for_", "i_", "in_", "re_", "._", "findall_", "(_", "r", "'\"", "raw", "Ur", "l", "\":\"", "([", "^", "\"]", "*)\"", "'_", ",_", "html_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "titles_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "title_", "=_", "titles_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "real", "\\u", "url_", "=_", "real", "\\u", "urls_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "type_", ",_", "ext_", ",_", "size_", "=_", "url", "\\u", "info_", "(_", "real", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print", "\\u", "info_", "(_", "site", "\\u", "info_", ",_", "title_", ",_", "type_", ",_", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "info", "\\u", "only_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "download", "\\u", "urls_", "(_", "[_", "real", "\\u", "url_", "]_", ",_", "title_", ",_", "ext_", ",_", "size_", ",_", "output", "\\u", "dir_", ",_", "merge_", "=_", "merge_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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extension)\n try:\n yield b\n finally:\n drop(resource(b))", "metadata": "root.s3_bucket", "header": "['module', '___EOS___']", "index": 57 } ]
[ { "span": "next(_tmps),", "start_line": 60, "start_column": 48, "end_line": 60, "end_column": 59 } ]
[]
1
true
[ "[CLS]_", "Un", "guard", "ed_", "next_", "in_", "generator_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "contextmanager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "s3", "\\u", "bucket_", "(_", "extension_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "conn_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "b_", "=_", "'", "s3", "://", "%", "s", "/", "%", "s", "%", "s", "'_", "%_", "(_", "test\\u", "bucket", "\\u", "name_", ",_", "next_", "(_", "\\u", "tmps", "_", ")_", ",_", "extension_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "b_", "\\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 ", " _", "drop_", "(_", "resource_", "(_", "b_", ")_", ")_", "\\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, 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 ]
Unused local variable
lisa-lab/pylearn2/pylearn2/dataset_get/dataset_resolver.py
[ { "content": " def read_installed_packages_list(self, from_location):\n \"\"\"\n Reads a given configuration file, and updates the\n internal installed packages list.\n\n :param from_location: a path (string) to a directory containing an installed.lst file\n \"\"\"\n\n try:\n installed_list_file=open(from_location+\"/installed.lst\")\n except IOError:\n # maybe not a problem, but\n # FIXME: print a warning if exists,\n # but cannot be read (permissions)\n pass\n else:\n # read from file and\n # create a dictionary\n for line in installed_list_file:\n l=line.rstrip().split(' ')\n if l:\n self.installed_packages_list[l[0]]=\\\n this_package=self.package_info(\n from_location, # from which configuration files it comes\n l[0], # name\n l[1], # timestamp\n l[2], # human-readable size\n urllib.unquote(l[3]), # source on the web\n urllib.unquote(l[4])) # where installed\n else:\n pass# skip blank lines (there shouldn't be any)", "metadata": "root.dataset_resolver.read_installed_packages_list", "header": "['class', 'dataset_resolver', ':', '___NEWLINE___', '___NL___', '########################################', '___NL___', '___EOS___']", "index": 30 } ]
[ { "span": "this_package=", "start_line": 52, "start_column": 24, "end_line": 52, "end_column": 36 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "dataset", "\\u", "resolver_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "read", "\\u", "install", "ed", "\\u", "package", "s", "\\u", "list_", "(_", "self_", ",_", "from", "\\u", "location_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Read", "s", " ", "a", " ", "give", "n", " ", "configura", "tion", " ", "file", ",", " ", "and", " ", "update", "s", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "internal", " ", "install", "ed", " ", "package", "s", " ", "list", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "from", "\\u", "location", ":", " ", "a", " ", "path", " ", "(", "string", ")", " ", "to", " ", "a", " ", "director", "y", " ", "contain", "ing", " ", "an", " ", "install", "ed", ".", "lst", " ", "file", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "install", "ed", "\\u", "list", "\\u", "file_", "=_", "open_", "(_", "from", "\\u", "location_", "+_", "\"/", "install", "ed", ".", "lst", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "IO", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "may", "be", " ", "not", " ", "a", " ", "problem", ",", " ", "but", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIX", "ME", ":", " ", "print", " ", "a", " ", "warn", "ing", " ", "if", " ", "exist", "s", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "but", " ", "cann", "ot", " ", "be", " ", "read", " ", "(", "permissi", "ons", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "read", " ", "from", " ", "file", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "dictionary_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "line_", "in_", "install", "ed", "\\u", "list", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l_", "=_", "line_", "._", "rstrip_", "(_", ")_", "._", "split_", "(_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "l_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "install", "ed", "\\u", "package", "s", "\\u", "list_", "[_", "l_", "[_", "0_", "]_", "]_", "=_", "this", "\\u", "package_", "=_", "self_", "._", "package", "\\u", "info_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "from", "\\u", "location_", ",_", "#", " ", "from", " ", "whi", "ch", " ", "configura", "tion", " ", "files", " ", "it", " ", "come", "s_", "\\u\\u\\uNL\\u\\u\\u_", "l_", "[_", "0_", "]_", ",_", "#", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "l_", "[_", "1_", "]_", ",_", "#", " ", "timestamp_", "\\u\\u\\uNL\\u\\u\\u_", "l_", "[_", "2_", "]_", ",_", "#", " ", "human", "-", "reada", "ble", " ", "size_", "\\u\\u\\uNL\\u\\u\\u_", "urllib_", "._", "unquote_", "(_", "l_", "[_", "3_", "]_", ")_", ",_", "#", " ", "source", " ", "on", " ", "the", " ", "web_", "\\u\\u\\uNL\\u\\u\\u_", "urllib_", "._", "unquote_", "(_", "l_", "[_", "4_", "]_", ")_", ")_", "#", " ", "where", " ", "installed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pass_", "#", " ", "skip", " ", "blank", " ", "lines", " ", "(", "there", " ", "shou", "ld", "n", "'", "t", " ", "be", " ", "any", ")_", "\\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 ]
Unnecessary delete statement in function
babble/babble/include/jython/Lib/test/test_itertools.py
[ { "content": " def test_tee(self):\n n = 200\n def irange(n):\n for i in xrange(n):\n yield i\n\n a, b = tee([]) # test empty iterator\n self.assertEqual(list(a), [])\n self.assertEqual(list(b), [])\n\n a, b = tee(irange(n)) # test 100% interleaved\n self.assertEqual(zip(a,b), zip(range(n),range(n)))\n\n a, b = tee(irange(n)) # test 0% interleaved\n self.assertEqual(list(a), range(n))\n self.assertEqual(list(b), range(n))\n\n a, b = tee(irange(n)) # test dealloc of leading iterator\n for i in xrange(100):\n self.assertEqual(a.next(), i)\n del a\n self.assertEqual(list(b), range(n))\n\n a, b = tee(irange(n)) # test dealloc of trailing iterator\n for i in xrange(100):\n self.assertEqual(a.next(), i)\n del b\n self.assertEqual(list(a), range(100, n))\n\n for j in xrange(5): # test randomly interleaved\n order = [0]*n + [1]*n\n random.shuffle(order)\n lists = ([], [])\n its = tee(irange(n))\n for i in order:\n value = its[i].next()\n lists[i].append(value)\n self.assertEqual(lists[0], range(n))\n self.assertEqual(lists[1], range(n))\n\n # test argument format checking\n self.assertRaises(TypeError, tee)\n self.assertRaises(TypeError, tee, 3)\n self.assertRaises(TypeError, tee, [1,2], 'x')\n self.assertRaises(TypeError, tee, [1,2], 3, 'x')\n\n # tee object should be instantiable\n a, b = tee('abc')\n c = type(a)('def')\n self.assertEqual(list(c), list('def'))\n\n # test long-lagged and multi-way split\n a, b, c = tee(xrange(2000), 3)\n for i in xrange(100):\n self.assertEqual(a.next(), i)\n self.assertEqual(list(b), range(2000))\n self.assertEqual([c.next(), c.next()], range(2))\n self.assertEqual(list(a), range(100,2000))\n self.assertEqual(list(c), range(2,2000))\n\n # test values of n\n self.assertRaises(TypeError, tee, 'abc', 'invalid')\n self.assertRaises(ValueError, tee, [], -1)\n for n in xrange(5):\n result = tee('abc', n)\n self.assertEqual(type(result), tuple)\n self.assertEqual(len(result), n)\n self.assertEqual(map(list, result), [list('abc')]*n)\n\n # tee pass-through to copyable iterator\n a, b = tee('abc')\n c, d = tee(a)\n # JYTHON TODO: we do not currently implement copy\n # self.assert_(a is c)\n\n # test tee_new\n t1, t2 = tee('abc')\n tnew = type(t1)\n self.assertRaises(TypeError, tnew)\n self.assertRaises(TypeError, tnew, 10)\n t3 = tnew(t1)\n\n # JYTHON: this tests that copy is transitive\n #self.assert_(list(t1) == list(t2) == list(t3) == list('abc'))\n self.assert_(list(t3) == list(t2) == list('abc'))\n # test that tee objects are weak referencable\n a, b = tee(xrange(10))\n p = proxy(a)\n self.assertEqual(getattr(p, '__class__'), type(b))\n del a\n # JYTHON: this depends on `a` actually going out of scope; we\n # would have to play with GC to make it so\n\n # self.assertRaises(ReferenceError, getattr, p, '__class__')", "metadata": "root.TestBasicOps.test_tee", "header": "['class', 'TestBasicOps', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 312 }, { "content": " def makecycle(self, iterator, container):\n container.append(iterator)\n iterator.next()\n del container, iterator", "metadata": "root.TestGC.makecycle", "header": "['class', 'TestGC', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 432 } ]
[ { "span": "del a", "start_line": 401, "start_column": 8, "end_line": 401, "end_column": 13 }, { "span": "del container, iterator", "start_line": 435, "start_column": 8, "end_line": 435, "end_column": 31 } ]
[ { "span": "def test_tee(self):", "start_line": 312, "start_column": 4, "end_line": 312, "end_column": 23 }, { "span": "def makecycle(self, iterator, container):", "start_line": 432, "start_column": 4, "end_line": 432, "end_column": 45 } ]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "delete_", "statement_", "in_", "function_", "[SEP]_", "class_", "Test", "Basic", "Ops_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "tee", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "200_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "ira", "nge_", "(_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "xrange_", "(_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "a_", ",_", "b_", "=_", "tee", "_", "(_", "[_", "]_", ")_", "#", " ", "test", " ", "empty", " ", "iterator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "a_", ")_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "b_", ")_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", ",_", "b_", "=_", "tee", "_", "(_", "ira", "nge_", "(_", "n_", ")_", ")_", "#", " ", "test", " ", "100", "%", " ", "interleave", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zip_", "(_", "a_", ",_", "b_", ")_", ",_", "zip_", "(_", "range_", "(_", "n_", ")_", ",_", "range_", "(_", "n_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", ",_", "b_", "=_", "tee", "_", "(_", "ira", "nge_", "(_", "n_", ")_", ")_", "#", " ", "test", " ", "0", "%", " ", "interleave", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "a_", ")_", ",_", "range_", "(_", "n_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "b_", ")_", ",_", "range_", "(_", "n_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", ",_", "b_", "=_", "tee", "_", "(_", "ira", "nge_", "(_", "n_", ")_", ")_", "#", " ", "test", " ", "deal", "loc", " ", "of", " ", "lead", "ing", " ", "iterator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "100_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "a_", "._", "next_", "(_", ")_", ",_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "del_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "b_", ")_", ",_", "range_", "(_", "n_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", ",_", "b_", "=_", "tee", "_", "(_", "ira", "nge_", "(_", "n_", ")_", ")_", "#", " ", "test", " ", "deal", "loc", " ", "of", " ", "trail", "ing", " ", "iterator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "100_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "a_", "._", "next_", "(_", ")_", ",_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "del_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "a_", ")_", ",_", "range_", "(_", "100_", ",_", "n_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "j_", "in_", "xrange_", "(_", "5_", ")_", ":_", "#", " ", "test", " ", "random", "ly", " ", "interleave", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "order_", "=_", "[_", "0_", "]_", "*_", "n_", "+_", "[_", "1_", "]_", "*_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "random_", "._", "shuffle_", "(_", "order_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lists_", "=_", "(_", "[_", "]_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "its_", "=_", "tee", "_", "(_", "ira", "nge_", "(_", "n_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "order_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "its_", "[_", "i_", "]_", "._", "next_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lists_", "[_", "i_", "]_", "._", "append_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "lists_", "[_", "0_", "]_", ",_", "range_", "(_", "n_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "lists_", "[_", "1_", "]_", ",_", "range_", "(_", "n_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "argu", "ment", " ", "format", " ", "checking", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "tee", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "tee", "_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "tee", "_", ",_", "[_", "1_", ",_", "2_", "]_", ",_", "'", "x", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "tee", "_", ",_", "[_", "1_", ",_", "2_", "]_", ",_", "3_", ",_", "'", "x", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tee", " ", "object", " ", "shou", "ld", " ", "be", " ", "instant", "iable", "_", "\\u\\u\\uNL\\u\\u\\u_", "a_", ",_", "b_", "=_", "tee", "_", "(_", "'", "abc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "type_", "(_", "a_", ")_", "(_", "'", "def", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "c_", ")_", ",_", "list_", "(_", "'", "def", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "long", "-", "lag", "ged", " ", "and", " ", "multi", "-", "way", " ", "split_", "\\u\\u\\uNL\\u\\u\\u_", "a_", ",_", "b_", ",_", "c_", "=_", "tee", "_", "(_", "xrange_", "(_", "2000_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "100_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "a_", "._", "next_", "(_", ")_", ",_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "b_", ")_", ",_", "range_", "(_", "2000_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "c_", "._", "next_", "(_", ")_", ",_", "c_", "._", "next_", "(_", ")_", "]_", ",_", "range_", "(_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "a_", ")_", ",_", "range_", "(_", "100_", ",_", "2000_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "c_", ")_", ",_", "range_", "(_", "2_", ",_", "2000_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "values", " ", "of", " ", "n_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "tee", "_", ",_", "'", "abc", "'_", ",_", "'", "invalid", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "tee", "_", ",_", "[_", "]_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "n_", "in_", "xrange_", "(_", "5_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "tee", "_", "(_", "'", "abc", "'_", ",_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "type_", "(_", "result_", ")_", ",_", "tuple_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "result_", ")_", ",_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "map_", "(_", "list_", ",_", "result_", ")_", ",_", "[_", "list_", "(_", "'", "abc", "'_", ")_", "]_", "*_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tee", " ", "pass", "-", "through", " ", "to", " ", "copy", "able", " ", "iterator_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "a_", ",_", "b_", "=_", "tee", "_", "(_", "'", "abc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", ",_", "d_", "=_", "tee", "_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "JY", "THO", "N", " ", "TOD", "O", ":", " ", "we", " ", "do", " ", "not", " ", "currentl", "y", " ", "implement", " ", "copy_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "assert", "\\u(", "a", " ", "is", " ", "c", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "tee", "\\u", "new_", "\\u\\u\\uNL\\u\\u\\u_", "t1_", ",_", "t2_", "=_", "tee", "_", "(_", "'", "abc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tne", "w_", "=_", "type_", "(_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "tne", "w_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "tne", "w_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t3_", "=_", "tne", "w_", "(_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "JY", "THO", "N", ":", " ", "this", " ", "tests", " ", "tha", "t", " ", "copy", " ", "is", " ", "transiti", "ve_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "assert", "\\u(", "list", "(", "t1", ")", " ", "==", " ", "list", "(", "t2", ")", " ", "==", " ", "list", "(", "t3", ")", " ", "==", " ", "list", "('", "abc", "'))", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "list_", "(_", "t3_", ")_", "==_", "list_", "(_", "t2_", ")_", "==_", "list_", "(_", "'", "abc", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "tha", "t", " ", "tee", " ", "object", "s", " ", "are", " ", "weak", " ", "referen", "cable", "_", "\\u\\u\\uNL\\u\\u\\u_", "a_", ",_", "b_", "=_", "tee", "_", "(_", "xrange_", "(_", "10_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "proxy_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "getattr_", "(_", "p_", ",_", "'\\u", "\\u", "class", "\\u\\u'_", ")_", ",_", "type_", "(_", "b_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "JY", "THO", "N", ":", " ", "this", " ", "depend", "s", " ", "on", " ", "`", "a", "`", " ", "actual", "ly", " ", "goi", "ng", " ", "out", " ", "of", " ", "scope", ";", " ", "we", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "wou", "ld", " ", "have", " ", "to", " ", "play", " ", "with", " ", "GC", " ", "to", " ", "make", " ", "it", " ", "so_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "assert", "Rai", "ses", "(", "Reference", "Error", ",", " ", "getattr", ",", " ", "p", ",", " ", "'\\u", "\\u", "class", "\\u\\u'", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "GC", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "make", "cycle_", "(_", "self_", ",_", "iterator_", ",_", "container_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "container_", "._", "append_", "(_", "iterator_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iterator_", "._", "next_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "container_", ",_", "iterator_", "\\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, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 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, 2 ]
Unused local variable
contextio/Python-ContextIO/contextio/lib/resources/message.py
[ { "content": " @only(\"lite\")\n def delete_read(self, **params):\n all_args = [\"delimiter\"]\n params = helpers.sanitize_params(params, all_args)\n return super(Message, self).delete(\"read\")", "metadata": "root.Message.delete_read", "header": "['class', 'Message', '(', 'BaseResource', ')', ':', '___EOS___']", "index": 461 } ]
[ { "span": "params ", "start_line": 464, "start_column": 8, "end_line": 464, "end_column": 14 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Message_", "(_", "Base", "Resource_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "only_", "(_", "\"", "lite", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "delete", "\\u", "read_", "(_", "self_", ",_", "**_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "all", "\\u", "args_", "=_", "[_", "\"", "delimiter", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "helpers_", "._", "sanitize", "\\u", "params_", "(_", "params_", ",_", "all", "\\u", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Message_", ",_", "self_", ")_", "._", "delete_", "(_", "\"", "read", "\"_", ")_" ]
[ 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, 2, 2, 2, 2, 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
JetBrains/youtrack-rest-python-library/python/youtrackRestSamples.py
[ { "content": "# coding=UTF-8\n\nfrom youtrack.connection import Connection, httplib2\nfrom xml.etree.ElementTree import fromstring\nimport random\nimport urllib\nimport httplib\nimport urllib2\n\nimport socks\n\nhttplib2.debuglevel=4\nhttplib.debuglevel=4\n\nyt = Connection('http://teamsys.intellij.net', 'resttest', 'resttest')#, proxy_info = httplib2.ProxyInfo(socks.PROXY_TYPE_HTTP, 'localhost', 8888))\n#yt = Connection('http://localhost:8080', 'root', 'root')\n\n#yt = Connection('http://v-rot-mne-nogi.myjetbrains.com/youtrack', 'root', 'root') #, proxy_info = httplib2.ProxyInfo(socks.PROXY_TYPE_HTTP, 'localhost', 8888))\n\nprint 'connected'\n\n# create subsystem\n#print yt.createSubsystemDetailed('ADM', 'ss' + str(random.random()), False, 'root')\n\n# get issue\n#i = yt.getIssue('SB-4950')\n\n#print i\n\nprint yt.createIssue('SB', 'resttest', 'test', 'test', '1', 'Bug', 'Unknown', 'Open', '', '', '')\n#print i.getAttachments()\n#a = i.getAttachments()[0]\n#print a\n#\n#content = open('socks.py')\n#print yt2.createAttachment('ADM-1', a.name, content, 'root', contentLength=int(content.headers.dict['content-length']), contentType=content.info().type)\n\n#i = yt.getIssues('ADM', 'tut', 0, 100)\n#print i\n#print i[0].getLinks()\n#print i[0].getAttachments()\n#print i[0].getComments()\n\n#print yt.getSubsystems('JT')\n#print yt.getIssue('JT-4832')\n#print yt.getProject('JT')\n#print yt.getUser('root')\n#print yt.createUser('v2', 'v1', 'vadim', 'vadim@vadim.com', 'vadim@vadim.com')\n#print yt.importUsers([{'login':'vadim2', 'fullName':'vadim', 'email':'eee@ss.com', 'jabber':'fff@fff.com'},\n# {'login':'maxim2', 'fullName':'maxim', 'email':'aaa@ss.com', 'jabber':'www@fff.com'}])\n\n\n#connection.importIssues('ADM', 'group', [\n# {'numberInProject':'1',\n# 'summary': 'some summary',\n# 'description':'some description',\n# 'priority':'1',\n# 'fixedVersion':['1.0', '2.0'],\n# 'comment':[{'author':'yamaxim', 'text':'comment text', 'created':'1267030230127'},\n# {'author':'yavadim', 'text':'comment text 2', 'created':'1267030230127'}]\n# },\n# {'numberInProject':'2',\n# 'summary':'some problem',\n# 'description':'some description',\n# 'priority':'1'}])\n\n#print yt.importIssues('JT', 'group', yt.getIssues('JT', '', 100, 3))\n\n#print yt.getIssues('JT', '', 0, 10)\n\n\n#send: 'GET /rest/issue/SB-4950 HTTP/1.1\\r\\n\n# Host: teamsys.intellij.net\\r\\nuser-agent: Python-httplib2/$Rev: 259 $\\r\\n\n# cookie: JSESSIONID=drgfn16jz02vllov6w3p6gyl;Path=/, jetbrains.charisma.main.security.PRINCIPAL=YzBjZGM3N2UyMmRlYTAyY2I2NzMyZTdlZjc5N2JkYjI5YzdjYWU0NTRmY2I1Zjc5NzBiMmUzY2ZlM2QzZDA2YjpyZXN0dGVzdA;Path=/;Expires=Fri, 17-Jun-2011 10:53:34 GMT\\r\\\\a\n# accept-encoding: compress, gzip\\r\\ncache-control: no-cache\\r\\n\\r\\n'\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from xml.etree.ElementTree import fromstring", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 44 }, { "span": "import random", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 13 }, { "span": "import urllib", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 13 }, { "span": "import urllib2", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 14 }, { "span": "import socks", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 12 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "codi", "ng", "=", "UT", "F", "-", "8_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "you", "track_", "._", "connection_", "import_", "Connection_", ",_", "httplib2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "xml_", "._", "etree_", "._", "Element", "Tree_", "import_", "fromstring_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "httplib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "socks", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "httplib2_", "._", "debugl", "evel_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "httplib_", "._", "debugl", "evel_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "yt_", "=_", "Connection_", "(_", "'", "http", "://", "team", "sys", ".", "intel", "li", "j", ".", "net", "'_", ",_", "'", "rest", "test", "'_", ",_", "'", "rest", "test", "'_", ")_", "#", ",", " ", "proxy", "\\u", "info", " ", "=", " ", "http", "lib", "2", ".", "Pro", "xy", "Info", "(", "socks", ".", "PROX", "Y", "\\u", "TYPE", "\\u", "HTTP", ",", " ", "'", "local", "host", "',", " ", "8888", "))", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "yt", " ", "=", " ", "Connect", "ion", "('", "http", "://", "local", "host", ":", "808", "0", "',", " ", "'", "root", "',", " ", "'", "root", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "yt", " ", "=", " ", "Connect", "ion", "('", "http", "://", "v", "-", "rot", "-", "mne", "-", "nog", "i", ".", "my", "jet", "brain", "s", ".", "com", "/", "you", "track", "',", " ", "'", "root", "',", " ", "'", "root", "')", " ", "#", ",", " ", "proxy", "\\u", "info", " ", "=", " ", "http", "lib", "2", ".", "Pro", "xy", "Info", "(", "socks", ".", "PROX", "Y", "\\u", "TYPE", "\\u", "HTTP", ",", " ", "'", "local", "host", "',", " ", "8888", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "connect", "ed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "subsystem", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "yt", ".", "create", "Subs", "yste", "m", "Det", "ail", "ed", "('", "ADM", "',", " ", "'", "ss", "'", " ", "+", " ", "str", "(", "random", ".", "random", "())", ",", " ", "Fal", "se", ",", " ", "'", "root", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "issue_", "\\u\\u\\uNL\\u\\u\\u_", "#", "i", " ", "=", " ", "yt", ".", "get", "Issue", "('", "SB", "-", "495", "0", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "i_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "yt_", "._", "create", "Issue_", "(_", "'", "SB", "'_", ",_", "'", "rest", "test", "'_", ",_", "'", "test", "'_", ",_", "'", "test", "'_", ",_", "'", "1", "'_", ",_", "'", "Bug", "'_", ",_", "'", "Un", "know", "n", "'_", ",_", "'", "Open", "'_", ",_", "''_", ",_", "''_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "i", ".", "get", "Attach", "ment", "s", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "a", " ", "=", " ", "i", ".", "get", "Attach", "ment", "s", "()[", "0", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "content", " ", "=", " ", "open", "('", "socks", ".", "py", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "yt", "2", ".", "create", "Attach", "ment", "('", "ADM", "-1", "',", " ", "a", ".", "name", ",", " ", "content", ",", " ", "'", "root", "',", " ", "content", "Length", "=", "int", "(", "content", ".", "header", "s", ".", "dict", "['", "content", "-", "length", "'])", ",", " ", "content", "Type", "=", "content", ".", "info", "()", ".", "type", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "i", " ", "=", " ", "yt", ".", "get", "Issues", "('", "ADM", "',", " ", "'", "tut", "',", " ", "0", ",", " ", "100", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "i_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "i", "[", "0", "].", "get", "Link", "s", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "i", "[", "0", "].", "get", "Attach", "ment", "s", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "i", "[", "0", "].", "get", "Comme", "nts", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "yt", ".", "get", "Subs", "yste", "ms", "('", "JT", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "yt", ".", "get", "Issue", "('", "JT", "-", "483", "2", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "yt", ".", "get", "Project", "('", "JT", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "yt", ".", "get", "User", "('", "root", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "yt", ".", "create", "User", "('", "v2", "',", " ", "'", "v1", "',", " ", "'", "vad", "im", "',", " ", "'", "vad", "im", "@", "vad", "im", ".", "com", "',", " ", "'", "vad", "im", "@", "vad", "im", ".", "com", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "yt", ".", "import", "User", "s", "([", "{", "'", "login", "':", "'", "vad", "im2", "',", " ", "'", "full", "Name", "':", "'", "vad", "im", "',", " ", "'", "email", "':", "'", "eee", "@", "ss", ".", "com", "',", " ", "'", "jab", "ber", "':", "'", "fff", "@", "fff", ".", "com", "'}", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "{", "'", "login", "':", "'", "maxim", "2", "',", " ", "'", "full", "Name", "':", "'", "maxim", "',", " ", "'", "email", "':", "'", "aaa", "@", "ss", ".", "com", "',", " ", "'", "jab", "ber", "':", "'", "www", "@", "fff", ".", "com", "'}", "])", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "connecti", "on", ".", "import", "Issues", "('", "ADM", "',", " ", "'", "group", "',", " ", "[_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "{", "'", "number", "In", "Project", "':", "'", "1", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'", "summar", "y", "':", " ", "'", "some", " ", "summar", "y", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'", "description", "':", "'", "some", " ", "description", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'", "priorit", "y", "':", "'", "1", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'", "fixed", "Version", "':", "['", "1.0", "',", " ", "'", "2.0", "']", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'", "comment", "':", "[{", "'", "author", "':", "'", "ya", "maxim", "',", " ", "'", "text", "':", "'", "comment", " ", "text", "',", " ", "'", "created", "':", "'", "126", "703", "023", "012", "7", "'}", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "{", "'", "author", "':", "'", "ya", "vad", "im", "',", " ", "'", "text", "':", "'", "comment", " ", "text", " ", "2", "',", " ", "'", "created", "':", "'", "126", "703", "023", "012", "7", "'}", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "},", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "{", "'", "number", "In", "Project", "':", "'", "2", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'", "summar", "y", "':", "'", "some", " ", "problem", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'", "description", "':", "'", "some", " ", "description", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'", "priorit", "y", "':", "'", "1", "'}", "])", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "yt", ".", "import", "Issues", "('", "JT", "',", " ", "'", "group", "',", " ", "yt", ".", "get", "Issues", "('", "JT", "',", " ", "''", ",", " ", "100", ",", " ", "3", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "yt", ".", "get", "Issues", "('", "JT", "',", " ", "''", ",", " ", "0", ",", " ", "10", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "send", ":", " ", "'", "GET", " ", "/", "rest", "/", "issue", "/", "SB", "-", "495", "0", " ", "HTTP", "/", "1.1", "\\\\", "r", "\\\\", "n_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Host", ":", " ", "team", "sys", ".", "intel", "li", "j", ".", "net", "\\\\", "r", "\\\\", "nus", "er", "-", "agent", ":", " ", "Pyth", "on", "-", "http", "lib", "2", "/$", "Rev", ":", " ", "259", " ", "$", "\\\\", "r", "\\\\", "n_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "cookie", ":", " ", "JS", "ESSION", "ID", "=", "dr", "gf", "n1", "6", "jz", "02", "vl", "lo", "v6", "w3", "p6", "gy", "l", ";", "Path", "=", "/", ",", " ", "jet", "brain", "s", ".", "char", "isma", ".", "main", ".", "security", ".", "PRI", "NCI", "PAL", "=", "Y", "z", "Bj", "ZG", "M3", "N", "2", "U", "y", "Mm", "Rl", "YT", "Ay", "Y", "2", "I2", "Nz", "My", "ZT", "dl", "Z", "jc", "5", "N", "2", "Jk", "Y", "j", "I", "5", "Y", "zd", "j", "Y", "WU", "0", "NT", "Rm", "Y", "2", "I1", "Z", "jc", "5", "Nz", "Bi", "Mm", "Uz", "Y", "2", "Zl", "M2", "Q", "z", "ZD", "A2", "Y", "jp", "y", "ZX", "N", "0d", "GV", "zd", "A", ";", "Path", "=", "/", ";", "Expire", "s", "=", "Fri", ",", " ", "1", "7", "-", "Jun", "-", "2011", " ", "10", ":", "5", "3", ":", "3", "4", " ", "GM", "T", "\\\\", "r", "\\\\\\\\", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "accept", "-", "encoding", ":", " ", "compress", ",", " ", "gzip", "\\\\", "r", "\\\\", "nca", "che", "-", "control", ":", " ", "no", "-", "cache", "\\\\", "r", "\\\\", "n", "\\\\", "r", "\\\\", "n", "'_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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 local variable
openstack/gertty/gertty/search/parser.py
[ { "content": "def SearchParser():\n precedence = ( # NOQA\n ('left', 'NOT', 'NEG'),\n )\n\n def p_terms(p):\n '''expression : list_expr\n | paren_expr\n | boolean_expr\n | negative_expr\n | term'''\n p[0] = p[1]\n\n def p_list_expr(p):\n '''list_expr : expression expression'''\n p[0] = and_(p[1], p[2])\n\n def p_paren_expr(p):\n '''paren_expr : LPAREN expression RPAREN'''\n p[0] = p[2]\n\n def p_boolean_expr(p):\n '''boolean_expr : expression AND expression\n | expression OR expression'''\n if p[2].lower() == 'and':\n p[0] = and_(p[1], p[3])\n elif p[2].lower() == 'or':\n p[0] = or_(p[1], p[3])\n else:\n raise gertty.search.SearchSyntaxError(\"Boolean %s not recognized\" % p[2])\n\n def p_negative_expr(p):\n '''negative_expr : NOT expression\n | NEG expression'''\n p[0] = not_(p[2])\n\n def p_term(p):\n '''term : age_term\n | recentlyseen_term\n | change_term\n | owner_term\n | reviewer_term\n | commit_term\n | project_term\n | project_key_term\n | branch_term\n | topic_term\n | ref_term\n | label_term\n | message_term\n | comment_term\n | has_term\n | is_term\n | status_term\n | file_term\n | limit_term\n | op_term'''\n p[0] = p[1]\n\n def p_string(p):\n '''string : SSTRING\n | DSTRING\n | USTRING'''\n p[0] = p[1]\n\n def p_age_term(p):\n '''age_term : OP_AGE NUMBER string'''\n now = datetime.datetime.utcnow()\n delta = p[2]\n unit = p[3]\n delta = age_to_delta(delta, unit)\n p[0] = gertty.db.change_table.c.updated < (now-datetime.timedelta(seconds=delta))\n\n def p_recentlyseen_term(p):\n '''recentlyseen_term : OP_RECENTLYSEEN NUMBER string'''\n # A gertty extension\n now = datetime.datetime.utcnow()\n delta = p[2]\n unit = p[3]\n delta = age_to_delta(delta, unit)\n s = select([func.datetime(func.max(gertty.db.change_table.c.last_seen), '-%s seconds' % delta)],\n correlate=False)\n p[0] = gertty.db.change_table.c.last_seen >= s\n\n def p_change_term(p):\n '''change_term : OP_CHANGE CHANGE_ID\n | OP_CHANGE NUMBER'''\n if type(p[2]) == int:\n p[0] = gertty.db.change_table.c.number == p[2]\n else:\n p[0] = gertty.db.change_table.c.change_id == p[2]\n\n def p_owner_term(p):\n '''owner_term : OP_OWNER string'''\n if p[2] == 'self':\n username = p.parser.username\n p[0] = gertty.db.account_table.c.username == username\n else:\n p[0] = or_(gertty.db.account_table.c.username == p[2],\n gertty.db.account_table.c.email == p[2],\n gertty.db.account_table.c.name == p[2])\n\n def p_reviewer_term(p):\n '''reviewer_term : OP_REVIEWER string\n | OP_REVIEWER NUMBER'''\n filters = []\n filters.append(gertty.db.approval_table.c.change_key == gertty.db.change_table.c.key)\n filters.append(gertty.db.approval_table.c.account_key == gertty.db.account_table.c.key)\n try:\n number = int(p[2])\n except:\n number = None\n if number is not None:\n filters.append(gertty.db.account_table.c.id == number)\n elif p[2] == 'self':\n username = p.parser.username\n filters.append(gertty.db.account_table.c.username == username)\n else:\n filters.append(or_(gertty.db.account_table.c.username == p[2],\n gertty.db.account_table.c.email == p[2],\n gertty.db.account_table.c.name == p[2]))\n s = select([gertty.db.change_table.c.key], correlate=False).where(and_(*filters))\n p[0] = gertty.db.change_table.c.key.in_(s)\n\n def p_commit_term(p):\n '''commit_term : OP_COMMIT string'''\n filters = []\n filters.append(gertty.db.revision_table.c.change_key == gertty.db.change_table.c.key)\n filters.append(gertty.db.revision_table.c.commit == p[2])\n s = select([gertty.db.change_table.c.key], correlate=False).where(and_(*filters))\n p[0] = gertty.db.change_table.c.key.in_(s)\n\n def p_project_term(p):\n '''project_term : OP_PROJECT string'''\n if p[2].startswith('^'):\n p[0] = func.matches(p[2], gertty.db.project_table.c.name)\n else:\n p[0] = gertty.db.project_table.c.name == p[2]\n\n def p_project_key_term(p):\n '''project_key_term : OP_PROJECT_KEY NUMBER'''\n p[0] = gertty.db.change_table.c.project_key == p[2]\n\n def p_branch_term(p):\n '''branch_term : OP_BRANCH string'''\n if p[2].startswith('^'):\n p[0] = func.matches(p[2], gertty.db.change_table.c.branch)\n else:\n p[0] = gertty.db.change_table.c.branch == p[2]\n\n def p_topic_term(p):\n '''topic_term : OP_TOPIC string'''\n if p[2].startswith('^'):\n p[0] = func.matches(p[2], gertty.db.change_table.c.topic)\n else:\n p[0] = gertty.db.change_table.c.topic == p[2]\n\n def p_ref_term(p):\n '''ref_term : OP_REF string'''\n if p[2].startswith('^'):\n p[0] = func.matches(p[2], 'refs/heads/'+gertty.db.change_table.c.branch)\n else:\n p[0] = gertty.db.change_table.c.branch == p[2][len('refs/heads/'):]\n\n label_re = re.compile(r'(?P<label>[a-zA-Z0-9_-]+([a-zA-Z]|((?<![-+])[0-9])))'\n r'(?P<operator>[<>]?=?)(?P<value>[-+]?[0-9]+)'\n r'($|,(user=)?(?P<user>\\S+))')\n\n def p_label_term(p):\n '''label_term : OP_LABEL string'''\n args = label_re.match(p[2])\n label = args.group('label')\n op = args.group('operator') or '='\n value = int(args.group('value'))\n user = args.group('user')\n\n filters = []\n filters.append(gertty.db.approval_table.c.change_key == gertty.db.change_table.c.key)\n filters.append(gertty.db.approval_table.c.category == label)\n if op == '=':\n filters.append(gertty.db.approval_table.c.value == value)\n elif op == '>=':\n filters.append(gertty.db.approval_table.c.value >= value)\n elif op == '<=':\n filters.append(gertty.db.approval_table.c.value <= value)\n if user is not None:\n filters.append(gertty.db.approval_table.c.account_key == gertty.db.account_table.c.key)\n if user == 'self':\n filters.append(gertty.db.account_table.c.username == p.parser.username)\n else:\n filters.append(\n or_(gertty.db.account_table.c.username == user,\n gertty.db.account_table.c.email == user,\n gertty.db.account_table.c.name == user))\n s = select([gertty.db.change_table.c.key], correlate=False).where(and_(*filters))\n p[0] = gertty.db.change_table.c.key.in_(s)\n\n def p_message_term(p):\n '''message_term : OP_MESSAGE string'''\n filters = []\n filters.append(gertty.db.revision_table.c.change_key == gertty.db.change_table.c.key)\n filters.append(gertty.db.revision_table.c.message.like('%%%s%%' % p[2]))\n s = select([gertty.db.change_table.c.key], correlate=False).where(and_(*filters))\n p[0] = gertty.db.change_table.c.key.in_(s)\n\n def p_comment_term(p):\n '''comment_term : OP_COMMENT string'''\n filters = []\n filters.append(gertty.db.revision_table.c.change_key == gertty.db.change_table.c.key)\n filters.append(gertty.db.revision_table.c.message == p[2])\n revision_select = select([gertty.db.change_table.c.key], correlate=False).where(and_(*filters))\n filters = []\n filters.append(gertty.db.revision_table.c.change_key == gertty.db.change_table.c.key)\n filters.append(gertty.db.comment_table.c.revision_key == gertty.db.revision_table.c.key)\n filters.append(gertty.db.comment_table.c.message == p[2])\n comment_select = select([gertty.db.change_table.c.key], correlate=False).where(and_(*filters))\n p[0] = or_(gertty.db.change_table.c.key.in_(comment_select),\n gertty.db.change_table.c.key.in_(revision_select))\n\n def p_has_term(p):\n '''has_term : OP_HAS string'''\n #TODO: implement star\n if p[2] == 'draft':\n filters = []\n filters.append(gertty.db.revision_table.c.change_key == gertty.db.change_table.c.key)\n filters.append(gertty.db.message_table.c.revision_key == gertty.db.revision_table.c.key)\n filters.append(gertty.db.message_table.c.draft == True)\n s = select([gertty.db.change_table.c.key], correlate=False).where(and_(*filters))\n p[0] = gertty.db.change_table.c.key.in_(s)\n else:\n raise gertty.search.SearchSyntaxError('Syntax error: has:%s is not supported' % p[2])\n\n def p_is_term(p):\n '''is_term : OP_IS string'''\n #TODO: implement draft\n username = p.parser.username\n if p[2] == 'reviewed':\n filters = []\n filters.append(gertty.db.approval_table.c.change_key == gertty.db.change_table.c.key)\n filters.append(gertty.db.approval_table.c.value != 0)\n s = select([gertty.db.change_table.c.key], correlate=False).where(and_(*filters))\n p[0] = gertty.db.change_table.c.key.in_(s)\n elif p[2] == 'open':\n p[0] = gertty.db.change_table.c.status.notin_(['MERGED', 'ABANDONED'])\n elif p[2] == 'closed':\n p[0] = gertty.db.change_table.c.status.in_(['MERGED', 'ABANDONED'])\n elif p[2] == 'submitted':\n p[0] = gertty.db.change_table.c.status == 'SUBMITTED'\n elif p[2] == 'merged':\n p[0] = gertty.db.change_table.c.status == 'MERGED'\n elif p[2] == 'abandoned':\n p[0] = gertty.db.change_table.c.status == 'ABANDONED'\n elif p[2] == 'owner':\n p[0] = gertty.db.account_table.c.username == username\n elif p[2] == 'starred':\n p[0] = gertty.db.change_table.c.starred == True\n elif p[2] == 'held':\n # A gertty extension\n p[0] = gertty.db.change_table.c.held == True\n elif p[2] == 'reviewer':\n filters = []\n filters.append(gertty.db.approval_table.c.change_key == gertty.db.change_table.c.key)\n filters.append(gertty.db.approval_table.c.account_key == gertty.db.account_table.c.key)\n filters.append(gertty.db.account_table.c.username == username)\n s = select([gertty.db.change_table.c.key], correlate=False).where(and_(*filters))\n p[0] = gertty.db.change_table.c.key.in_(s)\n elif p[2] == 'watched':\n p[0] = gertty.db.project_table.c.subscribed == True\n else:\n raise gertty.search.SearchSyntaxError('Syntax error: is:%s is not supported' % p[2])\n\n def p_file_term(p):\n '''file_term : OP_FILE string'''\n if p[2].startswith('^'):\n p[0] = and_(or_(func.matches(p[2], gertty.db.file_table.c.path),\n func.matches(p[2], gertty.db.file_table.c.old_path)),\n gertty.db.file_table.c.status is not None)\n else:\n p[0] = and_(or_(gertty.db.file_table.c.path == p[2],\n gertty.db.file_table.c.old_path == p[2]),\n gertty.db.file_table.c.status is not None)\n\n def p_status_term(p):\n '''status_term : OP_STATUS string'''\n if p[2] == 'open':\n p[0] = gertty.db.change_table.c.status.notin_(['MERGED', 'ABANDONED'])\n elif p[2] == 'closed':\n p[0] = gertty.db.change_table.c.status.in_(['MERGED', 'ABANDONED'])\n else:\n p[0] = gertty.db.change_table.c.status == p[2].upper()\n\n def p_limit_term(p):\n '''limit_term : OP_LIMIT NUMBER'''\n # TODO: Implement this. The sqlalchemy limit call needs to be\n # applied to the query operation and so can not be returned as\n # part of the production here. The information would need to\n # be returned out-of-band. In the mean time, since limits are\n # not as important in gertty, make this a no-op for now so\n # that it does not produce a syntax error.\n p[0] = (True == True)\n\n def p_op_term(p):\n 'op_term : OP'\n raise SyntaxError()\n\n def p_error(p):\n if p:\n raise gertty.search.SearchSyntaxError('Syntax error at \"%s\" in search string \"%s\" (col %s)' % (\n p.lexer.lexdata[p.lexpos:], p.lexer.lexdata, p.lexpos))\n else:\n raise gertty.search.SearchSyntaxError('Syntax error: EOF in search string')\n\n return yacc.yacc(debug=0, write_tables=0)", "metadata": "root.SearchParser", "header": "['module', '___EOS___']", "index": 41 } ]
[ { "span": "p_terms(", "start_line": 46, "start_column": 8, "end_line": 46, "end_column": 15 }, { "span": "p_list_expr(", "start_line": 54, "start_column": 8, "end_line": 54, "end_column": 19 }, { "span": "p_paren_expr(", "start_line": 58, "start_column": 8, "end_line": 58, "end_column": 20 }, { "span": "p_boolean_expr(", "start_line": 62, "start_column": 8, "end_line": 62, "end_column": 22 }, { "span": "p_negative_expr(", "start_line": 72, "start_column": 8, "end_line": 72, "end_column": 23 }, { "span": "p_term(", "start_line": 77, "start_column": 8, "end_line": 77, "end_column": 14 }, { "span": "p_string(", "start_line": 100, "start_column": 8, "end_line": 100, "end_column": 16 }, { "span": "p_age_term(", "start_line": 106, "start_column": 8, "end_line": 106, "end_column": 18 }, { "span": "p_recentlyseen_term(", "start_line": 114, "start_column": 8, "end_line": 114, "end_column": 27 }, { "span": "now ", "start_line": 117, "start_column": 8, "end_line": 117, "end_column": 11 }, { "span": "p_change_term(", "start_line": 125, "start_column": 8, "end_line": 125, "end_column": 21 }, { "span": "p_owner_term(", "start_line": 133, "start_column": 8, "end_line": 133, "end_column": 20 }, { "span": "p_reviewer_term(", "start_line": 143, "start_column": 8, "end_line": 143, "end_column": 23 }, { "span": "p_commit_term(", "start_line": 165, "start_column": 8, "end_line": 165, "end_column": 21 }, { "span": "p_project_term(", "start_line": 173, "start_column": 8, "end_line": 173, "end_column": 22 }, { "span": "p_project_key_term(", "start_line": 180, "start_column": 8, "end_line": 180, "end_column": 26 }, { "span": "p_branch_term(", "start_line": 184, "start_column": 8, "end_line": 184, "end_column": 21 }, { "span": "p_topic_term(", "start_line": 191, "start_column": 8, "end_line": 191, "end_column": 20 }, { "span": "p_ref_term(", "start_line": 198, "start_column": 8, "end_line": 198, "end_column": 18 }, { "span": "p_label_term(", "start_line": 209, "start_column": 8, "end_line": 209, "end_column": 20 }, { "span": "p_message_term(", "start_line": 238, "start_column": 8, "end_line": 238, "end_column": 22 }, { "span": "p_comment_term(", "start_line": 246, "start_column": 8, "end_line": 246, "end_column": 22 }, { "span": "p_has_term(", "start_line": 260, "start_column": 8, "end_line": 260, "end_column": 18 }, { "span": "p_is_term(", "start_line": 273, "start_column": 8, "end_line": 273, "end_column": 17 }, { "span": "p_file_term(", "start_line": 312, "start_column": 8, "end_line": 312, "end_column": 19 }, { "span": "p_status_term(", "start_line": 323, "start_column": 8, "end_line": 323, "end_column": 21 }, { "span": "p_limit_term(", "start_line": 332, "start_column": 8, "end_line": 332, "end_column": 20 }, { "span": "p_op_term(", "start_line": 342, "start_column": 8, "end_line": 342, "end_column": 17 }, { "span": "p_error(", "start_line": 346, "start_column": 8, "end_line": 346, "end_column": 15 } ]
[]
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_", "Sear", "ch", "Parser_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "preceden", "ce_", "=_", "(_", "#", " ", "NO", "QA", "_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "left", "'_", ",_", "'", "NOT", "'_", ",_", "'", "NEG", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "p", "\\u", "terms_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "express", "ion", " ", ":", " ", "list", "\\u", "expr", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "paren", "\\u", "expr", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "boolean", "\\u", "expr", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "negati", "ve", "\\u", "expr", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "term", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "list", "\\u", "expr_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "list", "\\u", "expr", " ", ":", " ", "express", "ion", " ", "express", "ion", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "and\\u_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "paren", "\\u", "expr_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "paren", "\\u", "expr", " ", ":", " ", "LPAR", "EN", " ", "express", "ion", " ", "RPA", "REN", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "boolean", "\\u", "expr_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "boolean", "\\u", "expr", " ", ":", " ", "express", "ion", " ", "AND", " ", "express", "ion", "\\", "10", ";", " ", " ", "|", " ", "express", "ion", " ", "OR", " ", "express", "ion", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "p_", "[_", "2_", "]_", "._", "lower_", "(_", ")_", "==_", "'", "and", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "and\\u_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "p_", "[_", "2_", "]_", "._", "lower_", "(_", ")_", "==_", "'", "or", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "or\\u_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "ger", "tty_", "._", "search_", "._", "Sear", "ch", "Syntax", "Error_", "(_", "\"", "Boo", "lean", " ", "%", "s", " ", "not", " ", "recognize", "d", "\"_", "%_", "p_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "negati", "ve", "\\u", "expr_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "negati", "ve", "\\u", "expr", " ", ":", " ", "NOT", " ", "express", "ion", "\\", "10", ";", " ", " ", " ", "|", " ", "NEG", " ", "express", "ion", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "not", "\\u_", "(_", "p_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "term", " ", ":", " ", "age", "\\u", "term", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "recent", "lys", "een", "\\u", "term", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "change", "\\u", "term", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "owner", "\\u", "term", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "reviewer", "\\u", "term", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "commit", "\\u", "term", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "project", "\\u", "term", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "project", "\\u", "key", "\\u", "term", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "branch", "\\u", "term", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "topic", "\\u", "term", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "ref", "\\u", "term", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "label", "\\u", "term", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "message", "\\u", "term", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "comment", "\\u", "term", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "has", "\\u", "term", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "is", "\\u", "term", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "status", "\\u", "term", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "file", "\\u", "term", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "limit", "\\u", "term", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "op", "\\u", "term", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "string_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "string", " ", ":", " ", "SS", "TRING", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "|", " ", "DST", "RING", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "|", " ", "UST", "RING", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "age", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "age", "\\u", "term", " ", ":", " ", "OP", "\\u", "AGE", " ", "NUMB", "ER", " ", "string", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "now_", "=_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delta_", "=_", "p_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unit_", "=_", "p_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delta_", "=_", "age", "\\u", "to", "\\u", "delta_", "(_", "delta_", ",_", "unit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "updated_", "<_", "(_", "now_", "-_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "delta_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "recent", "lys", "een", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "recent", "lys", "een", "\\u", "term", " ", ":", " ", "OP", "\\u", "REC", "ENT", "LYS", "EE", "N", " ", "NUMB", "ER", " ", "string", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "A", " ", "ger", "tt", "y", " ", "extension_", "\\u\\u\\uNL\\u\\u\\u_", "now_", "=_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delta_", "=_", "p_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unit_", "=_", "p_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delta_", "=_", "age", "\\u", "to", "\\u", "delta_", "(_", "delta_", ",_", "unit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "select_", "(_", "[_", "func_", "._", "datetime_", "(_", "func_", "._", "max_", "(_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "last", "\\u", "seen_", ")_", ",_", "'-", "%", "s", " ", "second", "s", "'_", "%_", "delta_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "correlate", "_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "last", "\\u", "seen_", ">=_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "change", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "change", "\\u", "term", " ", ":", " ", "OP", "\\u", "CHANGE", " ", "CHANGE", "\\u", "ID", "\\", "10", ";", " ", " ", " ", " ", " ", "|", " ", "OP", "\\u", "CHANGE", " ", "NUMB", "ER", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "(_", "p_", "[_", "2_", "]_", ")_", "==_", "int_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "number_", "==_", "p_", "[_", "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 ", " _", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "change", "\\u", "id_", "==_", "p_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "owner", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "owner", "\\u", "term", " ", ":", " ", "OP", "\\u", "OWNER", " ", "string", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "p_", "[_", "2_", "]_", "==_", "'", "self", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "username_", "=_", "p_", "._", "parser_", "._", "username_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "account", "\\u", "table_", "._", "c_", "._", "username_", "==_", "username_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "or\\u_", "(_", "ger", "tty_", "._", "db_", "._", "account", "\\u", "table_", "._", "c_", "._", "username_", "==_", "p_", "[_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ger", "tty_", "._", "db_", "._", "account", "\\u", "table_", "._", "c_", "._", "email_", "==_", "p_", "[_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ger", "tty_", "._", "db_", "._", "account", "\\u", "table_", "._", "c_", "._", "name_", "==_", "p_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "reviewer", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "reviewer", "\\u", "term", " ", ":", " ", "OP", "\\u", "REVI", "EW", "ER", " ", "string", "\\", "10", ";", " ", " ", " ", "|", " ", "OP", "\\u", "REVI", "EW", "ER", " ", "NUMB", "ER", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "approval", "\\u", "table_", "._", "c_", "._", "change", "\\u", "key_", "==_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "approval", "\\u", "table_", "._", "c_", "._", "account", "\\u", "key_", "==_", "ger", "tty_", "._", "db_", "._", "account", "\\u", "table_", "._", "c_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "number_", "=_", "int_", "(_", "p_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "number_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "number_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "account", "\\u", "table_", "._", "c_", "._", "id_", "==_", "number_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "p_", "[_", "2_", "]_", "==_", "'", "self", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "username_", "=_", "p_", "._", "parser_", "._", "username_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "account", "\\u", "table_", "._", "c_", "._", "username_", "==_", "username_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filters_", "._", "append_", "(_", "or\\u_", "(_", "ger", "tty_", "._", "db_", "._", "account", "\\u", "table_", "._", "c_", "._", "username_", "==_", "p_", "[_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ger", "tty_", "._", "db_", "._", "account", "\\u", "table_", "._", "c_", "._", "email_", "==_", "p_", "[_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ger", "tty_", "._", "db_", "._", "account", "\\u", "table_", "._", "c_", "._", "name_", "==_", "p_", "[_", "2_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "select_", "(_", "[_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", "]_", ",_", "correlate", "_", "=_", "False_", ")_", "._", "where_", "(_", "and\\u_", "(_", "*_", "filters_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", "._", "in\\u_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "commit", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "commit", "\\u", "term", " ", ":", " ", "OP", "\\u", "COMMIT", " ", "string", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "revis", "ion", "\\u", "table_", "._", "c_", "._", "change", "\\u", "key_", "==_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "revis", "ion", "\\u", "table_", "._", "c_", "._", "commit_", "==_", "p_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "select_", "(_", "[_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", "]_", ",_", "correlate", "_", "=_", "False_", ")_", "._", "where_", "(_", "and\\u_", "(_", "*_", "filters_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", "._", "in\\u_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "project", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "project", "\\u", "term", " ", ":", " ", "OP", "\\u", "PROJECT", " ", "string", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "p_", "[_", "2_", "]_", "._", "startswith_", "(_", "'", "^", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "func_", "._", "matches_", "(_", "p_", "[_", "2_", "]_", ",_", "ger", "tty_", "._", "db_", "._", "project", "\\u", "table_", "._", "c_", "._", "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 ", " _", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "project", "\\u", "table_", "._", "c_", "._", "name_", "==_", "p_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "project", "\\u", "key", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "project", "\\u", "key", "\\u", "term", " ", ":", " ", "OP", "\\u", "PROJECT", "\\u", "KEY", " ", "NUMB", "ER", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "project", "\\u", "key_", "==_", "p_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "branch", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "branch", "\\u", "term", " ", ":", " ", "OP", "\\u", "BRANCH", " ", "string", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "p_", "[_", "2_", "]_", "._", "startswith_", "(_", "'", "^", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "func_", "._", "matches_", "(_", "p_", "[_", "2_", "]_", ",_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "branch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "branch_", "==_", "p_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "topic", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "topic", "\\u", "term", " ", ":", " ", "OP", "\\u", "TOPIC", " ", "string", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "p_", "[_", "2_", "]_", "._", "startswith_", "(_", "'", "^", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "func_", "._", "matches_", "(_", "p_", "[_", "2_", "]_", ",_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "topic_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "topic_", "==_", "p_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "ref", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "ref", "\\u", "term", " ", ":", " ", "OP", "\\u", "REF", " ", "string", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "p_", "[_", "2_", "]_", "._", "startswith_", "(_", "'", "^", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "func_", "._", "matches_", "(_", "p_", "[_", "2_", "]_", ",_", "'", "refs", "/", "head", "s", "/'_", "+_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "branch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "branch_", "==_", "p_", "[_", "2_", "]_", "[_", "len_", "(_", "'", "refs", "/", "head", "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_", "label", "\\u", "re_", "=_", "re_", "._", "compile_", "(_", "r", "'(", "?", "P", "<", "label", ">[", "a", "-", "z", "A", "-", "Z", "0", "-", "9", "\\u-]", "+([", "a", "-", "z", "A", "-", "Z", "]|", "((", "?<", "![", "-+", "])", "[", "0", "-", "9", "]))", ")'_", "\\u\\u\\uNL\\u\\u\\u_", "r", "'(", "?", "P", "<", "opera", "tor", ">[", "<>", "]?", "=?", ")(?", "P", "<", "value", ">[-", "+]", "?", "[", "0", "-", "9", "]+)'_", "\\u\\u\\uNL\\u\\u\\u_", "r", "'(", "$", "|", ",(", "user", "=", ")?(", "?", "P", "<", "user", ">\\\\", "S", "+))", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "p", "\\u", "label", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "label", "\\u", "term", " ", ":", " ", "OP", "\\u", "LAB", "EL", " ", "string", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "label", "\\u", "re_", "._", "match_", "(_", "p_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label_", "=_", "args_", "._", "group_", "(_", "'", "label", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "op_", "=_", "args_", "._", "group_", "(_", "'", "opera", "tor", "'_", ")_", "or_", "'='_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "int_", "(_", "args_", "._", "group_", "(_", "'", "value", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "args_", "._", "group_", "(_", "'", "user", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "approval", "\\u", "table_", "._", "c_", "._", "change", "\\u", "key_", "==_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "approval", "\\u", "table_", "._", "c_", "._", "category_", "==_", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "op_", "==_", "'='_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "approval", "\\u", "table_", "._", "c_", "._", "value_", "==_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "op_", "==_", "'>='_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "approval", "\\u", "table_", "._", "c_", "._", "value_", ">=_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "op_", "==_", "'<='_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "approval", "\\u", "table_", "._", "c_", "._", "value_", "<=_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "user_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "approval", "\\u", "table_", "._", "c_", "._", "account", "\\u", "key_", "==_", "ger", "tty_", "._", "db_", "._", "account", "\\u", "table_", "._", "c_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "user_", "==_", "'", "self", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "account", "\\u", "table_", "._", "c_", "._", "username_", "==_", "p_", "._", "parser_", "._", "username_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filters_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "or\\u_", "(_", "ger", "tty_", "._", "db_", "._", "account", "\\u", "table_", "._", "c_", "._", "username_", "==_", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ger", "tty_", "._", "db_", "._", "account", "\\u", "table_", "._", "c_", "._", "email_", "==_", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ger", "tty_", "._", "db_", "._", "account", "\\u", "table_", "._", "c_", "._", "name_", "==_", "user_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "select_", "(_", "[_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", "]_", ",_", "correlate", "_", "=_", "False_", ")_", "._", "where_", "(_", "and\\u_", "(_", "*_", "filters_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", "._", "in\\u_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "message", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "message", "\\u", "term", " ", ":", " ", "OP", "\\u", "MESSAGE", " ", "string", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "revis", "ion", "\\u", "table_", "._", "c_", "._", "change", "\\u", "key_", "==_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "revis", "ion", "\\u", "table_", "._", "c_", "._", "message_", "._", "like_", "(_", "'%%", "%", "s", "%%'", "_", "%_", "p_", "[_", "2_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "select_", "(_", "[_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", "]_", ",_", "correlate", "_", "=_", "False_", ")_", "._", "where_", "(_", "and\\u_", "(_", "*_", "filters_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", "._", "in\\u_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "comment", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "comment", "\\u", "term", " ", ":", " ", "OP", "\\u", "COMMENT", " ", "string", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "revis", "ion", "\\u", "table_", "._", "c_", "._", "change", "\\u", "key_", "==_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "revis", "ion", "\\u", "table_", "._", "c_", "._", "message_", "==_", "p_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "revis", "ion", "\\u", "select_", "=_", "select_", "(_", "[_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", "]_", ",_", "correlate", "_", "=_", "False_", ")_", "._", "where_", "(_", "and\\u_", "(_", "*_", "filters_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "revis", "ion", "\\u", "table_", "._", "c_", "._", "change", "\\u", "key_", "==_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "comment", "\\u", "table_", "._", "c_", "._", "revis", "ion", "\\u", "key_", "==_", "ger", "tty_", "._", "db_", "._", "revis", "ion", "\\u", "table_", "._", "c_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "comment", "\\u", "table_", "._", "c_", "._", "message_", "==_", "p_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "comment", "\\u", "select_", "=_", "select_", "(_", "[_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", "]_", ",_", "correlate", "_", "=_", "False_", ")_", "._", "where_", "(_", "and\\u_", "(_", "*_", "filters_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "or\\u_", "(_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", "._", "in\\u_", "(_", "comment", "\\u", "select_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", "._", "in\\u_", "(_", "revis", "ion", "\\u", "select_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "has", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "has", "\\u", "term", " ", ":", " ", "OP", "\\u", "HAS", " ", "string", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "TOD", "O", ":", " ", "implement", " ", "star_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "p_", "[_", "2_", "]_", "==_", "'", "draft", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filters_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "revis", "ion", "\\u", "table_", "._", "c_", "._", "change", "\\u", "key_", "==_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "message", "\\u", "table_", "._", "c_", "._", "revis", "ion", "\\u", "key_", "==_", "ger", "tty_", "._", "db_", "._", "revis", "ion", "\\u", "table_", "._", "c_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "message", "\\u", "table_", "._", "c_", "._", "draft_", "==_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "select_", "(_", "[_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", "]_", ",_", "correlate", "_", "=_", "False_", ")_", "._", "where_", "(_", "and\\u_", "(_", "*_", "filters_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", "._", "in\\u_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "ger", "tty_", "._", "search_", "._", "Sear", "ch", "Syntax", "Error_", "(_", "'", "Syntax", " ", "error", ":", " ", "has", ":", "%", "s", " ", "is", " ", "not", " ", "support", "ed", "'_", "%_", "p_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "is", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "is", "\\u", "term", " ", ":", " ", "OP", "\\u", "IS", " ", "string", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "TOD", "O", ":", " ", "implement", " ", "draft_", "\\u\\u\\uNL\\u\\u\\u_", "username_", "=_", "p_", "._", "parser_", "._", "username_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "p_", "[_", "2_", "]_", "==_", "'", "reviewe", "d", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filters_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "approval", "\\u", "table_", "._", "c_", "._", "change", "\\u", "key_", "==_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "approval", "\\u", "table_", "._", "c_", "._", "value_", "!=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "select_", "(_", "[_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", "]_", ",_", "correlate", "_", "=_", "False_", ")_", "._", "where_", "(_", "and\\u_", "(_", "*_", "filters_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", "._", "in\\u_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "p_", "[_", "2_", "]_", "==_", "'", "open", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "status_", "._", "noti", "n", "\\u_", "(_", "[_", "'", "MERGE", "D", "'_", ",_", "'", "ABA", "ND", "ONE", "D", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "p_", "[_", "2_", "]_", "==_", "'", "close", "d", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "status_", "._", "in\\u_", "(_", "[_", "'", "MERGE", "D", "'_", ",_", "'", "ABA", "ND", "ONE", "D", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "p_", "[_", "2_", "]_", "==_", "'", "submitted", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "status_", "==_", "'", "SUBMIT", "TED", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "p_", "[_", "2_", "]_", "==_", "'", "merge", "d", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "status_", "==_", "'", "MERGE", "D", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "p_", "[_", "2_", "]_", "==_", "'", "aband", "oned", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "status_", "==_", "'", "ABA", "ND", "ONE", "D", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "p_", "[_", "2_", "]_", "==_", "'", "owner", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "account", "\\u", "table_", "._", "c_", "._", "username_", "==_", "username_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "p_", "[_", "2_", "]_", "==_", "'", "starred", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "starred", "_", "==_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "p_", "[_", "2_", "]_", "==_", "'", "hel", "d", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "A", " ", "ger", "tt", "y", " ", "extension_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "hel", "d_", "==_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "p_", "[_", "2_", "]_", "==_", "'", "reviewer", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filters_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "approval", "\\u", "table_", "._", "c_", "._", "change", "\\u", "key_", "==_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "approval", "\\u", "table_", "._", "c_", "._", "account", "\\u", "key_", "==_", "ger", "tty_", "._", "db_", "._", "account", "\\u", "table_", "._", "c_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filters_", "._", "append_", "(_", "ger", "tty_", "._", "db_", "._", "account", "\\u", "table_", "._", "c_", "._", "username_", "==_", "username_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "select_", "(_", "[_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", "]_", ",_", "correlate", "_", "=_", "False_", ")_", "._", "where_", "(_", "and\\u_", "(_", "*_", "filters_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "key_", "._", "in\\u_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "p_", "[_", "2_", "]_", "==_", "'", "watched", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "project", "\\u", "table_", "._", "c_", "._", "subscribed", "_", "==_", "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_", "ger", "tty_", "._", "search_", "._", "Sear", "ch", "Syntax", "Error_", "(_", "'", "Syntax", " ", "error", ":", " ", "is", ":", "%", "s", " ", "is", " ", "not", " ", "support", "ed", "'_", "%_", "p_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "file", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "file", "\\u", "term", " ", ":", " ", "OP", "\\u", "FILE", " ", "string", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "p_", "[_", "2_", "]_", "._", "startswith_", "(_", "'", "^", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "and\\u_", "(_", "or\\u_", "(_", "func_", "._", "matches_", "(_", "p_", "[_", "2_", "]_", ",_", "ger", "tty_", "._", "db_", "._", "file", "\\u", "table_", "._", "c_", "._", "path_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "func_", "._", "matches_", "(_", "p_", "[_", "2_", "]_", ",_", "ger", "tty_", "._", "db_", "._", "file", "\\u", "table_", "._", "c_", "._", "old", "\\u", "path_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ger", "tty_", "._", "db_", "._", "file", "\\u", "table_", "._", "c_", "._", "status_", "is_", "not_", "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 ", " _", "p_", "[_", "0_", "]_", "=_", "and\\u_", "(_", "or\\u_", "(_", "ger", "tty_", "._", "db_", "._", "file", "\\u", "table_", "._", "c_", "._", "path_", "==_", "p_", "[_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ger", "tty_", "._", "db_", "._", "file", "\\u", "table_", "._", "c_", "._", "old", "\\u", "path_", "==_", "p_", "[_", "2_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ger", "tty_", "._", "db_", "._", "file", "\\u", "table_", "._", "c_", "._", "status_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "status", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "status", "\\u", "term", " ", ":", " ", "OP", "\\u", "STATUS", " ", "string", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "p_", "[_", "2_", "]_", "==_", "'", "open", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "status_", "._", "noti", "n", "\\u_", "(_", "[_", "'", "MERGE", "D", "'_", ",_", "'", "ABA", "ND", "ONE", "D", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "p_", "[_", "2_", "]_", "==_", "'", "close", "d", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "status_", "._", "in\\u_", "(_", "[_", "'", "MERGE", "D", "'_", ",_", "'", "ABA", "ND", "ONE", "D", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "ger", "tty_", "._", "db_", "._", "change", "\\u", "table_", "._", "c_", "._", "status_", "==_", "p_", "[_", "2_", "]_", "._", "upper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "limit", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "limit", "\\u", "term", " ", ":", " ", "OP", "\\u", "LIMIT", " ", "NUMB", "ER", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Impl", "ement", " ", "this", ".", " ", " ", "The", " ", "sqla", "lche", "my", " ", "limit", " ", "call", " ", "need", "s", " ", "to", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "applied", " ", "to", " ", "the", " ", "query", " ", "operati", "on", " ", "and", " ", "so", " ", "can", " ", "not", " ", "be", " ", "return", "ed", " ", "as_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "part", " ", "of", " ", "the", " ", "producti", "on", " ", "here", ".", " ", " ", "The", " ", "informati", "on", " ", "wou", "ld", " ", "need", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "be", " ", "return", "ed", " ", "out", "-", "of", "-", "band", ".", " ", " ", "In", " ", "the", " ", "mean", " ", "time", ",", " ", "sinc", "e", " ", "limit", "s", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "not", " ", "as", " ", "importa", "nt", " ", "in", " ", "ger", "tt", "y", ",", " ", "make", " ", "this", " ", "a", " ", "no", "-", "op", " ", "for", " ", "now", " ", "so_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tha", "t", " ", "it", " ", "doe", "s", " ", "not", " ", "produce", " ", "a", " ", "synta", "x", " ", "error", "._", "\\u\\u\\uNL\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "True_", "==_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "op", "\\u", "term_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "op", "\\u", "term", " ", ":", " ", "OP", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Syntax", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "error_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "p_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "ger", "tty_", "._", "search_", "._", "Sear", "ch", "Syntax", "Error_", "(_", "'", "Syntax", " ", "error", " ", "at", " ", "\"%", "s", "\"", " ", "in", " ", "search", " ", "string", " ", "\"%", "s", "\"", " ", "(", "col", " ", "%", "s", ")'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "lexer_", "._", "lex", "data_", "[_", "p_", "._", "lex", "pos_", ":_", "]_", ",_", "p_", "._", "lexer_", "._", "lex", "data_", ",_", "p_", "._", "lex", "pos_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "ger", "tty_", "._", "search_", "._", "Sear", "ch", "Syntax", "Error_", "(_", "'", "Syntax", " ", "error", ":", " ", "EO", "F", " ", "in", " ", "search", " ", "string", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "yac", "c_", "._", "yac", "c_", "(_", "debug_", "=_", "0_", ",_", "write", "\\u", "tables_", "=_", "0_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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ppScale/appscale/AppServer/lib/django-1.5/tests/modeltests/model_forms/tests.py
[ { "content": " def test_abstract_inherited_unique(self):\n title = 'Boss'\n isbn = '12345'\n dbook = DerivedBook.objects.create(title=title, author=self.writer, isbn=isbn)\n form = DerivedBookForm({'title': 'Other', 'author': self.writer.pk, 'isbn': isbn})\n self.assertFalse(form.is_valid())\n self.assertEqual(len(form.errors), 1)\n self.assertEqual(form.errors['isbn'], ['Derived book with this Isbn already exists.'])", "metadata": "root.UniqueTest.test_abstract_inherited_unique", "header": "['class', 'UniqueTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 461 }, { "content": " def test_abstract_inherited_unique_together(self):\n title = 'Boss'\n isbn = '12345'\n dbook = DerivedBook.objects.create(title=title, author=self.writer, isbn=isbn)\n form = DerivedBookForm({\n 'title': 'Other',\n 'author': self.writer.pk,\n 'isbn': '9876',\n 'suffix1': '0',\n 'suffix2': '0'\n })\n self.assertFalse(form.is_valid())\n self.assertEqual(len(form.errors), 1)\n self.assertEqual(form.errors['__all__'],\n ['Derived book with this Suffix1 and Suffix2 already exists.'])", "metadata": "root.UniqueTest.test_abstract_inherited_unique_together", "header": "['class', 'UniqueTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 470 }, { "content": " def test_media_on_modelform(self):\n # Similar to a regular Form class you can define custom media to be used on\n # the ModelForm.\n f = ModelFormWithMedia()\n self.assertHTMLEqual(six.text_type(f.media), '''<link href=\"/some/form/css\" type=\"text/css\" media=\"all\" rel=\"stylesheet\" />\n<script type=\"text/javascript\" src=\"/some/form/javascript\"></script>''')\n\n f = CommaSeparatedIntegerForm({'field': '1,2,3'})\n self.assertEqual(f.is_valid(), True)\n self.assertEqual(f.cleaned_data, {'field': '1,2,3'})\n f = CommaSeparatedIntegerForm({'field': '1a,2'})\n self.assertEqual(f.errors, {'field': ['Enter only digits separated by commas.']})\n f = CommaSeparatedIntegerForm({'field': ',,,,'})\n self.assertEqual(f.is_valid(), True)\n self.assertEqual(f.cleaned_data, {'field': ',,,,'})\n f = CommaSeparatedIntegerForm({'field': '1.2'})\n self.assertEqual(f.errors, {'field': ['Enter only digits separated by commas.']})\n f = CommaSeparatedIntegerForm({'field': '1,a,2'})\n self.assertEqual(f.errors, {'field': ['Enter only digits separated by commas.']})\n f = CommaSeparatedIntegerForm({'field': '1,,2'})\n self.assertEqual(f.is_valid(), True)\n self.assertEqual(f.cleaned_data, {'field': '1,,2'})\n f = CommaSeparatedIntegerForm({'field': '1'})\n self.assertEqual(f.is_valid(), True)\n self.assertEqual(f.cleaned_data, {'field': '1'})\n\n # This Price instance generated by this form is not valid because the quantity\n # field is required, but the form is valid because the field is excluded from\n # the form. This is for backwards compatibility.\n\n form = PriceFormWithoutQuantity({'price': '6.00'})\n self.assertEqual(form.is_valid(), True)\n price = form.save(commit=False)\n with self.assertRaises(ValidationError):\n price.full_clean()\n\n # The form should not validate fields that it doesn't contain even if they are\n # specified using 'fields', not 'exclude'.\n class Meta:\n model = Price\n fields = ('price',)\n form = PriceFormWithoutQuantity({'price': '6.00'})\n self.assertEqual(form.is_valid(), True)\n\n # The form should still have an instance of a model that is not complete and\n # not saved into a DB yet.\n\n self.assertEqual(form.instance.price, Decimal('6.00'))\n self.assertEqual(form.instance.quantity is None, True)\n self.assertEqual(form.instance.pk is None, True)\n\n # Choices on CharField and IntegerField\n f = ArticleForm()\n with self.assertRaises(ValidationError):\n f.fields['status'].clean('42')\n\n f = ArticleStatusForm()\n with self.assertRaises(ValidationError):\n f.fields['status'].clean('z')", "metadata": "root.OldFormForXTests.test_media_on_modelform", "header": "['class', 'OldFormForXTests', '(', 'TestCase', ')', ':', '___EOS___']", "index": 1410 }, { "content": " def test_foreignkeys_which_use_to_field(self):\n apple = Inventory.objects.create(barcode=86, name='Apple')\n pear = Inventory.objects.create(barcode=22, name='Pear')\n core = Inventory.objects.create(barcode=87, name='Core', parent=apple)\n\n field = forms.ModelChoiceField(Inventory.objects.all(), to_field_name='barcode')\n self.assertEqual(tuple(field.choices), (\n ('', '---------'),\n (86, 'Apple'),\n (87, 'Core'),\n (22, 'Pear')))\n\n form = InventoryForm(instance=core)\n self.assertHTMLEqual(six.text_type(form['parent']), '''<select name=\"parent\" id=\"id_parent\">\n<option value=\"\">---------</option>\n<option value=\"86\" selected=\"selected\">Apple</option>\n<option value=\"87\">Core</option>\n<option value=\"22\">Pear</option>\n</select>''')\n data = model_to_dict(core)\n data['parent'] = '22'\n form = InventoryForm(data=data, instance=core)\n core = form.save()\n self.assertEqual(core.parent.name, 'Pear')\n\n class CategoryForm(forms.ModelForm):\n description = forms.CharField()\n class Meta:\n model = Category\n fields = ['description', 'url']\n\n self.assertEqual(list(CategoryForm.base_fields),\n ['description', 'url'])\n\n self.assertHTMLEqual(six.text_type(CategoryForm()), '''<tr><th><label for=\"id_description\">Description:</label></th><td><input type=\"text\" name=\"description\" id=\"id_description\" /></td></tr>\n<tr><th><label for=\"id_url\">The URL:</label></th><td><input id=\"id_url\" type=\"text\" name=\"url\" maxlength=\"40\" /></td></tr>''')\n # to_field_name should also work on ModelMultipleChoiceField ##################\n\n field = forms.ModelMultipleChoiceField(Inventory.objects.all(), to_field_name='barcode')\n self.assertEqual(tuple(field.choices), ((86, 'Apple'), (87, 'Core'), (22, 'Pear')))\n self.assertQuerysetEqual(field.clean([86]), ['Apple'])\n\n form = SelectInventoryForm({'items': [87, 22]})\n self.assertEqual(form.is_valid(), True)\n self.assertEqual(len(form.cleaned_data), 1)\n self.assertQuerysetEqual(form.cleaned_data['items'], ['Core', 'Pear'])", "metadata": "root.OldFormForXTests.test_foreignkeys_which_use_to_field", "header": "['class', 'OldFormForXTests', '(', 'TestCase', ')', ':', '___EOS___']", "index": 1470 } ]
[ { "span": "dbook ", "start_line": 464, "start_column": 8, "end_line": 464, "end_column": 13 }, { "span": "dbook ", "start_line": 473, "start_column": 8, "end_line": 473, "end_column": 13 }, { "span": "Meta:", "start_line": 1448, "start_column": 18, "end_line": 1448, "end_column": 22 }, { "span": "pear ", "start_line": 1472, "start_column": 8, "end_line": 1472, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Unique", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "abstract", "\\u", "inherited", "\\u", "unique_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "title_", "=_", "'", "Boss", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "isbn", "_", "=_", "'", "12345", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbo", "ok_", "=_", "Derive", "d", "Book_", "._", "objects_", "._", "create_", "(_", "title_", "=_", "title_", ",_", "author_", "=_", "self_", "._", "writer_", ",_", "isbn", "_", "=_", "isbn", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "Derive", "d", "Boo", "k", "Form_", "(_", "{_", "'", "title", "'_", ":_", "'", "Ot", "her", "'_", ",_", "'", "author", "'_", ":_", "self_", "._", "writer_", "._", "pk_", ",_", "'", "isbn", "'_", ":_", "isbn", "_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "form_", "._", "errors_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "form_", "._", "errors_", "[_", "'", "isbn", "'_", "]_", ",_", "[_", "'", "Derive", "d", " ", "book", " ", "with", " ", "this", " ", "Is", "bn", " ", "alr", "ead", "y", " ", "exist", "s", ".'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Unique", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "abstract", "\\u", "inherited", "\\u", "unique", "\\u", "together_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "title_", "=_", "'", "Boss", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "isbn", "_", "=_", "'", "12345", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbo", "ok_", "=_", "Derive", "d", "Book_", "._", "objects_", "._", "create_", "(_", "title_", "=_", "title_", ",_", "author_", "=_", "self_", "._", "writer_", ",_", "isbn", "_", "=_", "isbn", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "Derive", "d", "Boo", "k", "Form_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "'", "Ot", "her", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "author", "'_", ":_", "self_", "._", "writer_", "._", "pk_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "isbn", "'_", ":_", "'", "9876", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "suff", "ix", "1", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "suff", "ix", "2", "'_", ":_", "'", "0", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "form_", "._", "errors_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "form_", "._", "errors_", "[_", "'\\u", "\\u", "all", "\\u\\u'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "Derive", "d", " ", "book", " ", "with", " ", "this", " ", "Su", "ffi", "x1", " ", "and", " ", "Su", "ffi", "x2", " ", "alr", "ead", "y", " ", "exist", "s", ".'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Old", "Form", "For", "XT", "ests", "_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "media", "\\u", "on", "\\u", "modelf", "orm_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Simil", "ar", " ", "to", " ", "a", " ", "regular", " ", "Form", " ", "class", " ", "you", " ", "can", " ", "defin", "e", " ", "custom", " ", "media", " ", "to", " ", "be", " ", "used", " ", "on_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "Model", "Form", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "Model", "Form", "With", "Media_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "HTM", "LE", "qual_", "(_", "six_", "._", "text", "\\u", "type_", "(_", "f_", "._", "media_", ")_", ",_", "'''", "<", "link", " ", "href", "=\"", "/", "some", "/", "form", "/", "css", "\"", " ", "type", "=\"", "text", "/", "css", "\"", " ", "media", "=\"", "all", "\"", " ", "rel", "=\"", "stylesheet", "\"", " ", "/>", "\\", "10", ";<", "script", " ", "type", "=\"", "text", "/", "javascript", "\"", " ", "src", "=\"", "/", "some", "/", "form", "/", "javascript", "\">", "</", "script", ">'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "Comm", "a", "Separate", "d", "Integer", "Form_", "(_", "{_", "'", "field", "'_", ":_", "'", "1", ",", "2", ",", "3", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f_", "._", "is", "\\u", "valid_", "(_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f_", "._", "clean", "ed", "\\u", "data_", ",_", "{_", "'", "field", "'_", ":_", "'", "1", ",", "2", ",", "3", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "Comm", "a", "Separate", "d", "Integer", "Form_", "(_", "{_", "'", "field", "'_", ":_", "'", "1a", ",", "2", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f_", "._", "errors_", ",_", "{_", "'", "field", "'_", ":_", "[_", "'", "Enter", " ", "only", " ", "digit", "s", " ", "separate", "d", " ", "by", " ", "commas", ".'_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "Comm", "a", "Separate", "d", "Integer", "Form_", "(_", "{_", "'", "field", "'_", ":_", "',", ",,,", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f_", "._", "is", "\\u", "valid_", "(_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f_", "._", "clean", "ed", "\\u", "data_", ",_", "{_", "'", "field", "'_", ":_", "',", ",,,", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "Comm", "a", "Separate", "d", "Integer", "Form_", "(_", "{_", "'", "field", "'_", ":_", "'", "1.2", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f_", "._", "errors_", ",_", "{_", "'", "field", "'_", ":_", "[_", "'", "Enter", " ", "only", " ", "digit", "s", " ", "separate", "d", " ", "by", " ", "commas", ".'_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "Comm", "a", "Separate", "d", "Integer", "Form_", "(_", "{_", "'", "field", "'_", ":_", "'", "1", ",", "a", ",", "2", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f_", "._", "errors_", ",_", "{_", "'", "field", "'_", ":_", "[_", "'", "Enter", " ", "only", " ", "digit", "s", " ", "separate", "d", " ", "by", " ", "commas", ".'_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "Comm", "a", "Separate", "d", "Integer", "Form_", "(_", "{_", "'", "field", "'_", ":_", "'", "1", ",", ",", "2", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f_", "._", "is", "\\u", "valid_", "(_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f_", "._", "clean", "ed", "\\u", "data_", ",_", "{_", "'", "field", "'_", ":_", "'", "1", ",", ",", "2", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "Comm", "a", "Separate", "d", "Integer", "Form_", "(_", "{_", "'", "field", "'_", ":_", "'", "1", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f_", "._", "is", "\\u", "valid_", "(_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f_", "._", "clean", "ed", "\\u", "data_", ",_", "{_", "'", "field", "'_", ":_", "'", "1", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "Price", " ", "instance", " ", "generat", "ed", " ", "by", " ", "this", " ", "form", " ", "is", " ", "not", " ", "valid", " ", "bec", "aus", "e", " ", "the", " ", "quantity_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "field", " ", "is", " ", "require", "d", ",", " ", "but", " ", "the", " ", "form", " ", "is", " ", "valid", " ", "bec", "aus", "e", " ", "the", " ", "field", " ", "is", " ", "exclu", "ded", " ", "from_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "form", ".", " ", "Thi", "s", " ", "is", " ", "for", " ", "back", "ward", "s", " ", "compatibility", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "form_", "=_", "Price", "Form", "With", "out", "Quantity_", "(_", "{_", "'", "price", "'_", ":_", "'", "6.0", "0", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "price_", "=_", "form_", "._", "save_", "(_", "commit_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "price_", "._", "full", "\\u", "clean_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "form", " ", "shou", "ld", " ", "not", " ", "validat", "e", " ", "fields", " ", "tha", "t", " ", "it", " ", "doe", "sn", "'", "t", " ", "contain", " ", "even", " ", "if", " ", "the", "y", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "specified", " ", "usi", "ng", " ", "'", "fields", "',", " ", "not", " ", "'", "exclu", "de", "'.", "_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Price_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "(_", "'", "price", "'_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "form_", "=_", "Price", "Form", "With", "out", "Quantity_", "(_", "{_", "'", "price", "'_", ":_", "'", "6.0", "0", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "form", " ", "shou", "ld", " ", "still", " ", "have", " ", "an", " ", "instance", " ", "of", " ", "a", " ", "model", " ", "tha", "t", " ", "is", " ", "not", " ", "complete", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "not", " ", "saved", " ", "int", "o", " ", "a", " ", "DB", " ", "ye", "t", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "form_", "._", "instance_", "._", "price_", ",_", "Decimal_", "(_", "'", "6.0", "0", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "form_", "._", "instance_", "._", "quantity_", "is_", "None_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "form_", "._", "instance_", "._", "pk_", "is_", "None_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Choi", "ces", " ", "on", " ", "Char", "Field", " ", "and", " ", "Integer", "Field_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "Artic", "le", "Form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "fields_", "[_", "'", "status", "'_", "]_", "._", "clean_", "(_", "'", "4", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f_", "=_", "Artic", "le", "Status", "Form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "fields_", "[_", "'", "status", "'_", "]_", "._", "clean_", "(_", "'", "z", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Old", "Form", "For", "XT", "ests", "_", "(_", "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", "foreign", "keys", "\\u", "whi", "ch", "\\u", "use", "\\u", "to", "\\u", "field_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "apple", "_", "=_", "Inventory_", "._", "objects_", "._", "create_", "(_", "barcode_", "=_", "86_", ",_", "name_", "=_", "'", "Apple", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pea", "r_", "=_", "Inventory_", "._", "objects_", "._", "create_", "(_", "barcode_", "=_", "22_", ",_", "name_", "=_", "'", "Pea", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "core_", "=_", "Inventory_", "._", "objects_", "._", "create_", "(_", "barcode_", "=_", "87_", ",_", "name_", "=_", "'", "Core", "'_", ",_", "parent_", "=_", "apple", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "field_", "=_", "forms_", "._", "Model", "Choi", "ce", "Field_", "(_", "Inventory_", "._", "objects_", "._", "all_", "(_", ")_", ",_", "to", "\\u", "field", "\\u", "name_", "=_", "'", "barcode", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "tuple_", "(_", "field_", "._", "choices_", ")_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "''_", ",_", "'-------", "--'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "86_", ",_", "'", "Apple", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "87_", ",_", "'", "Core", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "22_", ",_", "'", "Pea", "r", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "form_", "=_", "Inven", "tor", "y", "Form_", "(_", "instance_", "=_", "core_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "HTM", "LE", "qual_", "(_", "six_", "._", "text", "\\u", "type_", "(_", "form_", "[_", "'", "parent", "'_", "]_", ")_", ",_", "'''", "<", "select", " ", "name", "=\"", "parent", "\"", " ", "id", "=\"", "id", "\\u", "parent", "\">", "\\", "10", ";<", "option", " ", "value", "=\"\"", ">-", "--------", "</", "option", ">", "\\", "10", ";<", "option", " ", "value", "=\"", "86", "\"", " ", "selecte", "d", "=\"", "selecte", "d", "\">", "Apple", "</", "option", ">", "\\", "10", ";<", "option", " ", "value", "=\"", "87", "\">", "Core", "</", "option", ">", "\\", "10", ";<", "option", " ", "value", "=\"", "2", "2", "\">", "Pea", "r", "</", "option", ">", "\\", "10", ";<", "/", "select", ">'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "model", "\\u", "to", "\\u", "dict_", "(_", "core_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "parent", "'_", "]_", "=_", "'", "2", "2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "Inven", "tor", "y", "Form_", "(_", "data_", "=_", "data_", ",_", "instance_", "=_", "core_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "core_", "=_", "form_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "core_", "._", "parent_", "._", "name_", ",_", "'", "Pea", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Cate", "gory", "Form_", "(_", "forms_", "._", "Model", "Form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "description_", "=_", "forms_", "._", "Char", "Field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Category_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "[_", "'", "description", "'_", ",_", "'", "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_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "Cate", "gory", "Form_", "._", "base", "\\u", "fields_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "description", "'_", ",_", "'", "url", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "HTM", "LE", "qual_", "(_", "six_", "._", "text", "\\u", "type_", "(_", "Cate", "gory", "Form_", "(_", ")_", ")_", ",_", "'''", "<", "tr", "><", "th", "><", "label", " ", "for", "=\"", "id", "\\u", "description", "\">", "Descripti", "on", ":", "</", "label", "><", "/", "th", "><", "td", "><", "input", " ", "type", "=\"", "text", "\"", " ", "name", "=\"", "description", "\"", " ", "id", "=\"", "id", "\\u", "description", "\"", " ", "/>", "</", "td", "><", "/", "tr", ">", "\\", "10", ";<", "tr", "><", "th", "><", "label", " ", "for", "=\"", "id", "\\u", "url", "\">", "The", " ", "URL", ":", "</", "label", "><", "/", "th", "><", "td", "><", "input", " ", "id", "=\"", "id", "\\u", "url", "\"", " ", "type", "=\"", "text", "\"", " ", "name", "=\"", "url", "\"", " ", "maxlength", "=\"", "40", "\"", " ", "/>", "</", "td", "><", "/", "tr", ">'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "to", "\\u", "field", "\\u", "name", " ", "shou", "ld", " ", "als", "o", " ", "work", " ", "on", " ", "Model", "Multipl", "e", "Choi", "ce", "Field", " ", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "field_", "=_", "forms_", "._", "Model", "Multipl", "e", "Choi", "ce", "Field_", "(_", "Inventory_", "._", "objects_", "._", "all_", "(_", ")_", ",_", "to", "\\u", "field", "\\u", "name_", "=_", "'", "barcode", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "tuple_", "(_", "field_", "._", "choices_", ")_", ",_", "(_", "(_", "86_", ",_", "'", "Apple", "'_", ")_", ",_", "(_", "87_", ",_", "'", "Core", "'_", ")_", ",_", "(_", "22_", ",_", "'", "Pea", "r", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "field_", "._", "clean_", "(_", "[_", "86_", "]_", ")_", ",_", "[_", "'", "Apple", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "form_", "=_", "Select", "Inven", "tor", "y", "Form_", "(_", "{_", "'", "items", "'_", ":_", "[_", "87_", ",_", "22_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "form_", "._", "clean", "ed", "\\u", "data_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "items", "'_", "]_", ",_", "[_", "'", "Core", "'_", ",_", "'", "Pea", "r", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
neurodata/ndstore/ingest/binary/ingestbinary.py
[ { "content": "# Copyright 2014 Open Connectome Project (http://openconnecto.me)\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# \n# http://www.apache.org/licenses/LICENSE-2.0\n# \n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport numpy as np\nfrom PIL import Image\nimport urllib2\nimport zlib\nimport StringIO\nimport os\nimport sys\nimport cStringIO\nimport zindex\n\n\n# We are going to build this directly on the database to avoid\n# Web transfer limitations.\n\n# include the paths\nEM_BASE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), \"..\" ))\nEM_UTIL_PATH = os.path.join(EM_BASE_PATH, \"util\" )\nEM_EMCA_PATH = os.path.join(EM_BASE_PATH, \"emca\" )\nEM_DBCONFIG_PATH = os.path.join(EM_BASE_PATH, \"dbconfig\" )\n\nsys.path += [ EM_UTIL_PATH, EM_DBCONFIG_PATH, EM_EMCA_PATH ]\n\nimport emcaproj\nimport emcadb\nimport dbconfig\n\n# load the project\nprojdb = emcaproj.EMCAProjectsDB()\nproj = projdb.getProj ( 'kasthuri11cc' )\ndbcfg = dbconfig.switchDataset ( proj.getDataset() )\n\n#Load the database\ndb = emcadb.EMCADB ( dbcfg, proj )\n\n_ximagesz = 10748\n_yimagesz = 12896\n_xcubedim = 128\n_ycubedim = 128\n_zcubedim = 16\n\nfid = open ( \"/data/scratch/bigcutout.screened.zs.data\", \"r\" )\n\nresolution = 1\n\nfor zstart in range(1,1850,16):\n\n zend = min(zstart+16,1851)\n\n slab = np.fromfile( fid, count=_ximagesz * _yimagesz * (zend-zstart), dtype=np.uint8 )\n slab = slab.reshape([(zend-zstart), _yimagesz, _ximagesz])\n\n for y in range ( 0, _yimagesz, _ycubedim ):\n for x in range ( 0, _ximagesz, _xcubedim ):\n\n mortonidx = zindex.XYZMorton ( [ x/_xcubedim, y/_ycubedim, (zstart-1)/_zcubedim] )\n cubedata = np.zeros ( [_zcubedim, _ycubedim, _xcubedim], dtype=np.uint8 )\n\n xmin = x\n ymin = y\n xmax = min ( _ximagesz, x+_xcubedim )\n ymax = min ( _yimagesz, y+_ycubedim )\n zmin = 0\n zmax = zend-zstart\n\n cubedata[0:zmax-zmin,0:ymax-ymin,0:xmax-xmin] = slab[zmin:zmax,ymin:ymax,xmin:xmax]\n\n# print \"zindex,x,y,z,xmax,ymax,zmax,shape\",mortonidx,x,y,zstart,xmax,ymax,zend,cubedata.shape\n\n # create the DB BLOB\n fileobj = cStringIO.StringIO ()\n np.save ( fileobj, cubedata )\n cdz = zlib.compress (fileobj.getvalue())\n\n # insert the blob into the database\n cursor = db.conn.cursor()\n sql = \"INSERT INTO res1 (zindex, cube) VALUES (%s, %s)\"\n cursor.execute(sql, (mortonidx, cdz))\n cursor.close()\n print \"Commiting at x=%s, y=%s, z=%s\" % (x,y,zstart) \n db.conn.commit()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from PIL import Image", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 21 }, { "span": "import urllib2", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 14 }, { "span": "import StringIO", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 15 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2014", " ", "Open", " ", "Connect", "ome", " ", "Project", " ", "(", "http", "://", "openco", "nnect", "o", ".", "me", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "PIL_", "import_", "Image_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "zlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "c", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "zin", "dex_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "are", " ", "goi", "ng", " ", "to", " ", "build", " ", "this", " ", "direct", "ly", " ", "on", " ", "the", " ", "databa", "se", " ", "to", " ", "avoid", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Web", " ", "transfer", " ", "limit", "ation", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "include", " ", "the", " ", "paths_", "\\u\\u\\uNL\\u\\u\\u_", "EM", "\\u", "BASE", "\\u", "PATH_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", ",_", "\"..\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EM", "\\u", "UTIL", "\\u", "PATH_", "=_", "os_", "._", "path_", "._", "join_", "(_", "EM", "\\u", "BASE", "\\u", "PATH_", ",_", "\"", "util", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EM", "\\u", "EMC", "A", "\\u", "PATH_", "=_", "os_", "._", "path_", "._", "join_", "(_", "EM", "\\u", "BASE", "\\u", "PATH_", ",_", "\"", "emc", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EM", "\\u", "DB", "CONFIG", "\\u", "PATH_", "=_", "os_", "._", "path_", "._", "join_", "(_", "EM", "\\u", "BASE", "\\u", "PATH_", ",_", "\"", "dbco", "nfig", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "path_", "+=_", "[_", "EM", "\\u", "UTIL", "\\u", "PATH_", ",_", "EM", "\\u", "DB", "CONFIG", "\\u", "PATH_", ",_", "EM", "\\u", "EMC", "A", "\\u", "PATH_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "emc", "apro", "j_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "emc", "adb_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "dbco", "nfig_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "load", " ", "the", " ", "project_", "\\u\\u\\uNL\\u\\u\\u_", "proj", "db_", "=_", "emc", "apro", "j_", "._", "EMC", "AP", "roj", "ect", "s", "DB_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proj_", "=_", "proj", "db_", "._", "get", "Proj", "_", "(_", "'", "kas", "thu", "ri", "11", "cc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbc", "fg_", "=_", "dbco", "nfig_", "._", "switch", "Dataset_", "(_", "proj_", "._", "get", "Dataset_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Load", " ", "the", " ", "database_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "=_", "emc", "adb_", "._", "EMC", "AD", "B_", "(_", "dbc", "fg_", ",_", "proj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "xim", "age", "sz_", "=_", "107", "48_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "yi", "mage", "sz_", "=_", "128", "96_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "xc", "ube", "dim_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "yc", "ube", "dim_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "zc", "ube", "dim_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fid_", "=_", "open_", "(_", "\"/", "data", "/", "scratch", "/", "big", "cuto", "ut", ".", "screen", "ed", ".", "zs", ".", "data", "\"_", ",_", "\"", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resolution_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "zs", "tart_", "in_", "range_", "(_", "1_", ",_", "185", "0_", ",_", "16_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "zen", "d_", "=_", "min_", "(_", "zs", "tart_", "+_", "16_", ",_", "185", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "slab", "_", "=_", "np_", "._", "fromfile_", "(_", "fid_", ",_", "count_", "=_", "\\u", "xim", "age", "sz_", "*_", "\\u", "yi", "mage", "sz_", "*_", "(_", "zen", "d_", "-_", "zs", "tart_", ")_", ",_", "dtype_", "=_", "np_", "._", "uint8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "slab", "_", "=_", "slab", "_", "._", "reshape_", "(_", "[_", "(_", "zen", "d_", "-_", "zs", "tart_", ")_", ",_", "\\u", "yi", "mage", "sz_", ",_", "\\u", "xim", "age", "sz_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "y_", "in_", "range_", "(_", "0_", ",_", "\\u", "yi", "mage", "sz_", ",_", "\\u", "yc", "ube", "dim_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "x_", "in_", "range_", "(_", "0_", ",_", "\\u", "xim", "age", "sz_", ",_", "\\u", "xc", "ube", "dim_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mort", "oni", "dx_", "=_", "zin", "dex_", "._", "XY", "ZM", "ort", "on_", "(_", "[_", "x_", "/_", "\\u", "xc", "ube", "dim_", ",_", "y_", "/_", "\\u", "yc", "ube", "dim_", ",_", "(_", "zs", "tart_", "-_", "1_", ")_", "/_", "\\u", "zc", "ube", "dim_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cube", "data_", "=_", "np_", "._", "zeros_", "(_", "[_", "\\u", "zc", "ube", "dim_", ",_", "\\u", "yc", "ube", "dim_", ",_", "\\u", "xc", "ube", "dim_", "]_", ",_", "dtype_", "=_", "np_", "._", "uint8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "xmin_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ymin_", "=_", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xmax_", "=_", "min_", "(_", "\\u", "xim", "age", "sz_", ",_", "x_", "+_", "\\u", "xc", "ube", "dim_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ymax_", "=_", "min_", "(_", "\\u", "yi", "mage", "sz_", ",_", "y_", "+_", "\\u", "yc", "ube", "dim_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zmin", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zmax", "_", "=_", "zen", "d_", "-_", "zs", "tart_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cube", "data_", "[_", "0_", ":_", "zmax", "_", "-_", "zmin", "_", ",_", "0_", ":_", "ymax_", "-_", "ymin_", ",_", "0_", ":_", "xmax_", "-_", "xmin_", "]_", "=_", "slab", "_", "[_", "zmin", "_", ":_", "zmax", "_", ",_", "ymin_", ":_", "ymax_", ",_", "xmin_", ":_", "xmax_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "print", " ", "\"", "zin", "dex", ",", "x", ",", "y", ",", "z", ",", "xma", "x", ",", "ymax", ",", "zmax", ",", "shape", "\",", "mort", "oni", "dx", ",", "x", ",", "y", ",", "zs", "tart", ",", "xma", "x", ",", "ymax", ",", "zen", "d", ",", "cube", "data", ".", "shape_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "the", " ", "DB", " ", "BLOB", "_", "\\u\\u\\uNL\\u\\u\\u_", "fileobj_", "=_", "c", "String", "IO_", "._", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "np_", "._", "save_", "(_", "fileobj_", ",_", "cube", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cd", "z_", "=_", "zlib_", "._", "compress_", "(_", "fileobj_", "._", "getvalue_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "insert", " ", "the", " ", "blob", " ", "int", "o", " ", "the", " ", "database_", "\\u\\u\\uNL\\u\\u\\u_", "cursor_", "=_", "db_", "._", "conn_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sql_", "=_", "\"", "INSERT", " ", "INT", "O", " ", "res", "1", " ", "(", "zin", "dex", ",", " ", "cube", ")", " ", "VALU", "ES", " ", "(%", "s", ",", " ", "%", "s", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cursor_", "._", "execute_", "(_", "sql_", ",_", "(_", "mort", "oni", "dx_", ",_", "cd", "z_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cursor_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "Commi", "ting", " ", "at", " ", "x", "=", "%", "s", ",", " ", "y", "=", "%", "s", ",", " ", "z", "=", "%", "s", "\"_", "%_", "(_", "x_", ",_", "y_", ",_", "zs", "tart_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "conn_", "._", "commit_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
xraypy/xraylarch/plugins/wx/xrfdisplay_utils.py
[ { "content": " def onCalibrate(self, event=None):\n x, y = [], []\n mca = self.mca\n # save old calib\n old_calib = mca.offset, mca.slope\n init_calib = copy.deepcopy(mca.init_calib)\n for roiname, eknown, ecen, w_ncen, w_ndif, w_nwid, w_use in self.wids:\n if not w_use.IsChecked():\n mca.init_calib.pop(roiname)\n\n xrf_calib_compute(mca, apply=True, _larch=self.larch)\n offset, slope = mca.new_calib\n self.calib_updated = True\n self.new_offset.SetValue(\"% .3f\" % (1000*offset))\n self.new_slope.SetValue(\"% .3f\" % (1000*slope))\n\n # find ROI peak positions using this new calibration\n xrf_calib_fitrois(mca, _larch=self.larch)\n for roi in self.mca.rois:\n eknown, ecen, fwhm, amp, fit = mca.init_calib[roi.name]\n diff = ecen - eknown\n for roiname, eknown, ocen, w_ncen, w_ndif, w_nwid, w_use in self.wids:\n if roiname == roi.name:\n w_ncen.SetLabel(\"%.1f\" % (1000*ecen))\n w_ndif.SetLabel(\"% .1f\" % (1000*diff))\n w_nwid.SetLabel(\"%.1f\" % (1000*fwhm))\n break\n\n # restore calibration to old values until new values are accepted\n xrf_calib_apply(mca, offset=old_calib[0], slope=old_calib[1],\n _larch=self.larch)\n mca.init_calib = init_calib\n\n tsize = self.GetSize()\n self.SetSize((tsize[0]+1, tsize[1]))\n self.SetSize((tsize[0], tsize[1]))", "metadata": "root.CalibrationFrame.onCalibrate", "header": "['class', 'CalibrationFrame', '(', 'wx', '.', 'Frame', ')', ':', '___EOS___']", "index": 117 } ]
[ { "span": "x,", "start_line": 118, "start_column": 8, "end_line": 118, "end_column": 9 }, { "span": "y ", "start_line": 118, "start_column": 11, "end_line": 118, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Calibrat", "ion", "Frame_", "(_", "wx_", "._", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Calibrat", "e_", "(_", "self_", ",_", "event_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", ",_", "y_", "=_", "[_", "]_", ",_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mca", "_", "=_", "self_", "._", "mca", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "save", " ", "old", " ", "calib", "_", "\\u\\u\\uNL\\u\\u\\u_", "old", "\\u", "calib", "_", "=_", "mca", "_", "._", "offset_", ",_", "mca", "_", "._", "slope_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "init", "\\u", "calib", "_", "=_", "copy_", "._", "deepcopy_", "(_", "mca", "_", "._", "init", "\\u", "calib", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "roi", "name_", ",_", "ek", "now", "n_", ",_", "ece", "n_", ",_", "w", "\\u", "nce", "n_", ",_", "w", "\\u", "ndi", "f_", ",_", "w", "\\u", "nwi", "d_", ",_", "w", "\\u", "use_", "in_", "self_", "._", "wids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "w", "\\u", "use_", "._", "Is", "Checked_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mca", "_", "._", "init", "\\u", "calib", "_", "._", "pop_", "(_", "roi", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "xr", "f", "\\u", "calib", "\\u", "compute_", "(_", "mca", "_", ",_", "apply_", "=_", "True_", ",_", "\\u", "lar", "ch_", "=_", "self_", "._", "lar", "ch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", ",_", "slope_", "=_", "mca", "_", "._", "new", "\\u", "calib", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "calib", "\\u", "updated_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "new", "\\u", "offset_", "._", "Set", "Value_", "(_", "\"%", " ", ".3", "f", "\"_", "%_", "(_", "1000_", "*_", "offset_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "new", "\\u", "slope_", "._", "Set", "Value_", "(_", "\"%", " ", ".3", "f", "\"_", "%_", "(_", "1000_", "*_", "slope_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "find", " ", "ROI", " ", "peak", " ", "position", "s", " ", "usi", "ng", " ", "this", " ", "new", " ", "calibration_", "\\u\\u\\uNL\\u\\u\\u_", "xr", "f", "\\u", "calib", "\\u", "fit", "rois_", "(_", "mca", "_", ",_", "\\u", "lar", "ch_", "=_", "self_", "._", "lar", "ch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "roi_", "in_", "self_", "._", "mca", "_", "._", "rois_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ek", "now", "n_", ",_", "ece", "n_", ",_", "fwhm_", ",_", "amp_", ",_", "fit_", "=_", "mca", "_", "._", "init", "\\u", "calib", "_", "[_", "roi_", "._", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diff_", "=_", "ece", "n_", "-_", "ek", "now", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "roi", "name_", ",_", "ek", "now", "n_", ",_", "oce", "n_", ",_", "w", "\\u", "nce", "n_", ",_", "w", "\\u", "ndi", "f_", ",_", "w", "\\u", "nwi", "d_", ",_", "w", "\\u", "use_", "in_", "self_", "._", "wids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "roi", "name_", "==_", "roi_", "._", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "w", "\\u", "nce", "n_", "._", "Set", "Label_", "(_", "\"%", ".1", "f", "\"_", "%_", "(_", "1000_", "*_", "ece", "n_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w", "\\u", "ndi", "f_", "._", "Set", "Label_", "(_", "\"%", " ", ".1", "f", "\"_", "%_", "(_", "1000_", "*_", "diff_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w", "\\u", "nwi", "d_", "._", "Set", "Label_", "(_", "\"%", ".1", "f", "\"_", "%_", "(_", "1000_", "*_", "fwhm_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "restore", " ", "calibra", "tion", " ", "to", " ", "old", " ", "values", " ", "unti", "l", " ", "new", " ", "values", " ", "are", " ", "accepted_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "xr", "f", "\\u", "calib", "\\u", "apply_", "(_", "mca", "_", ",_", "offset_", "=_", "old", "\\u", "calib", "_", "[_", "0_", "]_", ",_", "slope_", "=_", "old", "\\u", "calib", "_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "lar", "ch_", "=_", "self_", "._", "lar", "ch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mca", "_", "._", "init", "\\u", "calib", "_", "=_", "init", "\\u", "calib", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tsi", "ze_", "=_", "self_", "._", "Get", "Size_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Set", "Size_", "(_", "(_", "tsi", "ze_", "[_", "0_", "]_", "+_", "1_", ",_", "tsi", "ze_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Set", "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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 ]
Unused local variable
enthought/mayavi/mayavi/tests/test_user_defined.py
[ { "content": " def setUp(self):\n \"\"\"Initial setting up of test fixture, automatically called by TestCase before any other test method is invoked\"\"\"\n e = NullEngine()\n # Uncomment to see visualization for debugging etc.\n #e = Engine()\n e.start()\n e.new_scene()\n self.e=e\n\n # Read a VTK (old style) data file.\n r = VTKXMLFileReader()\n r.initialize(get_example_data('pyramid_ug.vtu'))\n e.add_source(r)\n\n # Create the filters.\n # CellDerivatives\n cd = tvtk.CellDerivatives()\n ud = UserDefined(filter=cd)\n e.add_filter(ud)\n ctp = CellToPointData()\n ctp.filter.pass_cell_data = False\n e.add_filter(ctp)\n evn = ExtractVectorNorm()\n e.add_filter(evn)\n evc = ExtractVectorComponents(component='y-component')\n o = Optional(filter=evc)\n e.add_filter(o)\n e.add_module(ScalarCutPlane())\n self.scene = e.current_scene\n s = self.scene\n return", "metadata": "root.TestUserDefined.setUp", "header": "['class', 'TestUserDefined', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 25 }, { "content": " def test_user_defined(self):\n \"Test if the test fixture works\"\n #Now test.\n s = self.scene\n self.check()\n\n #from mayavi.tools.show import show\n #show()", "metadata": "root.TestUserDefined.test_user_defined", "header": "['class', 'TestUserDefined', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 99 }, { "content": " def test_save_and_restore(self):\n \"\"\"Test if saving a visualization and restoring it works.\"\"\"\n engine = self.e\n scene = self.scene\n\n # Save visualization.\n f = BytesIO()\n f.name = abspath('test.mv2') # We simulate a file.\n engine.save_visualization(f)\n f.seek(0) # So we can read this saved data.\n\n # Remove existing scene.\n\n engine.close_scene(scene)\n\n # Load visualization\n engine.load_visualization(f)\n self.scene = engine.current_scene\n s = self.scene\n self.check()", "metadata": "root.TestUserDefined.test_save_and_restore", "header": "['class', 'TestUserDefined', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 108 }, { "content": " def test_deepcopied(self):\n \"\"\"Test if the MayaVi2 visualization can be deep-copied.\"\"\"\n ############################################################\n # Test if the MayaVi2 visualization can be deep-copied.\n\n # Pop the source object.\n s = self.scene\n source = s.children.pop()\n # Add it back to see if that works without error.\n s.children.append(source)\n cp = source.children[0].children[-1]\n s = self.scene\n\n self.check()\n\n # Now deepcopy the source and replace the existing one with\n # the copy. This basically simulates cutting/copying the\n # object from the UI via the right-click menu on the tree\n # view, and pasting the copy back.\n source1 = copy.deepcopy(source)\n s.children[0] = source1\n s = self.scene\n self.check()\n #from mayavi.tools.show import show\n #show()", "metadata": "root.TestUserDefined.test_deepcopied", "header": "['class', 'TestUserDefined', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 129 } ]
[ { "span": "s ", "start_line": 54, "start_column": 8, "end_line": 54, "end_column": 9 }, { "span": "s ", "start_line": 102, "start_column": 8, "end_line": 102, "end_column": 9 }, { "span": "s ", "start_line": 126, "start_column": 8, "end_line": 126, "end_column": 9 }, { "span": "cp ", "start_line": 139, "start_column": 8, "end_line": 139, "end_column": 10 }, { "span": "s ", "start_line": 150, "start_column": 8, "end_line": 150, "end_column": 9 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "User", "Define", "d_", "(_", "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 ", " _", "\"\"\"", "Initial", " ", "setti", "ng", " ", "up", " ", "of", " ", "test", " ", "fixture", ",", " ", "automati", "call", "y", " ", "call", "ed", " ", "by", " ", "Test", "Case", " ", "bef", "ore", " ", "any", " ", "other", " ", "test", " ", "method", " ", "is", " ", "invoke", "d", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "=_", "Null", "Engine_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Unco", "mmen", "t", " ", "to", " ", "see", " ", "visualization", " ", "for", " ", "debugg", "ing", " ", "etc", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "e", " ", "=", " ", "Engine", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "e_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "._", "new", "\\u", "scene_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "e_", "=_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Read", " ", "a", " ", "VT", "K", " ", "(", "old", " ", "style", ")", " ", "data", " ", "file", "._", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "VT", "KX", "ML", "File", "Reader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "._", "initialize_", "(_", "get", "\\u", "example", "\\u", "data_", "(_", "'", "pyram", "id", "\\u", "ug", ".", "vt", "u", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "._", "add", "\\u", "source_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "the", " ", "filter", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Cel", "l", "Derivati", "ves_", "\\u\\u\\uNL\\u\\u\\u_", "cd_", "=_", "tv", "tk_", "._", "Cel", "l", "Derivati", "ves_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ud_", "=_", "User", "Define", "d_", "(_", "filter_", "=_", "cd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "._", "add", "\\u", "filter_", "(_", "ud_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ct", "p_", "=_", "Cel", "l", "To", "Point", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ct", "p_", "._", "filter_", "._", "pass", "\\u", "cell", "\\u", "data_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "._", "add", "\\u", "filter_", "(_", "ct", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ev", "n_", "=_", "Extract", "Vector", "Norm_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "._", "add", "\\u", "filter_", "(_", "ev", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ev", "c_", "=_", "Extract", "Vector", "Components_", "(_", "component_", "=_", "'", "y", "-", "component", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "o_", "=_", "Optional_", "(_", "filter_", "=_", "ev", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "._", "add", "\\u", "filter_", "(_", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "._", "add", "\\u", "module_", "(_", "Scala", "r", "Cut", "Plane_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "scene_", "=_", "e_", "._", "current", "\\u", "scene_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "self_", "._", "scene_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "User", "Define", "d_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "user", "\\u", "defined_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Test", " ", "if", " ", "the", " ", "test", " ", "fixture", " ", "works", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "No", "w", " ", "test", "._", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "self_", "._", "scene_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "check_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "from", " ", "maya", "vi", ".", "tool", "s", ".", "show", " ", "import", " ", "show_", "\\u\\u\\uNL\\u\\u\\u_", "#", "show", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "User", "Define", "d_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "save", "\\u", "and", "\\u", "restore_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "if", " ", "saving", " ", "a", " ", "visualization", " ", "and", " ", "resto", "ring", " ", "it", " ", "works", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "engine_", "=_", "self_", "._", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scene_", "=_", "self_", "._", "scene_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Save", " ", "visualization", "._", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "Byte", "s", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "name_", "=_", "abspath_", "(_", "'", "test", ".", "mv", "2", "'_", ")_", "#", " ", "We", " ", "simulat", "e", " ", "a", " ", "file", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "engine_", "._", "save", "\\u", "visualization", "_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "seek_", "(_", "0_", ")_", "#", " ", "So", " ", "we", " ", "can", " ", "read", " ", "this", " ", "saved", " ", "data", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remove", " ", "exist", "ing", " ", "scen", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "engine_", "._", "close", "\\u", "scene_", "(_", "scene_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Load", " ", "visualization", "_", "\\u\\u\\uNL\\u\\u\\u_", "engine_", "._", "load", "\\u", "visualization", "_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "scene_", "=_", "engine_", "._", "current", "\\u", "scene_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "self_", "._", "scene_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "check_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "User", "Define", "d_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "deepc", "opi", "ed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "if", " ", "the", " ", "Maya", "Vi", "2", " ", "visualization", " ", "can", " ", "be", " ", "deep", "-", "copie", "d", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#####", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "if", " ", "the", " ", "Maya", "Vi", "2", " ", "visualization", " ", "can", " ", "be", " ", "deep", "-", "copie", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pop", " ", "the", " ", "source", " ", "object", "._", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "self_", "._", "scene_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source_", "=_", "s_", "._", "children_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", " ", "it", " ", "back", " ", "to", " ", "see", " ", "if", " ", "tha", "t", " ", "works", " ", "with", "out", " ", "error", "._", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "children_", "._", "append_", "(_", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cp_", "=_", "source_", "._", "children_", "[_", "0_", "]_", "._", "children_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "self_", "._", "scene_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "check_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "deepc", "opy", " ", "the", " ", "source", " ", "and", " ", "replace", " ", "the", " ", "exist", "ing", " ", "one", " ", "with_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "copy", ".", " ", " ", "Thi", "s", " ", "basic", "ally", " ", "simulat", "es", " ", "cutt", "ing", "/", "copy", "ing", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "object", " ", "from", " ", "the", " ", "UI", " ", "via", " ", "the", " ", "right", "-", "click", " ", "menu", " ", "on", " ", "the", " ", "tree_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "view", ",", " ", "and", " ", "past", "ing", " ", "the", " ", "copy", " ", "back", "._", "\\u\\u\\uNL\\u\\u\\u_", "source", "1_", "=_", "copy_", "._", "deepcopy_", "(_", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "children_", "[_", "0_", "]_", "=_", "source", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "self_", "._", "scene_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "check_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "from", " ", "maya", "vi", ".", "tool", "s", ".", "show", " ", "import", " ", "show_", "\\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, 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, 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 ]
Unused local variable
neurodata/ndstore/onetime/deprecated/allkatannos.py
[ { "content": "def main():\n\n parser = argparse.ArgumentParser(description='Download all annotations for a database')\n parser.add_argument('baseurl', action=\"store\")\n parser.add_argument('token', action=\"store\")\n parser.add_argument('outputdir', action=\"store\", help='Directory into which to write HDF5 files')\n parser.add_argument('--resolution', action=\"store\", help='Resolution at which you want the voxels. Defaults to the annotation database resolution.', default=None)\n parser.add_argument('--cutout', action='store_true', help='Return a cutout instead of a list of voxels.')\n parser.add_argument('--status', type=int, action=\"store\", default=None )\n parser.add_argument('--type', type=int, action=\"store\", default=None )\n\n result = parser.parse_args()\n\n # First let's get the list of annotations\n url = 'http://%s/emca/%s/list/' % ( result.baseurl, result.token )\n if result.type != None:\n url += 'type/%s/' % ( result.type )\n if result.status != None:\n url += 'status/%s/' % ( result.status )\n\n print \"Getting the list of annotations from \", url\n\n # Get cube in question\n try:\n f = urllib2.urlopen ( url )\n except urllib2.URLError, e:\n print \"Failed URL\", url\n print \"Error %s\" % (e.read())\n sys.exit(0)\n\n # Now we are processing the return. New tmpfile, new h5f\n tmpfile = tempfile.NamedTemporaryFile ( )\n tmpfile.write ( f.read() )\n f.close()\n tmpfile.tell()\n h5f = h5py.File ( tmpfile.name, driver='core', backing_store=False )\n\n if h5f.get('ANNOIDS'):\n if len(h5f['ANNOIDS']) == 0:\n print \"Found no annotations matching type and status\"\n sys.exit(0)\n else:\n print \"Malformed HDF5 file!\"\n sys.exit(0)\n\n for annoid in np.array(h5f['ANNOIDS'][:]):\n\n # Figure out how big the object is:\n if result.resolution == None:\n url = \"http://%s/emca/%s/%s/boundingbox/\" % (result.baseurl,result.token,annoid)\n else:\n url = \"http://%s/emca/%s/%s/boundingbox/%s/\" % (result.baseurl,result.token,result.annids, annoid)\n\n # Get annotation in question\n try:\n f = urllib2.urlopen ( url )\n except urllib2.URLError, e:\n print \"Failed URL\", url\n print \"Error %s\" % (e) \n sys.exit(0)\n\n\n # create an in memory h5 file\n # Read into a temporary file\n tmpfile = tempfile.NamedTemporaryFile ( )\n tmpfile.write ( f.read() )\n f.close()\n tmpfile.tell()\n h5f = h5py.File ( tmpfile.name, driver='core', backing_store=False )\n\n # If the bounding box is bigger than 100M, don't cut out\n idgrp = h5f.get(h5f.keys()[0])\n print \"Bounding box corner %s dim %s = \" % (idgrp['XYZOFFSET'][:],idgrp['XYZDIMENSION'][:])\n cutoutdim = idgrp['XYZDIMENSION'][:]\n if cutoutdim[0]*cutoutdim[1]*cutoutdim[2] > 2**27:\n sys.stderr.write(\"Not fetching annotation %s now. It's too big. %s bytes.\\n\" % ( annoid, cutoutdim[0]*cutoutdim[1]*cutoutdim[2]))\n sys.stderr.flush()\n continue\n\n h5f.close()\n \n # Get voxel lists for all other annotations and write to the output directory\n if not result.cutout:\n if result.resolution == None:\n url = \"http://%s/emca/%s/%s/voxels/\" % (result.baseurl,result.token,annoid)\n else:\n url = \"http://%s/emca/%s/%s/voxels/%s/\" % (result.baseurl,result.token,annoid, result.resolution)\n # or get a cutout if requested instead\n else:\n if result.resolution == None:\n url = \"http://%s/emca/%s/%s/cutout/\" % (result.baseurl,result.token,annoid)\n else:\n url = \"http://%s/emca/%s/%s/cutout/%s/\" % (result.baseurl,result.token,annoid, result.resolution)\n\n # Get annotation in question\n try:\n f = urllib2.urlopen ( url )\n except urllib2.URLError, e:\n print \"Failed URL\", url\n print \"Error %s\" % (e.read()) \n sys.exit(0)\n\n # Create an output file\n filename = \"/tmp/anno\" + str(annoid) + \".h5\"\n fh = open ( filename, 'w' )\n fh.write ( f.read() )\n fh.tell()\n h5f = h5py.File ( filename )\n\n idgrp = h5f.get(h5f.keys()[0])\n\n print \"Annotation id: \", h5f.keys()[0]\n print \"Annotation type: \", anno_names[idgrp['ANNOTATION_TYPE'][0]]\n\n mdgrp = idgrp['METADATA']\n\n if idgrp.get('VOXELS'):\n print \"Voxel list for object of length\", len(idgrp['VOXELS'][:])\n# print idgrp['VOXELS'][:]\n elif not result.cutout:\n print \"No voxels found at this resolution\"\n\n if idgrp.get('CUTOUT') and idgrp.get('XYZOFFSET'):\n print \"Cutout at corner %s dim %s = \" % (idgrp['XYZOFFSET'][:],idgrp['CUTOUT'].shape)\n print \"%s voxels match identifier in cutout\" % ( len(np.nonzero(np.array(idgrp['CUTOUT'][:,:,:]))[0]))\n\n h5f.flush()\n h5f.close()", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 33 } ]
[ { "span": "mdgrp ", "start_line": 147, "start_column": 4, "end_line": 147, "end_column": 9 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", "description_", "=_", "'", "Down", "load", " ", "all", " ", "annot", "ation", "s", " ", "for", " ", "a", " ", "databa", "se", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "baseu", "rl", "'_", ",_", "action_", "=_", "\"", "store", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "token", "'_", ",_", "action_", "=_", "\"", "store", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "output", "dir", "'_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "help_", "=_", "'", "Director", "y", " ", "int", "o", " ", "whi", "ch", " ", "to", " ", "write", " ", "HDF", "5", " ", "files", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "resolu", "tion", "'_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "help_", "=_", "'", "Reso", "luti", "on", " ", "at", " ", "whi", "ch", " ", "you", " ", "want", " ", "the", " ", "voxels", ".", " ", " ", "Default", "s", " ", "to", " ", "the", " ", "annot", "ation", " ", "databa", "se", " ", "resolu", "tion", ".'_", ",_", "default_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "cuto", "ut", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "help_", "=_", "'", "Return", " ", "a", " ", "cuto", "ut", " ", "inst", "ead", " ", "of", " ", "a", " ", "list", " ", "of", " ", "voxels", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "status", "'_", ",_", "type_", "=_", "int_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "default_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "type", "'_", ",_", "type_", "=_", "int_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "default_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Fi", "rst", " ", "let", "'", "s", " ", "get", " ", "the", " ", "list", " ", "of", " ", "annotations_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'", "http", "://", "%", "s", "/", "emc", "a", "/", "%", "s", "/", "list", "/'_", "%_", "(_", "result_", "._", "baseurl_", ",_", "result_", "._", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "type_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "+=_", "'", "type", "/", "%", "s", "/'_", "%_", "(_", "result_", "._", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "result_", "._", "status_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "+=_", "'", "status", "/", "%", "s", "/'_", "%_", "(_", "result_", "._", "status_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "Get", "ting", " ", "the", " ", "list", " ", "of", " ", "annot", "ation", "s", " ", "from", " ", "\"_", ",_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "cube", " ", "in", " ", "question_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "urllib2_", "._", "urlopen_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "urllib2_", "._", "URL", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Fail", "ed", " ", "URL", "\"_", ",_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Error", " ", "%", "s", "\"_", "%_", "(_", "e_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "we", " ", "are", " ", "process", "ing", " ", "the", " ", "return", ".", " ", " ", "New", " ", "tmpfile", ",", " ", "new", " ", "h5", "f_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tmpfile_", "=_", "tempfile_", "._", "Name", "d", "Tempora", "ry", "File_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmpfile_", "._", "write_", "(_", "f_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmpfile_", "._", "tell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h5", "f_", "=_", "h5py_", "._", "File_", "(_", "tmpfile_", "._", "name_", ",_", "driver_", "=_", "'", "core", "'_", ",_", "backing", "\\u", "store_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "h5", "f_", "._", "get_", "(_", "'", "ANN", "OID", "S", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "h5", "f_", "[_", "'", "ANN", "OID", "S", "'_", "]_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Foun", "d", " ", "no", " ", "annot", "ation", "s", " ", "matchi", "ng", " ", "type", " ", "and", " ", "status", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Mal", "formed", " ", "HDF", "5", " ", "file", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "anno", "id_", "in_", "np_", "._", "array_", "(_", "h5", "f_", "[_", "'", "ANN", "OID", "S", "'_", "]_", "[_", ":_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fig", "ure", " ", "out", " ", "how", " ", "big", " ", "the", " ", "object", " ", "is", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "result_", "._", "resolution_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "\"", "http", "://", "%", "s", "/", "emc", "a", "/", "%", "s", "/", "%", "s", "/", "bound", "ing", "box", "/\"_", "%_", "(_", "result_", "._", "baseurl_", ",_", "result_", "._", "token_", ",_", "anno", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "\"", "http", "://", "%", "s", "/", "emc", "a", "/", "%", "s", "/", "%", "s", "/", "bound", "ing", "box", "/", "%", "s", "/\"_", "%_", "(_", "result_", "._", "baseurl_", ",_", "result_", "._", "token_", ",_", "result_", "._", "ann", "ids_", ",_", "anno", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "annot", "ation", " ", "in", " ", "question_", "\\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 ", " _", "f_", "=_", "urllib2_", "._", "urlopen_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "urllib2_", "._", "URL", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Fail", "ed", " ", "URL", "\"_", ",_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Error", " ", "%", "s", "\"_", "%_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "an", " ", "in", " ", "memory", " ", "h5", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Read", " ", "int", "o", " ", "a", " ", "temporar", "y", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tmpfile_", "=_", "tempfile_", "._", "Name", "d", "Tempora", "ry", "File_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmpfile_", "._", "write_", "(_", "f_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmpfile_", "._", "tell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h5", "f_", "=_", "h5py_", "._", "File_", "(_", "tmpfile_", "._", "name_", ",_", "driver_", "=_", "'", "core", "'_", ",_", "backing", "\\u", "store_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "bound", "ing", " ", "box", " ", "is", " ", "bigger", " ", "than", " ", "100", "M", ",", " ", "don", "'", "t", " ", "cut", " ", "out_", "\\u\\u\\uNL\\u\\u\\u_", "id", "grp_", "=_", "h5", "f_", "._", "get_", "(_", "h5", "f_", "._", "keys_", "(_", ")_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Bound", "ing", " ", "box", " ", "corn", "er", " ", "%", "s", " ", "dim", " ", "%", "s", " ", "=", " ", "\"_", "%_", "(_", "id", "grp_", "[_", "'", "XY", "ZO", "FF", "SET", "'_", "]_", "[_", ":_", "]_", ",_", "id", "grp_", "[_", "'", "XY", "ZD", "IME", "NS", "ION", "'_", "]_", "[_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cuto", "ut", "dim_", "=_", "id", "grp_", "[_", "'", "XY", "ZD", "IME", "NS", "ION", "'_", "]_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cuto", "ut", "dim_", "[_", "0_", "]_", "*_", "cuto", "ut", "dim_", "[_", "1_", "]_", "*_", "cuto", "ut", "dim_", "[_", "2_", "]_", ">_", "2_", "**_", "27_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stderr_", "._", "write_", "(_", "\"", "Not", " ", "fetch", "ing", " ", "annot", "ation", " ", "%", "s", " ", "now", ".", " ", " ", "It", "'", "s", " ", "too", " ", "big", ".", " ", "%", "s", " ", "bytes", ".\\\\", "n", "\"_", "%_", "(_", "anno", "id_", ",_", "cuto", "ut", "dim_", "[_", "0_", "]_", "*_", "cuto", "ut", "dim_", "[_", "1_", "]_", "*_", "cuto", "ut", "dim_", "[_", "2_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stderr_", "._", "flush_", "(_", ")_", "\\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_", "h5", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Get", " ", "voxel", " ", "lists", " ", "for", " ", "all", " ", "other", " ", "annot", "ation", "s", " ", "and", " ", "write", " ", "to", " ", "the", " ", "output", " ", "directory_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "result_", "._", "cuto", "ut_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "result_", "._", "resolution_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "\"", "http", "://", "%", "s", "/", "emc", "a", "/", "%", "s", "/", "%", "s", "/", "voxels", "/\"_", "%_", "(_", "result_", "._", "baseurl_", ",_", "result_", "._", "token_", ",_", "anno", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "\"", "http", "://", "%", "s", "/", "emc", "a", "/", "%", "s", "/", "%", "s", "/", "voxels", "/", "%", "s", "/\"_", "%_", "(_", "result_", "._", "baseurl_", ",_", "result_", "._", "token_", ",_", "anno", "id_", ",_", "result_", "._", "resolution_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "or", " ", "get", " ", "a", " ", "cuto", "ut", " ", "if", " ", "request", "ed", " ", "inst", "ead_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "result_", "._", "resolution_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "\"", "http", "://", "%", "s", "/", "emc", "a", "/", "%", "s", "/", "%", "s", "/", "cuto", "ut", "/\"_", "%_", "(_", "result_", "._", "baseurl_", ",_", "result_", "._", "token_", ",_", "anno", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "\"", "http", "://", "%", "s", "/", "emc", "a", "/", "%", "s", "/", "%", "s", "/", "cuto", "ut", "/", "%", "s", "/\"_", "%_", "(_", "result_", "._", "baseurl_", ",_", "result_", "._", "token_", ",_", "anno", "id_", ",_", "result_", "._", "resolution_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "annot", "ation", " ", "in", " ", "question_", "\\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 ", " _", "f_", "=_", "urllib2_", "._", "urlopen_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "urllib2_", "._", "URL", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Fail", "ed", " ", "URL", "\"_", ",_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Error", " ", "%", "s", "\"_", "%_", "(_", "e_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "an", " ", "output", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "filename_", "=_", "\"/", "tmp", "/", "anno", "\"_", "+_", "str_", "(_", "anno", "id_", ")_", "+_", "\".", "h5", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fh_", "=_", "open_", "(_", "filename_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fh_", "._", "write_", "(_", "f_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fh_", "._", "tell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h5", "f_", "=_", "h5py_", "._", "File_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "id", "grp_", "=_", "h5", "f_", "._", "get_", "(_", "h5", "f_", "._", "keys_", "(_", ")_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"", "Annot", "ation", " ", "id", ":", " ", "\"_", ",_", "h5", "f_", "._", "keys_", "(_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Annot", "ation", " ", "type", ":", " ", "\"_", ",_", "anno", "\\u", "names_", "[_", "id", "grp_", "[_", "'", "ANNOTAT", "ION", "\\u", "TYPE", "'_", "]_", "[_", "0_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "md", "grp_", "=_", "id", "grp_", "[_", "'", "METAD", "ATA", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "id", "grp_", "._", "get_", "(_", "'", "VO", "XE", "LS", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Vo", "xel", " ", "list", " ", "for", " ", "object", " ", "of", " ", "length", "\"_", ",_", "len_", "(_", "id", "grp_", "[_", "'", "VO", "XE", "LS", "'_", "]_", "[_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", "print", " ", "id", "grp", "['", "VO", "XE", "LS", "']", "[:", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "result_", "._", "cuto", "ut_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "No", " ", "voxels", " ", "found", " ", "at", " ", "this", " ", "resolu", "tion", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "id", "grp_", "._", "get_", "(_", "'", "CUT", "OUT", "'_", ")_", "and_", "id", "grp_", "._", "get_", "(_", "'", "XY", "ZO", "FF", "SET", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Cuto", "ut", " ", "at", " ", "corn", "er", " ", "%", "s", " ", "dim", " ", "%", "s", " ", "=", " ", "\"_", "%_", "(_", "id", "grp_", "[_", "'", "XY", "ZO", "FF", "SET", "'_", "]_", "[_", ":_", "]_", ",_", "id", "grp_", "[_", "'", "CUT", "OUT", "'_", "]_", "._", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"%", "s", " ", "voxels", " ", "match", " ", "identifi", "er", " ", "in", " ", "cuto", "ut", "\"_", "%_", "(_", "len_", "(_", "np_", "._", "nonzero_", "(_", "np_", "._", "array_", "(_", "id", "grp_", "[_", "'", "CUT", "OUT", "'_", "]_", "[_", ":_", ",_", ":_", ",_", ":_", "]_", ")_", ")_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "h5", "f_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
rizar/attention-lvcsr/libs/Theano/theano/sparse/sandbox/test_sp.py
[ { "content": " @attr('slow')\n def test_sparse(self):\n\n# print '\\n\\n*************************************************'\n# print ' TEST SPARSE'\n# print '*************************************************'\n\n # fixed parameters\n bsize = 10 # batch size\n imshp = (8, 8)\n kshp = (5, 5)\n nkern = 1 # per output pixel\n ssizes = ((1, 1), (2, 2))\n convmodes = ('full', 'valid',)\n\n # symbolic stuff\n bias = tensor.dvector()\n kerns = tensor.dvector()\n input = tensor.dmatrix()\n rng = numpy.random.RandomState(3423489)\n\n import theano.gof as gof\n\n for mode in (None,):\n ntot, ttot = 0, 0\n for conv_mode in convmodes:\n for ss in ssizes:\n\n output, outshp = sp.applySparseFilter(kerns, kshp,\\\n nkern, input, imshp, ss, bias=bias, mode=conv_mode)\n f = function([kerns, bias, input], output, mode=mode)\n\n # build actual input images\n img2d = numpy.arange(bsize*numpy.prod(imshp)).reshape((bsize,)+imshp)\n img1d = img2d.reshape(bsize, -1)\n zeropad_img = numpy.zeros((bsize,\\\n img2d.shape[1]+2*(kshp[0]-1),\\\n img2d.shape[2]+2*(kshp[1]-1)))\n zeropad_img[:, kshp[0]-1:kshp[0]-1+img2d.shape[1],\n kshp[1]-1:kshp[1]-1+img2d.shape[2]] = img2d\n\n # build kernel matrix -- flatten it for theano stuff\n filters = numpy.arange(numpy.prod(outshp)*numpy.prod(kshp)).\\\n reshape(nkern, numpy.prod(outshp[1:]), numpy.prod(kshp))\n spfilt = filters.flatten()\n biasvals = numpy.arange(numpy.prod(outshp))\n\n # compute output by hand\n ntime1 = time.time()\n refout = numpy.zeros((bsize, nkern, outshp[1], outshp[2]))\n patch = numpy.zeros((kshp[0], kshp[1]))\n for b in xrange(bsize):\n for k in xrange(nkern):\n pixi = 0 # pixel index in raster order\n for j in xrange(outshp[1]):\n for i in xrange(outshp[2]):\n n = j * ss[0]\n m = i * ss[1]\n patch = zeropad_img[b, n:n+kshp[0], m:m+kshp[1]]\n refout[b, k, j, i] = numpy.dot(filters[k, pixi, :],\\\n patch.flatten())\n pixi += 1\n refout = refout.reshape(bsize, -1) + biasvals\n ntot += time.time() - ntime1\n\n # need to flatten images\n ttime1 = time.time()\n out1 = f(spfilt, biasvals, img1d)\n ttot += time.time() - ttime1\n\n temp = refout - out1\n assert (temp < 1e-10).all()\n\n # test downward propagation\n vis = tensor.grad(0.5*tensor.sqr(output).sum(), input)\n downprop = function([kerns, output], vis)\n temp1 = time.time()\n for zz in range(100):\n visval = downprop(spfilt, out1)\n indices, indptr, spmat_shape, sptype, outshp, kmap = \\\n sp.convolution_indices.sparse_eval(imshp, kshp, nkern, ss, conv_mode)\n spmat = sparse.csc_matrix((spfilt[kmap], indices, indptr), spmat_shape)\n visref = numpy.dot(out1, spmat.todense())\n assert numpy.all(visref == visval), (visref, visval)", "metadata": "root.TestSP.test_sparse", "header": "['class', 'TestSP', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 132 }, { "content": " @attr('slow')\n def test_multilayer_sparse(self):\n # fixed parameters\n bsize = 10 # batch size\n imshp = (5, 5)\n kshp = ((3, 3), (2, 2))\n nkerns = (10, 20) # per output pixel\n ssizes = ((1, 1), (2, 2))\n convmodes = ('full', 'valid',)\n\n # symbolic stuff\n kerns = [tensor.dvector(), tensor.dvector()]\n input = tensor.dmatrix()\n rng = numpy.random.RandomState(3423489)\n\n # build actual input images\n img2d = numpy.arange(bsize*numpy.prod(imshp)).reshape((bsize,)+imshp)\n img1d = img2d.reshape(bsize, -1)\n\n for mode in ('FAST_COMPILE', 'FAST_RUN'):\n for conv_mode in convmodes:\n for ss in ssizes:\n\n l1hid, l1outshp = sp.applySparseFilter(kerns[0], kshp[0],\\\n nkerns[0], input, imshp, ss, mode=conv_mode)\n l2hid, l2outshp = sp.applySparseFilter(kerns[1], kshp[1],\\\n nkerns[1], l1hid, l1outshp, ss, mode=conv_mode)\n\n l1propup = function([kerns[0], input], l1hid, mode=mode)\n l2propup = function([kerns[1], l1hid], l2hid, mode=mode)\n\n # actual values\n l1kernvals = numpy.arange(numpy.prod(l1outshp)*numpy.prod(kshp[0]))\n l2kernvals = numpy.arange(numpy.prod(l2outshp)*numpy.prod(kshp[1])*nkerns[0])\n l1hidval = l1propup(l1kernvals, img1d)\n l2hidval = l2propup(l2kernvals, l1hidval)", "metadata": "root.TestSP.test_multilayer_sparse", "header": "['class', 'TestSP', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 222 }, { "content": " def test_multilayer_conv(self):\n # fixed parameters\n bsize = 10 # batch size\n imshp = (5, 5)\n kshp = ((3, 3), (2, 2))\n nkerns = (3, 6) # per output pixel\n ssizes = (((1, 1), (2, 2)),)\n convmodes = ('full',) # 'valid',)\n\n # symbolic stuff\n kerns = [tensor.dmatrix(), tensor.dmatrix()]\n input = tensor.dmatrix()\n rng = numpy.random.RandomState(3423489)\n\n # build actual input images\n img2d = numpy.arange(bsize*numpy.prod(imshp)).reshape((bsize,)+imshp)\n img1d = img2d.reshape(bsize, -1)\n\n for mode in ('FAST_COMPILE', 'FAST_RUN'):\n for conv_mode in convmodes:\n for ss in ssizes:\n\n l1hid, l1shp = sp.convolve(kerns[0], kshp[0],\\\n nkerns[0], input, imshp, ss[0], mode=conv_mode)\n l1propup = function([kerns[0], input], l1hid, mode=mode)\n\n #l1kernvals = numpy.random.rand(nkerns[0],numpy.prod(kshp[0]))\n l1kernvals = numpy.arange(nkerns[0]*numpy.prod(kshp[0])).reshape(nkerns[0], numpy.prod(kshp[0]))\n l1hidval = l1propup(l1kernvals, img1d)\n\n # actual values\n l2hid, l2shp = sp.convolve(kerns[1], kshp[1],\\\n nkerns[1], l1hid, l1shp, ss[1], mode=conv_mode)\n l2propup = function([kerns[1], l1hid], l2hid, mode=mode)\n\n #l2kernvals = numpy.random.rand(nkerns[1],numpy.prod(kshp[1])*nkerns[0])\n l2kernvals = numpy.arange(nkerns[1]*numpy.prod(kshp[1])*nkerns[0]).reshape(nkerns[1], numpy.prod(kshp[1])*nkerns[0])\n # for debugging, we bring things back to integers\n l1hidval = numpy.arange(numpy.size(l1hidval)).reshape(l1hidval.shape)\n\n l2hidval = l2propup(l2kernvals, l1hidval)", "metadata": "root.TestSP.test_multilayer_conv", "header": "['class', 'TestSP', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 261 }, { "content": " def test_CSMGrad(self):\n imshp = (3, 3)\n nkern = 1 # per output pixel\n kshp = (2, 2)\n #ssizes = ((1,1),(2,2))\n ssizes = ((1, 1),)\n #convmodes = ('full','valid',)\n convmodes = ('full',)\n\n kerns = tensor.dvector()\n indices = tensor.ivector()\n indptr = tensor.ivector()\n spmat_shape = tensor.ivector()\n\n for mode in ['FAST_COMPILE', 'FAST_RUN']:\n for conv_mode in convmodes:\n for ss in ssizes:\n indvals, indptrvals, spshapevals, sptype, outshp, kmap = \\\n sp.convolution_indices.sparse_eval(imshp, kshp, nkern, ss, conv_mode)\n kvals = numpy.random.random(nkern*numpy.prod(kshp)*numpy.prod(outshp)).flatten()\n\n def d(kerns):\n return theano.sparse.dense_from_sparse(\n theano.sparse.CSM(sptype, kmap)(\n kerns, indvals, indptrvals, spshapevals))\n\n # symbolic stuff\n utt.verify_grad(d, [kvals])", "metadata": "root.TestSP.test_CSMGrad", "header": "['class', 'TestSP', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 337 } ]
[ { "span": "rng ", "start_line": 151, "start_column": 8, "end_line": 151, "end_column": 11 }, { "span": "temp1 ", "start_line": 208, "start_column": 20, "end_line": 208, "end_column": 25 }, { "span": "rng ", "start_line": 235, "start_column": 8, "end_line": 235, "end_column": 11 }, { "span": "l2hidval ", "start_line": 257, "start_column": 20, "end_line": 257, "end_column": 28 }, { "span": "rng ", "start_line": 273, "start_column": 8, "end_line": 273, "end_column": 11 }, { "span": "l2hidval ", "start_line": 301, "start_column": 20, "end_line": 301, "end_column": 28 }, { "span": "kerns ", "start_line": 346, "start_column": 8, "end_line": 346, "end_column": 13 }, { "span": "indices ", "start_line": 347, "start_column": 8, "end_line": 347, "end_column": 15 }, { "span": "indptr ", "start_line": 348, "start_column": 8, "end_line": 348, "end_column": 14 }, { "span": "spmat_shape ", "start_line": 349, "start_column": 8, "end_line": 349, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "SP_", "(_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "attr_", "(_", "'", "slow", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "sparse_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", "'\\\\", "n", "\\\\", "n", "***********", "***********", "***********", "***********", "*****", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", "'", " ", " ", " ", "TEST", " ", "SPAR", "SE", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", "'*******", "***********", "***********", "***********", "********", "*'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fixed", " ", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bsi", "ze_", "=_", "10_", "#", " ", "batch", " ", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ims", "hp_", "=_", "(_", "8_", ",_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ksh", "p_", "=_", "(_", "5_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nke", "rn_", "=_", "1_", "#", " ", "per", " ", "output", " ", "pixel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ssi", "zes", "_", "=_", "(_", "(_", "1_", ",_", "1_", ")_", ",_", "(_", "2_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conv", "modes_", "=_", "(_", "'", "full", "'_", ",_", "'", "valid", "'_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "symbolic", " ", "stuff_", "\\u\\u\\uNL\\u\\u\\u_", "bias_", "=_", "tensor_", "._", "dv", "ector_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kern", "s_", "=_", "tensor_", "._", "dv", "ector_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input_", "=_", "tensor_", "._", "dma", "trix_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rng_", "=_", "numpy_", "._", "random_", "._", "Random", "State_", "(_", "342", "348", "9_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "theano_", "._", "gof", "_", "as_", "gof", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "mode_", "in_", "(_", "None_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nto", "t_", ",_", "tto", "t_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "conv", "\\u", "mode_", "in_", "conv", "modes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "ss_", "in_", "ssi", "zes", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "output_", ",_", "outs", "hp_", "=_", "sp_", "._", "appl", "y", "Spar", "se", "Filter_", "(_", "kern", "s_", ",_", "ksh", "p_", ",_", "nke", "rn_", ",_", "input_", ",_", "ims", "hp_", ",_", "ss_", ",_", "bias_", "=_", "bias_", ",_", "mode_", "=_", "conv", "\\u", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "function_", "(_", "[_", "kern", "s_", ",_", "bias_", ",_", "input_", "]_", ",_", "output_", ",_", "mode_", "=_", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "build", " ", "actual", " ", "input", " ", "images_", "\\u\\u\\uNL\\u\\u\\u_", "img", "2d_", "=_", "numpy_", "._", "arange_", "(_", "bsi", "ze_", "*_", "numpy_", "._", "prod_", "(_", "ims", "hp_", ")_", ")_", "._", "reshape_", "(_", "(_", "bsi", "ze_", ",_", ")_", "+_", "ims", "hp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img", "1d_", "=_", "img", "2d_", "._", "reshape_", "(_", "bsi", "ze_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zero", "pad", "\\u", "img_", "=_", "numpy_", "._", "zeros_", "(_", "(_", "bsi", "ze_", ",_", "img", "2d_", "._", "shape_", "[_", "1_", "]_", "+_", "2_", "*_", "(_", "ksh", "p_", "[_", "0_", "]_", "-_", "1_", ")_", ",_", "img", "2d_", "._", "shape_", "[_", "2_", "]_", "+_", "2_", "*_", "(_", "ksh", "p_", "[_", "1_", "]_", "-_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zero", "pad", "\\u", "img_", "[_", ":_", ",_", "ksh", "p_", "[_", "0_", "]_", "-_", "1_", ":_", "ksh", "p_", "[_", "0_", "]_", "-_", "1_", "+_", "img", "2d_", "._", "shape_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ksh", "p_", "[_", "1_", "]_", "-_", "1_", ":_", "ksh", "p_", "[_", "1_", "]_", "-_", "1_", "+_", "img", "2d_", "._", "shape_", "[_", "2_", "]_", "]_", "=_", "img", "2d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "build", " ", "kernel", " ", "matrix", " ", "--", " ", "flat", "ten", " ", "it", " ", "for", " ", "theano", " ", "stuff_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", "=_", "numpy_", "._", "arange_", "(_", "numpy_", "._", "prod_", "(_", "outs", "hp_", ")_", "*_", "numpy_", "._", "prod_", "(_", "ksh", "p_", ")_", ")_", "._", "reshape_", "(_", "nke", "rn_", ",_", "numpy_", "._", "prod_", "(_", "outs", "hp_", "[_", "1_", ":_", "]_", ")_", ",_", "numpy_", "._", "prod_", "(_", "ksh", "p_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sp", "filt_", "=_", "filters_", "._", "flatten_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bias", "vals_", "=_", "numpy_", "._", "arange_", "(_", "numpy_", "._", "prod_", "(_", "outs", "hp_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "compute", " ", "output", " ", "by", " ", "hand_", "\\u\\u\\uNL\\u\\u\\u_", "ntime", "1_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ref", "out_", "=_", "numpy_", "._", "zeros_", "(_", "(_", "bsi", "ze_", ",_", "nke", "rn_", ",_", "outs", "hp_", "[_", "1_", "]_", ",_", "outs", "hp_", "[_", "2_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "=_", "numpy_", "._", "zeros_", "(_", "(_", "ksh", "p_", "[_", "0_", "]_", ",_", "ksh", "p_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "b_", "in_", "xrange_", "(_", "bsi", "ze_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "k_", "in_", "xrange_", "(_", "nke", "rn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "pix", "i_", "=_", "0_", "#", " ", "pixel", " ", "index", " ", "in", " ", "rast", "er", " ", "order_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", "in_", "xrange_", "(_", "outs", "hp_", "[_", "1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "i_", "in_", "xrange_", "(_", "outs", "hp_", "[_", "2_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "n_", "=_", "j_", "*_", "ss_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "i_", "*_", "ss_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "=_", "zero", "pad", "\\u", "img_", "[_", "b_", ",_", "n_", ":_", "n_", "+_", "ksh", "p_", "[_", "0_", "]_", ",_", "m_", ":_", "m_", "+_", "ksh", "p_", "[_", "1_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ref", "out_", "[_", "b_", ",_", "k_", ",_", "j_", ",_", "i_", "]_", "=_", "numpy_", "._", "dot_", "(_", "filters_", "[_", "k_", ",_", "pix", "i_", ",_", ":_", "]_", ",_", "patch_", "._", "flatten_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pix", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ref", "out_", "=_", "ref", "out_", "._", "reshape_", "(_", "bsi", "ze_", ",_", "-_", "1_", ")_", "+_", "bias", "vals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nto", "t_", "+=_", "time_", "._", "time_", "(_", ")_", "-_", "ntime", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "need", " ", "to", " ", "flat", "ten", " ", "images_", "\\u\\u\\uNL\\u\\u\\u_", "tti", "me", "1_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out1_", "=_", "f_", "(_", "sp", "filt_", ",_", "bias", "vals_", ",_", "img", "1d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tto", "t_", "+=_", "time_", "._", "time_", "(_", ")_", "-_", "tti", "me", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "temp_", "=_", "ref", "out_", "-_", "out1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "temp_", "<_", "1e-10_", ")_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "down", "ward", " ", "propagat", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "vis_", "=_", "tensor_", "._", "grad_", "(_", "0.5_", "*_", "tensor_", "._", "sqr", "_", "(_", "output_", ")_", "._", "sum_", "(_", ")_", ",_", "input_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "down", "prop_", "=_", "function_", "(_", "[_", "kern", "s_", ",_", "output_", "]_", ",_", "vis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp", "1_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "zz_", "in_", "range_", "(_", "100_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "vis", "val_", "=_", "down", "prop_", "(_", "sp", "filt_", ",_", "out1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "indices_", ",_", "indp", "tr_", ",_", "spm", "at", "\\u", "shape_", ",_", "spt", "ype_", ",_", "outs", "hp_", ",_", "kma", "p_", "=_", "sp_", "._", "convolution", "\\u", "indices_", "._", "spars", "e\\u", "eval_", "(_", "ims", "hp_", ",_", "ksh", "p_", ",_", "nke", "rn_", ",_", "ss_", ",_", "conv", "\\u", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spm", "at_", "=_", "sparse_", "._", "csc", "\\u", "matrix_", "(_", "(_", "sp", "filt_", "[_", "kma", "p_", "]_", ",_", "indices_", ",_", "indp", "tr_", ")_", ",_", "spm", "at", "\\u", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vis", "ref_", "=_", "numpy_", "._", "dot_", "(_", "out1_", ",_", "spm", "at_", "._", "tod", "ense", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "numpy_", "._", "all_", "(_", "vis", "ref_", "==_", "vis", "val_", ")_", ",_", "(_", "vis", "ref_", ",_", "vis", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "SP_", "(_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "attr_", "(_", "'", "slow", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "multil", "aye", "r", "\\u", "sparse_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "fixed", " ", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bsi", "ze_", "=_", "10_", "#", " ", "batch", " ", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ims", "hp_", "=_", "(_", "5_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ksh", "p_", "=_", "(_", "(_", "3_", ",_", "3_", ")_", ",_", "(_", "2_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nke", "rn", "s_", "=_", "(_", "10_", ",_", "20_", ")_", "#", " ", "per", " ", "output", " ", "pixel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ssi", "zes", "_", "=_", "(_", "(_", "1_", ",_", "1_", ")_", ",_", "(_", "2_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conv", "modes_", "=_", "(_", "'", "full", "'_", ",_", "'", "valid", "'_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "symbolic", " ", "stuff_", "\\u\\u\\uNL\\u\\u\\u_", "kern", "s_", "=_", "[_", "tensor_", "._", "dv", "ector_", "(_", ")_", ",_", "tensor_", "._", "dv", "ector_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input_", "=_", "tensor_", "._", "dma", "trix_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rng_", "=_", "numpy_", "._", "random_", "._", "Random", "State_", "(_", "342", "348", "9_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "build", " ", "actual", " ", "input", " ", "images_", "\\u\\u\\uNL\\u\\u\\u_", "img", "2d_", "=_", "numpy_", "._", "arange_", "(_", "bsi", "ze_", "*_", "numpy_", "._", "prod_", "(_", "ims", "hp_", ")_", ")_", "._", "reshape_", "(_", "(_", "bsi", "ze_", ",_", ")_", "+_", "ims", "hp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img", "1d_", "=_", "img", "2d_", "._", "reshape_", "(_", "bsi", "ze_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "mode_", "in_", "(_", "'", "FAST", "\\u", "COMPIL", "E", "'_", ",_", "'", "FAST", "\\u", "RUN", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "conv", "\\u", "mode_", "in_", "conv", "modes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "ss_", "in_", "ssi", "zes", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "l1", "hid_", ",_", "l1", "outs", "hp_", "=_", "sp_", "._", "appl", "y", "Spar", "se", "Filter_", "(_", "kern", "s_", "[_", "0_", "]_", ",_", "ksh", "p_", "[_", "0_", "]_", ",_", "nke", "rn", "s_", "[_", "0_", "]_", ",_", "input_", ",_", "ims", "hp_", ",_", "ss_", ",_", "mode_", "=_", "conv", "\\u", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l2", "hid_", ",_", "l2", "outs", "hp_", "=_", "sp_", "._", "appl", "y", "Spar", "se", "Filter_", "(_", "kern", "s_", "[_", "1_", "]_", ",_", "ksh", "p_", "[_", "1_", "]_", ",_", "nke", "rn", "s_", "[_", "1_", "]_", ",_", "l1", "hid_", ",_", "l1", "outs", "hp_", ",_", "ss_", ",_", "mode_", "=_", "conv", "\\u", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "l1", "prop", "up_", "=_", "function_", "(_", "[_", "kern", "s_", "[_", "0_", "]_", ",_", "input_", "]_", ",_", "l1", "hid_", ",_", "mode_", "=_", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l2", "prop", "up_", "=_", "function_", "(_", "[_", "kern", "s_", "[_", "1_", "]_", ",_", "l1", "hid_", "]_", ",_", "l2", "hid_", ",_", "mode_", "=_", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "actual", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "l1", "kern", "vals_", "=_", "numpy_", "._", "arange_", "(_", "numpy_", "._", "prod_", "(_", "l1", "outs", "hp_", ")_", "*_", "numpy_", "._", "prod_", "(_", "ksh", "p_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l2", "kern", "vals_", "=_", "numpy_", "._", "arange_", "(_", "numpy_", "._", "prod_", "(_", "l2", "outs", "hp_", ")_", "*_", "numpy_", "._", "prod_", "(_", "ksh", "p_", "[_", "1_", "]_", ")_", "*_", "nke", "rn", "s_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l1", "hid", "val_", "=_", "l1", "prop", "up_", "(_", "l1", "kern", "vals_", ",_", "img", "1d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l2", "hid", "val_", "=_", "l2", "prop", "up_", "(_", "l2", "kern", "vals_", ",_", "l1", "hid", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "SP_", "(_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "multil", "aye", "r", "\\u", "conv_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "fixed", " ", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bsi", "ze_", "=_", "10_", "#", " ", "batch", " ", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ims", "hp_", "=_", "(_", "5_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ksh", "p_", "=_", "(_", "(_", "3_", ",_", "3_", ")_", ",_", "(_", "2_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nke", "rn", "s_", "=_", "(_", "3_", ",_", "6_", ")_", "#", " ", "per", " ", "output", " ", "pixel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ssi", "zes", "_", "=_", "(_", "(_", "(_", "1_", ",_", "1_", ")_", ",_", "(_", "2_", ",_", "2_", ")_", ")_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conv", "modes_", "=_", "(_", "'", "full", "'_", ",_", ")_", "#", " ", "'", "valid", "',", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "symbolic", " ", "stuff_", "\\u\\u\\uNL\\u\\u\\u_", "kern", "s_", "=_", "[_", "tensor_", "._", "dma", "trix_", "(_", ")_", ",_", "tensor_", "._", "dma", "trix_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input_", "=_", "tensor_", "._", "dma", "trix_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rng_", "=_", "numpy_", "._", "random_", "._", "Random", "State_", "(_", "342", "348", "9_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "build", " ", "actual", " ", "input", " ", "images_", "\\u\\u\\uNL\\u\\u\\u_", "img", "2d_", "=_", "numpy_", "._", "arange_", "(_", "bsi", "ze_", "*_", "numpy_", "._", "prod_", "(_", "ims", "hp_", ")_", ")_", "._", "reshape_", "(_", "(_", "bsi", "ze_", ",_", ")_", "+_", "ims", "hp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img", "1d_", "=_", "img", "2d_", "._", "reshape_", "(_", "bsi", "ze_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "mode_", "in_", "(_", "'", "FAST", "\\u", "COMPIL", "E", "'_", ",_", "'", "FAST", "\\u", "RUN", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "conv", "\\u", "mode_", "in_", "conv", "modes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "ss_", "in_", "ssi", "zes", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "l1", "hid_", ",_", "l1", "shp_", "=_", "sp_", "._", "convolve", "_", "(_", "kern", "s_", "[_", "0_", "]_", ",_", "ksh", "p_", "[_", "0_", "]_", ",_", "nke", "rn", "s_", "[_", "0_", "]_", ",_", "input_", ",_", "ims", "hp_", ",_", "ss_", "[_", "0_", "]_", ",_", "mode_", "=_", "conv", "\\u", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l1", "prop", "up_", "=_", "function_", "(_", "[_", "kern", "s_", "[_", "0_", "]_", ",_", "input_", "]_", ",_", "l1", "hid_", ",_", "mode_", "=_", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "l1", "kern", "vals", " ", "=", " ", "nump", "y", ".", "random", ".", "rand", "(", "nke", "rn", "s", "[", "0", "],", "nump", "y", ".", "prod", "(", "ksh", "p", "[", "0", "]))", "_", "\\u\\u\\uNL\\u\\u\\u_", "l1", "kern", "vals_", "=_", "numpy_", "._", "arange_", "(_", "nke", "rn", "s_", "[_", "0_", "]_", "*_", "numpy_", "._", "prod_", "(_", "ksh", "p_", "[_", "0_", "]_", ")_", ")_", "._", "reshape_", "(_", "nke", "rn", "s_", "[_", "0_", "]_", ",_", "numpy_", "._", "prod_", "(_", "ksh", "p_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l1", "hid", "val_", "=_", "l1", "prop", "up_", "(_", "l1", "kern", "vals_", ",_", "img", "1d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "actual", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "l2", "hid_", ",_", "l2", "shp_", "=_", "sp_", "._", "convolve", "_", "(_", "kern", "s_", "[_", "1_", "]_", ",_", "ksh", "p_", "[_", "1_", "]_", ",_", "nke", "rn", "s_", "[_", "1_", "]_", ",_", "l1", "hid_", ",_", "l1", "shp_", ",_", "ss_", "[_", "1_", "]_", ",_", "mode_", "=_", "conv", "\\u", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l2", "prop", "up_", "=_", "function_", "(_", "[_", "kern", "s_", "[_", "1_", "]_", ",_", "l1", "hid_", "]_", ",_", "l2", "hid_", ",_", "mode_", "=_", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "l2", "kern", "vals", " ", "=", " ", "nump", "y", ".", "random", ".", "rand", "(", "nke", "rn", "s", "[", "1", "],", "nump", "y", ".", "prod", "(", "ksh", "p", "[", "1", "])", "*", "nke", "rn", "s", "[", "0", "])", "_", "\\u\\u\\uNL\\u\\u\\u_", "l2", "kern", "vals_", "=_", "numpy_", "._", "arange_", "(_", "nke", "rn", "s_", "[_", "1_", "]_", "*_", "numpy_", "._", "prod_", "(_", "ksh", "p_", "[_", "1_", "]_", ")_", "*_", "nke", "rn", "s_", "[_", "0_", "]_", ")_", "._", "reshape_", "(_", "nke", "rn", "s_", "[_", "1_", "]_", ",_", "numpy_", "._", "prod_", "(_", "ksh", "p_", "[_", "1_", "]_", ")_", "*_", "nke", "rn", "s_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "debugg", "ing", ",", " ", "we", " ", "bring", " ", "thing", "s", " ", "back", " ", "to", " ", "integers_", "\\u\\u\\uNL\\u\\u\\u_", "l1", "hid", "val_", "=_", "numpy_", "._", "arange_", "(_", "numpy_", "._", "size_", "(_", "l1", "hid", "val_", ")_", ")_", "._", "reshape_", "(_", "l1", "hid", "val_", "._", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "l2", "hid", "val_", "=_", "l2", "prop", "up_", "(_", "l2", "kern", "vals_", ",_", "l1", "hid", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "SP_", "(_", "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", "CS", "MG", "rad_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ims", "hp_", "=_", "(_", "3_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nke", "rn_", "=_", "1_", "#", " ", "per", " ", "output", " ", "pixel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ksh", "p_", "=_", "(_", "2_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "ssi", "zes", " ", "=", " ", "((", "1", ",", "1", "),", "(", "2", ",", "2", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "ssi", "zes", "_", "=_", "(_", "(_", "1_", ",_", "1_", ")_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "conv", "mode", "s", " ", "=", " ", "('", "full", "','", "valid", "',", ")_", "\\u\\u\\uNL\\u\\u\\u_", "conv", "modes_", "=_", "(_", "'", "full", "'_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "kern", "s_", "=_", "tensor_", "._", "dv", "ector_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "indices_", "=_", "tensor_", "._", "ive", "ctor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "indp", "tr_", "=_", "tensor_", "._", "ive", "ctor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spm", "at", "\\u", "shape_", "=_", "tensor_", "._", "ive", "ctor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "mode_", "in_", "[_", "'", "FAST", "\\u", "COMPIL", "E", "'_", ",_", "'", "FAST", "\\u", "RUN", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "conv", "\\u", "mode_", "in_", "conv", "modes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "ss_", "in_", "ssi", "zes", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "ind", "vals_", ",_", "indp", "tr", "vals_", ",_", "sps", "hap", "evals_", ",_", "spt", "ype_", ",_", "outs", "hp_", ",_", "kma", "p_", "=_", "sp_", "._", "convolution", "\\u", "indices_", "._", "spars", "e\\u", "eval_", "(_", "ims", "hp_", ",_", "ksh", "p_", ",_", "nke", "rn_", ",_", "ss_", ",_", "conv", "\\u", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kv", "als_", "=_", "numpy_", "._", "random_", "._", "random_", "(_", "nke", "rn_", "*_", "numpy_", "._", "prod_", "(_", "ksh", "p_", ")_", "*_", "numpy_", "._", "prod_", "(_", "outs", "hp_", ")_", ")_", "._", "flatten_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "d_", "(_", "kern", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "return_", "theano_", "._", "sparse_", "._", "dens", "e\\u", "from", "\\u", "sparse_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "theano_", "._", "sparse_", "._", "CS", "M_", "(_", "spt", "ype_", ",_", "kma", "p_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "kern", "s_", ",_", "ind", "vals_", ",_", "indp", "tr", "vals_", ",_", "sps", "hap", "evals_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "symbolic", " ", "stuff_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "utt", "_", "._", "verify", "\\u", "grad_", "(_", "d_", ",_", "[_", "kv", "als_", "]_", ")_", "\\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, 0, 2, 2, 2, 2, 2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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
albatrossandco/brubeck_cms/brubeck/publishing/views.py
[ { "content": "# Imports from standard libraries\nfrom datetime import date\n\n# Imports from Django\nfrom django.core.paginator import EmptyPage, InvalidPage, Paginator\nfrom django.core.urlresolvers import reverse\nfrom django.contrib.sites.models import Site\nfrom django.http import Http404, HttpResponseRedirect, HttpResponsePermanentRedirect\nfrom django.template import RequestContext\nfrom django.shortcuts import get_object_or_404, render_to_response\nfrom django.utils.http import urlencode\nfrom django.views.decorators.cache import cache_page\n\n# Imports from Brubeck\nfrom brubeck.articles.models import Article\nfrom brubeck.blogs.models import Blog, Entry\nfrom brubeck.management.models import WebFront\nfrom brubeck.multimedia.models import AudioClip, Slideshow, Video\nfrom brubeck.podcasts.models import Channel, Episode\nfrom brubeck.publishing.models import Issue, Section\nfrom brubeck.tagging.models import Tag\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@cache_page(60 * 5)\ndef issue_archive(request, page=1):\n \"\"\"\n Shows a paginated list of issues.\n \"\"\"\n try:\n page = int(page)\n except ValueError:\n raise Http404\n \n site = Site.objects.get_current()\n try:\n issues = Issue.objects.filter(volume__publication__site=site)\n except:\n raise Http404\n \n archive_name = 'Issues'\n \n paginator = Paginator(issues, 20)\n \n try:\n archive_page = paginator.page(page)\n except (EmptyPage, InvalidPage):\n raise Http404\n \n page = {\n 'archive_name': archive_name,\n 'archive_page': archive_page\n }\n \n return render_to_response('publishing/archive.html', page, context_instance=RequestContext(request))", "metadata": "root.issue_archive", "header": "['module', '___EOS___']", "index": 22 }, { "content": "@cache_page(60 * 5)\ndef issue_detail(request, id=None, page=None):\n \"\"\"\n Shows a specific issue and all its contents.\n \"\"\"\n issue = get_object_or_404(Issue, id=int(id))\n \n if page:\n HttpResponsePermanentRedirect(issue.get_absolute_url())\n \n images = []\n images.extend(issue.photo_set.all())\n images.extend(issue.graphic_set.all())\n \n comics = issue.comicepisode_set.all()\n games = issue.gameanswer_set.all()\n \n page = {\n 'comics': comics,\n 'games': games,\n 'images': images,\n 'issue': issue\n }\n \n return render_to_response('publishing/issue_detail.html', page, context_instance=RequestContext(request))", "metadata": "root.issue_detail", "header": "['module', '___EOS___']", "index": 54 }, { "content": "def section_archive(request, slug=None, page=1):\n \"\"\"\n Shows a paginated list of articles for a given section.\n \"\"\"\n site = Site.objects.get_current()\n try:\n section = Section.objects.filter(publication__site=site).get(slug=slug)\n except Section.DoesNotExist:\n raise Http404\n \n archive_name = section.name\n\n try:\n page = int(page)\n except ValueError:\n raise Http404\n \n articles = Article.get_published.filter(section=section)\n paginator = Paginator(articles, 20)\n\n try:\n archive_page = paginator.page(page)\n except (EmptyPage, InvalidPage):\n raise Http404\n \n next_page_url = '/section/%s/archives/%s/' % (slug, page + 1)\n previous_page_url = '/section/%s/archives/%s/' % (slug, page - 1)\n \n page = {\n 'archive_name': archive_name,\n 'archive_page': archive_page,\n 'next_page_url': next_page_url,\n 'previous_page_url': previous_page_url,\n 'section': section\n }\n \n return render_to_response('publishing/section_archive.html', page, RequestContext(request))", "metadata": "root.section_archive", "header": "['module', '___EOS___']", "index": 80 } ]
[ { "span": "from django.core.urlresolvers import reverse", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 44 }, { "span": "from django.http import Http404, HttpResponseRedirect, HttpResponsePermanentRedirect", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 84 }, { "span": "from django.utils.http import urlencode", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 39 }, { "span": "from brubeck.blogs.models import Blog, Entry", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 44 }, { "span": "from brubeck.management.models import WebFront", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 46 }, { "span": "from brubeck.multimedia.models import AudioClip, Slideshow, Video", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 65 }, { "span": "from brubeck.podcasts.models import Channel, Episode", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 52 }, { "span": "from brubeck.tagging.models import Tag", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 38 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Imports", " ", "from", " ", "standard", " ", "libraries_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "datetime_", "import_", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Imports", " ", "from", " ", "Dj", "ang", "o_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "paginator_", "import_", "Emp", "ty", "Page_", ",_", "Inva", "lid", "Page_", ",_", "Paginator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "urlresolvers_", "import_", "reverse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "sites_", "._", "models_", "import_", "Site_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http404_", ",_", "Http", "Respons", "e", "Redirect_", ",_", "Http", "Respons", "e", "Permanent", "Redirect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "import_", "Request", "Context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "shortcuts_", "import_", "get", "\\u", "object\\u", "or", "\\u", "404_", ",_", "render", "\\u", "to", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "http_", "import_", "urlencode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "views_", "._", "decorators_", "._", "cache_", "import_", "cache", "\\u", "page_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Imports", " ", "from", " ", "Bru", "bec", "k_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "bru", "bec", "k_", "._", "articles_", "._", "models_", "import_", "Article_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bru", "bec", "k_", "._", "blogs", "_", "._", "models_", "import_", "Blog", "_", ",_", "Entry_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bru", "bec", "k_", "._", "management_", "._", "models_", "import_", "Web", "Front", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bru", "bec", "k_", "._", "multim", "edia", "_", "._", "models_", "import_", "Audi", "o", "Clip", "_", ",_", "Slide", "show_", ",_", "Video_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bru", "bec", "k_", "._", "podcast", "s_", "._", "models_", "import_", "Channel_", ",_", "Episode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bru", "bec", "k_", "._", "publishing", "_", "._", "models_", "import_", "Issue_", ",_", "Section_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bru", "bec", "k_", "._", "tagging", "_", "._", "models_", "import_", "Tag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "@_", "cache", "\\u", "page_", "(_", "60_", "*_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "issue", "\\u", "archive_", "(_", "request_", ",_", "page_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Show", "s", " ", "a", " ", "paginated", " ", "list", " ", "of", " ", "issue", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "page_", "=_", "int_", "(_", "page_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Http404_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "site_", "=_", "Site_", "._", "objects_", "._", "get", "\\u", "current_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "issues_", "=_", "Issue_", "._", "objects_", "._", "filter_", "(_", "volume", "\\u\\u", "publicat", "ion", "\\u\\u", "site_", "=_", "site_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Http404_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "archive", "\\u", "name_", "=_", "'", "Issues", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "paginator_", "=_", "Paginator_", "(_", "issues_", ",_", "20_", ")_", "\\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 ", " _", "archive", "\\u", "page_", "=_", "paginator_", "._", "page_", "(_", "page_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Emp", "ty", "Page_", ",_", "Inva", "lid", "Page_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Http404_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "page_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "archive", "\\u", "name", "'_", ":_", "archive", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "archive", "\\u", "page", "'_", ":_", "archive", "\\u", "page_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "render", "\\u", "to", "\\u", "response_", "(_", "'", "publishing", "/", "archive", ".", "html", "'_", ",_", "page_", ",_", "context", "\\u", "instance_", "=_", "Request", "Context_", "(_", "request_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "cache", "\\u", "page_", "(_", "60_", "*_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "issue", "\\u", "detail_", "(_", "request_", ",_", "id_", "=_", "None_", ",_", "page_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Show", "s", " ", "a", " ", "specific", " ", "issue", " ", "and", " ", "all", " ", "its", " ", "content", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "issue_", "=_", "get", "\\u", "object\\u", "or", "\\u", "404_", "(_", "Issue_", ",_", "id_", "=_", "int_", "(_", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "page_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Http", "Respons", "e", "Permanent", "Redirect_", "(_", "issue_", "._", "get", "\\u", "abs", "olute", "\\u", "url_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "images_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "._", "extend_", "(_", "issue_", "._", "photo", "\\u", "set_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "._", "extend_", "(_", "issue_", "._", "graphic", "\\u", "set_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "comics", "_", "=_", "issue_", "._", "comic", "episode", "\\u", "set_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "games_", "=_", "issue_", "._", "game", "answer", "\\u", "set_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "page_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "comics", "'_", ":_", "comics", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "games", "'_", ":_", "games_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "images", "'_", ":_", "images_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "issue", "'_", ":_", "issue_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "render", "\\u", "to", "\\u", "response_", "(_", "'", "publishing", "/", "issue", "\\u", "deta", "il", ".", "html", "'_", ",_", "page_", ",_", "context", "\\u", "instance_", "=_", "Request", "Context_", "(_", "request_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "section", "\\u", "archive_", "(_", "request_", ",_", "slug_", "=_", "None_", ",_", "page_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Show", "s", " ", "a", " ", "paginated", " ", "list", " ", "of", " ", "article", "s", " ", "for", " ", "a", " ", "give", "n", " ", "section", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "site_", "=_", "Site_", "._", "objects_", "._", "get", "\\u", "current_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "section_", "=_", "Section_", "._", "objects_", "._", "filter_", "(_", "publicat", "ion", "\\u\\u", "site_", "=_", "site_", ")_", "._", "get_", "(_", "slug_", "=_", "slug_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Section_", "._", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Http404_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "archive", "\\u", "name_", "=_", "section_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "page_", "=_", "int_", "(_", "page_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Http404_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "articles_", "=_", "Article_", "._", "get", "\\u", "published_", "._", "filter_", "(_", "section_", "=_", "section_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "paginator_", "=_", "Paginator_", "(_", "articles_", ",_", "20_", ")_", "\\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 ", " _", "archive", "\\u", "page_", "=_", "paginator_", "._", "page_", "(_", "page_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Emp", "ty", "Page_", ",_", "Inva", "lid", "Page_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Http404_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "next", "\\u", "page", "\\u", "url_", "=_", "'/", "section", "/", "%", "s", "/", "archives", "/", "%", "s", "/'_", "%_", "(_", "slug_", ",_", "page_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "previ", "ous", "\\u", "page", "\\u", "url_", "=_", "'/", "section", "/", "%", "s", "/", "archives", "/", "%", "s", "/'_", "%_", "(_", "slug_", ",_", "page_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "page_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "archive", "\\u", "name", "'_", ":_", "archive", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "archive", "\\u", "page", "'_", ":_", "archive", "\\u", "page_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "next", "\\u", "page", "\\u", "url", "'_", ":_", "next", "\\u", "page", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "previ", "ous", "\\u", "page", "\\u", "url", "'_", ":_", "previ", "ous", "\\u", "page", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "section", "'_", ":_", "section_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "render", "\\u", "to", "\\u", "response_", "(_", "'", "publishing", "/", "section", "\\u", "archive", ".", "html", "'_", ",_", "page_", ",_", "Request", "Context_", "(_", "request_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
ufora/ufora/test_scripts/cumulus/testCumulus.py
[ { "content": "# Copyright 2015 Ufora Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport tempfile\nimport unittest\nimport os\nimport logging\n\nimport ufora.FORA.python.FORA as FORA\n\nimport ufora.test.ClusterSimulation as ClusterSimulation\nimport ufora.test.CumulusSimulationUtils as CumulusSimulationUtils\n\nimport ufora.distributed.SharedState.Connections.ViewFactory as ViewFactory\nimport ufora.native.CallbackScheduler as CallbackScheduler\n\nimport ufora.cumulus.test.TestBase as TestBase\n\n\n\n\nif __name__ == '__main__':\n import ufora.config.Mainline as Mainline\n Mainline.UnitTestMainline([])\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class CumulusServiceTests(unittest.TestCase, TestBase.CumulusTestCases):\n", "metadata": "root.CumulusServiceTests", "header": "['module', '___EOS___']", "index": 30 }, { "content": " @classmethod\n def setUpClass(cls):\n cls.numWorkers = 2\n cls.simulator = ClusterSimulation.Simulator.createGlobalSimulator()\n cls.simulator.startService()\n cls.simulator.verifySharedStateRunning()\n\n cls.desirePublisher = cls.simulator.desirePublisher\n\n cls.desirePublisher.desireNumberOfWorkers(cls.numWorkers)\n\n FORA.initialize()\n\n cls.temporaryDirectoryName = tempfile.mkdtemp()\n cls.temporaryFileName = os.path.join(cls.temporaryDirectoryName, \"temp.dat\")\n cls.temporaryFileName2 = os.path.join(cls.temporaryDirectoryName, \"temp2.dat\")\n\n logging.info('CumulusServiceTests: getting remote gateway')\n cls.gateway = cls.simulator.createCumulusGateway(cls.simulator.callbackScheduler)\n logging.info('CumulusServiceTests: waiting for cumulus')\n CumulusSimulationUtils.waitCumulusReady(cls.gateway, cls.numWorkers)\n logging.info('CumulusServiceTests: cumulus is ready')", "metadata": "root.CumulusServiceTests.setUpClass", "header": "['class', 'CumulusServiceTests', '(', 'unittest', '.', 'TestCase', ',', 'TestBase', '.', 'CumulusTestCases', ')', ':', '___EOS___']", "index": 31 }, { "content": " @classmethod\n def tearDownClass(cls):\n cls.simulator.stopService()", "metadata": "root.CumulusServiceTests.tearDownClass", "header": "['class', 'CumulusServiceTests', '(', 'unittest', '.', 'TestCase', ',', 'TestBase', '.', 'CumulusTestCases', ')', ':', '___EOS___']", "index": 54 } ]
[ { "span": "import ufora.distributed.SharedState.Connections.ViewFactory as ViewFactory", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 75 }, { "span": "import ufora.native.CallbackScheduler as CallbackScheduler", "start_line": 25, "start_column": 0, "end_line": 25, "end_column": 58 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", " ", " ", "Copy", "right", " ", "201", "5", " ", "Uf", "ora", " ", "Inc", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "ufo", "ra_", "._", "FOR", "A_", "._", "python_", "._", "FOR", "A_", "as_", "FOR", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "ufo", "ra_", "._", "test_", "._", "Cluster", "Simulation_", "as_", "Cluster", "Simulation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "ufo", "ra_", "._", "test_", "._", "Cum", "ulus", "Simul", "ation", "Utils_", "as_", "Cum", "ulus", "Simul", "ation", "Utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "ufo", "ra_", "._", "distributed", "_", "._", "Share", "d", "State_", "._", "Connections_", "._", "View", "Factory_", "as_", "View", "Factory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "ufo", "ra_", "._", "native_", "._", "Call", "back", "Scheduler_", "as_", "Call", "back", "Scheduler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "ufo", "ra_", "._", "cumul", "us_", "._", "test_", "._", "Test", "Base_", "as_", "Test", "Base_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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 ", " _", "import_", "ufo", "ra_", "._", "config_", "._", "Main", "line_", "as_", "Main", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Main", "line_", "._", "Unit", "Test", "Main", "line_", "(_", "[_", "]_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Cum", "ulus", "Service", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ",_", "Test", "Base_", "._", "Cum", "ulus", "Test", "Cases_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Cum", "ulus", "Service", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ",_", "Test", "Base_", "._", "Cum", "ulus", "Test", "Cases_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\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_", "._", "num", "Worke", "rs_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "simulator_", "=_", "Cluster", "Simulation_", "._", "Simulator_", "._", "create", "Global", "Simulator_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "simulator_", "._", "start", "Service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "simulator_", "._", "verify", "Share", "d", "State", "Running_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cls_", "._", "desi", "re", "Publisher_", "=_", "cls_", "._", "simulator_", "._", "desi", "re", "Publisher_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cls_", "._", "desi", "re", "Publisher_", "._", "desi", "re", "Number", "Of", "Worke", "rs_", "(_", "cls_", "._", "num", "Worke", "rs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "FOR", "A_", "._", "initialize_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cls_", "._", "temporar", "y", "Director", "y", "Name_", "=_", "tempfile_", "._", "mkdtemp_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "temporar", "y", "File", "Name_", "=_", "os_", "._", "path_", "._", "join_", "(_", "cls_", "._", "temporar", "y", "Director", "y", "Name_", ",_", "\"", "temp", ".", "dat", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "temporar", "y", "File", "Name", "2_", "=_", "os_", "._", "path_", "._", "join_", "(_", "cls_", "._", "temporar", "y", "Director", "y", "Name_", ",_", "\"", "temp", "2", ".", "dat", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logging_", "._", "info_", "(_", "'", "Cum", "ulus", "Service", "Test", "s", ":", " ", "getti", "ng", " ", "remote", " ", "gateway", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "gateway_", "=_", "cls_", "._", "simulator_", "._", "create", "Cum", "ulus", "Gateway_", "(_", "cls_", "._", "simulator_", "._", "callback", "Scheduler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "'", "Cum", "ulus", "Service", "Test", "s", ":", " ", "wait", "ing", " ", "for", " ", "cumul", "us", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Cum", "ulus", "Simul", "ation", "Utils_", "._", "wait", "Cum", "ulus", "Ready_", "(_", "cls_", "._", "gateway_", ",_", "cls_", "._", "num", "Worke", "rs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "'", "Cum", "ulus", "Service", "Test", "s", ":", " ", "cumul", "us", " ", "is", " ", "read", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cum", "ulus", "Service", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ",_", "Test", "Base_", "._", "Cum", "ulus", "Test", "Cases_", ")_", ":_", "\\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_", "._", "simulator_", "._", "stop", "Service_", "(_", ")_", "\\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,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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
numb3r3/crawler-python/dp_crawler.py
[ { "content": "#!/usr/bin/env python\n#-*- coding: utf-8 -*-\n'''\nCopyright (c) 2014 Feng Wang <wffrank1987@gmail.com>\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou 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\nfrom crawler.contrib.dpreviews import *\n\nfrom optparse import OptionParser\nimport os\nimport time\nimport pprint\nimport logging\n\nlogger = logging.getLogger(__name__)\nlogger.addHandler(logging.StreamHandler())\nlogger.setLevel(logging.DEBUG)\n\n\nusage = \"usage %prog [options] arg\"\nparser = OptionParser(usage=usage)\nparser.add_option('-s', \"--seed\", dest=\"initial search url\",\n help=\"the initial search url\")\nparser.add_option(\"-o\", \"--output\", dest=\"output_dir\",\n help=\"write out to DIR\")\nparser.add_option(\"-v\", \"--verbose\", action=\"store_true\", dest=\"verbose\")\nparser.add_option(\"-q\", \"--quiet\", action=\"store_false\", dest=\"verbose\")\n\n(options, args) = parser.parse_args()\n\n \nif __name__ == \"__main__\":\n main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def main():\n\n proxies = {'http': 'http://23.244.180.162:8089', 'https': 'http://23.244.180.162:8089'}\n\n socket_proxies = {'http': 'socket5://1.ss.shadowsocks.net:65535', 'https': 'http://23.244.180.162:8089'}\n\n \n\n techs = dp_specs(\"http://www.dpreview.com/products/panasonic/compacts/panasonic_dmcsz3/specifications\")\n print \"<table>\"\n for k in techs.keys():\n print \"<thead><tr><th>%s<th></tr></thead>\" % k\n print \"<tbody>\"\n for key, value in techs[k]:\n print '<tr><td>%s</td><td>%s</td></tr>' % (key, value)\n print \"</tbody>\"\n # for k in techs:\n # print '<tr><td>%s</td><td>%s</td></tr>' % (k, techs[k].encode('ascii', \"ignore\"))\n print \"</table>\"\n # for dirname, dirnames, filenames in os.walk('D:\\workspace\\camera\\small'):\n # for filename in filenames:\n # file_path = os.path.join(dirname, filename)\n \n # pid = filename[:-5]\n # if not os.path.isfile(os.path.join(\"D:\\workspace\\camera\\images\", pid) + \".jpg\"):\n # amazon_prd_img(pid, \"D:\\workspace\\camera\\images\")\n\n # print pid", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 42 } ]
[ { "span": "import os", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 9 }, { "span": "import time", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 11 }, { "span": "import pprint", "start_line": 23, "start_column": 0, "end_line": 23, "end_column": 13 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "\\", "10", ";", "Copy", "right", " ", "(", "c", ")", " ", "2014", " ", "Fen", "g", " ", "Wan", "g", " ", "<", "wf", "fran", "k", "1987", "@", "gma", "il", ".", "com", ">", "\\", "10", ";", "\\", "10", ";", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", "\\", "10", ";", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", ".", "\\", "10", ";", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", "\\", "10", ";", " ", " ", " ", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",", "\\", "10", ";", " ", " ", " ", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", ".", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "crawler_", "._", "contrib_", "._", "dpr", "evi", "ew", "s_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "optparse_", "import_", "Optio", "n", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pprint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "add", "Handler_", "(_", "logging_", "._", "Stream", "Handler_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "set", "Level_", "(_", "logging_", "._", "DEBUG_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "usage_", "=_", "\"", "usage", " ", "%", "prog", " ", "[", "options", "]", " ", "arg", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "=_", "Optio", "n", "Parser_", "(_", "usage_", "=_", "usage_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "s", "'_", ",_", "\"--", "seed", "\"_", ",_", "dest_", "=_", "\"", "initial", " ", "search", " ", "url", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "the", " ", "initial", " ", "search", " ", "url", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "o", "\"_", ",_", "\"--", "output", "\"_", ",_", "dest_", "=_", "\"", "output", "\\u", "dir", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "write", " ", "out", " ", "to", " ", "DIR", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "v", "\"_", ",_", "\"--", "verbo", "se", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "verbo", "se", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "q", "\"_", ",_", "\"--", "quie", "t", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "fal", "se", "\"_", ",_", "dest_", "=_", "\"", "verbo", "se", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "options_", ",_", "args_", ")_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "proxies_", "=_", "{_", "'", "http", "'_", ":_", "'", "http", "://", "23.", "244", ".1", "80.", "162", ":", "808", "9", "'_", ",_", "'", "https", "'_", ":_", "'", "http", "://", "23.", "244", ".1", "80.", "162", ":", "808", "9", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "socket", "\\u", "proxies_", "=_", "{_", "'", "http", "'_", ":_", "'", "socket", "5", "://", "1", ".", "ss", ".", "shadow", "socks", ".", "net", ":", "6553", "5", "'_", ",_", "'", "https", "'_", ":_", "'", "http", "://", "23.", "244", ".1", "80.", "162", ":", "808", "9", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tech", "s_", "=_", "dp", "\\u", "specs_", "(_", "\"", "http", "://", "www", ".", "dpr", "evi", "ew", ".", "com", "/", "products", "/", "pan", "aso", "nic", "/", "compact", "s", "/", "pan", "aso", "nic", "\\u", "dm", "cs", "z3", "/", "specifica", "tion", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"<", "table", ">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "tech", "s_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"<", "thea", "d", "><", "tr", "><", "th", ">", "%", "s", "<", "th", "><", "/", "tr", "><", "/", "thea", "d", ">\"_", "%_", "k_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"<", "tbo", "dy", ">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "tech", "s_", "[_", "k_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'<", "tr", "><", "td", ">", "%", "s", "</", "td", "><", "td", ">", "%", "s", "</", "td", "><", "/", "tr", ">'_", "%_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"<", "/", "tbo", "dy", ">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "k", " ", "in", " ", "tech", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'<", "tr", "><", "td", ">", "%", "s", "</", "td", "><", "td", ">", "%", "s", "</", "td", "><", "/", "tr", ">'", " ", "%", " ", "(", "k", ",", " ", "tech", "s", "[", "k", "].", "encode", "('", "ascii", "',", " ", "\"", "ignore", "\"))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"<", "/", "table", ">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "dir", "name", ",", " ", "dir", "names", ",", " ", "filename", "s", " ", "in", " ", "os", ".", "walk", "('", "D", ":\\\\", "works", "pace", "\\\\", "came", "ra", "\\\\", "small", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "filename", " ", "in", " ", "filename", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "file", "\\u", "path", " ", "=", " ", "os", ".", "path", ".", "join", "(", "dir", "name", ",", " ", "filename", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "pid", " ", "=", " ", "filename", "[:", "-", "5", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "if", " ", "not", " ", "os", ".", "path", ".", "isfi", "le", "(", "os", ".", "path", ".", "join", "(\"", "D", ":\\\\", "works", "pace", "\\\\", "came", "ra", "\\\\", "images", "\",", " ", "pid", ")", " ", "+", " ", "\".", "jp", "g", "\"):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "amaz", "on", "\\u", "prd", "\\u", "img", "(", "pid", ",", " ", "\"", "D", ":\\\\", "works", "pace", "\\\\", "came", "ra", "\\\\", "images", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "print", " ", "pid_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
ipython/ipython-py3k/IPython/parallel/engine/streamkernel.py
[ { "content": " def dispatch_control(self, msg):\n idents,msg = self.session.feed_identities(msg, copy=False)\n try:\n msg = self.session.unpack_message(msg, content=True, copy=False)\n except:\n self.log.error(\"Invalid Message\", exc_info=True)\n return\n else:\n self.log.debug(\"Control received, %s\", msg)\n \n header = msg['header']\n msg_id = header['msg_id']\n \n handler = self.control_handlers.get(msg['msg_type'], None)\n if handler is None:\n self.log.error(\"UNKNOWN CONTROL MESSAGE TYPE: %r\"%msg['msg_type'])\n else:\n handler(self.control_stream, idents, msg)", "metadata": "root.Kernel.dispatch_control", "header": "['class', 'Kernel', '(', 'SessionFactory', ')', ':', '___NEWLINE___', '___NL___', '#---------------------------------------------------------------------------', '___NL___', '# Kernel interface', '___NL___', '#---------------------------------------------------------------------------', '___NL___', '___NL___', '# kwargs:', '___NL___', '___EOS___']", "index": 194 }, { "content": " def clear_request(self, stream, idents, parent):\n \"\"\"Clear our namespace.\"\"\"\n self.user_ns = {}\n msg = self.session.send(stream, 'clear_reply', ident=idents, parent=parent, \n content = dict(status='ok'))\n self._initial_exec_lines()", "metadata": "root.Kernel.clear_request", "header": "['class', 'Kernel', '(', 'SessionFactory', ')', ':', '___NEWLINE___', '___NL___', '#---------------------------------------------------------------------------', '___NL___', '# Kernel interface', '___NL___', '#---------------------------------------------------------------------------', '___NL___', '___NL___', '# kwargs:', '___NL___', '___EOS___']", "index": 242 }, { "content": " def complete_request(self, stream, ident, parent):\n matches = {'matches' : self.complete(parent),\n 'status' : 'ok'}\n completion_msg = self.session.send(stream, 'complete_reply',\n matches, parent, ident)\n # print >> sys.__stdout__, completion_msg", "metadata": "root.Kernel.complete_request", "header": "['class', 'Kernel', '(', 'SessionFactory', ')', ':', '___NEWLINE___', '___NL___', '#---------------------------------------------------------------------------', '___NL___', '# Kernel interface', '___NL___', '#---------------------------------------------------------------------------', '___NL___', '___NL___', '# kwargs:', '___NL___', '___EOS___']", "index": 282 }, { "content": " def apply_request(self, stream, ident, parent):\n # flush previous reply, so this request won't block it\n stream.flush(zmq.POLLOUT)\n try:\n content = parent['content']\n bufs = parent['buffers']\n msg_id = parent['header']['msg_id']\n # bound = parent['header'].get('bound', False)\n except:\n self.log.error(\"Got bad msg: %s\"%parent, exc_info=True)\n return\n # pyin_msg = self.session.msg(u'pyin',{u'code':code}, parent=parent)\n # self.iopub_stream.send(pyin_msg)\n # self.session.send(self.iopub_stream, u'pyin', {u'code':code},parent=parent)\n sub = {'dependencies_met' : True, 'engine' : self.ident,\n 'started': datetime.now()}\n try:\n # allow for not overriding displayhook\n if hasattr(sys.displayhook, 'set_parent'):\n sys.displayhook.set_parent(parent)\n sys.stdout.set_parent(parent)\n sys.stderr.set_parent(parent)\n # exec \"f(*args,**kwargs)\" in self.user_ns, self.user_ns\n working = self.user_ns\n # suffix = \n prefix = \"_\"+str(msg_id).replace(\"-\",\"\")+\"_\"\n \n f,args,kwargs = unpack_apply_message(bufs, working, copy=False)\n # if bound:\n # bound_ns = Namespace(working)\n # args = [bound_ns]+list(args)\n\n fname = getattr(f, '__name__', 'f')\n \n fname = prefix+\"f\"\n argname = prefix+\"args\"\n kwargname = prefix+\"kwargs\"\n resultname = prefix+\"result\"\n \n ns = { fname : f, argname : args, kwargname : kwargs , resultname : None }\n # print ns\n working.update(ns)\n code = \"%s=%s(*%s,**%s)\"%(resultname, fname, argname, kwargname)\n try:\n exec(code, working,working)\n result = working.get(resultname)\n finally:\n for key in ns.keys():\n working.pop(key)\n # if bound:\n # working.update(bound_ns)\n \n packed_result,buf = serialize_object(result)\n result_buf = [packed_result]+buf\n except:\n exc_content = self._wrap_exception('apply')\n # exc_msg = self.session.msg(u'pyerr', exc_content, parent)\n self.session.send(self.iopub_stream, 'pyerr', exc_content, parent=parent,\n ident=asbytes('%s.pyerr'%self.prefix))\n reply_content = exc_content\n result_buf = []\n \n if exc_content['ename'] == 'UnmetDependency':\n sub['dependencies_met'] = False\n else:\n reply_content = {'status' : 'ok'}\n \n # put 'ok'/'error' status in header, for scheduler introspection:\n sub['status'] = reply_content['status']\n \n reply_msg = self.session.send(stream, 'apply_reply', reply_content, \n parent=parent, ident=ident,buffers=result_buf, subheader=sub)\n \n # flush i/o\n # should this be before reply_msg is sent, like in the single-kernel code, \n # or should nothing get in the way of real results?\n sys.stdout.flush()\n sys.stderr.flush()", "metadata": "root.Kernel.apply_request", "header": "['class', 'Kernel', '(', 'SessionFactory', ')', ':', '___NEWLINE___', '___NL___', '#---------------------------------------------------------------------------', '___NL___', '# Kernel interface', '___NL___', '#---------------------------------------------------------------------------', '___NL___', '___NL___', '# kwargs:', '___NL___', '___EOS___']", "index": 292 }, { "content": " def dispatch_queue(self, stream, msg):\n self.control_stream.flush()\n idents,msg = self.session.feed_identities(msg, copy=False)\n try:\n msg = self.session.unpack_message(msg, content=True, copy=False)\n except:\n self.log.error(\"Invalid Message\", exc_info=True)\n return\n else:\n self.log.debug(\"Message received, %s\", msg)\n \n \n header = msg['header']\n msg_id = header['msg_id']\n if self.check_aborted(msg_id):\n self.aborted.remove(msg_id)\n # is it safe to assume a msg_id will not be resubmitted?\n reply_type = msg['msg_type'].split('_')[0] + '_reply'\n status = {'status' : 'aborted'}\n reply_msg = self.session.send(stream, reply_type, subheader=status,\n content=status, parent=msg, ident=idents)\n return\n handler = self.shell_handlers.get(msg['msg_type'], None)\n if handler is None:\n self.log.error(\"UNKNOWN MESSAGE TYPE: %r\"%msg['msg_type'])\n else:\n handler(stream, idents, msg)", "metadata": "root.Kernel.dispatch_queue", "header": "['class', 'Kernel', '(', 'SessionFactory', ')', ':', '___NEWLINE___', '___NL___', '#---------------------------------------------------------------------------', '___NL___', '# Kernel interface', '___NL___', '#---------------------------------------------------------------------------', '___NL___', '___NL___', '# kwargs:', '___NL___', '___EOS___']", "index": 371 } ]
[ { "span": "msg_id ", "start_line": 205, "start_column": 8, "end_line": 205, "end_column": 14 }, { "span": "msg ", "start_line": 245, "start_column": 8, "end_line": 245, "end_column": 11 }, { "span": "completion_msg ", "start_line": 285, "start_column": 8, "end_line": 285, "end_column": 22 }, { "span": "content ", "start_line": 296, "start_column": 12, "end_line": 296, "end_column": 19 }, { "span": "reply_msg ", "start_line": 362, "start_column": 8, "end_line": 362, "end_column": 17 }, { "span": "reply_msg ", "start_line": 390, "start_column": 12, "end_line": 390, "end_column": 21 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Kernel_", "(_", "Sess", "ion", "Factory_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "----", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Kern", "el", " ", "interface_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "kwarg", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dispatch", "\\u", "control_", "(_", "self_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ident", "s_", ",_", "msg_", "=_", "self_", "._", "session_", "._", "feed", "\\u", "identities", "_", "(_", "msg_", ",_", "copy_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "self_", "._", "session_", "._", "unpack", "\\u", "message_", "(_", "msg_", ",_", "content_", "=_", "True_", ",_", "copy_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "log_", "._", "error_", "(_", "\"", "Inva", "lid", " ", "Messag", "e", "\"_", ",_", "exc", "\\u", "info_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "log_", "._", "debug_", "(_", "\"", "Control", " ", "receive", "d", ",", " ", "%", "s", "\"_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "header_", "=_", "msg_", "[_", "'", "header", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg", "\\u", "id_", "=_", "header_", "[_", "'", "msg", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "handler_", "=_", "self_", "._", "control", "\\u", "handlers_", "._", "get_", "(_", "msg_", "[_", "'", "msg", "\\u", "type", "'_", "]_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "handler_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "log_", "._", "error_", "(_", "\"", "UNK", "NOW", "N", " ", "CONTR", "OL", " ", "MESSAGE", " ", "TYPE", ":", " ", "%", "r", "\"_", "%_", "msg_", "[_", "'", "msg", "\\u", "type", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handler_", "(_", "self_", "._", "control", "\\u", "stream_", ",_", "ident", "s_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Kernel_", "(_", "Sess", "ion", "Factory_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "----", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Kern", "el", " ", "interface_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "kwarg", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "\\u", "request_", "(_", "self_", ",_", "stream_", ",_", "ident", "s_", ",_", "parent_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Clear", " ", "our", " ", "namespace", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "user", "\\u", "ns_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "self_", "._", "session_", "._", "send_", "(_", "stream_", ",_", "'", "clear", "\\u", "repl", "y", "'_", ",_", "ident_", "=_", "ident", "s_", ",_", "parent_", "=_", "parent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "content_", "=_", "dict_", "(_", "status_", "=_", "'", "ok", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "initial", "\\u", "exec", "\\u", "lines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Kernel_", "(_", "Sess", "ion", "Factory_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "----", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Kern", "el", " ", "interface_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "kwarg", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "complete", "\\u", "request_", "(_", "self_", ",_", "stream_", ",_", "ident_", ",_", "parent_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "matches_", "=_", "{_", "'", "matche", "s", "'_", ":_", "self_", "._", "complete_", "(_", "parent_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "ok", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "completion", "\\u", "msg_", "=_", "self_", "._", "session_", "._", "send_", "(_", "stream_", ",_", "'", "complete", "\\u", "repl", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "matches_", ",_", "parent_", ",_", "ident_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", ">>", " ", "sys", ".\\u", "\\u", "stdout", "\\u\\u", ",", " ", "completion", "\\u", "msg_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Kernel_", "(_", "Sess", "ion", "Factory_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "----", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Kern", "el", " ", "interface_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "kwarg", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "appl", "y", "\\u", "request_", "(_", "self_", ",_", "stream_", ",_", "ident_", ",_", "parent_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "flush", " ", "previ", "ous", " ", "repl", "y", ",", " ", "so", " ", "this", " ", "request", " ", "won", "'", "t", " ", "block", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stream_", "._", "flush_", "(_", "zmq_", "._", "POLL", "OUT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", "=_", "parent_", "[_", "'", "content", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "buf", "s_", "=_", "parent_", "[_", "'", "buffer", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg", "\\u", "id_", "=_", "parent_", "[_", "'", "header", "'_", "]_", "[_", "'", "msg", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "bound", " ", "=", " ", "parent", "['", "header", "']", ".", "get", "('", "bound", "',", " ", "Fal", "se", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "log_", "._", "error_", "(_", "\"", "Got", " ", "bad", " ", "msg", ":", " ", "%", "s", "\"_", "%_", "parent_", ",_", "exc", "\\u", "info_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "pyi", "n", "\\u", "msg", " ", "=", " ", "self", ".", "session", ".", "msg", "(", "u", "'", "pyi", "n", "',", "{", "u", "'", "code", "':", "code", "},", " ", "parent", "=", "parent", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "iop", "ub", "\\u", "stream", ".", "send", "(", "pyi", "n", "\\u", "msg", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "session", ".", "send", "(", "self", ".", "iop", "ub", "\\u", "stream", ",", " ", "u", "'", "pyi", "n", "',", " ", "{", "u", "'", "code", "':", "code", "},", "parent", "=", "parent", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sub_", "=_", "{_", "'", "dependen", "cies", "\\u", "met", "'_", ":_", "True_", ",_", "'", "eng", "ine", "'_", ":_", "self_", "._", "ident_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", "ed", "'_", ":_", "datetime_", "._", "now_", "(_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "allow", " ", "for", " ", "not", " ", "overrid", "ing", " ", "display", "hook_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "sys_", "._", "display", "hook_", ",_", "'", "set\\u", "parent", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "display", "hook_", "._", "set\\u", "parent_", "(_", "parent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "set\\u", "parent_", "(_", "parent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stderr_", "._", "set\\u", "parent_", "(_", "parent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "exec", " ", "\"", "f", "(*", "args", ",*", "*", "kwarg", "s", ")\"", " ", "in", " ", "self", ".", "user", "\\u", "ns", ",", " ", "self", ".", "user", "\\u", "ns_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "working", "_", "=_", "self_", "._", "user", "\\u", "ns_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "suff", "ix", " ", "=", " _", "\\u\\u\\uNL\\u\\u\\u_", "prefix_", "=_", "\"\\u\"_", "+_", "str_", "(_", "msg", "\\u", "id_", ")_", "._", "replace_", "(_", "\"-\"_", ",_", "\"\"_", ")_", "+_", "\"\\u\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", ",_", "args_", ",_", "kwargs_", "=_", "unpack", "\\u", "appl", "y", "\\u", "message_", "(_", "buf", "s_", ",_", "working", "_", ",_", "copy_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "bound", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bound", "\\u", "ns", " ", "=", " ", "Names", "pace", "(", "working", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "args", " ", "=", " ", "[", "bound", "\\u", "ns", "]+", "list", "(", "args", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fname_", "=_", "getattr_", "(_", "f_", ",_", "'\\u", "\\u", "name", "\\u\\u'_", ",_", "'", "f", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fname_", "=_", "prefix_", "+_", "\"", "f", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "argname", "_", "=_", "prefix_", "+_", "\"", "args", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwarg", "name_", "=_", "prefix_", "+_", "\"", "kwarg", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result", "name_", "=_", "prefix_", "+_", "\"", "result", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ns_", "=_", "{_", "fname_", ":_", "f_", ",_", "argname", "_", ":_", "args_", ",_", "kwarg", "name_", ":_", "kwargs_", ",_", "result", "name_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "ns_", "\\u\\u\\uNL\\u\\u\\u_", "working", "_", "._", "update_", "(_", "ns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "code_", "=_", "\"%", "s", "=", "%", "s", "(*", "%", "s", ",*", "*", "%", "s", ")\"_", "%_", "(_", "result", "name_", ",_", "fname_", ",_", "argname", "_", ",_", "kwarg", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exec_", "(_", "code_", ",_", "working", "_", ",_", "working", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "working", "_", "._", "get_", "(_", "result", "name_", ")_", "\\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 ", " _", "for_", "key_", "in_", "ns_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "working", "_", "._", "pop_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "bound", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "working", ".", "update", "(", "bound", "\\u", "ns", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pack", "ed", "\\u", "result_", ",_", "buf_", "=_", "serialize", "\\u", "object_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result", "\\u", "buf_", "=_", "[_", "pack", "ed", "\\u", "result_", "]_", "+_", "buf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exc", "\\u", "content_", "=_", "self_", "._", "\\u", "wrap", "\\u", "exception_", "(_", "'", "appl", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "exc", "\\u", "msg", " ", "=", " ", "self", ".", "session", ".", "msg", "(", "u", "'", "pye", "rr", "',", " ", "exc", "\\u", "content", ",", " ", "parent", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "session_", "._", "send_", "(_", "self_", "._", "iop", "ub", "\\u", "stream_", ",_", "'", "pye", "rr", "'_", ",_", "exc", "\\u", "content_", ",_", "parent_", "=_", "parent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ident_", "=_", "as", "bytes_", "(_", "'%", "s", ".", "pye", "rr", "'_", "%_", "self_", "._", "prefix_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repl", "y", "\\u", "content_", "=_", "exc", "\\u", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result", "\\u", "buf_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "exc", "\\u", "content_", "[_", "'", "ena", "me", "'_", "]_", "==_", "'", "Un", "met", "Dependenc", "y", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sub_", "[_", "'", "dependen", "cies", "\\u", "met", "'_", "]_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "repl", "y", "\\u", "content_", "=_", "{_", "'", "status", "'_", ":_", "'", "ok", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "put", " ", "'", "ok", "'/'", "error", "'", " ", "status", " ", "in", " ", "header", ",", " ", "for", " ", "schedule", "r", " ", "introspect", "ion", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sub_", "[_", "'", "status", "'_", "]_", "=_", "repl", "y", "\\u", "content_", "[_", "'", "status", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "repl", "y", "\\u", "msg_", "=_", "self_", "._", "session_", "._", "send_", "(_", "stream_", ",_", "'", "appl", "y", "\\u", "repl", "y", "'_", ",_", "repl", "y", "\\u", "content_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "parent_", "=_", "parent_", ",_", "ident_", "=_", "ident_", ",_", "buffers_", "=_", "result", "\\u", "buf_", ",_", "sub", "header_", "=_", "sub_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flush", " ", "i", "/", "o_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "shou", "ld", " ", "this", " ", "be", " ", "bef", "ore", " ", "repl", "y", "\\u", "msg", " ", "is", " ", "sent", ",", " ", "like", " ", "in", " ", "the", " ", "single", "-", "kernel", " ", "code", ",", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "or", " ", "shou", "ld", " ", "not", "hing", " ", "get", " ", "in", " ", "the", " ", "way", " ", "of", " ", "real", " ", "results", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "stdout_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stderr_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Kernel_", "(_", "Sess", "ion", "Factory_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "----", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Kern", "el", " ", "interface_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "kwarg", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dispatch", "\\u", "queue_", "(_", "self_", ",_", "stream_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "control", "\\u", "stream_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ident", "s_", ",_", "msg_", "=_", "self_", "._", "session_", "._", "feed", "\\u", "identities", "_", "(_", "msg_", ",_", "copy_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "self_", "._", "session_", "._", "unpack", "\\u", "message_", "(_", "msg_", ",_", "content_", "=_", "True_", ",_", "copy_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "log_", "._", "error_", "(_", "\"", "Inva", "lid", " ", "Messag", "e", "\"_", ",_", "exc", "\\u", "info_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "log_", "._", "debug_", "(_", "\"", "Messag", "e", " ", "receive", "d", ",", " ", "%", "s", "\"_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "header_", "=_", "msg_", "[_", "'", "header", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg", "\\u", "id_", "=_", "header_", "[_", "'", "msg", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "check", "\\u", "abort", "ed_", "(_", "msg", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "abort", "ed_", "._", "remove_", "(_", "msg", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "is", " ", "it", " ", "safe", " ", "to", " ", "assume", " ", "a", " ", "msg", "\\u", "id", " ", "will", " ", "not", " ", "be", " ", "resu", "bmi", "tted", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "repl", "y", "\\u", "type_", "=_", "msg_", "[_", "'", "msg", "\\u", "type", "'_", "]_", "._", "split_", "(_", "'\\u'_", ")_", "[_", "0_", "]_", "+_", "'\\u", "repl", "y", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "{_", "'", "status", "'_", ":_", "'", "abort", "ed", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repl", "y", "\\u", "msg_", "=_", "self_", "._", "session_", "._", "send_", "(_", "stream_", ",_", "repl", "y", "\\u", "type_", ",_", "sub", "header_", "=_", "status_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "content_", "=_", "status_", ",_", "parent_", "=_", "msg_", ",_", "ident_", "=_", "ident", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "handler_", "=_", "self_", "._", "shell", "\\u", "handlers_", "._", "get_", "(_", "msg_", "[_", "'", "msg", "\\u", "type", "'_", "]_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "handler_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "log_", "._", "error_", "(_", "\"", "UNK", "NOW", "N", " ", "MESSAGE", " ", "TYPE", ":", " ", "%", "r", "\"_", "%_", "msg_", "[_", "'", "msg", "\\u", "type", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handler_", "(_", "stream_", ",_", "ident", "s_", ",_", "msg_", ")_", "\\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, 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,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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 ]
`__eq__` not overridden when adding attributes
goFrendiAsgard/kokoropy/kokoropy/packages/sqlalchemy/orm/collections.py
[ { "content": "class MappedCollection(dict):\n \"\"\"A basic dictionary-based collection class.\n\n Extends dict with the minimal bag semantics that collection\n classes require. ``set`` and ``remove`` are implemented in terms\n of a keying function: any callable that takes an object and\n returns an object for use as a dictionary key.\n\n \"\"\"\n\n\n\n", "metadata": "root.MappedCollection", "header": "['module', '___EOS___']", "index": 1481 }, { "content": " def __init__(self, keyfunc):\n \"\"\"Create a new collection with keying provided by keyfunc.\n\n keyfunc may be any callable any callable that takes an object and\n returns an object for use as a dictionary key.\n\n The keyfunc will be called every time the ORM needs to add a member by\n value-only (such as when loading instances from the database) or\n remove a member. The usual cautions about dictionary keying apply-\n ``keyfunc(object)`` should return the same output for the life of the\n collection. Keying based on mutable properties can result in\n unreachable instances \"lost\" in the collection.\n\n \"\"\"\n self.keyfunc = keyfunc", "metadata": "root.MappedCollection.__init__", "header": "['class', 'MappedCollection', '(', 'dict', ')', ':', '___EOS___']", "index": 1491 }, { "content": " @collection.appender\n @collection.internally_instrumented\n def set(self, value, _sa_initiator=None):\n \"\"\"Add an item by value, consulting the keyfunc for the key.\"\"\"\n\n key = self.keyfunc(value)\n self.__setitem__(key, value, _sa_initiator)", "metadata": "root.MappedCollection.set", "header": "['class', 'MappedCollection', '(', 'dict', ')', ':', '___EOS___']", "index": 1507 }, { "content": " @collection.remover\n @collection.internally_instrumented\n def remove(self, value, _sa_initiator=None):\n \"\"\"Remove an item by value, consulting the keyfunc for the key.\"\"\"\n\n key = self.keyfunc(value)\n # Let self[key] raise if key is not in this collection\n # testlib.pragma exempt:__ne__\n if self[key] != value:\n raise sa_exc.InvalidRequestError(\n \"Can not remove '%s': collection holds '%s' for key '%s'. \"\n \"Possible cause: is the MappedCollection key function \"\n \"based on mutable properties or properties that only obtain \"\n \"values after flush?\" %\n (value, self[key], key))\n self.__delitem__(key, _sa_initiator)", "metadata": "root.MappedCollection.remove", "header": "['class', 'MappedCollection', '(', 'dict', ')', ':', '___EOS___']", "index": 1515 }, { "content": " @collection.converter\n def _convert(self, dictlike):\n \"\"\"Validate and convert a dict-like object into values for set()ing.\n\n This is called behind the scenes when a MappedCollection is replaced\n entirely by another collection, as in::\n\n myobj.mappedcollection = {'a':obj1, 'b': obj2} # ...\n\n Raises a TypeError if the key in any (key, value) pair in the dictlike\n object does not match the key that this collection's keyfunc would\n have assigned for that value.\n\n \"\"\"\n for incoming_key, value in util.dictlike_iteritems(dictlike):\n new_key = self.keyfunc(value)\n if incoming_key != new_key:\n raise TypeError(\n \"Found incompatible key %r for value %r; this \"\n \"collection's \"\n \"keying function requires a key of %r for this value.\" % (\n incoming_key, value, new_key))\n yield value", "metadata": "root.MappedCollection._convert", "header": "['class', 'MappedCollection', '(', 'dict', ')', ':', '___EOS___']", "index": 1532 } ]
[ { "span": "class MappedCollection(dict):", "start_line": 1481, "start_column": 0, "end_line": 1481, "end_column": 29 } ]
[ { "span": "self.keyfunc ", "start_line": 1505, "start_column": 8, "end_line": 1505, "end_column": 20 } ]
1
false
[ "[CLS]_", "`_", "\\u\\u", "eq\\u\\u_", "`_", "not_", "overrid", "den_", "when_", "addin", "g_", "attributes_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Map", "ped", "Collection_", "(_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "basic", " ", "dictionar", "y", "-", "based", " ", "collection", " ", "class", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Extend", "s", " ", "dict", " ", "with", " ", "the", " ", "minima", "l", " ", "bag", " ", "semantics", " ", "tha", "t", " ", "collection", "\\", "10", ";", " ", " ", " ", " ", "classe", "s", " ", "require", ".", " ", "``", "set", "``", " ", "and", " ", "``", "remove", "``", " ", "are", " ", "implemented", " ", "in", " ", "term", "s", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "a", " ", "key", "ing", " ", "function", ":", " ", "any", " ", "calla", "ble", " ", "tha", "t", " ", "take", "s", " ", "an", " ", "object", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "return", "s", " ", "an", " ", "object", " ", "for", " ", "use", " ", "as", " ", "a", " ", "dictionar", "y", " ", "key", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Map", "ped", "Collection_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "key", "func_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Creat", "e", " ", "a", " ", "new", " ", "collection", " ", "with", " ", "key", "ing", " ", "provided", " ", "by", " ", "key", "func", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "key", "func", " ", "may", " ", "be", " ", "any", " ", "calla", "ble", " ", "any", " ", "calla", "ble", " ", "tha", "t", " ", "take", "s", " ", "an", " ", "object", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "return", "s", " ", "an", " ", "object", " ", "for", " ", "use", " ", "as", " ", "a", " ", "dictionar", "y", " ", "key", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "key", "func", " ", "will", " ", "be", " ", "call", "ed", " ", "every", " ", "time", " ", "the", " ", "ORM", " ", "need", "s", " ", "to", " ", "add", " ", "a", " ", "member", " ", "by", "\\", "10", ";", " ", " ", " ", " ", "value", "-", "only", " ", "(", "suc", "h", " ", "as", " ", "whe", "n", " ", "load", "ing", " ", "instance", "s", " ", "from", " ", "the", " ", "databa", "se", ")", " ", "or", "\\", "10", ";", " ", " ", " ", " ", "remove", " ", "a", " ", "member", ".", " ", " ", "The", " ", "usual", " ", "cau", "tion", "s", " ", "abo", "ut", " ", "dictionar", "y", " ", "key", "ing", " ", "appl", "y", "-", "\\", "10", ";", " ", " ", " ", " ", "``", "key", "func", "(", "object", ")`", "`", " ", "shou", "ld", " ", "return", " ", "the", " ", "same", " ", "output", " ", "for", " ", "the", " ", "life", " ", "of", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "collection", ".", " ", " ", "Key", "ing", " ", "based", " ", "on", " ", "mutable", " ", "proper", "ties", " ", "can", " ", "result", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "unreachable", " ", "instance", "s", " ", "\"", "lost", "\"", " ", "in", " ", "the", " ", "collection", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "key", "func_", "=_", "key", "func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Map", "ped", "Collection_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "collection_", "._", "append", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "collection_", "._", "internal", "ly", "\\u", "instrument", "ed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "set_", "(_", "self_", ",_", "value_", ",_", "\\u", "sa", "\\u", "initiator_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Add", " ", "an", " ", "item", " ", "by", " ", "value", ",", " ", "consul", "ting", " ", "the", " ", "key", "func", " ", "for", " ", "the", " ", "key", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "key_", "=_", "self_", "._", "key", "func_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "setitem\\u\\u_", "(_", "key_", ",_", "value_", ",_", "\\u", "sa", "\\u", "initiator_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Map", "ped", "Collection_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "collection_", "._", "remove", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "collection_", "._", "internal", "ly", "\\u", "instrument", "ed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "remove_", "(_", "self_", ",_", "value_", ",_", "\\u", "sa", "\\u", "initiator_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Remove", " ", "an", " ", "item", " ", "by", " ", "value", ",", " ", "consul", "ting", " ", "the", " ", "key", "func", " ", "for", " ", "the", " ", "key", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "key_", "=_", "self_", "._", "key", "func_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Let", " ", "self", "[", "key", "]", " ", "raise", " ", "if", " ", "key", " ", "is", " ", "not", " ", "in", " ", "this", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "testl", "ib", ".", "pragma", " ", "exemp", "t", ":\\u", "\\u", "ne\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "[_", "key_", "]_", "!=_", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "sa", "\\u", "exc_", "._", "Inva", "lid", "Request", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Can", " ", "not", " ", "remove", " ", "'%", "s", "':", " ", "collection", " ", "hold", "s", " ", "'%", "s", "'", " ", "for", " ", "key", " ", "'%", "s", "'.", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Poss", "ibl", "e", " ", "caus", "e", ":", " ", "is", " ", "the", " ", "Map", "ped", "Collecti", "on", " ", "key", " ", "function", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "based", " ", "on", " ", "mutable", " ", "proper", "ties", " ", "or", " ", "proper", "ties", " ", "tha", "t", " ", "only", " ", "obtain", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "values", " ", "after", " ", "flush", "?\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "value_", ",_", "self_", "[_", "key_", "]_", ",_", "key_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u\\u", "delitem\\u\\u_", "(_", "key_", ",_", "\\u", "sa", "\\u", "initiator_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Map", "ped", "Collection_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "collection_", "._", "converter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "convert_", "(_", "self_", ",_", "dict", "like_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Validate", " ", "and", " ", "convert", " ", "a", " ", "dict", "-", "like", " ", "object", " ", "int", "o", " ", "values", " ", "for", " ", "set", "()", "ing", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "call", "ed", " ", "beh", "ind", " ", "the", " ", "scenes", " ", "whe", "n", " ", "a", " ", "Map", "ped", "Collecti", "on", " ", "is", " ", "replaced", "\\", "10", ";", " ", " ", " ", " ", "entire", "ly", " ", "by", " ", "anot", "her", " ", "collection", ",", " ", "as", " ", "in", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", "myo", "bj", ".", "mapp", "edc", "olle", "ction", " ", "=", " ", "{", "'", "a", "':", "obj1", ",", " ", "'", "b", "':", " ", "obj2", "}", " ", "#", " ", "...", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", " ", "a", " ", "Type", "Error", " ", "if", " ", "the", " ", "key", " ", "in", " ", "any", " ", "(", "key", ",", " ", "value", ")", " ", "pair", " ", "in", " ", "the", " ", "dict", "like", "\\", "10", ";", " ", " ", " ", " ", "object", " ", "doe", "s", " ", "not", " ", "match", " ", "the", " ", "key", " ", "tha", "t", " ", "this", " ", "collection", "'", "s", " ", "key", "func", " ", "wou", "ld", "\\", "10", ";", " ", " ", " ", " ", "have", " ", "assign", "ed", " ", "for", " ", "tha", "t", " ", "value", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "inco", "ming", "\\u", "key_", ",_", "value_", "in_", "util_", "._", "dict", "like", "\\u", "iteritems_", "(_", "dict", "like_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "key_", "=_", "self_", "._", "key", "func_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "inco", "ming", "\\u", "key_", "!=_", "new", "\\u", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Foun", "d", " ", "incomp", "atible", " ", "key", " ", "%", "r", " ", "for", " ", "value", " ", "%", "r", ";", " ", "this", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "collection", "'", "s", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "key", "ing", " ", "function", " ", "require", "s", " ", "a", " ", "key", " ", "of", " ", "%", "r", " ", "for", " ", "this", " ", "value", ".\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "inco", "ming", "\\u", "key_", ",_", "value_", ",_", "new", "\\u", "key_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "yield_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
scipy/scipy/benchmarks/benchmarks/sparse.py
[ { "content": "\"\"\"\nSimple benchmarks for the sparse module\n\"\"\"\nfrom __future__ import division, print_function, absolute_import\n\nimport warnings\nimport time\nimport timeit\n\nimport numpy\nimport numpy as np\nfrom numpy import ones, array, asarray, empty, random, zeros\n\ntry:\n from scipy import sparse\n from scipy.sparse import (csr_matrix, coo_matrix, dia_matrix, lil_matrix,\n dok_matrix, rand, SparseEfficiencyWarning)\nexcept ImportError:\n pass\n\nfrom .common import Benchmark\n\n\n\n\n# TODO move this to a matrix gallery and add unittests\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def random_sparse(m, n, nnz_per_row):\n rows = numpy.arange(m).repeat(nnz_per_row)\n cols = numpy.random.randint(0, n, size=nnz_per_row*m)\n vals = numpy.random.random_sample(m*nnz_per_row)\n return coo_matrix((vals, (rows, cols)), (m, n)).tocsr()", "metadata": "root.random_sparse", "header": "['module', '___EOS___']", "index": 23 }, { "content": "def poisson2d(N, dtype='d', format=None):\n \"\"\"\n Return a sparse matrix for the 2D Poisson problem\n with standard 5-point finite difference stencil on a\n square N-by-N grid.\n \"\"\"\n if N == 1:\n diags = asarray([[4]], dtype=dtype)\n return dia_matrix((diags, [0]), shape=(1, 1)).asformat(format)\n\n offsets = array([0, -N, N, -1, 1])\n\n diags = empty((5, N**2), dtype=dtype)\n\n diags[0] = 4 # main diagonal\n diags[1:] = -1 # all offdiagonals\n\n diags[3, N-1::N] = 0 # first lower diagonal\n diags[4, N::N] = 0 # first upper diagonal\n\n return dia_matrix((diags, offsets), shape=(N**2, N**2)).asformat(format)", "metadata": "root.poisson2d", "header": "['module', '___EOS___']", "index": 31 }, { "content": "class Arithmetic(Benchmark):\n param_names = ['format', 'XY', 'op']\n params = [\n ['csr'],\n ['AA', 'AB', 'BA', 'BB'],\n ['__add__', '__sub__', 'multiply', '__mul__']\n ]\n\n", "metadata": "root.Arithmetic", "header": "['module', '___EOS___']", "index": 54 }, { "content": " def setup(self, format, XY, op):\n matrices = dict(A=poisson2d(250, format=format),\n B=poisson2d(250, format=format)**2)\n\n x = matrices[XY[0]]\n self.y = matrices[XY[1]]\n self.fn = getattr(x, op)\n self.fn(self.y) # warmup", "metadata": "root.Arithmetic.setup", "header": "['class', 'Arithmetic', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 62 }, { "content": " def time_arithmetic(self, format, XY, op):\n self.fn(self.y)", "metadata": "root.Arithmetic.time_arithmetic", "header": "['class', 'Arithmetic', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 71 }, { "content": "class Sort(Benchmark):\n params = ['Rand10', 'Rand25', 'Rand50', 'Rand100', 'Rand200']\n param_names = ['matrix']\n\n", "metadata": "root.Sort", "header": "['module', '___EOS___']", "index": 75 }, { "content": " def setup(self, matrix):\n n = 10000\n if matrix.startswith('Rand'):\n k = int(matrix[4:])\n self.A = random_sparse(n, n, k)\n self.A.has_sorted_indices = False\n self.A.indices[:2] = 2, 1\n else:\n raise NotImplementedError()", "metadata": "root.Sort.setup", "header": "['class', 'Sort', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 79 }, { "content": " def time_sort(self, matrix):\n \"\"\"sort CSR column indices\"\"\"\n self.A.sort_indices()", "metadata": "root.Sort.time_sort", "header": "['class', 'Sort', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 89 }, { "content": "class Matvec(Benchmark):\n params = [\n ['Identity', 'Poisson5pt', 'Block2x2', 'Block3x3'],\n ['dia', 'csr', 'csc', 'dok', 'lil', 'coo', 'bsr']\n ]\n param_names = ['matrix', 'format']\n\n", "metadata": "root.Matvec", "header": "['module', '___EOS___']", "index": 94 }, { "content": " def setup(self, matrix, format):\n if matrix == 'Identity':\n if format in ('lil', 'dok'):\n raise NotImplementedError()\n self.A = sparse.eye(10000, 10000, format=format)\n elif matrix == 'Poisson5pt':\n self.A = poisson2d(300, format=format)\n elif matrix == 'Block2x2':\n if format not in ('csr', 'bsr'):\n raise NotImplementedError()\n b = (2, 2)\n self.A = sparse.kron(poisson2d(150),\n ones(b)).tobsr(blocksize=b).asformat(format)\n elif matrix == 'Block3x3':\n if format not in ('csr', 'bsr'):\n raise NotImplementedError()\n b = (3, 3)\n self.A = sparse.kron(poisson2d(100),\n ones(b)).tobsr(blocksize=b).asformat(format)\n else:\n raise NotImplementedError()\n\n self.x = ones(self.A.shape[1], dtype=float)", "metadata": "root.Matvec.setup", "header": "['class', 'Matvec', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 101 }, { "content": " def time_matvec(self, matrix, format):\n self.A * self.x", "metadata": "root.Matvec.time_matvec", "header": "['class', 'Matvec', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 125 }, { "content": "class Matvecs(Benchmark):\n params = ['dia', 'coo', 'csr', 'csc', 'bsr']\n param_names = [\"format\"]\n\n", "metadata": "root.Matvecs", "header": "['module', '___EOS___']", "index": 129 }, { "content": " def setup(self, format):\n self.A = poisson2d(300, format=format)\n self.x = ones((self.A.shape[1], 10), dtype=self.A.dtype)", "metadata": "root.Matvecs.setup", "header": "['class', 'Matvecs', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 133 }, { "content": " def time_matvecs(self, format):\n self.A * self.x", "metadata": "root.Matvecs.time_matvecs", "header": "['class', 'Matvecs', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 137 }, { "content": "class Matmul(Benchmark):\n", "metadata": "root.Matmul", "header": "['module', '___EOS___']", "index": 141 }, { "content": " def setup(self):\n H1, W1 = 1, 100000\n H2, W2 = W1, 1000\n C1 = 10\n C2 = 1000000\n\n random.seed(0)\n\n matrix1 = lil_matrix(zeros((H1, W1)))\n matrix2 = lil_matrix(zeros((H2, W2)))\n for i in range(C1):\n matrix1[random.randint(H1), random.randint(W1)] = random.rand()\n for i in range(C2):\n matrix2[random.randint(H2), random.randint(W2)] = random.rand()\n self.matrix1 = matrix1.tocsr()\n self.matrix2 = matrix2.tocsr()", "metadata": "root.Matmul.setup", "header": "['class', 'Matmul', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 142 }, { "content": " def time_large(self):\n for i in range(100):\n self.matrix1 * self.matrix2", "metadata": "root.Matmul.time_large", "header": "['class', 'Matmul', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 159 }, { "content": "class Construction(Benchmark):\n params = [\n ['Empty', 'Identity', 'Poisson5pt'],\n ['lil', 'dok']\n ]\n param_names = ['matrix', 'format']\n\n", "metadata": "root.Construction", "header": "['module', '___EOS___']", "index": 164 }, { "content": " def setup(self, name, format):\n if name == 'Empty':\n self.A = coo_matrix((10000, 10000))\n elif name == 'Identity':\n self.A = sparse.eye(10000, format='coo')\n else:\n self.A = poisson2d(100, format='coo')\n\n formats = {'lil': lil_matrix, 'dok': dok_matrix}\n self.cls = formats[format]", "metadata": "root.Construction.setup", "header": "['class', 'Construction', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 171 }, { "content": " def time_construction(self, name, format):\n T = self.cls(self.A.shape)\n for i, j, v in zip(self.A.row, self.A.col, self.A.data):\n T[i, j] = v", "metadata": "root.Construction.time_construction", "header": "['class', 'Construction', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 182 }, { "content": "class Conversion(Benchmark):\n params = [\n ['csr', 'csc', 'coo', 'dia', 'lil', 'dok'],\n ['csr', 'csc', 'coo', 'dia', 'lil', 'dok'],\n ]\n param_names = ['from_format', 'to_format']\n\n", "metadata": "root.Conversion", "header": "['module', '___EOS___']", "index": 188 }, { "content": " def setup(self, fromfmt, tofmt):\n base = poisson2d(100, format=fromfmt)\n\n try:\n self.fn = getattr(base, 'to' + tofmt)\n except:\n def fn():\n raise RuntimeError()\n self.fn = fn", "metadata": "root.Conversion.setup", "header": "['class', 'Conversion', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 195 }, { "content": " def time_conversion(self, fromfmt, tofmt):\n self.fn()", "metadata": "root.Conversion.time_conversion", "header": "['class', 'Conversion', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 205 }, { "content": "class Getset(Benchmark):\n params = [\n [1, 10, 100, 1000, 10000],\n ['different', 'same'],\n ['csr', 'csc', 'lil', 'dok']\n ]\n param_names = ['N', 'sparsity pattern', 'format']\n unit = \"seconds\"\n\n\n\n", "metadata": "root.Getset", "header": "['module', '___EOS___']", "index": 209 }, { "content": " def setup(self, N, sparsity_pattern, format):\n if format == 'dok' and N > 500:\n raise NotImplementedError()\n\n self.A = rand(1000, 1000, density=1e-5)\n\n A = self.A\n N = int(N)\n\n # indices to assign to\n i, j = [], []\n while len(i) < N:\n n = N - len(i)\n ip = numpy.random.randint(0, A.shape[0], size=n)\n jp = numpy.random.randint(0, A.shape[1], size=n)\n i = numpy.r_[i, ip]\n j = numpy.r_[j, jp]\n v = numpy.random.rand(n)\n\n if N == 1:\n i = int(i)\n j = int(j)\n v = float(v)\n\n base = A.asformat(format)\n\n self.m = base.copy()\n self.i = i\n self.j = j\n self.v = v", "metadata": "root.Getset.setup", "header": "['class', 'Getset', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 218 }, { "content": " def _timeit(self, kernel, recopy):\n min_time = 1e99\n if not recopy:\n kernel(self.m, self.i, self.j, self.v)\n\n number = 1\n start = time.time()\n while time.time() - start < 0.1:\n if recopy:\n m = self.m.copy()\n else:\n m = self.m\n while True:\n duration = timeit.timeit(\n lambda: kernel(m, self.i, self.j, self.v), number=number)\n if duration > 1e-5:\n break\n else:\n number *= 10\n min_time = min(min_time, duration/number)\n return min_time", "metadata": "root.Getset._timeit", "header": "['class', 'Getset', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 249 }, { "content": " def track_fancy_setitem(self, N, sparsity_pattern, format):\n def kernel(A, i, j, v):\n A[i, j] = v\n\n with warnings.catch_warnings():\n warnings.simplefilter('ignore', SparseEfficiencyWarning)\n return self._timeit(kernel, sparsity_pattern == 'different')", "metadata": "root.Getset.track_fancy_setitem", "header": "['class', 'Getset', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 271 }, { "content": " def time_fancy_getitem(self, N, sparsity_pattern, format):\n self.m[self.i, self.j]", "metadata": "root.Getset.time_fancy_getitem", "header": "['class', 'Getset', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 279 }, { "content": "class NullSlice(Benchmark):\n params = [[0.05, 0.01], ['csr', 'csc', 'lil']]\n param_names = ['density', 'format']\n\n\n\n\n", "metadata": "root.NullSlice", "header": "['module', '___EOS___']", "index": 283 }, { "content": " def setup(self, density, format):\n n = 100000\n k = 1000\n self.X = sparse.rand(n, k, format=format, density=density)", "metadata": "root.NullSlice.setup", "header": "['class', 'NullSlice', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 287 }, { "content": " def time_3_rows(self, density, format):\n self.X[[0, 100, 105], :]", "metadata": "root.NullSlice.time_3_rows", "header": "['class', 'NullSlice', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 292 }, { "content": " def time_10000_rows(self, density, format):\n self.X[np.arange(10000), :]", "metadata": "root.NullSlice.time_10000_rows", "header": "['class', 'NullSlice', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 295 }, { "content": " def time_3_cols(self, density, format):\n self.X[:, [0, 100, 105]]", "metadata": "root.NullSlice.time_3_cols", "header": "['class', 'NullSlice', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 298 }, { "content": " def time_100_cols(self, density, format):\n self.X[:, np.arange(100)]", "metadata": "root.NullSlice.time_100_cols", "header": "['class', 'NullSlice', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 301 }, { "content": "class Diagonal(Benchmark):\n params = [[0.01, 0.1, 0.5], ['csr', 'csc', 'coo', 'lil', 'dok', 'dia']]\n param_names = ['density', 'format']\n\n", "metadata": "root.Diagonal", "header": "['module', '___EOS___']", "index": 305 }, { "content": " def setup(self, density, format):\n n = 1000\n if format == 'dok' and n * density >= 500:\n raise NotImplementedError()\n\n self.X = sparse.rand(n, n, format=format, density=density)", "metadata": "root.Diagonal.setup", "header": "['class', 'Diagonal', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 309 }, { "content": " def time_diagonal(self, density, format):\n self.X.diagonal()", "metadata": "root.Diagonal.time_diagonal", "header": "['class', 'Diagonal', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 316 }, { "content": "class Sum(Benchmark):\n params = [[0.01, 0.1, 0.5], ['csr', 'csc', 'coo', 'lil', 'dok', 'dia']]\n param_names = ['density', 'format']\n\n\n\n", "metadata": "root.Sum", "header": "['module', '___EOS___']", "index": 320 }, { "content": " def setup(self, density, format):\n n = 1000\n if format == 'dok' and n * density >= 500:\n raise NotImplementedError()\n\n self.X = sparse.rand(n, n, format=format, density=density)", "metadata": "root.Sum.setup", "header": "['class', 'Sum', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 324 }, { "content": " def time_sum(self, density, format):\n self.X.sum()", "metadata": "root.Sum.time_sum", "header": "['class', 'Sum', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 331 }, { "content": " def time_sum_axis0(self, density, format):\n self.X.sum(axis=0)", "metadata": "root.Sum.time_sum_axis0", "header": "['class', 'Sum', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 334 }, { "content": " def time_sum_axis1(self, density, format):\n self.X.sum(axis=1)", "metadata": "root.Sum.time_sum_axis1", "header": "['class', 'Sum', '(', 'Benchmark', ')', ':', '___EOS___']", "index": 337 } ]
[ { "span": "from scipy.sparse import (csr_matrix, coo_matrix, dia_matrix, lil_matrix,\n dok_matrix, rand, SparseEfficiencyWarning)", "start_line": 15, "start_column": 4, "end_line": 16, "end_column": 72 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Simple", " ", "benchmarks", " ", "for", " ", "the", " ", "spars", "e", " ", "module", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "division_", ",_", "print", "\\u", "function_", ",_", "abs", "olute", "\\u", "import_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "warnings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "timeit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "numpy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "numpy_", "import_", "ones_", ",_", "array_", ",_", "asarray_", ",_", "empty_", ",_", "random_", ",_", "zeros_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "scipy_", "import_", "sparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "scipy_", "._", "sparse_", "import_", "(_", "csr", "\\u", "matrix_", ",_", "coo", "\\u", "matrix_", ",_", "dia", "\\u", "matrix_", ",_", "lil", "\\u", "matrix_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dok", "\\u", "matrix_", ",_", "rand_", ",_", "Spar", "se", "Efficien", "cy", "Warning_", ")_", "\\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_", "from_", "._", "common_", "import_", "Benchmark", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", " ", "move", " ", "this", " ", "to", " ", "a", " ", "matrix", " ", "gallery", " ", "and", " ", "add", " ", "unittest", "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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "random", "\\u", "sparse_", "(_", "m_", ",_", "n_", ",_", "nnz", "\\u", "per", "\\u", "row_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rows_", "=_", "numpy_", "._", "arange_", "(_", "m_", ")_", "._", "repeat_", "(_", "nnz", "\\u", "per", "\\u", "row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cols_", "=_", "numpy_", "._", "random_", "._", "randint_", "(_", "0_", ",_", "n_", ",_", "size_", "=_", "nnz", "\\u", "per", "\\u", "row_", "*_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vals_", "=_", "numpy_", "._", "random_", "._", "random", "\\u", "sample_", "(_", "m_", "*_", "nnz", "\\u", "per", "\\u", "row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "coo", "\\u", "matrix_", "(_", "(_", "vals_", ",_", "(_", "rows_", ",_", "cols_", ")_", ")_", ",_", "(_", "m_", ",_", "n_", ")_", ")_", "._", "toc", "sr_", "(_", ")_", "\\u\\u\\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_", "poisson", "2d_", "(_", "N_", ",_", "dtype_", "=_", "'", "d", "'_", ",_", "format_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "spars", "e", " ", "matrix", " ", "for", " ", "the", " ", "2", "D", " ", "Pois", "son", " ", "problem", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "standard", " ", "5", "-", "point", " ", "finite", " ", "difference", " ", "stencil", " ", "on", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "square", " ", "N", "-", "by", "-", "N", " ", "grid", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "N_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diag", "s_", "=_", "asarray_", "(_", "[_", "[_", "4_", "]_", "]_", ",_", "dtype_", "=_", "dtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "dia", "\\u", "matrix_", "(_", "(_", "diag", "s_", ",_", "[_", "0_", "]_", ")_", ",_", "shape_", "=_", "(_", "1_", ",_", "1_", ")_", ")_", "._", "asf", "ormat_", "(_", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "offsets_", "=_", "array_", "(_", "[_", "0_", ",_", "-_", "N_", ",_", "N_", ",_", "-_", "1_", ",_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "diag", "s_", "=_", "empty_", "(_", "(_", "5_", ",_", "N_", "**_", "2_", ")_", ",_", "dtype_", "=_", "dtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "diag", "s_", "[_", "0_", "]_", "=_", "4_", "#", " ", "main", " ", "diagonal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diag", "s_", "[_", "1_", ":_", "]_", "=_", "-_", "1_", "#", " ", "all", " ", "off", "diagonal", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "diag", "s_", "[_", "3_", ",_", "N_", "-_", "1_", ":_", ":_", "N_", "]_", "=_", "0_", "#", " ", "first", " ", "lower", " ", "diagonal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diag", "s_", "[_", "4_", ",_", "N_", ":_", ":_", "N_", "]_", "=_", "0_", "#", " ", "first", " ", "upper", " ", "diagonal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "dia", "\\u", "matrix_", "(_", "(_", "diag", "s_", ",_", "offsets_", ")_", ",_", "shape_", "=_", "(_", "N_", "**_", "2_", ",_", "N_", "**_", "2_", ")_", ")_", "._", "asf", "ormat_", "(_", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Arithm", "etic", "_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "param", "\\u", "names_", "=_", "[_", "'", "format", "'_", ",_", "'", "XY", "'_", ",_", "'", "op", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "csr", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "AA", "'_", ",_", "'", "AB", "'_", ",_", "'", "BA", "'_", ",_", "'", "BB", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'\\u", "\\u", "add", "\\u\\u'_", ",_", "'\\u", "\\u", "sub\\u", "\\u'_", ",_", "'", "multipl", "y", "'_", ",_", "'\\u", "\\u", "mul", "\\u\\u'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\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_", "Arithm", "etic", "_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "setup_", "(_", "self_", ",_", "format_", ",_", "XY_", ",_", "op_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "matrices_", "=_", "dict_", "(_", "A_", "=_", "poisson", "2d_", "(_", "250_", ",_", "format_", "=_", "format_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "B_", "=_", "poisson", "2d_", "(_", "250_", ",_", "format_", "=_", "format_", ")_", "**_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "=_", "matrices_", "[_", "XY_", "[_", "0_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "y_", "=_", "matrices_", "[_", "XY_", "[_", "1_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fn_", "=_", "getattr_", "(_", "x_", ",_", "op_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fn_", "(_", "self_", "._", "y_", ")_", "#", " ", "warmup", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Arithm", "etic", "_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "arithmetic", "_", "(_", "self_", ",_", "format_", ",_", "XY_", ",_", "op_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fn_", "(_", "self_", "._", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Sort_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "=_", "[_", "'", "Ran", "d1", "0", "'_", ",_", "'", "Ran", "d2", "5", "'_", ",_", "'", "Ran", "d5", "0", "'_", ",_", "'", "Ran", "d1", "00", "'_", ",_", "'", "Ran", "d2", "00", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "names_", "=_", "[_", "'", "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_", "[SEP]_", "class_", "Sort_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "setup_", "(_", "self_", ",_", "matrix_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "10000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matrix_", "._", "startswith_", "(_", "'", "Ran", "d", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k_", "=_", "int_", "(_", "matrix_", "[_", "4_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "A_", "=_", "random", "\\u", "sparse_", "(_", "n_", ",_", "n_", ",_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "A_", "._", "has", "\\u", "sorte", "d\\u", "indices_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "A_", "._", "indices_", "[_", ":_", "2_", "]_", "=_", "2_", ",_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sort_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "sort_", "(_", "self_", ",_", "matrix_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "sort", " ", "CSR", " ", "column", " ", "indice", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "A_", "._", "sort", "\\u", "indices_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Mat", "vec_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "Ident", "it", "y", "'_", ",_", "'", "Pois", "son", "5", "pt", "'_", ",_", "'", "Block", "2x", "2", "'_", ",_", "'", "Block", "3x", "3", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "dia", "'_", ",_", "'", "csr", "'_", ",_", "'", "csc", "'_", ",_", "'", "dok", "'_", ",_", "'", "lil", "'_", ",_", "'", "coo", "'_", ",_", "'", "bs", "r", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "names_", "=_", "[_", "'", "matrix", "'_", ",_", "'", "format", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Mat", "vec_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "setup_", "(_", "self_", ",_", "matrix_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "matrix_", "==_", "'", "Ident", "it", "y", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "format_", "in_", "(_", "'", "lil", "'_", ",_", "'", "dok", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "A_", "=_", "sparse_", "._", "eye_", "(_", "10000_", ",_", "10000_", ",_", "format_", "=_", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "matrix_", "==_", "'", "Pois", "son", "5", "pt", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "A_", "=_", "poisson", "2d_", "(_", "300_", ",_", "format_", "=_", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "matrix_", "==_", "'", "Block", "2x", "2", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "format_", "not_", "in_", "(_", "'", "csr", "'_", ",_", "'", "bs", "r", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "b_", "=_", "(_", "2_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "A_", "=_", "sparse_", "._", "kron", "_", "(_", "poisson", "2d_", "(_", "150_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ones_", "(_", "b_", ")_", ")_", "._", "tob", "sr_", "(_", "blocksize_", "=_", "b_", ")_", "._", "asf", "ormat_", "(_", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "matrix_", "==_", "'", "Block", "3x", "3", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "format_", "not_", "in_", "(_", "'", "csr", "'_", ",_", "'", "bs", "r", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "b_", "=_", "(_", "3_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "A_", "=_", "sparse_", "._", "kron", "_", "(_", "poisson", "2d_", "(_", "100_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ones_", "(_", "b_", ")_", ")_", "._", "tob", "sr_", "(_", "blocksize_", "=_", "b_", ")_", "._", "asf", "ormat_", "(_", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "x_", "=_", "ones_", "(_", "self_", "._", "A_", "._", "shape_", "[_", "1_", "]_", ",_", "dtype_", "=_", "float_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mat", "vec_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "mat", "vec_", "(_", "self_", ",_", "matrix_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "A_", "*_", "self_", "._", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Mat", "vecs_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "=_", "[_", "'", "dia", "'_", ",_", "'", "coo", "'_", ",_", "'", "csr", "'_", ",_", "'", "csc", "'_", ",_", "'", "bs", "r", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "names_", "=_", "[_", "\"", "format", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Mat", "vecs_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "setup_", "(_", "self_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "A_", "=_", "poisson", "2d_", "(_", "300_", ",_", "format_", "=_", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "x_", "=_", "ones_", "(_", "(_", "self_", "._", "A_", "._", "shape_", "[_", "1_", "]_", ",_", "10_", ")_", ",_", "dtype_", "=_", "self_", "._", "A_", "._", "dtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mat", "vecs_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "mat", "vecs_", "(_", "self_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "A_", "*_", "self_", "._", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Mat", "mul_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Mat", "mul_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "setup_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "H1_", ",_", "W1", "_", "=_", "1_", ",_", "100000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "H2", "_", ",_", "W2", "_", "=_", "W1", "_", ",_", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "C1_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "C2_", "=_", "1000000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "random_", "._", "seed_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "matrix", "1_", "=_", "lil", "\\u", "matrix_", "(_", "zeros_", "(_", "(_", "H1_", ",_", "W1", "_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matrix", "2_", "=_", "lil", "\\u", "matrix_", "(_", "zeros_", "(_", "(_", "H2", "_", ",_", "W2", "_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "C1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "matrix", "1_", "[_", "random_", "._", "randint_", "(_", "H1_", ")_", ",_", "random_", "._", "randint_", "(_", "W1", "_", ")_", "]_", "=_", "random_", "._", "rand_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "C2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "matrix", "2_", "[_", "random_", "._", "randint_", "(_", "H2", "_", ")_", ",_", "random_", "._", "randint_", "(_", "W2", "_", ")_", "]_", "=_", "random_", "._", "rand_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "matrix", "1_", "=_", "matrix", "1_", "._", "toc", "sr_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "matrix", "2_", "=_", "matrix", "2_", "._", "toc", "sr_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mat", "mul_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "large_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "range_", "(_", "100_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "matrix", "1_", "*_", "self_", "._", "matrix", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Construct", "ion_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "Emp", "ty", "'_", ",_", "'", "Ident", "it", "y", "'_", ",_", "'", "Pois", "son", "5", "pt", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "lil", "'_", ",_", "'", "dok", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "names_", "=_", "[_", "'", "matrix", "'_", ",_", "'", "format", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Construct", "ion_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "setup_", "(_", "self_", ",_", "name_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "==_", "'", "Emp", "ty", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "A_", "=_", "coo", "\\u", "matrix_", "(_", "(_", "10000_", ",_", "10000_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "name_", "==_", "'", "Ident", "it", "y", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "A_", "=_", "sparse_", "._", "eye_", "(_", "10000_", ",_", "format_", "=_", "'", "coo", "'_", ")_", "\\u\\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_", "._", "A_", "=_", "poisson", "2d_", "(_", "100_", ",_", "format_", "=_", "'", "coo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "formats_", "=_", "{_", "'", "lil", "'_", ":_", "lil", "\\u", "matrix_", ",_", "'", "dok", "'_", ":_", "dok", "\\u", "matrix_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cls_", "=_", "formats_", "[_", "format_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Construct", "ion_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "constructi", "on_", "(_", "self_", ",_", "name_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "T_", "=_", "self_", "._", "cls_", "(_", "self_", "._", "A_", "._", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "j_", ",_", "v_", "in_", "zip_", "(_", "self_", "._", "A_", "._", "row_", ",_", "self_", "._", "A_", "._", "col_", ",_", "self_", "._", "A_", "._", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "T_", "[_", "i_", ",_", "j_", "]_", "=_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Conversion", "_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "csr", "'_", ",_", "'", "csc", "'_", ",_", "'", "coo", "'_", ",_", "'", "dia", "'_", ",_", "'", "lil", "'_", ",_", "'", "dok", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "csr", "'_", ",_", "'", "csc", "'_", ",_", "'", "coo", "'_", ",_", "'", "dia", "'_", ",_", "'", "lil", "'_", ",_", "'", "dok", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "names_", "=_", "[_", "'", "from", "\\u", "format", "'_", ",_", "'", "to", "\\u", "format", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Conversion", "_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "setup_", "(_", "self_", ",_", "from", "fmt_", ",_", "tof", "mt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base_", "=_", "poisson", "2d_", "(_", "100_", ",_", "format_", "=_", "from", "fmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fn_", "=_", "getattr_", "(_", "base_", ",_", "'", "to", "'_", "+_", "tof", "mt_", ")_", "\\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 ", " _", "def_", "fn_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Run", "time", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "fn_", "=_", "fn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Conversion", "_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "conversion_", "(_", "self_", ",_", "from", "fmt_", ",_", "tof", "mt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fn_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Get", "set_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "1_", ",_", "10_", ",_", "100_", ",_", "1000_", ",_", "10000_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "different", "'_", ",_", "'", "same", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "csr", "'_", ",_", "'", "csc", "'_", ",_", "'", "lil", "'_", ",_", "'", "dok", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "names_", "=_", "[_", "'", "N", "'_", ",_", "'", "sparsity", " ", "pattern", "'_", ",_", "'", "format", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unit_", "=_", "\"", "second", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Get", "set_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "setup_", "(_", "self_", ",_", "N_", ",_", "sparsity", "\\u", "pattern_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "format_", "==_", "'", "dok", "'_", "and_", "N_", ">_", "500_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "A_", "=_", "rand_", "(_", "1000_", ",_", "1000_", ",_", "density_", "=_", "1e-5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "A_", "=_", "self_", "._", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "N_", "=_", "int_", "(_", "N_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "indice", "s", " ", "to", " ", "assign", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "i_", ",_", "j_", "=_", "[_", "]_", ",_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "len_", "(_", "i_", ")_", "<_", "N_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "N_", "-_", "len_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip_", "=_", "numpy_", "._", "random_", "._", "randint_", "(_", "0_", ",_", "A_", "._", "shape_", "[_", "0_", "]_", ",_", "size_", "=_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "jp", "_", "=_", "numpy_", "._", "random_", "._", "randint_", "(_", "0_", ",_", "A_", "._", "shape_", "[_", "1_", "]_", ",_", "size_", "=_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "numpy_", "._", "r\\u_", "[_", "i_", ",_", "ip_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "j_", "=_", "numpy_", "._", "r\\u_", "[_", "j_", ",_", "jp", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "v_", "=_", "numpy_", "._", "random_", "._", "rand_", "(_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "N_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "int_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "j_", "=_", "int_", "(_", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "float_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "base_", "=_", "A_", "._", "asf", "ormat_", "(_", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m_", "=_", "base_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "i_", "=_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "j_", "=_", "j_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "v_", "=_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "set_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "timeit_", "(_", "self_", ",_", "kernel_", ",_", "reco", "py_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "min", "\\u", "time_", "=_", "1e", "99_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "reco", "py_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kernel_", "(_", "self_", "._", "m_", ",_", "self_", "._", "i_", ",_", "self_", "._", "j_", ",_", "self_", "._", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "number_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "time_", "._", "time_", "(_", ")_", "-_", "start_", "<_", "0.1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "reco", "py_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "self_", "._", "m_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "self_", "._", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "duration_", "=_", "timeit_", "._", "timeit_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", ":_", "kernel_", "(_", "m_", ",_", "self_", "._", "i_", ",_", "self_", "._", "j_", ",_", "self_", "._", "v_", ")_", ",_", "number_", "=_", "number_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "duration_", ">_", "1e-5_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "number_", "*=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "min", "\\u", "time_", "=_", "min_", "(_", "min", "\\u", "time_", ",_", "duration_", "/_", "number_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "min", "\\u", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "set_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "track", "\\u", "fancy", "\\u", "setitem", "_", "(_", "self_", ",_", "N_", ",_", "sparsity", "\\u", "pattern_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "kernel_", "(_", "A_", ",_", "i_", ",_", "j_", ",_", "v_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "A_", "[_", "i_", ",_", "j_", "]_", "=_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "warnings_", "._", "catch", "\\u", "warnings_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warnings_", "._", "simplefilter_", "(_", "'", "ignore", "'_", ",_", "Spar", "se", "Efficien", "cy", "Warning_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "timeit_", "(_", "kernel_", ",_", "sparsity", "\\u", "pattern_", "==_", "'", "different", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "set_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "fancy", "\\u", "getitem", "_", "(_", "self_", ",_", "N_", ",_", "sparsity", "\\u", "pattern_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m_", "[_", "self_", "._", "i_", ",_", "self_", "._", "j_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Null", "Slice_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "=_", "[_", "[_", "0.05_", ",_", "0.01_", "]_", ",_", "[_", "'", "csr", "'_", ",_", "'", "csc", "'_", ",_", "'", "lil", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "names_", "=_", "[_", "'", "densit", "y", "'_", ",_", "'", "format", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\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_", "Null", "Slice_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "setup_", "(_", "self_", ",_", "density_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "100000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "k_", "=_", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "X_", "=_", "sparse_", "._", "rand_", "(_", "n_", ",_", "k_", ",_", "format_", "=_", "format_", ",_", "density_", "=_", "density_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Null", "Slice_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "3", "\\u", "rows_", "(_", "self_", ",_", "density_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "X_", "[_", "[_", "0_", ",_", "100_", ",_", "105_", "]_", ",_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Null", "Slice_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "10000", "\\u", "rows_", "(_", "self_", ",_", "density_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "X_", "[_", "np_", "._", "arange_", "(_", "10000_", ")_", ",_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Null", "Slice_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "3", "\\u", "cols_", "(_", "self_", ",_", "density_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "X_", "[_", ":_", ",_", "[_", "0_", ",_", "100_", ",_", "105_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Null", "Slice_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "100", "\\u", "cols_", "(_", "self_", ",_", "density_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "X_", "[_", ":_", ",_", "np_", "._", "arange_", "(_", "100_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Diag", "onal", "_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "=_", "[_", "[_", "0.01_", ",_", "0.1_", ",_", "0.5_", "]_", ",_", "[_", "'", "csr", "'_", ",_", "'", "csc", "'_", ",_", "'", "coo", "'_", ",_", "'", "lil", "'_", ",_", "'", "dok", "'_", ",_", "'", "dia", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "names_", "=_", "[_", "'", "densit", "y", "'_", ",_", "'", "format", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Diag", "onal", "_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "setup_", "(_", "self_", ",_", "density_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "format_", "==_", "'", "dok", "'_", "and_", "n_", "*_", "density_", ">=_", "500_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "X_", "=_", "sparse_", "._", "rand_", "(_", "n_", ",_", "n_", ",_", "format_", "=_", "format_", ",_", "density_", "=_", "density_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Diag", "onal", "_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "diagonal_", "(_", "self_", ",_", "density_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "X_", "._", "diagonal_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Sum_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "=_", "[_", "[_", "0.01_", ",_", "0.1_", ",_", "0.5_", "]_", ",_", "[_", "'", "csr", "'_", ",_", "'", "csc", "'_", ",_", "'", "coo", "'_", ",_", "'", "lil", "'_", ",_", "'", "dok", "'_", ",_", "'", "dia", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "names_", "=_", "[_", "'", "densit", "y", "'_", ",_", "'", "format", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Sum_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "setup_", "(_", "self_", ",_", "density_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "format_", "==_", "'", "dok", "'_", "and_", "n_", "*_", "density_", ">=_", "500_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "X_", "=_", "sparse_", "._", "rand_", "(_", "n_", ",_", "n_", ",_", "format_", "=_", "format_", ",_", "density_", "=_", "density_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sum_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "sum_", "(_", "self_", ",_", "density_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "X_", "._", "sum_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sum_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "sum", "\\u", "axis", "0_", "(_", "self_", ",_", "density_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "X_", "._", "sum_", "(_", "axis_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sum_", "(_", "Benchmark", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "sum", "\\u", "axis", "1_", "(_", "self_", ",_", "density_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "X_", "._", "sum_", "(_", "axis_", "=_", "1_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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from tornado.options import options\nfrom tornado.gen import Task\nfrom collections import deque\nfrom time import time\nfrom uuid import uuid4\nfrom traceback import format_exc\nfrom toto.options import safe_define\n\nsafe_define(\"worker_compression_module\", type=str, help=\"The module to use for compressing and decompressing messages to workers. The module must have 'decompress' and 'compress' methods. If not specified, no compression will be used. Only the default instance will be affected\")\nsafe_define(\"worker_serialization_module\", type=str, help=\"The module to use for serializing and deserializing messages to workers. The module must have 'dumps' and 'loads' methods. If not specified, cPickle will be used. Only the default instance will be affected\")\nsafe_define(\"worker_serialization_mime\", type=str, default='application/pickle', help=\"Used by HttpWorkerConnection in its Content-Type header.\")\nsafe_define(\"worker_timeout\", default=10.0, help=\"The default worker (instance()) will wait at least this many seconds before retrying a request (if retry is true), or timing out (if retry is false). Negative values will never retry or timeout. Note: This abs(value) is also the minimum resolution of any request-specific timeouts. Must not be 0.\")\nsafe_define(\"worker_auto_retry\", default=False, help=\"If True, the default timeout behavior of a worker RPC will be to retry instead of failing when the timeout is reached.\")\nsafe_define(\"worker_retry_count\", default=0, help=\"The maximum number of times to retry a request after timeout. Used by HttpWorkerConnection instead of worker_auto_retry.\")\nsafe_define(\"worker_address\", default='', help=\"This is the address that toto.workerconnection.invoke(method, params) will send tasks too (As specified in the worker conf file). A comma separated list may be used to round-robin load balance tasks between workers.\")\nsafe_define(\"worker_transport\", default='zmq', help=\"Either zmq or http to select which transport to use for worker communication.\")\n\nWORKER_SOCKET_CONNECT = 'CONNECT'\nWORKER_SOCKET_DISCONNECT = 'DISCONNECT'\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class WorkerConnection(object):\n '''Use a ``WorkerConnection`` to make RPCs to the remote worker service(s) or worker/router specified by ``address``.\n ``address`` may be either an enumerable of address strings or a string of comma separated addresses. RPC retries\n and timeouts will happen by at most every ``abs(timeout)`` seconds when a periodic callback runs through all active\n messages and checks for prolonged requests. This is also the default timeout for any new calls. ``timeout`` must not be\n ``0``.\n\n Optionally pass any object or module with ``compress`` and ``decompress`` methods as the ``compression`` parameter to\n compress messages. The module must implement the same algorithm used on the worker service. By default, messages are not\n compressed.\n\n Optionally pass any object or module with ``dumps`` and ``loads`` methods that convert an ``object`` to and from a\n ``str`` to replace the default ``cPickle`` serialization with a protocol of your choice.\n\n Use ``auto_retry`` to specify whether or not messages should be retried by default. Retrying messages can cause substantial\n congestion in your worker service. Use with caution.\n '''\n\n \n\n", "metadata": "root.WorkerConnection", "header": "['module', '___EOS___']", "index": 25 }, { "content": " def __getattr__(self, path):\n return WorkerInvocation(path, self)", "metadata": "root.WorkerConnection.__getattr__", "header": "['class', 'WorkerConnection', '(', 'object', ')', ':', '___EOS___']", "index": 43 }, { "content": " def log_error(self, error):\n logging.error(repr(error))", "metadata": "root.WorkerConnection.log_error", "header": "['class', 'WorkerConnection', '(', 'object', ')', ':', '___EOS___']", "index": 46 }, { "content": " def enable_traceback_logging(self):\n from new import instancemethod\n from traceback import format_exc\n def log_error(self, e):\n logging.error(format_exc())\n self.log_error = instancemethod(log_error, self)", "metadata": "root.WorkerConnection.enable_traceback_logging", "header": "['class', 'WorkerConnection', '(', 'object', ')', ':', '___EOS___']", "index": 49 }, { "content": " @classmethod\n def instance(cls):\n '''Returns the default instance of ``WorkerConnection`` as configured by the options prefixed\n with ``worker_``, instantiating it if necessary. Import the ``workerconnection`` module within\n your ``TotoService`` and run it with ``--help`` to see all available options.\n '''\n if not hasattr(cls, '_instance'):\n if options.worker_transport == 'http':\n from toto.httpworkerconnection import HTTPWorkerConnection\n cls._instance = HTTPWorkerConnection.instance()\n else:\n from toto.zmqworkerconnection import ZMQWorkerConnection\n cls._instance = ZMQWorkerConnection.instance()\n return cls._instance", "metadata": "root.WorkerConnection.instance", "header": "['class', 'WorkerConnection', '(', 'object', ')', ':', '___EOS___']", "index": 56 }, { "content": "class WorkerInvocation(object):\n \n\n", "metadata": "root.WorkerInvocation", "header": "['module', '___EOS___']", "index": 71 }, { "content": " def __init__(self, path, connection):\n self._path = path\n self._connection = connection", "metadata": "root.WorkerInvocation.__init__", "header": "['class', 'WorkerInvocation', '(', 'object', ')', ':', '___EOS___']", "index": 73 }, { "content": " def __call__(self, *args, **kwargs):\n return self._connection.invoke(self._path, *args, **kwargs)", "metadata": "root.WorkerInvocation.__call__", "header": "['class', 'WorkerInvocation', '(', 'object', ')', ':', '___EOS___']", "index": 77 }, { "content": " def __getattr__(self, path):\n return getattr(self._connection, self._path + '.' + path)", "metadata": "root.WorkerInvocation.__getattr__", "header": "['class', 'WorkerInvocation', '(', 'object', ')', ':', '___EOS___']", "index": 80 } ]
[ { "span": "import toto", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 11 }, { "span": "import cPickle as pickle", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 24 }, { "span": "import zlib", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 11 }, { "span": "from threading import Thread", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 28 }, { "span": "from tornado.gen import Task", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 28 }, { "span": "from collections import deque", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 29 }, { "span": "from time import time", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 21 }, { "span": "from uuid import uuid4", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 22 }, { "span": "from traceback import format_exc", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 32 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "tot", "o_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "c", "Pickle_", "as_", "pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "zlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "threading_", "import_", "Thread_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tornado_", "._", "options_", "import_", "options_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tornado_", "._", "gen_", "import_", "Task_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "collections_", "import_", "deque_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "time_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "uuid_", "import_", "uuid4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "traceback_", "import_", "format\\u", "exc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tot", "o_", "._", "options_", "import_", "safe", "\\u", "define_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "safe", "\\u", "define_", "(_", "\"", "worker", "\\u", "compress", "ion", "\\u", "module", "\"_", ",_", "type_", "=_", "str_", ",_", "help_", "=_", "\"", "The", " ", "module", " ", "to", " ", "use", " ", "for", " ", "compress", "ing", " ", "and", " ", "decompress", "ing", " ", "message", "s", " ", "to", " ", "worker", "s", ".", " ", "The", " ", "module", " ", "must", " ", "have", " ", "'", "decompress", "'", " ", "and", " ", "'", "compress", "'", " ", "method", "s", ".", " ", "If", " ", "not", " ", "specified", ",", " ", "no", " ", "compress", "ion", " ", "will", " ", "be", " ", "used", ".", " ", "On", "ly", " ", "the", " ", "default", " ", "instance", " ", "will", " ", "be", " ", "affect", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "\\u", "define_", "(_", "\"", "worker", "\\u", "serializ", "ation", "\\u", "module", "\"_", ",_", "type_", "=_", "str_", ",_", "help_", "=_", "\"", "The", " ", "module", " ", "to", " ", "use", " ", "for", " ", "serializ", "ing", " ", "and", " ", "deser", "iali", "zin", "g", " ", "message", "s", " ", "to", " ", "worker", "s", ".", " ", "The", " ", "module", " ", "must", " ", "have", " ", "'", "dump", "s", "'", " ", "and", " ", "'", "load", "s", "'", " ", "method", "s", ".", " ", "If", " ", "not", " ", "specified", ",", " ", "c", "Pickl", "e", " ", "will", " ", "be", " ", "used", ".", " ", "On", "ly", " ", "the", " ", "default", " ", "instance", " ", "will", " ", "be", " ", "affect", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "\\u", "define_", "(_", "\"", "worker", "\\u", "serializ", "ation", "\\u", "mime", "\"_", ",_", "type_", "=_", "str_", ",_", "default_", "=_", "'", "applica", "tion", "/", "pickle", "'_", ",_", "help_", "=_", "\"", "Us", "ed", " ", "by", " ", "Http", "Worke", "r", "Connect", "ion", " ", "in", " ", "its", " ", "Conten", "t", "-", "Type", " ", "header", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "\\u", "define_", "(_", "\"", "worker", "\\u", "timeo", "ut", "\"_", ",_", "default_", "=_", "10.0_", ",_", "help_", "=_", "\"", "The", " ", "default", " ", "worker", " ", "(", "instance", "())", " ", "will", " ", "wait", " ", "at", " ", "leas", "t", " ", "this", " ", "many", " ", "second", "s", " ", "bef", "ore", " ", "retrying", " ", "a", " ", "request", " ", "(", "if", " ", "retr", "y", " ", "is", " ", "true", "),", " ", "or", " ", "tim", "ing", " ", "out", " ", "(", "if", " ", "retr", "y", " ", "is", " ", "fal", "se", ").", " ", "Nega", "tiv", "e", " ", "values", " ", "will", " ", "neve", "r", " ", "retr", "y", " ", "or", " ", "timeo", "ut", ".", " ", "Not", "e", ":", " ", "Thi", "s", " ", "abs", "(", "value", ")", " ", "is", " ", "als", "o", " ", "the", " ", "minim", "um", " ", "resolu", "tion", " ", "of", " ", "any", " ", "request", "-", "specific", " ", "timeouts", ".", " ", "Mus", "t", " ", "not", " ", "be", " ", "0.", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "\\u", "define_", "(_", "\"", "worker", "\\u", "auto", "\\u", "retr", "y", "\"_", ",_", "default_", "=_", "False_", ",_", "help_", "=_", "\"", "If", " ", "Tru", "e", ",", " ", "the", " ", "default", " ", "timeo", "ut", " ", "behavior", " ", "of", " ", "a", " ", "worker", " ", "RP", "C", " ", "will", " ", "be", " ", "to", " ", "retr", "y", " ", "inst", "ead", " ", "of", " ", "faili", "ng", " ", "whe", "n", " ", "the", " ", "timeo", "ut", " ", "is", " ", "reache", "d", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "\\u", "define_", "(_", "\"", "worker", "\\u", "retr", "y", "\\u", "count", "\"_", ",_", "default_", "=_", "0_", ",_", "help_", "=_", "\"", "The", " ", "maxim", "um", " ", "number", " ", "of", " ", "times", " ", "to", " ", "retr", "y", " ", "a", " ", "request", " ", "after", " ", "timeo", "ut", ".", " ", "Us", "ed", " ", "by", " ", "Http", "Worke", "r", "Connect", "ion", " ", "inst", "ead", " ", "of", " ", "worker", "\\u", "auto", "\\u", "retr", "y", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "\\u", "define_", "(_", "\"", "worker", "\\u", "address", "\"_", ",_", "default_", "=_", "''_", ",_", "help_", "=_", "\"", "Thi", "s", " ", "is", " ", "the", " ", "address", " ", "tha", "t", " ", "tot", "o", ".", "worker", "connecti", "on", ".", "invoke", "(", "method", ",", " ", "params", ")", " ", "will", " ", "send", " ", "task", "s", " ", "too", " ", "(", "As", " ", "specified", " ", "in", " ", "the", " ", "worker", " ", "conf", " ", "file", ").", " ", "A", " ", "comma", " ", "separate", "d", " ", "list", " ", "may", " ", "be", " ", "used", " ", "to", " ", "round", "-", "robi", "n", " ", "load", " ", "balance", " ", "task", "s", " ", "bet", "ween", " ", "worker", "s", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "\\u", "define_", "(_", "\"", "worker", "\\u", "transport", "\"_", ",_", "default_", "=_", "'", "zmq", "'_", ",_", "help_", "=_", "\"", "Ei", "ther", " ", "zmq", " ", "or", " ", "http", " ", "to", " ", "select", " ", "whi", "ch", " ", "transport", " ", "to", " ", "use", " ", "for", " ", "worker", " ", "communication", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "WORKER", "\\u", "SOCKET", "\\u", "CONNECT", "_", "=_", "'", "CONNECT", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "WORKER", "\\u", "SOCKET", "\\u", "DISCONNECT", "_", "=_", "'", "DISCONNECT", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Worke", "r", "Connection_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Us", "e", " ", "a", " ", "``", "Worke", "r", "Connect", "ion", "``", " ", "to", " ", "make", " ", "RP", "Cs", " ", "to", " ", "the", " ", "remote", " ", "worker", " ", "service", "(", "s", ")", " ", "or", " ", "worker", "/", "router", " ", "specified", " ", "by", " ", "``", "address", "``.", "\\", "10", ";", " ", "``", "address", "``", " ", "may", " ", "be", " ", "eit", "her", " ", "an", " ", "enum", "era", "ble", " ", "of", " ", "address", " ", "string", "s", " ", "or", " ", "a", " ", "string", " ", "of", " ", "comma", " ", "separate", "d", " ", "addresse", "s", ".", " ", "RP", "C", " ", "retrie", "s", "\\", "10", ";", " ", "and", " ", "timeouts", " ", "will", " ", "happ", "en", " ", "by", " ", "at", " ", "most", " ", "every", " ", "``", "abs", "(", "timeo", "ut", ")`", "`", " ", "second", "s", " ", "whe", "n", " ", "a", " ", "periodic", " ", "callback", " ", "runs", " ", "through", " ", "all", " ", "active", "\\", "10", ";", " ", "message", "s", " ", "and", " ", "checks", " ", "for", " ", "pro", "long", "ed", " ", "request", "s", ".", " ", "Thi", "s", " ", "is", " ", "als", "o", " ", "the", " ", "default", " ", "timeo", "ut", " ", "for", " ", "any", " ", "new", " ", "calls", ".", " ", "``", "timeo", "ut", "``", " ", "must", " ", "not", " ", "be", "\\", "10", ";", " ", "``", "0", "``.", "\\", "10", ";", "\\", "10", ";", " ", "Optio", "nal", "ly", " ", "pass", " ", "any", " ", "object", " ", "or", " ", "module", " ", "with", " ", "``", "compress", "``", " ", "and", " ", "``", "decompress", "``", " ", "method", "s", " ", "as", " ", "the", " ", "``", "compress", "ion", "``", " ", "parameter", " ", "to", "\\", "10", ";", " ", "compress", " ", "message", "s", ".", " ", "The", " ", "module", " ", "must", " ", "implement", " ", "the", " ", "same", " ", "algo", "rit", "hm", " ", "used", " ", "on", " ", "the", " ", "worker", " ", "service", ".", " ", "By", " ", "default", ",", " ", "message", "s", " ", "are", " ", "not", "\\", "10", ";", " ", "compress", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", "Optio", "nal", "ly", " ", "pass", " ", "any", " ", "object", " ", "or", " ", "module", " ", "with", " ", "``", "dump", "s", "``", " ", "and", " ", "``", "load", "s", "``", " ", "method", "s", " ", "tha", "t", " ", "convert", " ", "an", " ", "``", "object", "``", " ", "to", " ", "and", " ", "from", " ", "a", "\\", "10", ";", " ", "``", "str", "``", " ", "to", " ", "replace", " ", "the", " ", "default", " ", "``", "c", "Pickl", "e", "``", " ", "serializ", "ation", " ", "with", " ", "a", " ", "protoc", "ol", " ", "of", " ", "your", " ", "choice", ".", "\\", "10", ";", "\\", "10", ";", " ", "Us", "e", " ", "``", "auto", "\\u", "retr", "y", "``", " ", "to", " ", "speci", "fy", " ", "whe", "ther", " ", "or", " ", "not", " ", "message", "s", " ", "shou", "ld", " ", "be", " ", "retrie", "d", " ", "by", " ", "default", ".", " ", "Retr", "ying", " ", "message", "s", " ", "can", " ", "caus", "e", " ", "substa", "nti", "al", "\\", "10", ";", " ", "cong", "esti", "on", " ", "in", " ", "your", " ", "worker", " ", "service", ".", " ", "Us", "e", " ", "with", " ", "cau", "tion", ".", "\\", "10", ";", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Worke", "r", "Connection_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "getattr\\u\\u_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Worke", "r", "Invoca", "tion_", "(_", "path_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Worke", "r", "Connection_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "log", "\\u", "error_", "(_", "self_", ",_", "error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "error_", "(_", "repr_", "(_", "error_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Worke", "r", "Connection_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "enable", "\\u", "traceback", "\\u", "logging_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "new_", "import_", "instance", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "traceback_", "import_", "format\\u", "exc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "log", "\\u", "error_", "(_", "self_", ",_", "e_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "error_", "(_", "format\\u", "exc_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "log", "\\u", "error_", "=_", "instance", "method_", "(_", "log", "\\u", "error_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Worke", "r", "Connection_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "instance_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Return", "s", " ", "the", " ", "default", " ", "instance", " ", "of", " ", "``", "Worke", "r", "Connect", "ion", "``", " ", "as", " ", "configur", "ed", " ", "by", " ", "the", " ", "options", " ", "prefixed", "\\", "10", ";", " ", " ", "with", " ", "``", "worker", "\\u`", "`", ",", " ", "instant", "iati", "ng", " ", "it", " ", "if", " ", "necessar", "y", ".", " ", "Import", " ", "the", " ", "``", "worker", "connecti", "on", "``", " ", "module", " ", "within", "\\", "10", ";", " ", " ", "your", " ", "``", "Tot", "o", "Service", "``", " ", "and", " ", "run", " ", "it", " ", "with", " ", "``-", "-", "help", "``", " ", "to", " ", "see", " ", "all", " ", "avail", "able", " ", "options", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "hasattr_", "(_", "cls_", ",_", "'\\u", "instance", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "options_", "._", "worker", "\\u", "transport_", "==_", "'", "http", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "tot", "o_", "._", "http", "worker", "connection_", "import_", "HTTP", "Worke", "r", "Connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "\\u", "instance_", "=_", "HTTP", "Worke", "r", "Connection_", "._", "instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "tot", "o_", "._", "zmq", "worker", "connection_", "import_", "ZM", "QW", "ork", "er", "Connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "\\u", "instance_", "=_", "ZM", "QW", "ork", "er", "Connection_", "._", "instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cls_", "._", "\\u", "instance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Worke", "r", "Invoca", "tion_", "(_", "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_", "[SEP]_", "class_", "Worke", "r", "Invoca", "tion_", "(_", "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_", ",_", "path_", ",_", "connection_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "path_", "=_", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "connection_", "=_", "connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Worke", "r", "Invoca", "tion_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "call\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "connection_", "._", "invoke_", "(_", "self_", "._", "\\u", "path_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Worke", "r", "Invoca", "tion_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "getattr\\u\\u_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "getattr_", "(_", "self_", "._", "\\u", "connection_", ",_", "self_", "._", "\\u", "path_", "+_", "'.'_", "+_", "path_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2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2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
XiaoMi/minos/client/deploy_hbase.py
[ { "content": "def generate_metrics_config(args, host, job_name, instance_id=-1):\n job = args.hbase_config.jobs[job_name]\n\n supervisor_client = deploy_utils.get_supervisor_client(host,\n \"hbase\", args.hbase_config.cluster.name, job_name, instance_id=instance_id)\n\n ganglia_switch = \"# \"\n if args.hbase_config.cluster.ganglia_address:\n ganglia_switch = \"\"\n config_dict = {\n \"job_name\": job_name,\n \"period\": 10,\n \"data_dir\": supervisor_client.get_log_dir(),\n \"ganglia_address\": args.hbase_config.cluster.ganglia_address,\n \"ganglia_switch\": ganglia_switch,\n }\n\n local_path = \"%s/hadoop-metrics.properties.tmpl\" % deploy_utils.get_template_dir()\n template = deploy_utils.Template(open(local_path, \"r\").read())\n return template.substitute(config_dict)", "metadata": "root.generate_metrics_config", "header": "['module', '___EOS___']", "index": 30 }, { "content": "def generate_run_scripts_params(args, host, job_name, host_id, instance_id):\n job = args.hbase_config.jobs[job_name]\n\n supervisor_client = deploy_utils.get_supervisor_client(host,\n \"hbase\", args.hbase_config.cluster.name, job_name, instance_id=instance_id)\n\n artifact_and_version = \"hbase-\" + args.hbase_config.cluster.version\n\n component_dir = \"$package_dir/\"\n # must include both [dir]/ and [dir]/* as [dir]/* only import all jars under\n # this dir but we also need access the webapps under this dir.\n jar_dirs = \"%s/:%s/lib/*:%s/*\" % (component_dir, component_dir, component_dir)\n log_level = deploy_utils.get_service_log_level(args, args.hbase_config)\n\n params = job.get_arguments(args, args.hbase_config.cluster, args.hbase_config.jobs,\n args.hbase_config.arguments_dict, job_name, host_id, instance_id)\n\n script_dict = {\n \"artifact\": artifact_and_version,\n \"job_name\": job_name,\n \"jar_dirs\": jar_dirs,\n \"run_dir\": supervisor_client.get_run_dir(),\n \"params\": params,\n }\n\n return script_dict", "metadata": "root.generate_run_scripts_params", "header": "['module', '___EOS___']", "index": 88 } ]
[ { "span": "job ", "start_line": 31, "start_column": 2, "end_line": 31, "end_column": 5 }, { "span": "log_level ", "start_line": 100, "start_column": 2, "end_line": 100, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "generat", "e\\u", "metric", "s", "\\u", "config_", "(_", "args_", ",_", "host_", ",_", "job", "\\u", "name_", ",_", "instance", "\\u", "id_", "=_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "job_", "=_", "args_", "._", "hbase", "\\u", "config_", "._", "jobs_", "[_", "job", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "supervisor", "\\u", "client_", "=_", "deploy", "\\u", "utils_", "._", "get", "\\u", "supervisor", "\\u", "client_", "(_", "host_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "hbase", "\"_", ",_", "args_", "._", "hbase", "\\u", "config_", "._", "cluster_", "._", "name_", ",_", "job", "\\u", "name_", ",_", "instance", "\\u", "id_", "=_", "instance", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gang", "lia", "\\u", "switch_", "=_", "\"#", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", "._", "hbase", "\\u", "config_", "._", "cluster_", "._", "gang", "lia", "\\u", "address_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gang", "lia", "\\u", "switch_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "config", "\\u", "dict_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "job", "\\u", "name", "\"_", ":_", "job", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "period", "\"_", ":_", "10_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "data\\u", "dir", "\"_", ":_", "supervisor", "\\u", "client_", "._", "get", "\\u", "log", "\\u", "dir_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gang", "lia", "\\u", "address", "\"_", ":_", "args_", "._", "hbase", "\\u", "config_", "._", "cluster_", "._", "gang", "lia", "\\u", "address_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gang", "lia", "\\u", "switch", "\"_", ":_", "gang", "lia", "\\u", "switch_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "local", "\\u", "path_", "=_", "\"%", "s", "/", "hadoop", "-", "metric", "s", ".", "proper", "ties", ".", "tmpl", "\"_", "%_", "deploy", "\\u", "utils_", "._", "get", "\\u", "template", "\\u", "dir_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "deploy", "\\u", "utils_", "._", "Template_", "(_", "open_", "(_", "local", "\\u", "path_", ",_", "\"", "r", "\"_", ")_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "template_", "._", "substitute_", "(_", "config", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "generat", "e\\u", "run", "\\u", "scripts", "\\u", "params_", "(_", "args_", ",_", "host_", ",_", "job", "\\u", "name_", ",_", "host", "\\u", "id_", ",_", "instance", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "job_", "=_", "args_", "._", "hbase", "\\u", "config_", "._", "jobs_", "[_", "job", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "supervisor", "\\u", "client_", "=_", "deploy", "\\u", "utils_", "._", "get", "\\u", "supervisor", "\\u", "client_", "(_", "host_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "hbase", "\"_", ",_", "args_", "._", "hbase", "\\u", "config_", "._", "cluster_", "._", "name_", ",_", "job", "\\u", "name_", ",_", "instance", "\\u", "id_", "=_", "instance", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "artifact", "\\u", "and", "\\u", "version_", "=_", "\"", "hbase", "-\"_", "+_", "args_", "._", "hbase", "\\u", "config_", "._", "cluster_", "._", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "component", "\\u", "dir_", "=_", "\"$", "package", "\\u", "dir", "/\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "must", " ", "include", " ", "bot", "h", " ", "[", "dir", "]/", " ", "and", " ", "[", "dir", "]/", "*", " ", "as", " ", "[", "dir", "]/", "*", " ", "only", " ", "import", " ", "all", " ", "jars", " ", "under", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "dir", " ", "but", " ", "we", " ", "als", "o", " ", "need", " ", "access", " ", "the", " ", "weba", "pps", " ", "under", " ", "this", " ", "dir", "._", "\\u\\u\\uNL\\u\\u\\u_", "jar", "\\u", "dirs_", "=_", "\"%", "s", "/", ":", "%", "s", "/", "lib", "/*", ":", "%", "s", "/*\"_", "%_", "(_", "component", "\\u", "dir_", ",_", "component", "\\u", "dir_", ",_", "component", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log", "\\u", "level_", "=_", "deploy", "\\u", "utils_", "._", "get", "\\u", "service", "\\u", "log", "\\u", "level_", "(_", "args_", ",_", "args_", "._", "hbase", "\\u", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "job_", "._", "get", "\\u", "arguments_", "(_", "args_", ",_", "args_", "._", "hbase", "\\u", "config_", "._", "cluster_", ",_", "args_", "._", "hbase", "\\u", "config_", "._", "jobs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "._", "hbase", "\\u", "config_", "._", "argu", "ment", "s", "\\u", "dict_", ",_", "job", "\\u", "name_", ",_", "host", "\\u", "id_", ",_", "instance", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "script", "\\u", "dict_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "artifact", "\"_", ":_", "artifact", "\\u", "and", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "job", "\\u", "name", "\"_", ":_", "job", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "jar", "\\u", "dirs", "\"_", ":_", "jar", "\\u", "dirs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "run", "\\u", "dir", "\"_", ":_", "supervisor", "\\u", "client_", "._", "get", "\\u", "run", "\\u", "dir_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Nested loops with same variable
anandology/pyjamas/examples/libtest/BuiltinTest.py
[ { "content": " def testForLoop(self):\n n1 = 0\n n2 = 0\n for i in range(10):\n n1 += i\n for i in xrange(4):\n n2 += i\n self.assertEqual(n1, 45)\n self.assertEqual(n2, 60)\n self.assertEqual(i, 3)\n\n try:\n for i in xrange(4):\n raise StopIteration\n self.fail(\"Failed to raise StopIteration\")\n except StopIteration:\n self.assertTrue(True)\n self.assertEqual(i, 0)\n\n e = 0\n i = -1\n for i in range(1):\n pass\n else:\n e = 1\n self.assertEqual(i, 0)\n self.assertEqual(e, 1)\n\n e = 0\n i = -1\n for i in range(0):\n pass\n else:\n e = 1\n self.assertEqual(i, -1)\n self.assertEqual(e, 1, \"bug #316 for X in Y:... else ...\")\n\n e = 0\n i = -1\n for i in range(1):\n e = 1\n break\n else:\n e = 2\n self.assertEqual(i, 0)\n self.assertEqual(e, 1)", "metadata": "root.BuiltinTest.testForLoop", "header": "['class', 'BuiltinTest', '(', 'UnitTest', ')', ':', '___EOS___']", "index": 412 } ]
[ { "span": "for i in xrange(4):", "start_line": 417, "start_column": 12, "end_line": 417, "end_column": 31 } ]
[ { "span": "for i in range(10):", "start_line": 415, "start_column": 8, "end_line": 415, "end_column": 27 } ]
1
true
[ "[CLS]_", "Nest", "ed_", "loops_", "with_", "same_", "variable_", "[SEP]_", "class_", "Bu", "ilt", "in", "Test_", "(_", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "For", "Loop_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n1_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n2_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "10_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n1_", "+=_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n2_", "+=_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "n1_", ",_", "45_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "n2_", ",_", "60_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "i_", ",_", "3_", ")_", "\\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 ", " _", "for_", "i_", "in_", "xrange_", "(_", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Sto", "p", "Iteration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "fail_", "(_", "\"", "Fail", "ed", " ", "to", " ", "raise", " ", "Sto", "p", "Iterat", "ion", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Sto", "p", "Iteration_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "i_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "e_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "1_", ")_", ":_", "\\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 ", " _", "e_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "i_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "e_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "e_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ")_", ":_", "\\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 ", " _", "e_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "i_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "e_", ",_", "1_", ",_", "\"", "bug", " ", "#", "316", " ", "for", " ", "X", " ", "in", " ", "Y", ":.", "..", " ", "else", " ", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "e_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "i_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "e_", ",_", "1_", ")_", "\\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, 3, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
NotImplemented is not an Exception
caktus/django-timepiece/timepiece/utils/csv.py
[ { "content": " def get_filename(self, context):\n raise NotImplemented('You must implement this in the subclass')", "metadata": "root.CSVViewMixin.get_filename", "header": "['class', 'CSVViewMixin', '(', 'object', ')', ':', '___EOS___']", "index": 29 }, { "content": " def convert_context_to_csv(self, context):\n \"\"\"Convert the context dictionary into a CSV file.\"\"\"\n raise NotImplemented('You must implement this in the subclass')", "metadata": "root.CSVViewMixin.convert_context_to_csv", "header": "['class', 'CSVViewMixin', '(', 'object', ')', ':', '___EOS___']", "index": 32 } ]
[ { "span": "NotImplemented(", "start_line": 30, "start_column": 14, "end_line": 30, "end_column": 28 }, { "span": "NotImplemented(", "start_line": 34, "start_column": 14, "end_line": 34, "end_column": 28 } ]
[]
1
true
[ "[CLS]_", "Not", "Implemented_", "is_", "not_", "an_", "Exception_", "[SEP]_", "class_", "CSV", "View", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "filename_", "(_", "self_", ",_", "context_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Implemented_", "(_", "'", "You", " ", "must", " ", "implement", " ", "this", " ", "in", " ", "the", " ", "subclass", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CSV", "View", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "convert", "\\u", "context", "\\u", "to", "\\u", "csv_", "(_", "self_", ",_", "context_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Convert", " ", "the", " ", "context", " ", "dictionar", "y", " ", "int", "o", " ", "a", " ", "CSV", " ", "file", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Implemented_", "(_", "'", "You", " ", "must", " ", "implement", " ", "this", " ", "in", " ", "the", " ", "subclass", "'_", ")_" ]
[ 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, 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, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
mmp2/megaman/megaman/embedding/tests/test_spectral_embedding.py
[ { "content": "# LICENSE: Simplified BSD https://github.com/mmp2/megaman/blob/master/LICENSE\n\nfrom nose.tools import assert_true\nfrom nose.tools import assert_equal\n\nfrom scipy.sparse import csr_matrix\nfrom scipy.sparse import csc_matrix\nfrom scipy.sparse import isspmatrix\nimport scipy.sparse as sp\nimport numpy as np\nfrom numpy.testing import assert_array_almost_equal, assert_allclose\nimport warnings\n\nfrom nose.tools import assert_raises\nfrom nose.plugins.skip import SkipTest\n\nfrom megaman.embedding.spectral_embedding import SpectralEmbedding, spectral_embedding, _graph_is_connected\nimport megaman.geometry.geometry as geom\n\nfrom sklearn.metrics import normalized_mutual_info_score\nfrom sklearn.datasets.samples_generator import make_blobs\n\n\n# non centered, sparse centers to check the\ncenters = np.array([\n [0.0, 5.0, 0.0, 0.0, 0.0],\n [0.0, 0.0, 4.0, 0.0, 0.0],\n [1.0, 0.0, 0.0, 5.0, 1.0],\n])\nn_samples = 1000\nn_clusters, n_features = centers.shape\nS, true_labels = make_blobs(n_samples=n_samples, centers=centers,\n cluster_std=1., random_state=42)\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def _check_with_col_sign_flipping(A, B, tol=0.0):\n \"\"\" Check array A and B are equal with possible sign flipping on\n each columns\"\"\"\n sign = True\n for column_idx in range(A.shape[1]):\n sign = sign and ((((A[:, column_idx] -\n B[:, column_idx]) ** 2).mean() <= tol ** 2) or\n (((A[:, column_idx] +\n B[:, column_idx]) ** 2).mean() <= tol ** 2))\n if not sign:\n return False\n return True", "metadata": "root._check_with_col_sign_flipping", "header": "['module', '___EOS___']", "index": 35 }, { "content": "def test_spectral_embedding_two_components(seed=36):\n \"\"\"Test spectral embedding with two components\"\"\"\n random_state = np.random.RandomState(seed)\n n_sample = 100\n affinity = np.zeros(shape=[n_sample * 2,\n n_sample * 2])\n # first component\n affinity[0:n_sample,\n 0:n_sample] = np.abs(random_state.randn(n_sample, n_sample)) + 2\n # second component\n affinity[n_sample::,\n n_sample::] = np.abs(random_state.randn(n_sample, n_sample)) + 2\n # connection\n affinity[0, n_sample + 1] = 1\n affinity[n_sample + 1, 0] = 1\n affinity.flat[::2 * n_sample + 1] = 0\n affinity = 0.5 * (affinity + affinity.T)\n\n true_label = np.zeros(shape=2 * n_sample)\n true_label[0:n_sample] = 1\n\n se_precomp = SpectralEmbedding(n_components=1,\n random_state=np.random.RandomState(seed),\n eigen_solver = 'arpack')\n embedded_coordinate = se_precomp.fit_transform(affinity,\n input_type='affinity')\n\n # thresholding on the first components using 0.\n label_ = np.array(embedded_coordinate.ravel() < 0, dtype=\"float\")\n assert_equal(normalized_mutual_info_score(true_label, label_), 1.0)", "metadata": "root.test_spectral_embedding_two_components", "header": "['module', '___EOS___']", "index": 48 }, { "content": "def test_spectral_embedding_precomputed_affinity(seed=36,almost_equal_decimals=5):\n \"\"\"Test spectral embedding with precomputed kernel\"\"\"\n radius = 4.0\n se_precomp = SpectralEmbedding(n_components=2,\n random_state=np.random.RandomState(seed))\n geom_params = {'affinity_kwds':{'radius':radius}, 'adjacency_kwds':{'radius':radius},\n 'adjacency_method':'brute'}\n se_rbf = SpectralEmbedding(n_components=2, random_state=np.random.RandomState(seed),\n geom = geom_params)\n G = geom.Geometry(adjacency_method = 'brute', adjacency_kwds = {'radius':radius},\n affinity_kwds = {'radius':radius})\n G.set_data_matrix(S)\n A = G.compute_affinity_matrix()\n embed_precomp = se_precomp.fit_transform(A, input_type = 'affinity')\n embed_rbf = se_rbf.fit_transform(S, input_type = 'data')\n assert_array_almost_equal(\n se_precomp.affinity_matrix_.todense(), se_rbf.affinity_matrix_.todense(),\n almost_equal_decimals)\n assert_true(_check_with_col_sign_flipping(embed_precomp, embed_rbf, 0.05))", "metadata": "root.test_spectral_embedding_precomputed_affinity", "header": "['module', '___EOS___']", "index": 80 }, { "content": "def test_spectral_embedding_amg_solver(seed=20):\n \"\"\"Test spectral embedding with amg solver vs arpack using symmetric laplacian\"\"\"\n radius = 4.0\n geom_params = {'affinity_kwds':{'radius':radius}, 'adjacency_kwds':{'radius':radius}, 'adjacency_method':'brute',\n 'laplacian_method':'symmetricnormalized'}\n try:\n import pyamg\n except ImportError:\n raise SkipTest(\"pyamg not available.\")\n se_amg = SpectralEmbedding(n_components=2,eigen_solver=\"amg\",\n random_state=np.random.RandomState(seed), geom = geom_params)\n se_arpack = SpectralEmbedding(n_components=2, eigen_solver=\"arpack\", geom = geom_params,\n random_state=np.random.RandomState(seed))\n embed_amg = se_amg.fit_transform(S)\n embed_arpack = se_arpack.fit_transform(S)\n assert_true(_check_with_col_sign_flipping(embed_amg, embed_arpack, 0.05))", "metadata": "root.test_spectral_embedding_amg_solver", "header": "['module', '___EOS___']", "index": 101 }, { "content": "def test_spectral_embedding_symmetrzation(seed=36):\n \"\"\"Test spectral embedding with amg solver vs arpack using non symmetric laplacian\"\"\"\n radius = 4.0\n geom_params = {'affinity_kwds':{'radius':radius}, 'adjacency_kwds':{'radius':radius}, 'adjacency_method':'brute',\n 'laplacian_method':'geometric'}\n try:\n import pyamg\n except ImportError:\n raise SkipTest(\"pyamg not available.\")\n se_amg = SpectralEmbedding(n_components=2,eigen_solver=\"amg\",\n random_state=np.random.RandomState(seed), geom = geom_params)\n se_arpack = SpectralEmbedding(n_components=2, eigen_solver=\"arpack\", geom = geom_params,\n random_state=np.random.RandomState(seed))\n embed_amg = se_amg.fit_transform(S)\n embed_arpack = se_arpack.fit_transform(S)\n assert_true(_check_with_col_sign_flipping(embed_amg, embed_arpack, 0.05))", "metadata": "root.test_spectral_embedding_symmetrzation", "header": "['module', '___EOS___']", "index": 119 }, { "content": "def test_spectral_embedding_unknown_eigensolver(seed=36):\n \"\"\"Test that SpectralClustering fails with an unknown eigensolver\"\"\"\n se = SpectralEmbedding(n_components=1,\n random_state=np.random.RandomState(seed),\n eigen_solver=\"<unknown>\")\n assert_raises(ValueError, se.fit, S)", "metadata": "root.test_spectral_embedding_unknown_eigensolver", "header": "['module', '___EOS___']", "index": 137 }, { "content": "def test_connectivity(seed=36):\n \"\"\"Test that graph connectivity test works as expected\"\"\"\n graph = np.array([[1, 0, 0, 0, 0],\n [0, 1, 1, 0, 0],\n [0, 1, 1, 1, 0],\n [0, 0, 1, 1, 1],\n [0, 0, 0, 1, 1]])\n assert_equal(_graph_is_connected(graph), False)\n assert_equal(_graph_is_connected(csr_matrix(graph)), False)\n assert_equal(_graph_is_connected(csc_matrix(graph)), False)\n graph = np.array([[1, 1, 0, 0, 0],\n [1, 1, 1, 0, 0],\n [0, 1, 1, 1, 0],\n [0, 0, 1, 1, 1],\n [0, 0, 0, 1, 1]])\n assert_equal(_graph_is_connected(graph), True)\n assert_equal(_graph_is_connected(csr_matrix(graph)), True)\n assert_equal(_graph_is_connected(csc_matrix(graph)), True)", "metadata": "root.test_connectivity", "header": "['module', '___EOS___']", "index": 145 } ]
[ { "span": "from scipy.sparse import isspmatrix", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 35 }, { "span": "import scipy.sparse as sp", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 25 }, { "span": "from numpy.testing import assert_array_almost_equal, assert_allclose", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 68 }, { "span": "import warnings", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 15 }, { "span": "from megaman.embedding.spectral_embedding import SpectralEmbedding, spectral_embedding, _graph_is_connected", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 107 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "LICENSE", ":", " ", "Simplif", "ied", " ", "BS", "D", " ", "https", "://", "git", "hub", ".", "com", "/", "mm", "p2", "/", "mega", "man", "/", "blob", "/", "master", "/", "LICENSE", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "nose_", "._", "tools_", "import_", "assert", "\\u", "true_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nose_", "._", "tools_", "import_", "assert", "\\u", "equal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "scipy_", "._", "sparse_", "import_", "csr", "\\u", "matrix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "scipy_", "._", "sparse_", "import_", "csc", "\\u", "matrix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "scipy_", "._", "sparse_", "import_", "iss", "pma", "trix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "scipy_", "._", "sparse_", "as_", "sp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "numpy_", "._", "testing_", "import_", "assert", "\\u", "array", "\\u", "alm", "ost", "\\u", "equal_", ",_", "assert", "\\u", "allclose_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "warnings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "nose_", "._", "tools_", "import_", "assert", "\\u", "raises_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nose_", "._", "plugins_", "._", "skip_", "import_", "Ski", "p", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "mega", "man_", "._", "embedding_", "._", "spectral", "\\u", "embedding_", "import_", "Spectra", "l", "Embedding", "_", ",_", "spectral", "\\u", "embedding_", ",_", "\\u", "graph", "\\u", "is", "\\u", "connected_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "mega", "man_", "._", "geometry_", "._", "geometry_", "as_", "geom_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "sklearn_", "._", "metrics_", "import_", "normali", "zed", "\\u", "mutual", "\\u", "info", "\\u", "score_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "datasets_", "._", "samples", "\\u", "generator_", "import_", "make", "\\u", "blobs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "non", " ", "centered", ",", " ", "spars", "e", " ", "center", "s", " ", "to", " ", "check", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "centers_", "=_", "np_", "._", "array_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.0_", ",_", "5.0_", ",_", "0.0_", ",_", "0.0_", ",_", "0.0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0.0_", ",_", "0.0_", ",_", "4.0_", ",_", "0.0_", ",_", "0.0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "1.0_", ",_", "0.0_", ",_", "0.0_", ",_", "5.0_", ",_", "1.0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "\\u", "samples_", "=_", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "\\u", "clusters_", ",_", "n", "\\u", "features_", "=_", "centers_", "._", "shape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "S_", ",_", "true", "\\u", "labels_", "=_", "make", "\\u", "blobs_", "(_", "n", "\\u", "samples_", "=_", "n", "\\u", "samples_", ",_", "centers_", "=_", "centers_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cluster", "\\u", "std_", "=_", "1._", ",_", "random", "\\u", "state_", "=_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "check", "\\u", "with", "\\u", "col", "\\u", "sign", "\\u", "flip", "ping_", "(_", "A_", ",_", "B_", ",_", "tol_", "=_", "0.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Check", " ", "array", " ", "A", " ", "and", " ", "B", " ", "are", " ", "equal", " ", "with", " ", "possib", "le", " ", "sign", " ", "flip", "ping", " ", "on", "\\", "10", ";", " ", " ", " ", " ", "each", " ", "column", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sign_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "column", "\\u", "idx_", "in_", "range_", "(_", "A_", "._", "shape_", "[_", "1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sign_", "=_", "sign_", "and_", "(_", "(_", "(_", "(_", "A_", "[_", ":_", ",_", "column", "\\u", "idx_", "]_", "-_", "\\u\\u\\uNL\\u\\u\\u_", "B_", "[_", ":_", ",_", "column", "\\u", "idx_", "]_", ")_", "**_", "2_", ")_", "._", "mean_", "(_", ")_", "<=_", "tol_", "**_", "2_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "(_", "(_", "A_", "[_", ":_", ",_", "column", "\\u", "idx_", "]_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "B_", "[_", ":_", ",_", "column", "\\u", "idx_", "]_", ")_", "**_", "2_", ")_", "._", "mean_", "(_", ")_", "<=_", "tol_", "**_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "sign_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "spectral", "\\u", "embed", "ding", "\\u", "two", "\\u", "components_", "(_", "seed_", "=_", "36_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "spectral", " ", "embed", "ding", " ", "with", " ", "two", " ", "component", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "random", "\\u", "state_", "=_", "np_", "._", "random_", "._", "Random", "State_", "(_", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "\\u", "sample_", "=_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "affinity", "_", "=_", "np_", "._", "zeros_", "(_", "shape_", "=_", "[_", "n", "\\u", "sample_", "*_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "sample_", "*_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "first", " ", "component_", "\\u\\u\\uNL\\u\\u\\u_", "affinity", "_", "[_", "0_", ":_", "n", "\\u", "sample_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ":_", "n", "\\u", "sample_", "]_", "=_", "np_", "._", "abs_", "(_", "random", "\\u", "state_", "._", "randn_", "(_", "n", "\\u", "sample_", ",_", "n", "\\u", "sample_", ")_", ")_", "+_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "second", " ", "component_", "\\u\\u\\uNL\\u\\u\\u_", "affinity", "_", "[_", "n", "\\u", "sample_", ":_", ":_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "sample_", ":_", ":_", "]_", "=_", "np_", "._", "abs_", "(_", "random", "\\u", "state_", "._", "randn_", "(_", "n", "\\u", "sample_", ",_", "n", "\\u", "sample_", ")_", ")_", "+_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "connection_", "\\u\\u\\uNL\\u\\u\\u_", "affinity", "_", "[_", "0_", ",_", "n", "\\u", "sample_", "+_", "1_", "]_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "affinity", "_", "[_", "n", "\\u", "sample_", "+_", "1_", ",_", "0_", "]_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "affinity", "_", "._", "flat_", "[_", ":_", ":_", "2_", "*_", "n", "\\u", "sample_", "+_", "1_", "]_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "affinity", "_", "=_", "0.5_", "*_", "(_", "affinity", "_", "+_", "affinity", "_", "._", "T_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "true", "\\u", "label_", "=_", "np_", "._", "zeros_", "(_", "shape_", "=_", "2_", "*_", "n", "\\u", "sample_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "true", "\\u", "label_", "[_", "0_", ":_", "n", "\\u", "sample_", "]_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "se", "\\u", "precom", "p_", "=_", "Spectra", "l", "Embedding", "_", "(_", "n", "\\u", "components_", "=_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "random", "\\u", "state_", "=_", "np_", "._", "random_", "._", "Random", "State_", "(_", "seed_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "eigen", "\\u", "solver_", "=_", "'", "arp", "ack", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "embedde", "d\\u", "coordinate_", "=_", "se", "\\u", "precom", "p_", "._", "fit", "\\u", "transform_", "(_", "affinity", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "input", "\\u", "type_", "=_", "'", "affinity", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "threshol", "ding", " ", "on", " ", "the", " ", "first", " ", "component", "s", " ", "usi", "ng", " ", "0._", "\\u\\u\\uNL\\u\\u\\u_", "label", "\\u_", "=_", "np_", "._", "array_", "(_", "embedde", "d\\u", "coordinate_", "._", "ravel_", "(_", ")_", "<_", "0_", ",_", "dtype_", "=_", "\"", "float", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "normali", "zed", "\\u", "mutual", "\\u", "info", "\\u", "score_", "(_", "true", "\\u", "label_", ",_", "label", "\\u_", ")_", ",_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "spectral", "\\u", "embed", "ding", "\\u", "precompute", "d\\u", "affinity", "_", "(_", "seed_", "=_", "36_", ",_", "alm", "ost", "\\u", "equal", "\\u", "decimals_", "=_", "5_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "spectral", " ", "embed", "ding", " ", "with", " ", "precompute", "d", " ", "kernel", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "radius_", "=_", "4.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "se", "\\u", "precom", "p_", "=_", "Spectra", "l", "Embedding", "_", "(_", "n", "\\u", "components_", "=_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "random", "\\u", "state_", "=_", "np_", "._", "random_", "._", "Random", "State_", "(_", "seed_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "geom", "\\u", "params_", "=_", "{_", "'", "affinity", "\\u", "kwd", "s", "'_", ":_", "{_", "'", "radi", "us", "'_", ":_", "radius_", "}_", ",_", "'", "adjacency", "\\u", "kwd", "s", "'_", ":_", "{_", "'", "radi", "us", "'_", ":_", "radius_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "adjacency", "\\u", "method", "'_", ":_", "'", "brute", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "se", "\\u", "rbf", "_", "=_", "Spectra", "l", "Embedding", "_", "(_", "n", "\\u", "components_", "=_", "2_", ",_", "random", "\\u", "state_", "=_", "np_", "._", "random_", "._", "Random", "State_", "(_", "seed_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "geom_", "=_", "geom", "\\u", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "G_", "=_", "geom_", "._", "Geometry_", "(_", "adjacency", "\\u", "method_", "=_", "'", "brute", "'_", ",_", "adjacency", "\\u", "kwds_", "=_", "{_", "'", "radi", "us", "'_", ":_", "radius_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "affinity", "\\u", "kwds_", "=_", "{_", "'", "radi", "us", "'_", ":_", "radius_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "G_", "._", "set\\u", "data\\u", "matrix_", "(_", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "=_", "G_", "._", "compute", "\\u", "affinity", "\\u", "matrix_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "embed", "\\u", "precom", "p_", "=_", "se", "\\u", "precom", "p_", "._", "fit", "\\u", "transform_", "(_", "A_", ",_", "input", "\\u", "type_", "=_", "'", "affinity", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "embed", "\\u", "rbf", "_", "=_", "se", "\\u", "rbf", "_", "._", "fit", "\\u", "transform_", "(_", "S_", ",_", "input", "\\u", "type_", "=_", "'", "data", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "array", "\\u", "alm", "ost", "\\u", "equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "se", "\\u", "precom", "p_", "._", "affinity", "\\u", "matrix", "\\u_", "._", "tod", "ense", "_", "(_", ")_", ",_", "se", "\\u", "rbf", "_", "._", "affinity", "\\u", "matrix", "\\u_", "._", "tod", "ense", "_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "alm", "ost", "\\u", "equal", "\\u", "decimals_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "true_", "(_", "\\u", "check", "\\u", "with", "\\u", "col", "\\u", "sign", "\\u", "flip", "ping_", "(_", "embed", "\\u", "precom", "p_", ",_", "embed", "\\u", "rbf", "_", ",_", "0.05_", ")_", ")_", "\\u\\u\\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", "spectral", "\\u", "embed", "ding", "\\u", "am", "g", "\\u", "solver_", "(_", "seed_", "=_", "20_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "spectral", " ", "embed", "ding", " ", "with", " ", "am", "g", " ", "solve", "r", " ", "vs", " ", "arp", "ack", " ", "usi", "ng", " ", "symmetric", " ", "laplac", "ian", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "radius_", "=_", "4.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "geom", "\\u", "params_", "=_", "{_", "'", "affinity", "\\u", "kwd", "s", "'_", ":_", "{_", "'", "radi", "us", "'_", ":_", "radius_", "}_", ",_", "'", "adjacency", "\\u", "kwd", "s", "'_", ":_", "{_", "'", "radi", "us", "'_", ":_", "radius_", "}_", ",_", "'", "adjacency", "\\u", "method", "'_", ":_", "'", "brute", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "laplac", "ian", "\\u", "method", "'_", ":_", "'", "symmetric", "normali", "zed", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "pya", "mg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Ski", "p", "Test_", "(_", "\"", "pya", "mg", " ", "not", " ", "avail", "able", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "se", "\\u", "am", "g_", "=_", "Spectra", "l", "Embedding", "_", "(_", "n", "\\u", "components_", "=_", "2_", ",_", "eigen", "\\u", "solver_", "=_", "\"", "am", "g", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "random", "\\u", "state_", "=_", "np_", "._", "random_", "._", "Random", "State_", "(_", "seed_", ")_", ",_", "geom_", "=_", "geom", "\\u", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "se", "\\u", "arp", "ack_", "=_", "Spectra", "l", "Embedding", "_", "(_", "n", "\\u", "components_", "=_", "2_", ",_", "eigen", "\\u", "solver_", "=_", "\"", "arp", "ack", "\"_", ",_", "geom_", "=_", "geom", "\\u", "params_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "random", "\\u", "state_", "=_", "np_", "._", "random_", "._", "Random", "State_", "(_", "seed_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "embed", "\\u", "am", "g_", "=_", "se", "\\u", "am", "g_", "._", "fit", "\\u", "transform_", "(_", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "embed", "\\u", "arp", "ack_", "=_", "se", "\\u", "arp", "ack_", "._", "fit", "\\u", "transform_", "(_", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "true_", "(_", "\\u", "check", "\\u", "with", "\\u", "col", "\\u", "sign", "\\u", "flip", "ping_", "(_", "embed", "\\u", "am", "g_", ",_", "embed", "\\u", "arp", "ack_", ",_", "0.05_", ")_", ")_", "\\u\\u\\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", "spectral", "\\u", "embed", "ding", "\\u", "symm", "etr", "zation_", "(_", "seed_", "=_", "36_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "spectral", " ", "embed", "ding", " ", "with", " ", "am", "g", " ", "solve", "r", " ", "vs", " ", "arp", "ack", " ", "usi", "ng", " ", "non", " ", "symmetric", " ", "laplac", "ian", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "radius_", "=_", "4.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "geom", "\\u", "params_", "=_", "{_", "'", "affinity", "\\u", "kwd", "s", "'_", ":_", "{_", "'", "radi", "us", "'_", ":_", "radius_", "}_", ",_", "'", "adjacency", "\\u", "kwd", "s", "'_", ":_", "{_", "'", "radi", "us", "'_", ":_", "radius_", "}_", ",_", "'", "adjacency", "\\u", "method", "'_", ":_", "'", "brute", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "laplac", "ian", "\\u", "method", "'_", ":_", "'", "geometric", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "pya", "mg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Ski", "p", "Test_", "(_", "\"", "pya", "mg", " ", "not", " ", "avail", "able", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "se", "\\u", "am", "g_", "=_", "Spectra", "l", "Embedding", "_", "(_", "n", "\\u", "components_", "=_", "2_", ",_", "eigen", "\\u", "solver_", "=_", "\"", "am", "g", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "random", "\\u", "state_", "=_", "np_", "._", "random_", "._", "Random", "State_", "(_", "seed_", ")_", ",_", "geom_", "=_", "geom", "\\u", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "se", "\\u", "arp", "ack_", "=_", "Spectra", "l", "Embedding", "_", "(_", "n", "\\u", "components_", "=_", "2_", ",_", "eigen", "\\u", "solver_", "=_", "\"", "arp", "ack", "\"_", ",_", "geom_", "=_", "geom", "\\u", "params_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "random", "\\u", "state_", "=_", "np_", "._", "random_", "._", "Random", "State_", "(_", "seed_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "embed", "\\u", "am", "g_", "=_", "se", "\\u", "am", "g_", "._", "fit", "\\u", "transform_", "(_", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "embed", "\\u", "arp", "ack_", "=_", "se", "\\u", "arp", "ack_", "._", "fit", "\\u", "transform_", "(_", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "true_", "(_", "\\u", "check", "\\u", "with", "\\u", "col", "\\u", "sign", "\\u", "flip", "ping_", "(_", "embed", "\\u", "am", "g_", ",_", "embed", "\\u", "arp", "ack_", ",_", "0.05_", ")_", ")_", "\\u\\u\\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", "spectral", "\\u", "embed", "ding", "\\u", "unknown", "\\u", "eigen", "solver_", "(_", "seed_", "=_", "36_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "tha", "t", " ", "Spectra", "l", "Clustering", " ", "fail", "s", " ", "with", " ", "an", " ", "unknown", " ", "eigen", "solve", "r", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "se_", "=_", "Spectra", "l", "Embedding", "_", "(_", "n", "\\u", "components_", "=_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "random", "\\u", "state_", "=_", "np_", "._", "random_", "._", "Random", "State_", "(_", "seed_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "eigen", "\\u", "solver_", "=_", "\"<", "unknown", ">\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "raises_", "(_", "Value", "Error_", ",_", "se_", "._", "fit_", ",_", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "connectivity_", "(_", "seed_", "=_", "36_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "tha", "t", " ", "graph", " ", "connecti", "vity", " ", "test", " ", "works", " ", "as", " ", "expected", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "graph_", "=_", "np_", "._", "array_", "(_", "[_", "[_", "1_", ",_", "0_", ",_", "0_", ",_", "0_", ",_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0_", ",_", "1_", ",_", "1_", ",_", "0_", ",_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0_", ",_", "1_", ",_", "1_", ",_", "1_", ",_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0_", ",_", "0_", ",_", "1_", ",_", "1_", ",_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0_", ",_", "0_", ",_", "0_", ",_", "1_", ",_", "1_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "\\u", "graph", "\\u", "is", "\\u", "connected_", "(_", "graph_", ")_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "\\u", "graph", "\\u", "is", "\\u", "connected_", "(_", "csr", "\\u", "matrix_", "(_", "graph_", ")_", ")_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "\\u", "graph", "\\u", "is", "\\u", "connected_", "(_", "csc", "\\u", "matrix_", "(_", "graph_", ")_", ")_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "graph_", "=_", "np_", "._", "array_", "(_", "[_", "[_", "1_", ",_", "1_", ",_", "0_", ",_", "0_", ",_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "1_", ",_", "1_", ",_", "1_", ",_", "0_", ",_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0_", ",_", "1_", ",_", "1_", ",_", "1_", ",_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0_", ",_", "0_", ",_", "1_", ",_", "1_", ",_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "0_", ",_", "0_", ",_", "0_", ",_", "1_", ",_", "1_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "\\u", "graph", "\\u", "is", "\\u", "connected_", "(_", "graph_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "\\u", "graph", "\\u", "is", "\\u", "connected_", "(_", "csr", "\\u", "matrix_", "(_", "graph_", ")_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "\\u", "graph", "\\u", "is", "\\u", "connected_", "(_", "csc", "\\u", "matrix_", "(_", "graph_", ")_", ")_", ",_", "True_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
owtf/owtf/framework/shell/blocking_shell.py
[ { "content": "#!/usr/bin/env python\n'''\nThe shell module allows running arbitrary shell commands and is critical to the framework in order to run third party tools\n'''\n# import shlex\nfrom collections import defaultdict\nfrom framework.dependency_management.dependency_resolver import BaseComponent\nfrom framework.dependency_management.interfaces import ShellInterface\nfrom framework.lib.general import *\nfrom framework.lib.formatters import LOG_LEVEL_TOOL\nimport signal\nimport subprocess\nimport os\nimport sys\nimport logging\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Shell(BaseComponent, ShellInterface):\n\n COMPONENT_NAME = \"shell\"\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.Shell", "header": "['module', '___EOS___']", "index": 17 }, { "content": " def __init__(self):\n self.register_in_service_locator()\n self.DynamicReplacements = {} # Some settings like the plugin output dir are dynamic, config is no place for those\n self.command_register = self.get_component(\"command_register\")\n self.target = self.get_component(\"target\")\n self.error_handler = self.get_component(\"error_handler\")\n self.timer = self.get_component(\"timer\")\n #self.CommandInfo = defaultdict(list)\n self.CommandTimeOffset = 'Command'\n self.OldCommands = defaultdict(list)\n # Environment variables for shell\n self.ShellEnviron = os.environ.copy()", "metadata": "root.Shell.__init__", "header": "['class', 'Shell', '(', 'BaseComponent', ',', 'ShellInterface', ')', ':', '___EOS___']", "index": 22 }, { "content": " def RefreshReplacements(self):\n self.DynamicReplacements['###plugin_output_dir###'] = self.target.GetPath('plugin_output_dir')", "metadata": "root.Shell.RefreshReplacements", "header": "['class', 'Shell', '(', 'BaseComponent', ',', 'ShellInterface', ')', ':', '___EOS___']", "index": 35 }, { "content": " def StartCommand(self, OriginalCommand, ModifiedCommand):\n #CommandInfo = defaultdict(list)\n if OriginalCommand == ModifiedCommand and ModifiedCommand in self.OldCommands:\n OriginalCommand = self.OldCommands[ModifiedCommand] # Restore original command saved at modification time\n self.timer.start_timer(self.CommandTimeOffset)\n return { 'OriginalCommand' : OriginalCommand, 'ModifiedCommand' : ModifiedCommand, 'Start' : self.timer.get_start_date_time(self.CommandTimeOffset) }", "metadata": "root.Shell.StartCommand", "header": "['class', 'Shell', '(', 'BaseComponent', ',', 'ShellInterface', ')', ':', '___EOS___']", "index": 38 }, { "content": " def FinishCommand(self, CommandInfo, WasCancelled, PluginInfo):\n CommandInfo['End'] = self.timer.get_end_date_time(self.CommandTimeOffset)\n Success = True\n if WasCancelled:\n Success = False\n CommandInfo['Success'] = Success\n CommandInfo['RunTime'] = self.timer.get_elapsed_time_as_str(self.CommandTimeOffset)\n CommandInfo['Target'] = self.target.GetTargetID()\n CommandInfo['PluginKey'] = PluginInfo[\"key\"]\n self.command_register.AddCommand(CommandInfo)", "metadata": "root.Shell.FinishCommand", "header": "['class', 'Shell', '(', 'BaseComponent', ',', 'ShellInterface', ')', ':', '___EOS___']", "index": 45 }, { "content": " def ShellPathEscape(self, Text):\n return MultipleReplace(Text, {' ': '\\ ', '(': '\\(', ')': '\\)'})", "metadata": "root.Shell.ShellPathEscape", "header": "['class', 'Shell', '(', 'BaseComponent', ',', 'ShellInterface', ')', ':', '___EOS___']", "index": 56 }, { "content": " def GetModifiedShellCommand(self, Command, PluginOutputDir):\n self.RefreshReplacements()\n NewCommand = \"cd \" + self.ShellPathEscape(PluginOutputDir) + \"; \" + MultipleReplace(Command,\n self.DynamicReplacements)\n self.OldCommands[NewCommand] = Command\n #self.StartCommand(Command, NewCommand)\n return NewCommand", "metadata": "root.Shell.GetModifiedShellCommand", "header": "['class', 'Shell', '(', 'BaseComponent', ',', 'ShellInterface', ')', ':', '___EOS___']", "index": 59 }, { "content": " def CanRunCommand(self, Command):\n #Target = self.Core.DB.POutput.CommandAlreadyRegistered(Command['OriginalCommand'])\n #if Target: # Command was run before\n # if Target == self.Core.Config.Get('TARGET'): # Run several times against same target for grep plugins. #and self.Core.Config.Get('FORCE_OVERWRITE'):\n # return [ None, True ] # Can only run again if against the same target and when -f was specified\n # return [Target, False ]\n #return [ None, True ] # Command was not run before\n Target = self.command_register.CommandAlreadyRegistered(Command['OriginalCommand'])\n if Target: # target_config will be None for a not found match\n return [Target, False]\n return [None, True]", "metadata": "root.Shell.CanRunCommand", "header": "['class', 'Shell', '(', 'BaseComponent', ',', 'ShellInterface', ')', ':', '___EOS___']", "index": 67 }, { "content": " def create_subprocess(self, Command):\n # Add proxy settings to environment variables so that tools can pick it up\n # TODO: Uncomment the following lines, when testing has been ensured for using environment variables for proxification,\n # because these variables are set for every command that is run\n # proxy_ip, proxy_port = self.Core.DB.Config.Get(\"INBOUND_PROXY_IP\"), self.Core.DB.Config.Get(\"INBOUND_PROXY_PORT\")\n # self.ShellEnviron[\"http_proxy\"] = \"http://\" + proxy_ip + \":\" + proxy_port\n # self.ShellEnviron[\"https_proxy\"] = \"https://\" + proxy_ip + \":\" + proxy_port\n\n #http://stackoverflow.com/questions/4789837/how-to-terminate-a-python-subprocess-launched-with-shell-true/4791612#4791612)\n proc = subprocess.Popen(\n Command,\n shell=True,\n env=self.ShellEnviron,\n preexec_fn=os.setsid,\n stdout=subprocess.PIPE,\n stderr=subprocess.STDOUT,\n bufsize=1\n )\n return proc", "metadata": "root.Shell.create_subprocess", "header": "['class', 'Shell', '(', 'BaseComponent', ',', 'ShellInterface', ')', ':', '___EOS___']", "index": 79 }, { "content": " def shell_exec_monitor(self, Command, PluginInfo):\n #if not self.CommandInfo:\n CommandInfo = self.StartCommand(Command, Command)\n #Target, CanRun = self.CanRunCommand(self.CommandInfo)\n Target, CanRun = self.CanRunCommand(CommandInfo)\n if not CanRun:\n Message = \"The command was already run for target: \" + str(Target)\n return Message\n logging.info(\"\")\n logging.info(\"Executing :\\n\\n%s\\n\\n\", Command)\n logging.info(\"\")\n logging.info(\"------> Execution Start Date/Time: \" + self.timer.get_start_date_time_as_str('Command'))\n logging.info(\"\")\n Output = ''\n Cancelled = False\n try: # Stolen from: http://stackoverflow.com/questions/5833716/how-to-capture-output-of-a-shell-script-running-in-a-separate-process-in-a-wxpyt\n proc = self.create_subprocess(Command)\n while True:\n line = proc.stdout.readline()\n if not line: break\n # NOTE: Below MUST BE print instead of \"cprint\" to clearly distinguish between owtf output and tool output\n logging.warn(line.strip()) # Show progress on the screen too!\n Output += line # Save as much output as possible before a tool crashes! :)\n except KeyboardInterrupt:\n os.killpg(proc.pid, signal.SIGINT)\n outdata, errdata = proc.communicate()\n logging.warn(outdata)\n Output += outdata\n try:\n os.killpg(os.getpgid(proc.pid), signal.SIGTERM) # Plugin KIA (Killed in Action)\n except OSError:\n pass # Plugin RIP (Rested In Peace)\n Cancelled = True\n #self.FinishCommand(self.CommandInfo, Cancelled)\n Output += self.error_handler.UserAbort('Command', Output) # Identify as Command Level abort\n finally:\n self.FinishCommand(CommandInfo, Cancelled, PluginInfo)\n\n return scrub_output(Output)", "metadata": "root.Shell.shell_exec_monitor", "header": "['class', 'Shell', '(', 'BaseComponent', ',', 'ShellInterface', ')', ':', '___EOS___']", "index": 99 }, { "content": " def shell_exec(self, Command, **kwds): # Mostly used for internal framework commands\n #Stolen from (added shell=True tweak, necessary for easy piping straight via the command line, etc):\n #http://stackoverflow.com/questions/236737/making-a-system-call-that-returns-the-stdout-output-as-a-string/236909#236909\n kwds.setdefault(\"stdout\", subprocess.PIPE)\n kwds.setdefault(\"stderr\", subprocess.STDOUT)\n p = subprocess.Popen(Command, shell=True, **kwds)\n return p.communicate()[0]", "metadata": "root.Shell.shell_exec", "header": "['class', 'Shell', '(', 'BaseComponent', ',', 'ShellInterface', ')', ':', '___EOS___']", "index": 139 } ]
[ { "span": "from framework.lib.formatters import LOG_LEVEL_TOOL", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 51 }, { "span": "import sys", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 10 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "\\", "10", ";", "The", " ", "shell", " ", "module", " ", "allow", "s", " ", "runn", "ing", " ", "arbitra", "ry", " ", "shell", " ", "command", "s", " ", "and", " ", "is", " ", "critic", "al", " ", "to", " ", "the", " ", "frame", "work", " ", "in", " ", "order", " ", "to", " ", "run", " ", "third", " ", "part", "y", " ", "tool", "s", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "import", " ", "shlex_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "collections_", "import_", "defaultdict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "framework_", "._", "dependen", "cy", "\\u", "management_", "._", "dependen", "cy", "\\u", "resolver_", "import_", "Base", "Component_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "framework_", "._", "dependen", "cy", "\\u", "management_", "._", "interfaces_", "import_", "Shel", "l", "Interface_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "framework_", "._", "lib_", "._", "general_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "framework_", "._", "lib_", "._", "formatters_", "import_", "LOG", "\\u", "LE", "VEL", "\\u", "TOOL", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "signal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Shell_", "(_", "Base", "Component_", ",_", "Shel", "l", "Interface_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "COMPONENT", "\\u", "NAME_", "=_", "\"", "shell", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "[SEP]_", "class_", "Shell_", "(_", "Base", "Component_", ",_", "Shel", "l", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "register", "\\u", "in", "\\u", "service", "\\u", "locator_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Dynamic", "Replace", "ments_", "=_", "{_", "}_", "#", " ", "Some", " ", "settings", " ", "like", " ", "the", " ", "plugin", " ", "output", " ", "dir", " ", "are", " ", "dynami", "c", ",", " ", "config", " ", "is", " ", "no", " ", "place", " ", "for", " ", "tho", "se_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "command", "\\u", "register_", "=_", "self_", "._", "get", "\\u", "component_", "(_", "\"", "command", "\\u", "register", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "target_", "=_", "self_", "._", "get", "\\u", "component_", "(_", "\"", "target", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error", "\\u", "handler_", "=_", "self_", "._", "get", "\\u", "component_", "(_", "\"", "error", "\\u", "handler", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "timer_", "=_", "self_", "._", "get", "\\u", "component_", "(_", "\"", "timer", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "Command", "Info", " ", "=", " ", "default", "dict", "(", "list", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Command", "Time", "Offset_", "=_", "'", "Command", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Old", "Commands_", "=_", "defaultdict_", "(_", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Environ", "ment", " ", "variab", "les", " ", "for", " ", "shell_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Shel", "l", "Environ", "_", "=_", "os_", "._", "environ_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Shell_", "(_", "Base", "Component_", ",_", "Shel", "l", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Refr", "esh", "Replace", "ments_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Dynamic", "Replace", "ments_", "[_", "'###", "plugin", "\\u", "output", "\\u", "dir", "###", "'_", "]_", "=_", "self_", "._", "target_", "._", "Get", "Path_", "(_", "'", "plugin", "\\u", "output", "\\u", "dir", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Shell_", "(_", "Base", "Component_", ",_", "Shel", "l", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Start", "Command_", "(_", "self_", ",_", "Origina", "l", "Command_", ",_", "Modifie", "d", "Command_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Command", "Info", " ", "=", " ", "default", "dict", "(", "list", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "Origina", "l", "Command_", "==_", "Modifie", "d", "Command_", "and_", "Modifie", "d", "Command_", "in_", "self_", "._", "Old", "Commands_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Origina", "l", "Command_", "=_", "self_", "._", "Old", "Commands_", "[_", "Modifie", "d", "Command_", "]_", "#", " ", "Restor", "e", " ", "original", " ", "command", " ", "saved", " ", "at", " ", "modification", " ", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "timer_", "._", "start", "\\u", "timer_", "(_", "self_", "._", "Command", "Time", "Offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "'", "Origina", "l", "Command", "'_", ":_", "Origina", "l", "Command_", ",_", "'", "Modifie", "d", "Command", "'_", ":_", "Modifie", "d", "Command_", ",_", "'", "Start", "'_", ":_", "self_", "._", "timer_", "._", "get", "\\u", "start", "\\u", "date", "\\u", "time_", "(_", "self_", "._", "Command", "Time", "Offset_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Shell_", "(_", "Base", "Component_", ",_", "Shel", "l", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Finish", "Command_", "(_", "self_", ",_", "Command", "Info_", ",_", "Wa", "s", "Cancel", "led_", ",_", "Plug", "in", "Info_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Command", "Info_", "[_", "'", "End", "'_", "]_", "=_", "self_", "._", "timer_", "._", "get", "\\u", "end", "\\u", "date", "\\u", "time_", "(_", "self_", "._", "Command", "Time", "Offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Success_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "Wa", "s", "Cancel", "led_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Success_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Command", "Info_", "[_", "'", "Success", "'_", "]_", "=_", "Success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Command", "Info_", "[_", "'", "Run", "Time", "'_", "]_", "=_", "self_", "._", "timer_", "._", "get", "\\u", "ela", "pse", "d\\u", "time", "\\u", "as", "\\u", "str_", "(_", "self_", "._", "Command", "Time", "Offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Command", "Info_", "[_", "'", "Target", "'_", "]_", "=_", "self_", "._", "target_", "._", "Get", "Target", "ID_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Command", "Info_", "[_", "'", "Plug", "in", "Key", "'_", "]_", "=_", "Plug", "in", "Info_", "[_", "\"", "key", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "command", "\\u", "register_", "._", "Add", "Command_", "(_", "Command", "Info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Shell_", "(_", "Base", "Component_", ",_", "Shel", "l", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Shel", "l", "Path", "Escape_", "(_", "self_", ",_", "Text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Multipl", "e", "Replace", "_", "(_", "Text_", ",_", "{_", "'", " ", "'_", ":_", "'\\\\", " ", "'_", ",_", "'('_", ":_", "'\\\\(", "'_", ",_", "')'_", ":_", "'\\\\", ")'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Shell_", "(_", "Base", "Component_", ",_", "Shel", "l", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Modifie", "d", "Shel", "l", "Command_", "(_", "self_", ",_", "Command_", ",_", "Plug", "in", "Output", "Dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Refr", "esh", "Replace", "ments_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "New", "Command_", "=_", "\"", "cd", " ", "\"_", "+_", "self_", "._", "Shel", "l", "Path", "Escape_", "(_", "Plug", "in", "Output", "Dir_", ")_", "+_", "\";", " ", "\"_", "+_", "Multipl", "e", "Replace", "_", "(_", "Command_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Dynamic", "Replace", "ments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Old", "Commands_", "[_", "New", "Command_", "]_", "=_", "Command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "Start", "Command", "(", "Command", ",", " ", "New", "Command", ")_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "New", "Command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Shell_", "(_", "Base", "Component_", ",_", "Shel", "l", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Can", "Run", "Command_", "(_", "self_", ",_", "Command_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Target", " ", "=", " ", "self", ".", "Core", ".", "DB", ".", "PO", "ut", "put", ".", "Command", "Al", "read", "y", "Register", "ed", "(", "Command", "['", "Origina", "l", "Command", "'])", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "Target", ":", " ", "#", " ", "Command", " ", "was", " ", "run", " ", "before_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "Target", " ", "==", " ", "self", ".", "Core", ".", "Config", ".", "Get", "('", "TARGET", "')", ":", " ", "#", " ", "Run", " ", "sever", "al", " ", "times", " ", "against", " ", "same", " ", "target", " ", "for", " ", "grep", " ", "plugin", "s", ".", " ", " ", "#", "and", " ", "self", ".", "Core", ".", "Config", ".", "Get", "('", "FORCE", "\\u", "OVER", "WRITE", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "return", " ", "[", " ", "Non", "e", ",", " ", "Tru", "e", " ", "]", " ", "#", " ", "Can", " ", "only", " ", "run", " ", "again", " ", "if", " ", "against", " ", "the", " ", "same", " ", "target", " ", "and", " ", "whe", "n", " ", "-", "f", " ", "was", " ", "specified", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "return", " ", "[", "Target", ",", " ", "Fal", "se", " ", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", "return", " ", "[", " ", "Non", "e", ",", " ", "Tru", "e", " ", "]", " ", "#", " ", "Command", " ", "was", " ", "not", " ", "run", " ", "before_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Target_", "=_", "self_", "._", "command", "\\u", "register_", "._", "Command", "Al", "read", "y", "Register", "ed_", "(_", "Command_", "[_", "'", "Origina", "l", "Command", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "Target_", ":_", "#", " ", "target", "\\u", "config", " ", "will", " ", "be", " ", "Non", "e", " ", "for", " ", "a", " ", "not", " ", "found", " ", "match_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "Target_", ",_", "False_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "None_", ",_", "True_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Shell_", "(_", "Base", "Component_", ",_", "Shel", "l", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "subprocess_", "(_", "self_", ",_", "Command_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", " ", "proxy", " ", "settings", " ", "to", " ", "environ", "ment", " ", "variab", "les", " ", "so", " ", "tha", "t", " ", "tool", "s", " ", "can", " ", "pick", " ", "it", " ", "up_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Unco", "mmen", "t", " ", "the", " ", "follow", "ing", " ", "lines", ",", " ", "whe", "n", " ", "testi", "ng", " ", "has", " ", "bee", "n", " ", "ensure", "d", " ", "for", " ", "usi", "ng", " ", "environ", "ment", " ", "variab", "les", " ", "for", " ", "prox", "ificatio", "n", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bec", "aus", "e", " ", "these", " ", "variab", "les", " ", "are", " ", "set", " ", "for", " ", "every", " ", "command", " ", "tha", "t", " ", "is", " ", "run_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "proxy", "\\u", "ip", ",", " ", "proxy", "\\u", "port", " ", "=", " ", "self", ".", "Core", ".", "DB", ".", "Config", ".", "Get", "(\"", "IN", "BOUND", "\\u", "PROX", "Y", "\\u", "IP", "\")", ",", " ", "self", ".", "Core", ".", "DB", ".", "Config", ".", "Get", "(\"", "IN", "BOUND", "\\u", "PROX", "Y", "\\u", "PORT", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "Shel", "l", "Environ", "[\"", "http", "\\u", "proxy", "\"]", " ", "=", " ", "\"", "http", "://", "\"", " ", "+", " ", "proxy", "\\u", "ip", " ", "+", " ", "\":\"", " ", "+", " ", "proxy", "\\u", "port_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "Shel", "l", "Environ", "[\"", "https", "\\u", "proxy", "\"]", " ", "=", " ", "\"", "https", "://", "\"", " ", "+", " ", "proxy", "\\u", "ip", " ", "+", " ", "\":\"", " ", "+", " ", "proxy", "\\u", "port_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "http", "://", "stack", "overflow", ".", "com", "/", "question", "s", "/", "478", "983", "7", "/", "how", "-", "to", "-", "terminate", "-", "a", "-", "python", "-", "subproc", "ess", "-", "launched", "-", "with", "-", "shell", "-", "true", "/", "479", "161", "2", "#", "479", "161", "2", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "proc_", "=_", "subprocess_", "._", "Popen_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Command_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shell_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "env_", "=_", "self_", "._", "Shel", "l", "Environ", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pree", "xec", "\\u", "fn_", "=_", "os_", "._", "sets", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stdout_", "=_", "subprocess_", "._", "PIPE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stderr_", "=_", "subprocess_", "._", "STDOUT_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bufsize_", "=_", "1_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "proc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Shell_", "(_", "Base", "Component_", ",_", "Shel", "l", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "shell", "\\u", "exec", "\\u", "monitor_", "(_", "self_", ",_", "Command_", ",_", "Plug", "in", "Info_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "not", " ", "self", ".", "Command", "Info", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Command", "Info_", "=_", "self_", "._", "Start", "Command_", "(_", "Command_", ",_", "Command_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Target", ",", " ", "Can", "Run", " ", "=", " ", "self", ".", "Can", "Run", "Command", "(", "self", ".", "Command", "Info", ")_", "\\u\\u\\uNL\\u\\u\\u_", "Target_", ",_", "Can", "Run_", "=_", "self_", "._", "Can", "Run", "Command_", "(_", "Command", "Info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "Can", "Run_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Message_", "=_", "\"", "The", " ", "command", " ", "was", " ", "alr", "ead", "y", " ", "run", " ", "for", " ", "target", ":", " ", "\"_", "+_", "str_", "(_", "Target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"", "Execut", "ing", " ", ":\\\\", "n", "\\\\", "n", "%", "s", "\\\\", "n", "\\\\", "n", "\"_", ",_", "Command_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"----", "-->", " ", "Execut", "ion", " ", "Start", " ", "Date", "/", "Time", ":", " ", "\"_", "+_", "self_", "._", "timer_", "._", "get", "\\u", "start", "\\u", "date", "\\u", "time", "\\u", "as", "\\u", "str_", "(_", "'", "Command", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Output_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Cancel", "led_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "#", " ", "Sto", "len", " ", "from", ":", " ", "http", "://", "stack", "overflow", ".", "com", "/", "question", "s", "/", "583", "371", "6", "/", "how", "-", "to", "-", "captur", "e-", "output", "-", "of", "-", "a", "-", "shell", "-", "script", "-", "runn", "ing", "-", "in", "-", "a", "-", "separate", "-", "process", "-", "in", "-", "a", "-", "wx", "pyt", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "proc_", "=_", "self_", "._", "create", "\\u", "subprocess_", "(_", "Command_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "proc_", "._", "stdout_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "line_", ":_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "NOTE", ":", " ", "Below", " ", "MUS", "T", " ", "BE", " ", "print", " ", "inst", "ead", " ", "of", " ", "\"", "cpr", "int", "\"", " ", "to", " ", "clear", "ly", " ", "distinguish", " ", "bet", "ween", " ", "ow", "tf", " ", "output", " ", "and", " ", "tool", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "logging_", "._", "warn_", "(_", "line_", "._", "strip_", "(_", ")_", ")_", "#", " ", "Show", " ", "progress", " ", "on", " ", "the", " ", "screen", " ", "too", "!", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Output_", "+=_", "line_", "#", " ", "Save", " ", "as", " ", "muc", "h", " ", "output", " ", "as", " ", "possib", "le", " ", "bef", "ore", " ", "a", " ", "tool", " ", "crashes", "!", " ", ":)", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "kill", "pg_", "(_", "proc_", "._", "pid_", ",_", "signal_", "._", "SIGINT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "outd", "ata_", ",_", "err", "data_", "=_", "proc_", "._", "communicate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "warn_", "(_", "outd", "ata_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Output_", "+=_", "outd", "ata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "kill", "pg_", "(_", "os_", "._", "getp", "gid_", "(_", "proc_", "._", "pid_", ")_", ",_", "signal_", "._", "SIGTERM_", ")_", "#", " ", "Plug", "in", " ", "KI", "A", " ", "(", "Kill", "ed", " ", "in", " ", "Action", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "OSE", "rror_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "#", " ", "Plug", "in", " ", "RI", "P", " ", "(", "Rest", "ed", " ", "In", " ", "Pea", "ce", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Cancel", "led_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "Finish", "Command", "(", "self", ".", "Command", "Info", ",", " ", "Cancel", "led", ")_", "\\u\\u\\uNL\\u\\u\\u_", "Output_", "+=_", "self_", "._", "error", "\\u", "handler_", "._", "User", "Abort_", "(_", "'", "Command", "'_", ",_", "Output_", ")_", "#", " ", "Identif", "y", " ", "as", " ", "Command", " ", "Leve", "l", " ", "abort_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Finish", "Command_", "(_", "Command", "Info_", ",_", "Cancel", "led_", ",_", "Plug", "in", "Info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "scrub", "\\u", "output_", "(_", "Output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Shell_", "(_", "Base", "Component_", ",_", "Shel", "l", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "shell", "\\u", "exec_", "(_", "self_", ",_", "Command_", ",_", "**_", "kwds_", ")_", ":_", "#", " ", "Mos", "tl", "y", " ", "used", " ", "for", " ", "internal", " ", "frame", "work", " ", "commands_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Sto", "len", " ", "from", " ", "(", "adde", "d", " ", "shell", "=", "Tru", "e", " ", "tweak", ",", " ", "necessar", "y", " ", "for", " ", "easy", " ", "pip", "ing", " ", "straight", " ", "via", " ", "the", " ", "command", " ", "line", ",", " ", "etc", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "http", "://", "stack", "overflow", ".", "com", "/", "question", "s", "/", "236", "737", "/", "mak", "ing", "-", "a", "-", "system", "-", "call", "-", "tha", "t", "-", "return", "s", "-", "the", "-", "stdout", "-", "output", "-", "as", "-", "a", "-", "string", "/", "236", "909", "#", "236", "909", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwds_", "._", "setdefault_", "(_", "\"", "stdout", "\"_", ",_", "subprocess_", "._", "PIPE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwds_", "._", "setdefault_", "(_", "\"", "std", "err", "\"_", ",_", "subprocess_", "._", "STDOUT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "subprocess_", "._", "Popen_", "(_", "Command_", ",_", "shell_", "=_", "True_", ",_", "**_", "kwds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "p_", "._", "communicate_", "(_", ")_", "[_", "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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Comparison of identical values
gitpython-developers/GitPython/git/test/test_refs.py
[ { "content": " def test_tags(self):\n # tag refs can point to tag objects or to commits\n s = set()\n ref_count = 0\n for ref in chain(self.rorepo.tags, self.rorepo.heads):\n ref_count += 1\n assert isinstance(ref, refs.Reference)\n assert str(ref) == ref.name\n assert repr(ref)\n assert ref == ref\n assert not ref != ref\n s.add(ref)\n # END for each ref\n assert len(s) == ref_count\n assert len(s | s) == ref_count", "metadata": "root.TestRefs.test_tags", "header": "['class', 'TestRefs', '(', 'TestBase', ')', ':', '___EOS___']", "index": 76 } ]
[ { "span": "ref == ref", "start_line": 85, "start_column": 19, "end_line": 85, "end_column": 29 }, { "span": "ref != ref", "start_line": 86, "start_column": 23, "end_line": 86, "end_column": 33 } ]
[]
1
true
[ "[CLS]_", "Compari", "son_", "of_", "identical_", "values_", "[SEP]_", "class_", "Test", "Refs", "_", "(_", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "tags_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "tag", " ", "refs", " ", "can", " ", "point", " ", "to", " ", "tag", " ", "object", "s", " ", "or", " ", "to", " ", "commits_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ref", "\\u", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ref_", "in_", "chain_", "(_", "self_", "._", "ror", "epo", "_", "._", "tags_", ",_", "self_", "._", "ror", "epo", "_", "._", "heads_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ref", "\\u", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "isinstance_", "(_", "ref_", ",_", "refs_", "._", "Reference_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "str_", "(_", "ref_", ")_", "==_", "ref_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "repr_", "(_", "ref_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "ref_", "==_", "ref_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "ref_", "!=_", "ref_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "add_", "(_", "ref_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "END", " ", "for", " ", "each", " ", "ref_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "len_", "(_", "s_", ")_", "==_", "ref", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "s_", "|_", "s_", ")_", "==_", "ref", "\\u", "count_", "\\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, 0, 1, 1, 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 ]
Unused import
mountainstorm/MobileDevice/setup.py
[ { "content": "#!/usr/bin/python\n# coding: utf-8\n\n# Copyright (c) 2013 Mountainstorm\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n# \n# The above copyright notice and this permission notice shall be included in all\n# copies or substantial portions of the Software.\n# \n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n\n\nfrom distutils.core import setup\nimport os.path\nimport os\nfrom subprocess import check_output\n\n\n\n\n\nsetup(\n\tname=u'Distutils',\n\tversion=u'1.0' + getcommit(),\n\tdescription=u'A python package, and command line tool, which wraps Apple\\'s MobileDevice API - providing access to iOS devices',\n\tlong_description = readfile(u'README.md'),\n\tauthor=u'Cooper',\n\turl=u'https://github.com/mountainstorm/MobileDevice',\n\tclassifiers = [\n\t\tu'Development Status :: 5 - Production/Stable',\n\t\tu'Environment :: Console',\n\t\tu'Environment :: MacOS X',\n\t\tu'Intended Audience :: Developers',\n\t\tu'License :: OSI Approved :: MIT License',\n\t\tu'Natural Language :: English',\n\t\tu'Operating System :: MacOS :: MacOS X',\n\t\tu'Programming Language :: Python',\n\t\tu'Programming Language :: Python :: 2.7',\n\t\tu'Topic :: Security',\n\t\tu'Topic :: Software Development :: Libraries :: Python Modules',\n\t\tu'Topic :: Utilities',\n\t],\n\tlicense= readfile(u'LICENSE'),\n\tpackages=['MobileDevice'],\n\tpackage_dir={'': u'../'},\n\tscripts=[u'mdf']\n)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def readfile(filename):\n\tf = open(filename)\n\ttext = f.read()\n\tf.close()\n\treturn text", "metadata": "root.readfile", "header": "['module', '___EOS___']", "index": 30 }, { "content": "def getcommit():\n\tretval = u''\n\ttry:\n\t\tretval = check_output([u'git', u'rev-list', u'--all', u'--count'])\n\t\tretval = u'.' + retval.strip()\n\texcept:\n\t\tpass\n\treturn retval", "metadata": "root.getcommit", "header": "['module', '___EOS___']", "index": 36 } ]
[ { "span": "import os.path", "start_line": 25, "start_column": 0, "end_line": 25, "end_column": 14 }, { "span": "import os", "start_line": 26, "start_column": 0, "end_line": 26, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "codi", "ng", ":", " ", "utf", "-", "8_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2013", " ", "Mount", "ain", "storm", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Permi", "ssion", " ", "is", " ", "here", "by", " ", "grant", "ed", ",", " ", "free", " ", "of", " ", "charge", ",", " ", "to", " ", "any", " ", "person", " ", "obtain", "ing", " ", "a", " ", "copy_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "this", " ", "software", " ", "and", " ", "associate", "d", " ", "documentation", " ", "files", " ", "(", "the", " ", "\"", "Sof", "twa", "re", "\")", ",", " ", "to", " ", "deal", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "the", " ", "Sof", "twa", "re", " ", "with", "out", " ", "restriction", ",", " ", "inclu", "ding", " ", "with", "out", " ", "limit", "ation", " ", "the", " ", "rights_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "use", ",", " ", "copy", ",", " ", "modif", "y", ",", " ", "merge", ",", " ", "publi", "sh", ",", " ", "distribute", ",", " ", "subli", "cens", "e", ",", " ", "and", "/", "or", " ", "sell", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "copie", "s", " ", "of", " ", "the", " ", "Sof", "twa", "re", ",", " ", "and", " ", "to", " ", "permit", " ", "person", "s", " ", "to", " ", "who", "m", " ", "the", " ", "Sof", "twa", "re", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fur", "nish", "ed", " ", "to", " ", "do", " ", "so", ",", " ", "subject", " ", "to", " ", "the", " ", "follow", "ing", " ", "condition", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "above", " ", "copyr", "ight", " ", "notice", " ", "and", " ", "this", " ", "permissi", "on", " ", "notice", " ", "sha", "ll", " ", "be", " ", "include", "d", " ", "in", " ", "all_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "copie", "s", " ", "or", " ", "substa", "nti", "al", " ", "porti", "ons", " ", "of", " ", "the", " ", "Sof", "twa", "re", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THE", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "\"", "AS", " ", "IS", "\",", " ", "WITH", "OUT", " ", "WAR", "RAN", "TY", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "EXPR", "ESS", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IMPL", "IED", ",", " ", "INC", "LU", "DING", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", " ", "THE", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", " ", "AND", " ", "NON", "INF", "RING", "EME", "NT", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "AUTHOR", "S", " ", "OR", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "CLA", "IM", ",", " ", "DA", "MAGE", "S", " ", "OR", " ", "OTHER", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "AN", " ", "ACTI", "ON", " ", "OF", " ", "CONTR", "ACT", ",", " ", "TOR", "T", " ", "OR", " ", "OTHER", "WI", "SE", ",", " ", "ARI", "SIN", "G", " ", "FROM", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "OUT", " ", "OF", " ", "OR", " ", "IN", " ", "CONNECTION", " ", "WITH", " ", "THE", " ", "SOFT", "WARE", " ", "OR", " ", "THE", " ", "USE", " ", "OR", " ", "OTHER", " ", "DEA", "LING", "S", " ", "IN", " ", "THE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SOFT", "WARE", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "distutils_", "._", "core_", "import_", "setup_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "._", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "subprocess_", "import_", "check", "\\u", "output_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "setup_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "u", "'", "Dist", "util", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "u", "'", "1.0", "'_", "+_", "getco", "mmi", "t_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "u", "'", "A", " ", "python", " ", "package", ",", " ", "and", " ", "command", " ", "line", " ", "tool", ",", " ", "whi", "ch", " ", "wrap", "s", " ", "Apple", "\\\\'", "s", " ", "Mob", "ile", "Dev", "ice", " ", "API", " ", "-", " ", "provi", "ding", " ", "access", " ", "to", " ", "i", "OS", " ", "device", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "long", "\\u", "description_", "=_", "readf", "ile_", "(_", "u", "'", "READ", "ME", ".", "md", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "author_", "=_", "u", "'", "Coo", "per", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "u", "'", "https", "://", "git", "hub", ".", "com", "/", "mount", "ain", "storm", "/", "Mob", "ile", "Dev", "ice", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "classifiers_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Dev", "elo", "pme", "nt", " ", "Status", " ", "::", " ", "5", " ", "-", " ", "Product", "ion", "/", "Sta", "ble", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Environ", "ment", " ", "::", " ", "Cons", "ole", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Environ", "ment", " ", "::", " ", "Mac", "OS", " ", "X", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Inten", "ded", " ", "Audi", "ence", " ", "::", " ", "Dev", "elope", "rs", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "License", " ", "::", " ", "OSI", " ", "Appro", "ved", " ", "::", " ", "MIT", " ", "License", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Nat", "ural", " ", "Lang", "ua", "ge", " ", "::", " ", "Eng", "lish", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Opera", "ting", " ", "System", " ", "::", " ", "Mac", "OS", " ", "::", " ", "Mac", "OS", " ", "X", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Programm", "ing", " ", "Lang", "ua", "ge", " ", "::", " ", "Pyth", "on", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Programm", "ing", " ", "Lang", "ua", "ge", " ", "::", " ", "Pyth", "on", " ", "::", " ", "2.7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Topic", " ", "::", " ", "Secur", "it", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Topic", " ", "::", " ", "Sof", "twa", "re", " ", "Dev", "elo", "pme", "nt", " ", "::", " ", "Libr", "aries", " ", "::", " ", "Pyth", "on", " ", "Modul", "es", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Topic", " ", "::", " ", "Utili", "ties", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "license_", "=_", "readf", "ile_", "(_", "u", "'", "LICENSE", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "packages_", "=_", "[_", "'", "Mob", "ile", "Dev", "ice", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "dir_", "=_", "{_", "''_", ":_", "u", "'../", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "scripts_", "=_", "[_", "u", "'", "md", "f", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "readf", "ile_", "(_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "f_", "=_", "open_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "f_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "getco", "mmi", "t_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "retval_", "=_", "u", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "retval_", "=_", "check", "\\u", "output_", "(_", "[_", "u", "'", "git", "'_", ",_", "u", "'", "rev", "-", "list", "'_", ",_", "u", "'--", "all", "'_", ",_", "u", "'--", "count", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "retval_", "=_", "u", "'.'_", "+_", "retval_", "._", "strip_", "(_", ")_", "\\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_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "retval_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
Ivaylo-Popov/Theano-Lights/models/cnn.py
[ { "content": "import theano\nimport theano.tensor as T\nfrom theano.sandbox.rng_mrg import MRG_RandomStreams\nfrom theano.tensor.nnet.conv import conv2d\nfrom theano.tensor.signal.downsample import max_pool_2d\nfrom theano.tensor.shared_randomstreams import RandomStreams\n\nimport numpy as np\nimport scipy.io\nimport time\nimport sys\nimport logging\nimport copy\n\nfrom toolbox import *\nfrom modelbase import *\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class CNN(ModelSLBase):", "metadata": "root.CNN", "header": "['module', '___EOS___']", "index": 18 }, { "content": " def __init__(self, data, hp):\n super(CNN, self).__init__(self.__class__.__name__, data, hp)\n \n self.n_h = 400\n\n self.params = Parameters()\n n_x = self.data['n_x']\n n_y = self.data['n_y']\n n_h = self.n_h\n scale = hp.init_scale\n\n if hp.load_model and os.path.isfile(self.filename):\n self.params.load(self.filename)\n else:\n with self.params:\n w = shared_normal((32, 1, 3, 3), scale=scale)\n w2 = shared_normal((64, 32, 3, 3), scale=scale)\n w3 = shared_normal((128, 64, 3, 3), scale=scale)\n w4 = shared_normal((128 * 3 * 3, 625), scale=scale)\n w_o = shared_normal((625, n_y), scale=scale)\n \n def model(X, params, p_drop_conv, p_drop_hidden):\n l1a = rectify(conv2d(X, params.w, border_mode='full'))\n l1 = max_pool_2d(l1a, (2, 2))\n l1 = dropout(l1, p_drop_conv)\n\n l2a = rectify(conv2d(l1, params.w2))\n l2 = max_pool_2d(l2a, (2, 2))\n l2 = dropout(l2, p_drop_conv)\n\n l3a = rectify(conv2d(l2, params.w3))\n l3b = max_pool_2d(l3a, (2, 2))\n l3 = T.flatten(l3b, outdim=2)\n l3 = dropout(l3, p_drop_conv)\n\n l4 = rectify(T.dot(l3, params.w4))\n l4 = dropout(l4, p_drop_hidden)\n\n py_x = softmax(T.dot(l4, params.w_o))\n return py_x\n \n x = T.reshape(self.X, (-1, 1, 28, 28))\n\n noise_py_x = model(x, self.params, 0.2, 0.5)\n cost = T.sum(T.nnet.categorical_crossentropy(noise_py_x, self.Y))\n\n pyx = model(x, self.params, 0., 0.)\n map_pyx = T.argmax(pyx, axis=1)\n error_map_pyx = T.sum(T.neq(map_pyx, T.argmax(self.Y, axis=1)))\n\n self.compile(cost, error_map_pyx)", "metadata": "root.CNN.__init__", "header": "['class', 'CNN', '(', 'ModelSLBase', ')', ':', '___EOS___']", "index": 19 } ]
[ { "span": "import theano", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 13 }, { "span": "from theano.sandbox.rng_mrg import MRG_RandomStreams", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 52 }, { "span": "from theano.tensor.shared_randomstreams import RandomStreams", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 60 }, { "span": "import numpy as np", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 18 }, { "span": "import scipy.io", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 15 }, { "span": "import time", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 11 }, { "span": "import sys", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 10 }, { "span": "import logging", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 14 }, { "span": "import copy", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "theano_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "theano_", "._", "tensor_", "as_", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "theano_", "._", "sandbox_", "._", "rng", "\\u", "mr", "g_", "import_", "MR", "G", "\\u", "Random", "Stream", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "theano_", "._", "tensor_", "._", "nnet", "_", "._", "conv_", "import_", "conv2d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "theano_", "._", "tensor_", "._", "signal_", "._", "downsample", "_", "import_", "max", "\\u", "pool", "\\u", "2d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "theano_", "._", "tensor_", "._", "shared", "\\u", "random", "streams_", "import_", "Random", "Stream", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "scipy_", "._", "io_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "toolbox_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "model", "base_", "import_", "*_", "\\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_", "CNN", "_", "(_", "Model", "SL", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CNN", "_", "(_", "Model", "SL", "Base_", ")_", ":_", "\\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_", ",_", "data_", ",_", "hp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "CNN", "_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "data_", ",_", "hp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "n", "\\u", "h_", "=_", "400_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "params_", "=_", "Parameters_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "\\u", "x_", "=_", "self_", "._", "data_", "[_", "'", "n", "\\u", "x", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "\\u", "y_", "=_", "self_", "._", "data_", "[_", "'", "n", "\\u", "y", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "\\u", "h_", "=_", "self_", "._", "n", "\\u", "h_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scale_", "=_", "hp_", "._", "init", "\\u", "scale_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hp_", "._", "load", "\\u", "model_", "and_", "os_", "._", "path_", "._", "isfile_", "(_", "self_", "._", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "params_", "._", "load_", "(_", "self_", "._", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "w_", "=_", "shared", "\\u", "normal_", "(_", "(_", "32_", ",_", "1_", ",_", "3_", ",_", "3_", ")_", ",_", "scale_", "=_", "scale_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w2_", "=_", "shared", "\\u", "normal_", "(_", "(_", "64_", ",_", "32_", ",_", "3_", ",_", "3_", ")_", ",_", "scale_", "=_", "scale_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w3", "_", "=_", "shared", "\\u", "normal_", "(_", "(_", "128_", ",_", "64_", ",_", "3_", ",_", "3_", ")_", ",_", "scale_", "=_", "scale_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w", "4_", "=_", "shared", "\\u", "normal_", "(_", "(_", "128_", "*_", "3_", "*_", "3_", ",_", "625_", ")_", ",_", "scale_", "=_", "scale_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w", "\\u", "o_", "=_", "shared", "\\u", "normal_", "(_", "(_", "625_", ",_", "n", "\\u", "y_", ")_", ",_", "scale_", "=_", "scale_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "model_", "(_", "X_", ",_", "params_", ",_", "p", "\\u", "drop", "\\u", "conv_", ",_", "p", "\\u", "drop", "\\u", "hidden_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l1", "a_", "=_", "recti", "fy_", "(_", "conv2d_", "(_", "X_", ",_", "params_", "._", "w_", ",_", "border", "\\u", "mode_", "=_", "'", "full", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l1_", "=_", "max", "\\u", "pool", "\\u", "2d_", "(_", "l1", "a_", ",_", "(_", "2_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l1_", "=_", "dropout_", "(_", "l1_", ",_", "p", "\\u", "drop", "\\u", "conv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "l2", "a_", "=_", "recti", "fy_", "(_", "conv2d_", "(_", "l1_", ",_", "params_", "._", "w2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l2_", "=_", "max", "\\u", "pool", "\\u", "2d_", "(_", "l2", "a_", ",_", "(_", "2_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l2_", "=_", "dropout_", "(_", "l2_", ",_", "p", "\\u", "drop", "\\u", "conv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "l3", "a_", "=_", "recti", "fy_", "(_", "conv2d_", "(_", "l2_", ",_", "params_", "._", "w3", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l3", "b_", "=_", "max", "\\u", "pool", "\\u", "2d_", "(_", "l3", "a_", ",_", "(_", "2_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l3_", "=_", "T_", "._", "flatten_", "(_", "l3", "b_", ",_", "outd", "im_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l3_", "=_", "dropout_", "(_", "l3_", ",_", "p", "\\u", "drop", "\\u", "conv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "l4", "_", "=_", "recti", "fy_", "(_", "T_", "._", "dot_", "(_", "l3_", ",_", "params_", "._", "w", "4_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l4", "_", "=_", "dropout_", "(_", "l4", "_", ",_", "p", "\\u", "drop", "\\u", "hidden_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "py", "\\u", "x_", "=_", "softmax_", "(_", "T_", "._", "dot_", "(_", "l4", "_", ",_", "params_", "._", "w", "\\u", "o_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "py", "\\u", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "x_", "=_", "T_", "._", "reshape_", "(_", "self_", "._", "X_", ",_", "(_", "-_", "1_", ",_", "1_", ",_", "28_", ",_", "28_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "noise", "\\u", "py", "\\u", "x_", "=_", "model_", "(_", "x_", ",_", "self_", "._", "params_", ",_", "0.2_", ",_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cost_", "=_", "T_", "._", "sum_", "(_", "T_", "._", "nnet", "_", "._", "categor", "ical", "\\u", "crossentropy", "_", "(_", "noise", "\\u", "py", "\\u", "x_", ",_", "self_", "._", "Y_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pyx", "_", "=_", "model_", "(_", "x_", ",_", "self_", "._", "params_", ",_", "0._", ",_", "0._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "map", "\\u", "pyx", "_", "=_", "T_", "._", "argmax_", "(_", "pyx", "_", ",_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "map", "\\u", "pyx", "_", "=_", "T_", "._", "sum_", "(_", "T_", "._", "neq", "_", "(_", "map", "\\u", "pyx", "_", ",_", "T_", "._", "argmax_", "(_", "self_", "._", "Y_", ",_", "axis_", "=_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "compile_", "(_", "cost_", ",_", "error", "\\u", "map", "\\u", "pyx", "_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 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 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
ODM2/ODMToolsPython/odmtools/lib/ObjectListView/__init__.py
[ { "content": "# -*- coding: utf-8 -*-\n#----------------------------------------------------------------------------\n# Name: ObjectListView module initialization\n# Author: Phillip Piper\n# Created: 29 February 2008\n# SVN-ID: $Id$\n# Copyright: (c) 2008 by Phillip Piper\n# License: wxWindows license\n#----------------------------------------------------------------------------\n# Change log:\n# 2008/08/02 JPP Added list printing material\n# 2008/07/24 JPP Added list group related material\n# 2008/06/19 JPP Added sort event related material\n# 2008/04/11 JPP Initial Version\n\n\"\"\"\nAn ObjectListView provides a more convienent and powerful interface to a ListCtrl.\n\"\"\"\n\n__version__ = '1.2'\n__copyright__ = \"Copyright (c) 2008 Phillip Piper (phillip_piper@bigfoot.com)\"\n\nfrom ObjectListView import ObjectListView, VirtualObjectListView, ColumnDefn, FastObjectListView, GroupListView, ListGroup, BatchedUpdate\nfrom OLVEvent import CellEditFinishedEvent, CellEditFinishingEvent, CellEditStartedEvent, CellEditStartingEvent, SortEvent\nfrom OLVEvent import EVT_CELL_EDIT_STARTING, EVT_CELL_EDIT_STARTED, EVT_CELL_EDIT_FINISHING, EVT_CELL_EDIT_FINISHED, EVT_SORT\nfrom OLVEvent import EVT_COLLAPSING, EVT_COLLAPSED, EVT_EXPANDING, EVT_EXPANDED, EVT_GROUP_CREATING, EVT_GROUP_SORT\nfrom CellEditor import CellEditorRegistry, MakeAutoCompleteTextBox, MakeAutoCompleteComboBox\nfrom ListCtrlPrinter import ListCtrlPrinter, ReportFormat, BlockFormat, LineDecoration, RectangleDecoration, ImageDecoration\n\nimport Filter\n__all__ = [\n \"BatchedUpdate\",\n \"BlockFormat\",\n \"CellEditFinishedEvent\",\n \"CellEditFinishingEvent\",\n \"CellEditorRegistry\",\n \"CellEditStartedEvent\",\n \"CellEditStartingEvent\",\n \"ColumnDefn\",\n \"EVT_CELL_EDIT_FINISHED\",\n \"EVT_CELL_EDIT_FINISHING\",\n \"EVT_CELL_EDIT_STARTED\",\n \"EVT_CELL_EDIT_STARTING\",\n \"EVT_COLLAPSED\",\n \"EVT_COLLAPSING\",\n \"EVT_EXPANDED\",\n \"EVT_EXPANDING\",\n \"EVT_GROUP_CREATING\",\n \"EVT_GROUP_SORT\"\n \"EVT_SORT\",\n \"Filter\",\n \"FastObjectListView\",\n \"GroupListView\",\n \"ListGroup\",\n \"ImageDecoration\",\n \"MakeAutoCompleteTextBox\",\n \"MakeAutoCompleteComboBox\",\n \"ListGroup\",\n \"ObjectListView\",\n \"ListCtrlPrinter\",\n \"RectangleDecoration\",\n \"ReportFormat\",\n \"SortEvent\",\n \"VirtualObjectListView\",\n]\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from OLVEvent import EVT_CELL_EDIT_STARTING, EVT_CELL_EDIT_STARTED, EVT_CELL_EDIT_FINISHING, EVT_CELL_EDIT_FINISHED, EVT_SORT", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 125 }, { "span": "from OLVEvent import EVT_COLLAPSING, EVT_COLLAPSED, EVT_EXPANDING, EVT_EXPANDED, EVT_GROUP_CREATING, EVT_GROUP_SORT", "start_line": 25, "start_column": 0, "end_line": 25, "end_column": 115 }, { "span": "from ListCtrlPrinter import ListCtrlPrinter, ReportFormat, BlockFormat, LineDecoration, RectangleDecoration, ImageDecoration", "start_line": 27, "start_column": 0, "end_line": 27, "end_column": 124 } ]
[]
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_", "#", " ", "Name", ":", " ", " ", " ", " ", " ", "Object", "List", "View", " ", "module", " ", "initialization", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Author", ":", " ", " ", " ", "Phil", "lip", " ", "Pipe", "r_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "ed", ":", " ", " ", "2", "9", " ", "Fe", "bru", "ary", " ", "2008_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SV", "N", "-", "ID", ":", " ", " ", " ", "$", "Id", "$", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", ":", " ", " ", " ", " ", "(", "c", ")", " ", "2008", " ", "by", " ", "Phil", "lip", " ", "Pipe", "r_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", ":", " ", " ", "wx", "Window", "s", " ", "license_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "-----", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Change", " ", "log", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2008", "/", "0", "8", "/", "02", " ", " ", "JP", "P", " ", " ", " ", "Added", " ", "list", " ", "printin", "g", " ", "material_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2008", "/", "0", "7", "/", "24", " ", " ", "JP", "P", " ", " ", " ", "Added", " ", "list", " ", "group", " ", "relate", "d", " ", "material_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2008", "/", "0", "6", "/", "1", "9", " ", " ", "JP", "P", " ", " ", " ", "Added", " ", "sort", " ", "event", " ", "relate", "d", " ", "material_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2008", "/", "04", "/", "11", " ", " ", "JP", "P", " ", " ", " ", "Initial", " ", "Version_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "An", " ", "Object", "List", "View", " ", "provide", "s", " ", "a", " ", "more", " ", "conv", "ien", "ent", " ", "and", " ", "power", "ful", " ", "interface", " ", "to", " ", "a", " ", "List", "Ctrl", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "version\\u\\u_", "=_", "'", "1.2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "copyright\\u\\u_", "=_", "\"", "Copy", "right", " ", "(", "c", ")", " ", "2008", " ", "Phil", "lip", " ", "Pipe", "r", " ", "(", "phil", "lip", "\\u", "pipe", "r", "@", "big", "foot", ".", "com", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Object", "List", "View_", "import_", "Object", "List", "View_", ",_", "Virt", "ual", "Object", "List", "View_", ",_", "Colum", "n", "Defn_", ",_", "Fast", "Object", "List", "View_", ",_", "Group", "List", "View_", ",_", "List", "Group_", ",_", "Bat", "ched", "Update_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "OL", "VE", "vent_", "import_", "Cel", "l", "Edit", "Finish", "ed", "Event_", ",_", "Cel", "l", "Edit", "Finish", "ing", "Event_", ",_", "Cel", "l", "Edit", "Start", "ed", "Event_", ",_", "Cel", "l", "Edit", "Start", "ing", "Event_", ",_", "Sort", "Event_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "OL", "VE", "vent_", "import_", "EV", "T", "\\u", "CELL", "\\u", "EDIT", "\\u", "START", "ING_", ",_", "EV", "T", "\\u", "CELL", "\\u", "EDIT", "\\u", "STARTED_", ",_", "EV", "T", "\\u", "CELL", "\\u", "EDIT", "\\u", "FINISH", "ING_", ",_", "EV", "T", "\\u", "CELL", "\\u", "EDIT", "\\u", "FINISH", "ED_", ",_", "EV", "T", "\\u", "SORT", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "OL", "VE", "vent_", "import_", "EV", "T", "\\u", "COLL", "APS", "ING_", ",_", "EV", "T", "\\u", "COLL", "APS", "ED_", ",_", "EV", "T", "\\u", "EXPAN", "DING", "_", ",_", "EV", "T", "\\u", "EXPAN", "DED", "_", ",_", "EV", "T", "\\u", "GROU", "P", "\\u", "CREATI", "NG_", ",_", "EV", "T", "\\u", "GROU", "P", "\\u", "SORT", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Cel", "l", "Editor_", "import_", "Cel", "l", "Edit", "or", "Registry_", ",_", "Make", "Auto", "Complete", "Text", "Box_", ",_", "Make", "Auto", "Complete", "Comb", "o", "Box_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "List", "Ctrl", "Printer_", "import_", "List", "Ctrl", "Printer_", ",_", "Report", "Format_", ",_", "Block", "Format_", ",_", "Line", "Decorat", "ion_", ",_", "Rect", "angle", "Decorat", "ion_", ",_", "Image", "Decorat", "ion_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "Filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "all\\u\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Bat", "ched", "Update", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Block", "Format", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Cel", "l", "Edit", "Finish", "ed", "Event", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Cel", "l", "Edit", "Finish", "ing", "Event", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Cel", "l", "Edit", "or", "Regi", "stry", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Cel", "l", "Edit", "Start", "ed", "Event", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Cel", "l", "Edit", "Start", "ing", "Event", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Colum", "n", "Def", "n", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "EV", "T", "\\u", "CELL", "\\u", "EDIT", "\\u", "FINISH", "ED", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "EV", "T", "\\u", "CELL", "\\u", "EDIT", "\\u", "FINISH", "ING", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "EV", "T", "\\u", "CELL", "\\u", "EDIT", "\\u", "START", "ED", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "EV", "T", "\\u", "CELL", "\\u", "EDIT", "\\u", "START", "ING", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "EV", "T", "\\u", "COLL", "APS", "ED", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "EV", "T", "\\u", "COLL", "APS", "ING", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "EV", "T", "\\u", "EXPAN", "DED", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "EV", "T", "\\u", "EXPAN", "DING", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "EV", "T", "\\u", "GROU", "P", "\\u", "CREATI", "NG", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "EV", "T", "\\u", "GROU", "P", "\\u", "SORT", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "EV", "T", "\\u", "SORT", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Filter", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Fast", "Object", "List", "View", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Group", "List", "View", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "List", "Group", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Image", "Decorat", "ion", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Make", "Auto", "Complete", "Text", "Box", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Make", "Auto", "Complete", "Comb", "o", "Box", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "List", "Group", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Object", "List", "View", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "List", "Ctrl", "Print", "er", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Rect", "angle", "Decorat", "ion", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Report", "Format", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Sort", "Event", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Virt", "ual", "Object", "List", "View", "\"_", ",_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Variable defined multiple times
AppScale/appscale/AppServer/lib/setuptools-0.6c11/setuptools/command/egg_info.py
[ { "content": " def get_svn_revision(self):\n revision = 0\n urlre = re.compile('url=\"([^\"]+)\"')\n revre = re.compile('committed-rev=\"(\\d+)\"')\n\n for base,dirs,files in os.walk(os.curdir):\n if '.svn' not in dirs:\n dirs[:] = []\n continue # no sense walking uncontrolled subdirs\n dirs.remove('.svn')\n f = open(os.path.join(base,'.svn','entries'))\n data = f.read()\n f.close()\n\n if data.startswith('<?xml'):\n dirurl = urlre.search(data).group(1) # get repository URL\n localrev = max([int(m.group(1)) for m in revre.finditer(data)]+[0])\n else:\n try: svnver = int(data.splitlines()[0])\n except: svnver=-1\n if data<8:\n log.warn(\"unrecognized .svn/entries format; skipping %s\", base)\n dirs[:] = []\n continue\n \n data = map(str.splitlines,data.split('\\n\\x0c\\n'))\n del data[0][0] # get rid of the '8' or '9'\n dirurl = data[0][3]\n localrev = max([int(d[9]) for d in data if len(d)>9 and d[9]]+[0])\n if base==os.curdir:\n base_url = dirurl+'/' # save the root url\n elif not dirurl.startswith(base_url):\n dirs[:] = []\n continue # not part of the same svn tree, skip it\n revision = max(revision, localrev)\n\n return str(revision or get_pkg_info_revision())", "metadata": "root.egg_info.get_svn_revision", "header": "['class', 'egg_info', '(', 'Command', ')', ':', '___EOS___']", "index": 205 } ]
[ { "span": "svnver ", "start_line": 223, "start_column": 21, "end_line": 223, "end_column": 27 }, { "span": "svnver=", "start_line": 224, "start_column": 24, "end_line": 224, "end_column": 30 } ]
[]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "egg", "\\u", "info_", "(_", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "svn", "\\u", "revision_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "revision_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "urlr", "e_", "=_", "re_", "._", "compile_", "(_", "'", "url", "=\"(", "[", "^", "\"]+", ")\"", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rev", "re_", "=_", "re_", "._", "compile_", "(_", "'", "committ", "ed", "-", "rev", "=\"(", "\\\\", "d", "+)", "\"'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "base_", ",_", "dirs_", ",_", "files_", "in_", "os_", "._", "walk_", "(_", "os_", "._", "curdir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'.", "svn", "'_", "not_", "in_", "dirs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dirs_", "[_", ":_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "#", " ", "no", " ", "sense", " ", "walking", " ", "uncon", "troll", "ed", " ", "subdirs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dirs_", "._", "remove_", "(_", "'.", "svn", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "base_", ",_", "'.", "svn", "'_", ",_", "'", "entri", "es", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "f_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "data_", "._", "startswith_", "(_", "'<", "?", "xml", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dir", "url_", "=_", "urlr", "e_", "._", "search_", "(_", "data_", ")_", "._", "group_", "(_", "1_", ")_", "#", " ", "get", " ", "repos", "itor", "y", " ", "URL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "local", "rev_", "=_", "max_", "(_", "[_", "int_", "(_", "m_", "._", "group_", "(_", "1_", ")_", ")_", "for_", "m_", "in_", "rev", "re_", "._", "finditer_", "(_", "data_", ")_", "]_", "+_", "[_", "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 ", " _", "try_", ":_", "svn", "ver_", "=_", "int_", "(_", "data_", "._", "splitlines_", "(_", ")_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "svn", "ver_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "data_", "<_", "8_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "log_", "._", "warn_", "(_", "\"", "unre", "cogni", "zed", " ", ".", "svn", "/", "entri", "es", " ", "format", ";", " ", "skip", "ping", " ", "%", "s", "\"_", ",_", "base_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dirs_", "[_", ":_", "]_", "=_", "[_", "]_", "\\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_", "data_", "=_", "map_", "(_", "str_", "._", "splitlines_", ",_", "data_", "._", "split_", "(_", "'\\\\", "n", "\\\\", "x0", "c", "\\\\", "n", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "data_", "[_", "0_", "]_", "[_", "0_", "]_", "#", " ", "get", " ", "rid", " ", "of", " ", "the", " ", "'", "8", "'", " ", "or", " ", "'", "9", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dir", "url_", "=_", "data_", "[_", "0_", "]_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "local", "rev_", "=_", "max_", "(_", "[_", "int_", "(_", "d_", "[_", "9_", "]_", ")_", "for_", "d_", "in_", "data_", "if_", "len_", "(_", "d_", ")_", ">_", "9_", "and_", "d_", "[_", "9_", "]_", "]_", "+_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "base_", "==_", "os_", "._", "curdir_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base", "\\u", "url_", "=_", "dir", "url_", "+_", "'/'_", "#", " ", "save", " ", "the", " ", "root", " ", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "dir", "url_", "._", "startswith_", "(_", "base", "\\u", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dirs_", "[_", ":_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "#", " ", "not", " ", "part", " ", "of", " ", "the", " ", "same", " ", "svn", " ", "tree", ",", " ", "skip", " ", "it_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "revision_", "=_", "max_", "(_", "revision_", ",_", "local", "rev_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "str_", "(_", "revision_", "or_", "get", "\\u", "pkg", "\\u", "info", "\\u", "revision_", "(_", ")_", ")_", "\\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,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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 ]
Unused import
rdhyee/working-open-data-2014/notebooks/Day_01_B_World_Population.py
[ { "content": "# -*- coding: utf-8 -*-\n# <nbformat>3.0</nbformat>\n\n# <headingcell level=1>\n\n# Goals\n\n# <markdowncell>\n\n# Some goals for this exercise:\n# \n# * to reacquaint ourselves with Python\n# * to start learning how to use a particular IPython notebook environment, one which is easy to jump right into, namely [Wakari](https://www.wakari.io/)\n# * to learn a bit about the international context before diving into the US Census.\n# * to get ourselves into looking at the Wikipedia as a data source.\n# \n# Thinking about populations of various geographic entities is a good place to start with open data. We can to work with numbers without necessarily involving complicated mathematics. Just addition if we're lucky. We can also think about geographical locations. We can build out from our initial explorations in a systematic manner.\n\n# <headingcell level=1>\n\n# Things to Think About\n\n# <markdowncell>\n\n# Off the top of your head:\n# \n# * What do you think is the current world population?\n# * How many countries are there?\n# * How many people are there in the USA? Canada? Mexico? Your favorite country?\n# * What is the minimum number of countries to add up to 50% of the world's population? How about 90%?\n# \n# Now go answer these questions looking on the web. Find some a source or two or three.\n\n# <headingcell level=1>\n\n# Data Source for Populations\n\n# <markdowncell>\n\n# Two open sources we'll consider:\n# \n# * [CIA World Factbook: Country Comparison Population](https://www.cia.gov/library/publications/the-world-factbook/rankorder/2119rank.html) (see also [The World Factbook: ABOUT :: COPYRIGHT AND CONTRIBUTORS](https://www.cia.gov/library/publications/the-world-factbook/docs/contributor_copyright.html))\n# * [List of countries by population (United Nations) - Wikipedia, the free encyclopedia](https://en.wikipedia.org/w/index.php?title=List_of_countries_by_population_(United_Nations)) (see also [Wikipedia:Reusing Wikipedia content - Wikipedia, the free encyclopedia](https://en.wikipedia.org/wiki/Wikipedia:Reusing_Wikipedia_content)) -- btw, not the same as [List of countries by population - Wikipedia, the free encyclopedia](https://en.wikipedia.org/wiki/List_of_countries_by_population).\n# \n# We will study how to parse these data sources in a later exercise, but for this exercise, the data sets have been parsed into [JSON format](https://en.wikipedia.org/wiki/JSON), which is easily loadable in many languages, including Python using the [json Python standard library](http://docs.python.org/2/library/json.html). We'll also use [requests](http://docs.python-requests.org/en/latest/).\n# \n# Let's look first at the Wikipedia source.\n\n# <codecell>\n\n# https://gist.github.com/rdhyee/8511607/raw/f16257434352916574473e63612fcea55a0c1b1c/population_of_countries.json\n# scraping of https://en.wikipedia.org/w/index.php?title=List_of_countries_by_population_(United_Nations)&oldid=590438477\n\n# read population in\nimport json\nimport requests\n\npop_json_url = \"https://gist.github.com/rdhyee/8511607/raw/f16257434352916574473e63612fcea55a0c1b1c/population_of_countries.json\"\npop_list= requests.get(pop_json_url).json()\npop_list\n\n# <headingcell level=1>\n\n# EXERCISES\n\n# <markdowncell>\n\n# Show how to calculate the total population according to the list in the Wikipedia. (Answer: 7,162,119,434)\n\n# <codecell>\n\ntotal = 0\nfor country in pop_list:\n total += country[2]\nprint total\n\n# <codecell>\n\nsum([country[2] for country in pop_list])\n\n# <markdowncell>\n\n# Calculate the total population of 196 entities that have a numeric rank. (Answer: 7,145,999,288) BTW, are those entities actually countries?\n\n# <codecell>\n\nsum([country[2] for country in pop_list if country[0] is not None])\n\n# <markdowncell>\n\n# Calculate the total population according to [The World Factbook: Country Comparison Population](https://www.cia.gov/library/publications/the-world-factbook/rankorder/2119rank.html) (See https://gist.github.com/rdhyee/8530164).\n\n# <codecell>\n\n# https://gist.github.com/rdhyee/8530164/raw/f8e842fe8ccd6e3bc424e3a24e41ef5c38f419e8/world_factbook_poulation.json\n# https://gist.github.com/rdhyee/8530164\n# https://www.cia.gov/library/publications/the-world-factbook/rankorder/2119rank.html\n# https://www.cia.gov/library/publications/the-world-factbook/rankorder/rawdata_2119.txt\n\n\nimport json\nimport requests\n\ncia_json_url = \"https://gist.github.com/rdhyee/8530164/raw/f8e842fe8ccd6e3bc424e3a24e41ef5c38f419e8/world_factbook_poulation.json\"\ncia_list= requests.get(cia_json_url).json()\n\n\ncia_world_pop = sum([r[2] for r in cia_list if r[1] != 'European Union'])\ncia_world_pop\n\n# <headingcell level=1>\n\n# CHALLENGE EXERCISE\n\n# <markdowncell>\n\n# Now for something more interesting. I'd like for us to get a feel of what it'd be like to pick a person completely at random from the world's population. Say, if you were picking 5 people -- where might these people be from? Of course, you won't be surprised to pick someone from China or India since those countries are so populous. But how likely will it be for someone from the USA to show up?\n# \n# To the end of answering this question, start thinking about writing a Python generator that will return the name of a country in which the probability of that country being returned is the proportion of the world's population represented by that country. \n# \n# Work with your neighbors -- we'll come back to this problem in detail in class on Thursday.\n\n# <codecell>\n\n# This solution is a bit \"fancy\" and can certainly be better commented.\n\nimport bisect\nimport random\nfrom itertools import repeat, islice\nfrom collections import Counter\n\n# http://stackoverflow.com/a/15889203/7782\n\n# depends on pop_list above\n \nworld_pop = sum([r[2] for r in pop_list])\ncum_pop = list(cumsum((r[2] for r in pop_list)))\n\n \n\n# <codecell>\n\n# generate 5 random countries and feed to Counter\nCounter(islice(random_country_weighted_by_pop(),5))\n\n# <markdowncell>\n\n# \n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def cumsum(lis):\n total = 0\n for x in lis:\n total += x\n yield total", "metadata": "root.cumsum", "header": "['module', '___EOS___']", "index": 132 }, { "content": "def random_country_weighted_by_pop():\n while True:\n yield pop_list[bisect.bisect_left(cum_pop,random.randint(1,world_pop))][1]", "metadata": "root.random_country_weighted_by_pop", "header": "['module', '___EOS___']", "index": 143 } ]
[ { "span": "import json", "start_line": 54, "start_column": 0, "end_line": 54, "end_column": 11 }, { "span": "import json", "start_line": 100, "start_column": 0, "end_line": 100, "end_column": 11 }, { "span": "from itertools import repeat, islice", "start_line": 128, "start_column": 0, "end_line": 128, "end_column": 36 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "nb", "format", ">", "3.0", "</", "nb", "format", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "heading", "cell", " ", "level", "=", "1", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Goal", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "mark", "down", "cell", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Some", " ", "goal", "s", " ", "for", " ", "this", " ", "exercise", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "to", " ", "rea", "cq", "ua", "int", " ", "ours", "elv", "es", " ", "with", " ", "Python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "to", " ", "start", " ", "learn", "ing", " ", "how", " ", "to", " ", "use", " ", "a", " ", "partic", "ular", " ", "IP", "yth", "on", " ", "notebook", " ", "environ", "ment", ",", " ", "one", " ", "whi", "ch", " ", "is", " ", "easy", " ", "to", " ", "jump", " ", "right", " ", "int", "o", ",", " ", "namel", "y", " ", "[", "Wa", "kar", "i", "](", "https", "://", "www", ".", "wa", "kar", "i", ".", "io", "/)", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "to", " ", "learn", " ", "a", " ", "bit", " ", "abo", "ut", " ", "the", " ", "international", " ", "context", " ", "bef", "ore", " ", "divi", "ng", " ", "int", "o", " ", "the", " ", "US", " ", "Cen", "sus", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "to", " ", "get", " ", "ours", "elv", "es", " ", "int", "o", " ", "look", "ing", " ", "at", " ", "the", " ", "Wiki", "pedi", "a", " ", "as", " ", "a", " ", "data", " ", "source", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thin", "king", " ", "abo", "ut", " ", "populations", " ", "of", " ", "vari", "ous", " ", "geographic", " ", "entit", "ies", " ", "is", " ", "a", " ", "good", " ", "place", " ", "to", " ", "start", " ", "with", " ", "open", " ", "data", ".", " ", " ", "We", " ", "can", " ", "to", " ", "work", " ", "with", " ", "numbers", " ", "with", "out", " ", "necessar", "il", "y", " ", "involv", "ing", " ", "compli", "cated", " ", "mathe", "matics", ".", " ", " ", "Ju", "st", " ", "addition", " ", "if", " ", "we", "'", "re", " ", "luck", "y", ".", " ", "We", " ", "can", " ", "als", "o", " ", "think", " ", "abo", "ut", " ", "geographic", "al", " ", "location", "s", ".", " ", " ", "We", " ", "can", " ", "build", " ", "out", " ", "from", " ", "our", " ", "initial", " ", "exploration", "s", " ", "in", " ", "a", " ", "system", "atic", " ", "manner", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "heading", "cell", " ", "level", "=", "1", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thin", "gs", " ", "to", " ", "Thin", "k", " ", "About_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "mark", "down", "cell", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Off", " ", "the", " ", "top", " ", "of", " ", "your", " ", "head", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "*", " ", "What", " ", "do", " ", "you", " ", "think", " ", "is", " ", "the", " ", "current", " ", "world", " ", "popul", "ation", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "*", " ", "Ho", "w", " ", "many", " ", "countr", "ies", " ", "are", " ", "there", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "*", " ", "Ho", "w", " ", "many", " ", "people", " ", "are", " ", "there", " ", "in", " ", "the", " ", "USA", "?", " ", " ", "Cana", "da", "?", " ", " ", "Me", "xic", "o", "?", " ", " ", "You", "r", " ", "favorite", " ", "countr", "y", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "*", " ", "What", " ", "is", " ", "the", " ", "minim", "um", " ", "number", " ", "of", " ", "countr", "ies", " ", "to", " ", "add", " ", "up", " ", "to", " ", "50", "%", " ", "of", " ", "the", " ", "world", "'", "s", " ", "popul", "ation", "?", " ", " ", "Ho", "w", " ", "abo", "ut", " ", "90", "%", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "go", " ", "answer", " ", "these", " ", "question", "s", " ", "look", "ing", " ", "on", " ", "the", " ", "web", ".", " ", " ", "Fin", "d", " ", "some", " ", "a", " ", "source", " ", "or", " ", "two", " ", "or", " ", "three", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "heading", "cell", " ", "level", "=", "1", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Data", " ", "Sou", "rce", " ", "for", " ", "Popula", "tions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "mark", "down", "cell", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tw", "o", " ", "open", " ", "source", "s", " ", "we", "'", "ll", " ", "consider", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "[", "CI", "A", " ", "Wor", "ld", " ", "Fact", "book", ":", " ", "Count", "ry", " ", "Compari", "son", " ", "Popula", "tion", "](", "https", "://", "www", ".", "cia", ".", "gov", "/", "librar", "y", "/", "publications", "/", "the", "-", "world", "-", "fact", "book", "/", "rank", "order", "/", "211", "9", "rank", ".", "html", ")", " ", "(", "see", " ", "als", "o", " ", "[", "The", " ", "Wor", "ld", " ", "Fact", "book", ":", " ", "ABO", "UT", " ", "::", " ", "COPY", "RIG", "HT", " ", "AND", " ", "CONTRIB", "UTO", "RS", "](", "https", "://", "www", ".", "cia", ".", "gov", "/", "librar", "y", "/", "publications", "/", "the", "-", "world", "-", "fact", "book", "/", "docs", "/", "contributor", "\\u", "copyr", "ight", ".", "html", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "[", "List", " ", "of", " ", "countr", "ies", " ", "by", " ", "popul", "ation", " ", "(", "Unit", "ed", " ", "Nat", "ion", "s", ")", " ", "-", " ", "Wiki", "pedi", "a", ",", " ", "the", " ", "free", " ", "ency", "clo", "pedi", "a", "](", "https", "://", "en", ".", "wikip", "edia", ".", "org", "/", "w", "/", "index", ".", "php", "?", "title", "=", "List", "\\u", "of", "\\u", "countr", "ies", "\\u", "by", "\\u", "popul", "ation", "\\u(", "Unit", "ed", "\\u", "Nat", "ion", "s", "))", " ", "(", "see", " ", "als", "o", " ", "[", "Wiki", "pedi", "a", ":", "Reu", "sing", " ", "Wiki", "pedi", "a", " ", "content", " ", "-", " ", "Wiki", "pedi", "a", ",", " ", "the", " ", "free", " ", "ency", "clo", "pedi", "a", "](", "https", "://", "en", ".", "wikip", "edia", ".", "org", "/", "wiki", "/", "Wiki", "pedi", "a", ":", "Reu", "sing", "\\u", "Wiki", "pedi", "a", "\\u", "content", "))", " ", "--", " ", "bt", "w", ",", " ", "not", " ", "the", " ", "same", " ", "as", " ", "[", "List", " ", "of", " ", "countr", "ies", " ", "by", " ", "popul", "ation", " ", "-", " ", "Wiki", "pedi", "a", ",", " ", "the", " ", "free", " ", "ency", "clo", "pedi", "a", "](", "https", "://", "en", ".", "wikip", "edia", ".", "org", "/", "wiki", "/", "List", "\\u", "of", "\\u", "countr", "ies", "\\u", "by", "\\u", "popul", "ation", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "will", " ", "stud", "y", " ", "how", " ", "to", " ", "parse", " ", "these", " ", "data", " ", "source", "s", " ", "in", " ", "a", " ", "late", "r", " ", "exercise", ",", " ", "but", " ", "for", " ", "this", " ", "exercise", ",", " ", "the", " ", "data", " ", "sets", " ", "have", " ", "bee", "n", " ", "parsed", " ", "int", "o", " ", "[", "JSO", "N", " ", "format", "](", "https", "://", "en", ".", "wikip", "edia", ".", "org", "/", "wiki", "/", "JSO", "N", "),", " ", "whi", "ch", " ", "is", " ", "easi", "ly", " ", "loada", "ble", " ", "in", " ", "many", " ", "language", "s", ",", " ", "inclu", "ding", " ", "Pyth", "on", " ", "usi", "ng", " ", "the", " ", "[", "json", " ", "Pyth", "on", " ", "standard", " ", "librar", "y", "](", "http", "://", "docs", ".", "python", ".", "org", "/", "2", "/", "librar", "y", "/", "json", ".", "html", ").", " ", " ", "We", "'", "ll", " ", "als", "o", " ", "use", " ", "[", "request", "s", "](", "http", "://", "docs", ".", "python", "-", "request", "s", ".", "org", "/", "en", "/", "late", "st", "/)", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Let", "'", "s", " ", "look", " ", "first", " ", "at", " ", "the", " ", "Wiki", "pedi", "a", " ", "source", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "codec", "ell", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "https", "://", "gist", ".", "git", "hub", ".", "com", "/", "rd", "hy", "ee", "/", "851", "160", "7", "/", "raw", "/", "f1", "625", "743", "435", "291", "657", "447", "3e", "636", "1", "2f", "cea", "5", "5a", "0c", "1b", "1c", "/", "popul", "ation", "\\u", "of", "\\u", "countr", "ies", ".", "json_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "scrap", "ing", " ", "of", " ", "https", "://", "en", ".", "wikip", "edia", ".", "org", "/", "w", "/", "index", ".", "php", "?", "title", "=", "List", "\\u", "of", "\\u", "countr", "ies", "\\u", "by", "\\u", "popul", "ation", "\\u(", "Unit", "ed", "\\u", "Nat", "ion", "s", ")&", "oldi", "d", "=", "590", "438", "477", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "read", " ", "popul", "ation", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "requests_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pop", "\\u", "json", "\\u", "url_", "=_", "\"", "https", "://", "gist", ".", "git", "hub", ".", "com", "/", "rd", "hy", "ee", "/", "851", "160", "7", "/", "raw", "/", "f1", "625", "743", "435", "291", "657", "447", "3e", "636", "1", "2f", "cea", "5", "5a", "0c", "1b", "1c", "/", "popul", "ation", "\\u", "of", "\\u", "countr", "ies", ".", "json", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pop", "\\u", "list_", "=_", "requests_", "._", "get_", "(_", "pop", "\\u", "json", "\\u", "url_", ")_", "._", "json_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pop", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "heading", "cell", " ", "level", "=", "1", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "EXE", "RC", "ISE", "S_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "mark", "down", "cell", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Show", " ", "how", " ", "to", " ", "calcul", "ate", " ", "the", " ", "total", " ", "popul", "ation", " ", "according", " ", "to", " ", "the", " ", "list", " ", "in", " ", "the", " ", "Wiki", "pedi", "a", ".", " ", "(", "Answer", ":", " ", "7", ",", "162", ",", "119", ",", "434", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "codec", "ell", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "total_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "country_", "in_", "pop", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "total_", "+=_", "country_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "total_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "codec", "ell", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sum_", "(_", "[_", "country_", "[_", "2_", "]_", "for_", "country_", "in_", "pop", "\\u", "list_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "mark", "down", "cell", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Calculat", "e", " ", "the", " ", "total", " ", "popul", "ation", " ", "of", " ", "196", " ", "entit", "ies", " ", "tha", "t", " ", "have", " ", "a", " ", "numeri", "c", " ", "rank", ".", " ", "(", "Answer", ":", " ", "7", ",", "145", ",", "999", ",", "288", ")", " ", "BT", "W", ",", " ", "are", " ", "tho", "se", " ", "entit", "ies", " ", "actual", "ly", " ", "countr", "ies", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "codec", "ell", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sum_", "(_", "[_", "country_", "[_", "2_", "]_", "for_", "country_", "in_", "pop", "\\u", "list_", "if_", "country_", "[_", "0_", "]_", "is_", "not_", "None_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "mark", "down", "cell", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Calculat", "e", " ", "the", " ", "total", " ", "popul", "ation", " ", "according", " ", "to", " ", "[", "The", " ", "Wor", "ld", " ", "Fact", "book", ":", " ", "Count", "ry", " ", "Compari", "son", " ", "Popula", "tion", "](", "https", "://", "www", ".", "cia", ".", "gov", "/", "librar", "y", "/", "publications", "/", "the", "-", "world", "-", "fact", "book", "/", "rank", "order", "/", "211", "9", "rank", ".", "html", ")", " ", "(", "See", " ", "https", "://", "gist", ".", "git", "hub", ".", "com", "/", "rd", "hy", "ee", "/", "853", "016", "4", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "codec", "ell", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "https", "://", "gist", ".", "git", "hub", ".", "com", "/", "rd", "hy", "ee", "/", "853", "016", "4", "/", "raw", "/", "f8", "e8", "4", "2f", "e8", "ccd", "6e", "3b", "c4", "24", "e3", "a2", "4e", "4", "1e", "f5", "c3", "8f", "419", "e8", "/", "world", "\\u", "fact", "book", "\\u", "pou", "lation", ".", "json_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "https", "://", "gist", ".", "git", "hub", ".", "com", "/", "rd", "hy", "ee", "/", "853", "016", "4_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "https", "://", "www", ".", "cia", ".", "gov", "/", "librar", "y", "/", "publications", "/", "the", "-", "world", "-", "fact", "book", "/", "rank", "order", "/", "211", "9", "rank", ".", "html_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "https", "://", "www", ".", "cia", ".", "gov", "/", "librar", "y", "/", "publications", "/", "the", "-", "world", "-", "fact", "book", "/", "rank", "order", "/", "raw", "data\\u", "211", "9", ".", "txt_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "requests_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cia", "\\u", "json", "\\u", "url_", "=_", "\"", "https", "://", "gist", ".", "git", "hub", ".", "com", "/", "rd", "hy", "ee", "/", "853", "016", "4", "/", "raw", "/", "f8", "e8", "4", "2f", "e8", "ccd", "6e", "3b", "c4", "24", "e3", "a2", "4e", "4", "1e", "f5", "c3", "8f", "419", "e8", "/", "world", "\\u", "fact", "book", "\\u", "pou", "lation", ".", "json", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cia", "\\u", "list_", "=_", "requests_", "._", "get_", "(_", "cia", "\\u", "json", "\\u", "url_", ")_", "._", "json_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cia", "\\u", "world", "\\u", "pop_", "=_", "sum_", "(_", "[_", "r_", "[_", "2_", "]_", "for_", "r_", "in_", "cia", "\\u", "list_", "if_", "r_", "[_", "1_", "]_", "!=_", "'", "Euro", "pea", "n", " ", "Uni", "on", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cia", "\\u", "world", "\\u", "pop_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "heading", "cell", " ", "level", "=", "1", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "CHA", "LLE", "NGE", " ", "EXE", "RC", "ISE", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "mark", "down", "cell", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "for", " ", "somet", "hing", " ", "more", " ", "interesting", ".", " ", "I", "'", "d", " ", "like", " ", "for", " ", "us", " ", "to", " ", "get", " ", "a", " ", "feel", " ", "of", " ", "what", " ", "it", "'", "d", " ", "be", " ", "like", " ", "to", " ", "pick", " ", "a", " ", "person", " ", "complete", "ly", " ", "at", " ", "random", " ", "from", " ", "the", " ", "world", "'", "s", " ", "popul", "ation", ".", " ", " ", "Say", ",", " ", "if", " ", "you", " ", "wer", "e", " ", "pick", "ing", " ", "5", " ", "people", " ", "--", " ", "where", " ", "mig", "ht", " ", "these", " ", "people", " ", "be", " ", "from", "?", " ", " ", "Of", " ", "course", ",", " ", "you", " ", "won", "'", "t", " ", "be", " ", "sur", "pris", "ed", " ", "to", " ", "pick", " ", "some", "one", " ", "from", " ", "Chin", "a", " ", "or", " ", "Indi", "a", " ", "sinc", "e", " ", "tho", "se", " ", "countr", "ies", " ", "are", " ", "so", " ", "popul", "ous", ".", " ", " ", "Bu", "t", " ", "how", " ", "like", "ly", " ", "will", " ", "it", " ", "be", " ", "for", " ", "some", "one", " ", "from", " ", "the", " ", "USA", " ", "to", " ", "show", " ", "up", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "To", " ", "the", " ", "end", " ", "of", " ", "answer", "ing", " ", "this", " ", "question", ",", " ", "start", " ", "think", "ing", " ", "abo", "ut", " ", "writ", "ing", " ", "a", " ", "Pyth", "on", " ", "generat", "or", " ", "tha", "t", " ", "will", " ", "return", " ", "the", " ", "name", " ", "of", " ", "a", " ", "countr", "y", " ", "in", " ", "whi", "ch", " ", "the", " ", "probabilit", "y", " ", "of", " ", "tha", "t", " ", "countr", "y", " ", "bei", "ng", " ", "return", "ed", " ", "is", " ", "the", " ", "proportion", " ", "of", " ", "the", " ", "world", "'", "s", " ", "popul", "ation", " ", "represent", "ed", " ", "by", " ", "tha", "t", " ", "countr", "y", ".", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Work", " ", "with", " ", "your", " ", "neighbor", "s", " ", "--", " ", "we", "'", "ll", " ", "come", " ", "back", " ", "to", " ", "this", " ", "problem", " ", "in", " ", "deta", "il", " ", "in", " ", "class", " ", "on", " ", "Thu", "rsd", "ay", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "codec", "ell", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "solut", "ion", " ", "is", " ", "a", " ", "bit", " ", "\"", "fancy", "\"", " ", "and", " ", "can", " ", "cert", "ain", "ly", " ", "be", " ", "bett", "er", " ", "commente", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "bisect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "itertools_", "import_", "repeat_", ",_", "islice_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "collections_", "import_", "Counter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "stack", "overflow", ".", "com", "/", "a", "/", "158", "892", "03", "/", "778", "2_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "depend", "s", " ", "on", " ", "pop", "\\u", "list", " ", "above_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "world", "\\u", "pop_", "=_", "sum_", "(_", "[_", "r_", "[_", "2_", "]_", "for_", "r_", "in_", "pop", "\\u", "list_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cum", "\\u", "pop_", "=_", "list_", "(_", "cumsum_", "(_", "(_", "r_", "[_", "2_", "]_", "for_", "r_", "in_", "pop", "\\u", "list_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "codec", "ell", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "generat", "e", " ", "5", " ", "random", " ", "countr", "ies", " ", "and", " ", "feed", " ", "to", " ", "Counter_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Counter_", "(_", "islice_", "(_", "random", "\\u", "countr", "y", "\\u", "weight", "ed", "\\u", "by", "\\u", "pop_", "(_", ")_", ",_", "5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "mark", "down", "cell", ">_", "\\u\\u\\uNL\\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_", "def_", "cumsum_", "(_", "lis_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "total_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "lis_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "total_", "+=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "total_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "random", "\\u", "countr", "y", "\\u", "weight", "ed", "\\u", "by", "\\u", "pop_", "(_", ")_", ":_", "\\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_", "pop", "\\u", "list_", "[_", "bisect_", "._", "bisect", "\\u", "left_", "(_", "cum", "\\u", "pop_", ",_", "random_", "._", "randint_", "(_", "1_", ",_", "world", "\\u", "pop_", ")_", ")_", "]_", "[_", "1_", "]_", "\\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, 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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
RobotLocomotion/director/src/python/tests/testPropertiesPanel.py
[ { "content": "def main():\n\n\n obj = om.ObjectModelItem('test')\n obj.addProperty('double', 1.0, attributes=om.PropertyAttributes(decimals=2, minimum=0, maximum=100, singleStep=0.5))\n obj.addProperty('double list', [1.0, 2.0, 3.0], attributes=om.PropertyAttributes(decimals=2, minimum=0, maximum=100, singleStep=0.5))\n\n obj.addProperty('int', 1, attributes=om.PropertyAttributes(minimum=0, maximum=100, singleStep=5))\n obj.addProperty('int list', [1, 2, 3], attributes=om.PropertyAttributes(minimum=0, maximum=100, singleStep=1))\n\n obj.addProperty('bool', True)\n\n obj.addProperty('str', 'value')\n\n obj.addProperty('str list', 0, attributes=om.PropertyAttributes(enumNames=['value 1', 'value 2', 'value 3']))\n\n obj.addProperty('color', [1.0, 0.5, 0.0])\n\n panel = PythonQt.dd.ddPropertiesPanel()\n panel.setBrowserModeToWidget()\n panel.show()\n\n panelConnector = propertyset.PropertyPanelConnector(obj.properties, panel)\n\n\n def onPropertyChanged(propertySet, propertyName):\n obj.properties.setPropertyAttribute('str list', 'enumNames', ['one','two','three'])\n\n obj.properties.connectPropertyChanged(onPropertyChanged)\n obj.setProperty('bool', False)\n\n assert 'one' in obj.properties.getPropertyAttribute('str list', 'enumNames')\n\n\n _pythonManager.consoleWidget().show()\n startApplication(enableQuitTimer=True)", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 17 } ]
[ { "span": "panelConnector ", "start_line": 39, "start_column": 4, "end_line": 39, "end_column": 18 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "=_", "om_", "._", "Object", "Model", "Item_", "(_", "'", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "add", "Property_", "(_", "'", "double", "'_", ",_", "1.0_", ",_", "attributes_", "=_", "om_", "._", "Proper", "ty", "Attributes_", "(_", "decimals_", "=_", "2_", ",_", "minimum_", "=_", "0_", ",_", "maximum_", "=_", "100_", ",_", "single", "Step_", "=_", "0.5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "add", "Property_", "(_", "'", "double", " ", "list", "'_", ",_", "[_", "1.0_", ",_", "2.0_", ",_", "3.0_", "]_", ",_", "attributes_", "=_", "om_", "._", "Proper", "ty", "Attributes_", "(_", "decimals_", "=_", "2_", ",_", "minimum_", "=_", "0_", ",_", "maximum_", "=_", "100_", ",_", "single", "Step_", "=_", "0.5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "obj_", "._", "add", "Property_", "(_", "'", "int", "'_", ",_", "1_", ",_", "attributes_", "=_", "om_", "._", "Proper", "ty", "Attributes_", "(_", "minimum_", "=_", "0_", ",_", "maximum_", "=_", "100_", ",_", "single", "Step_", "=_", "5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "add", "Property_", "(_", "'", "int", " ", "list", "'_", ",_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", ",_", "attributes_", "=_", "om_", "._", "Proper", "ty", "Attributes_", "(_", "minimum_", "=_", "0_", ",_", "maximum_", "=_", "100_", ",_", "single", "Step_", "=_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "obj_", "._", "add", "Property_", "(_", "'", "bool", "'_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "obj_", "._", "add", "Property_", "(_", "'", "str", "'_", ",_", "'", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "obj_", "._", "add", "Property_", "(_", "'", "str", " ", "list", "'_", ",_", "0_", ",_", "attributes_", "=_", "om_", "._", "Proper", "ty", "Attributes_", "(_", "enum", "Names_", "=_", "[_", "'", "value", " ", "1", "'_", ",_", "'", "value", " ", "2", "'_", ",_", "'", "value", " ", "3", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "obj_", "._", "add", "Property_", "(_", "'", "color", "'_", ",_", "[_", "1.0_", ",_", "0.5_", ",_", "0.0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "panel_", "=_", "Pyth", "on", "Qt_", "._", "dd_", "._", "dd", "Proper", "ties", "Panel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "panel_", "._", "set", "Brows", "er", "Mode", "To", "Widget_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "panel_", "._", "show_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "panel", "Connector_", "=_", "property", "set_", "._", "Proper", "ty", "Pane", "l", "Connector_", "(_", "obj_", "._", "properties_", ",_", "panel_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "on", "Proper", "ty", "Changed_", "(_", "property", "Set_", ",_", "property", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "._", "properties_", "._", "set", "Proper", "ty", "Attribute_", "(_", "'", "str", " ", "list", "'_", ",_", "'", "enum", "Names", "'_", ",_", "[_", "'", "one", "'_", ",_", "'", "two", "'_", ",_", "'", "three", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "obj_", "._", "properties_", "._", "connect", "Proper", "ty", "Changed_", "(_", "on", "Proper", "ty", "Changed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "set", "Property_", "(_", "'", "bool", "'_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "'", "one", "'_", "in_", "obj_", "._", "properties_", "._", "get", "Proper", "ty", "Attribute_", "(_", "'", "str", " ", "list", "'_", ",_", "'", "enum", "Names", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "python", "Manager_", "._", "console", "Widget_", "(_", ")_", "._", "show_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "Application_", "(_", "enable", "Qui", "t", "Timer_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
pyjs/pyjs/examples/libtest/FunctionTest.py
[ { "content": " def testLambda(self):\n f = lambda x: x\n self.assertEqual(f(1), 1)\n f = lambda x=1: x\n self.assertEqual(f(), 1)\n self.assertEqual(f(2), 2)\n\n f = lambda x, y: x*y\n self.assertEqual(f(2,3), 6)\n f = lambda x, y=4: x*y\n self.assertEqual(f(2), 8)\n h = Handler(5)\n f = lambda x: h.handle(x)\n self.assertTrue(f(5))\n self.assertFalse(f(4))\n\n f = lambda a, b=1, **kw: (a,b,kw)\n v = f(b = 2, c = 3, a = 1)\n self.assertEqual(v[0], 1)\n self.assertEqual(v[1], 2)\n self.assertEqual(v[2]['c'], 3)\n\n f = lambda a, b=1, *args: (a, b, args)\n v = f(1,2,3,4)\n self.assertEqual(v[2][0], 3)\n self.assertEqual(v[2][1], 4)\n\n try:\n class ClassWithLambdas1:\n f1 = [lambda *args: args[0]]\n except:\n self.fail(\"issue #385 - lambda in class definition\")\n else:\n c = ClassWithLambdas1()\n self.assertEqual(c.f1[0](1), 1, 'issue #385 - lambda function called as bound method')\n\n try:\n class ClassWithLambdas2:\n f2 = lambda *args: args[0]\n except:\n self.fail(\"issue #385 - lambda in class definition\")\n else:\n c = ClassWithLambdas2()\n self.assertEqual(c.f2(1), c, 'issue #385 - bound method lambda called as function')", "metadata": "root.FunctionTest.testLambda", "header": "['class', 'FunctionTest', '(', 'UnitTest', ')', ':', '___EOS___']", "index": 72 }, { "content": " def test_callable(self):\n try:\n self.assertEqual(Callable()(), 5)\n except:\n self.fail(\"Bug #572 Callable()() __call__ not supported\")\n self.assertTrue(callable(Callable))\n self.assertTrue(\n callable(Callable()),\n \"Bug #572 callable(Callable()) __call__ not supported\",\n )", "metadata": "root.FunctionTest.test_callable", "header": "['class', 'FunctionTest', '(', 'UnitTest', ')', ':', '___EOS___']", "index": 117 }, { "content": " def testNameMapping(self):\n r = call(1, 2, this=3, label=4)\n self.assertEqual(r[0], 'mapping-test')\n self.assertEqual(r[1], 1)\n self.assertEqual(r[2], 2)\n self.assertEqual(r[3], 3)\n self.assertEqual(r[4], 4)\n try:\n self.assertEqual(Text('foo'), 'Text: foo')\n except:\n self.fail(\"Bug #574: javascript keywords\")", "metadata": "root.FunctionTest.testNameMapping", "header": "['class', 'FunctionTest', '(', 'UnitTest', ')', ':', '___EOS___']", "index": 173 }, { "content": " def testFactory(self):\n\n Factory2.gregister(\"passme\", PassMeAClass)\n Factory2.gregister(\"exchild\", ExampleChildClass)\n Factory2.gregister(\"mscp1\", ExampleMultiSuperclassParent1)\n\n pmc = Factory2.ggetObject(\"passme\")\n self.assertEqual(pmc.foo(), \"foo in PassMeAClass\")\n\n try:\n pmc = Factory2.ggetObject(\"mscp1\", 5)\n except:\n self.assertEqual(False, True, \"Exception indicates bug in compiler: 'Error: uncaught exception: ExampleMultiSuperclassParent1() arguments after ** must be a dictionary 5'\")\n else:\n self.assertEqual(pmc.x, 5)\n try:\n pmc = Factory2.ggetObject(\"exchild\", 5, 7) # 5 is ignored\n except:\n self.assertEqual(False, True, \"Exception indicates bug in compiler: 'Error: uncaught exception: ExampleChildClass() arguments after ** must be a dictionary 7'\")\n else:\n self.assertEqual(pmc.prop_a, 1)\n self.assertEqual(pmc.prop_b, 7)", "metadata": "root.FunctionTest.testFactory", "header": "['class', 'FunctionTest', '(', 'UnitTest', ')', ':', '___EOS___']", "index": 185 } ]
[ { "span": "except:", "start_line": 102, "start_column": 8, "end_line": 102, "end_column": 15 }, { "span": "except:", "start_line": 111, "start_column": 8, "end_line": 111, "end_column": 15 }, { "span": "except:", "start_line": 120, "start_column": 8, "end_line": 120, "end_column": 15 }, { "span": "except:", "start_line": 182, "start_column": 8, "end_line": 182, "end_column": 15 }, { "span": "except:", "start_line": 196, "start_column": 8, "end_line": 196, "end_column": 15 }, { "span": "except:", "start_line": 202, "start_column": 8, "end_line": 202, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Function", "Test_", "(_", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test", "Lambda_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "lambda_", "x_", ":_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f_", "(_", "1_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "lambda_", "x_", "=_", "1_", ":_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f_", "(_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f_", "(_", "2_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "lambda_", "x_", ",_", "y_", ":_", "x_", "*_", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f_", "(_", "2_", ",_", "3_", ")_", ",_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "lambda_", "x_", ",_", "y_", "=_", "4_", ":_", "x_", "*_", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f_", "(_", "2_", ")_", ",_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "=_", "Handler_", "(_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "lambda_", "x_", ":_", "h_", "._", "handle_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "f_", "(_", "5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "f_", "(_", "4_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "lambda_", "a_", ",_", "b_", "=_", "1_", ",_", "**_", "kw_", ":_", "(_", "a_", ",_", "b_", ",_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "f_", "(_", "b_", "=_", "2_", ",_", "c_", "=_", "3_", ",_", "a_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "v_", "[_", "0_", "]_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "v_", "[_", "1_", "]_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "v_", "[_", "2_", "]_", "[_", "'", "c", "'_", "]_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "lambda_", "a_", ",_", "b_", "=_", "1_", ",_", "*_", "args_", ":_", "(_", "a_", ",_", "b_", ",_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "f_", "(_", "1_", ",_", "2_", ",_", "3_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "v_", "[_", "2_", "]_", "[_", "0_", "]_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "v_", "[_", "2_", "]_", "[_", "1_", "]_", ",_", "4_", ")_", "\\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 ", " _", "class_", "Class", "With", "Lam", "bda", "s1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f1_", "=_", "[_", "lambda_", "*_", "args_", ":_", "args_", "[_", "0_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "issue", " ", "#", "385", " ", "-", " ", "lambda", " ", "in", " ", "class", " ", "definit", "ion", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "Class", "With", "Lam", "bda", "s1_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "c_", "._", "f1_", "[_", "0_", "]_", "(_", "1_", ")_", ",_", "1_", ",_", "'", "issue", " ", "#", "385", " ", "-", " ", "lambda", " ", "function", " ", "call", "ed", " ", "as", " ", "bound", " ", "method", "'_", ")_", "\\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 ", " _", "class_", "Class", "With", "Lam", "bda", "s2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f2_", "=_", "lambda_", "*_", "args_", ":_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "issue", " ", "#", "385", " ", "-", " ", "lambda", " ", "in", " ", "class", " ", "definit", "ion", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "Class", "With", "Lam", "bda", "s2_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "c_", "._", "f2_", "(_", "1_", ")_", ",_", "c_", ",_", "'", "issue", " ", "#", "385", " ", "-", " ", "bound", " ", "method", " ", "lambda", " ", "call", "ed", " ", "as", " ", "function", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Function", "Test_", "(_", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "callable_", "(_", "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 ", " _", "self_", "._", "assert", "Equal_", "(_", "Callable_", "(_", ")_", "(_", ")_", ",_", "5_", ")_", "\\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_", "._", "fail_", "(_", "\"", "Bug", " ", "#", "572", " ", "Call", "able", "()(", ")", " ", "\\u\\u", "call", "\\u\\u", " ", "not", " ", "support", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "callable_", "(_", "Callable_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "callable_", "(_", "Callable_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Bug", " ", "#", "572", " ", "calla", "ble", "(", "Call", "able", "())", " ", "\\u\\u", "call", "\\u\\u", " ", "not", " ", "support", "ed", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Function", "Test_", "(_", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Name", "Mapping_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "call_", "(_", "1_", ",_", "2_", ",_", "this_", "=_", "3_", ",_", "label_", "=_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "r_", "[_", "0_", "]_", ",_", "'", "mapping", "-", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "r_", "[_", "1_", "]_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "r_", "[_", "2_", "]_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "r_", "[_", "3_", "]_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "r_", "[_", "4_", "]_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "Text_", "(_", "'", "foo", "'_", ")_", ",_", "'", "Text", ":", " ", "foo", "'_", ")_", "\\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_", "._", "fail_", "(_", "\"", "Bug", " ", "#", "574", ":", " ", "javascript", " ", "keywords", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Function", "Test_", "(_", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Factory_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Factor", "y2_", "._", "greg", "iste", "r_", "(_", "\"", "pass", "me", "\"_", ",_", "Pass", "Me", "AC", "lass_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Factor", "y2_", "._", "greg", "iste", "r_", "(_", "\"", "exc", "hild", "\"_", ",_", "Exam", "ple", "Chil", "d", "Class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Factor", "y2_", "._", "greg", "iste", "r_", "(_", "\"", "msc", "p1", "\"_", ",_", "Exam", "ple", "Multi", "Super", "class", "Parent", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pmc", "_", "=_", "Factor", "y2_", "._", "gge", "t", "Object_", "(_", "\"", "pass", "me", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "pmc", "_", "._", "foo_", "(_", ")_", ",_", "\"", "foo", " ", "in", " ", "Pass", "Me", "AC", "lass", "\"_", ")_", "\\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 ", " _", "pmc", "_", "=_", "Factor", "y2_", "._", "gge", "t", "Object_", "(_", "\"", "msc", "p1", "\"_", ",_", "5_", ")_", "\\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_", "._", "assert", "Equal_", "(_", "False_", ",_", "True_", ",_", "\"", "Except", "ion", " ", "indicat", "es", " ", "bug", " ", "in", " ", "compiler", ":", " ", "'", "Error", ":", " ", "unca", "ugh", "t", " ", "exception", ":", " ", "Exam", "ple", "Multi", "Super", "class", "Parent", "1", "()", " ", "argu", "ment", "s", " ", "after", " ", "**", " ", "must", " ", "be", " ", "a", " ", "dictionar", "y", " ", "5", "'\"_", ")_", "\\u\\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_", "(_", "pmc", "_", "._", "x_", ",_", "5_", ")_", "\\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 ", " _", "pmc", "_", "=_", "Factor", "y2_", "._", "gge", "t", "Object_", "(_", "\"", "exc", "hild", "\"_", ",_", "5_", ",_", "7_", ")_", "#", " ", "5", " ", "is", " ", "ignored_", "\\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_", "._", "assert", "Equal_", "(_", "False_", ",_", "True_", ",_", "\"", "Except", "ion", " ", "indicat", "es", " ", "bug", " ", "in", " ", "compiler", ":", " ", "'", "Error", ":", " ", "unca", "ugh", "t", " ", "exception", ":", " ", "Exam", "ple", "Chil", "d", "Class", "()", " ", "argu", "ment", "s", " ", "after", " ", "**", " ", "must", " ", "be", " ", "a", " ", "dictionar", "y", " ", "7", "'\"_", ")_", "\\u\\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_", "(_", "pmc", "_", "._", "prop", "\\u", "a_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "pmc", "_", "._", "prop", "\\u", "b_", ",_", "7_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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, 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, 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 ]
Redundant comparison
jbrew/pt-voicebox/vbox.py
[ { "content": " def addWord(self,D,s,pos,v):\n #extract string of word from the sentence\n word = s[pos]\n #base case. v is 0, so we're just returning D with the frequency of s[w] incremented, not altering subdictionaries\n if v <= 0:\n # increment the frequency if the word already exists\n if word in D:\n D[word].set_freq(D[word].freq+1)\n # otherwise, create a new entry in D\n else:\n D[word] = Word(word)\n return D\n\n # if v is greater than 0, we increment the frequency and ask for subdictionaries\n elif v>0:\n if word in D:\n newsub1 = D[word].sub1\n if pos < len(s)-1:\n newsub1 = self.addWord(D[word].sub1,s,pos+1,v-1)\n\n newsub2 = D[word].sub2\n if v>1 and pos < len(s)-2:\n newsub2 = self.addWord(D[word].sub2,s,pos+2,0)\n\n D[word].set_freq(D[word].freq+1)\n D[word].set_sub1(newsub1)\n D[word].set_sub2(newsub2)\n return D\n else:\n D[word] = Word(word)\n\n newsub1 = {}\n if pos < len(s)-1:\n newsub1 = self.addWord(D[word].sub1,s,pos+1,v-1)\n\n newsub2 = {}\n if v>1 and pos < len(s)-2:\n newsub2 = self.addWord(D[word].sub2,s,pos+2,0)\n\n\n D[word].set_sub1(newsub1)\n D[word].set_sub2(newsub2)\n return D", "metadata": "root.Voicebox.addWord", "header": "['class', 'Voicebox', '(', 'object', ')', ':', '___EOS___']", "index": 166 } ]
[ { "span": "v>0:", "start_line": 180, "start_column": 13, "end_line": 180, "end_column": 16 } ]
[ { "span": "v <= 0:", "start_line": 170, "start_column": 11, "end_line": 170, "end_column": 17 } ]
1
true
[ "[CLS]_", "Redu", "ndan", "t_", "comparison_", "[SEP]_", "class_", "Voic", "ebo", "x_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Word_", "(_", "self_", ",_", "D_", ",_", "s_", ",_", "pos_", ",_", "v_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "extract", " ", "string", " ", "of", " ", "word", " ", "from", " ", "the", " ", "sentence_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "word_", "=_", "s_", "[_", "pos_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "base", " ", "case", ".", " ", "v", " ", "is", " ", "0", ",", " ", "so", " ", "we", "'", "re", " ", "just", " ", "return", "ing", " ", "D", " ", "with", " ", "the", " ", "freque", "nc", "y", " ", "of", " ", "s", "[", "w", "]", " ", "increment", "ed", ",", " ", "not", " ", "alter", "ing", " ", "subd", "ict", "ionar", "ies_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "v_", "<=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "increment", " ", "the", " ", "freque", "nc", "y", " ", "if", " ", "the", " ", "word", " ", "alr", "ead", "y", " ", "exists_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "word_", "in_", "D_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "D_", "[_", "word_", "]_", "._", "set\\u", "freq_", "(_", "D_", "[_", "word_", "]_", "._", "freq_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "other", "wis", "e", ",", " ", "create", " ", "a", " ", "new", " ", "entry", " ", "in", " ", "D_", "\\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 ", " _", "D_", "[_", "word_", "]_", "=_", "Word_", "(_", "word_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "D_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "v", " ", "is", " ", "great", "er", " ", "than", " ", "0", ",", " ", "we", " ", "increment", " ", "the", " ", "freque", "nc", "y", " ", "and", " ", "ask", " ", "for", " ", "subd", "ict", "ionar", "ies_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "v_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "word_", "in_", "D_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "news", "ub", "1_", "=_", "D_", "[_", "word_", "]_", "._", "sub", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pos_", "<_", "len_", "(_", "s_", ")_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "news", "ub", "1_", "=_", "self_", "._", "add", "Word_", "(_", "D_", "[_", "word_", "]_", "._", "sub", "1_", ",_", "s_", ",_", "pos_", "+_", "1_", ",_", "v_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "news", "ub", "2_", "=_", "D_", "[_", "word_", "]_", "._", "sub", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "v_", ">_", "1_", "and_", "pos_", "<_", "len_", "(_", "s_", ")_", "-_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "news", "ub", "2_", "=_", "self_", "._", "add", "Word_", "(_", "D_", "[_", "word_", "]_", "._", "sub", "2_", ",_", "s_", ",_", "pos_", "+_", "2_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "D_", "[_", "word_", "]_", "._", "set\\u", "freq_", "(_", "D_", "[_", "word_", "]_", "._", "freq_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "D_", "[_", "word_", "]_", "._", "set\\u", "sub", "1_", "(_", "news", "ub", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "D_", "[_", "word_", "]_", "._", "set\\u", "sub", "2_", "(_", "news", "ub", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "D_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "D_", "[_", "word_", "]_", "=_", "Word_", "(_", "word_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "news", "ub", "1_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pos_", "<_", "len_", "(_", "s_", ")_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "news", "ub", "1_", "=_", "self_", "._", "add", "Word_", "(_", "D_", "[_", "word_", "]_", "._", "sub", "1_", ",_", "s_", ",_", "pos_", "+_", "1_", ",_", "v_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "news", "ub", "2_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "v_", ">_", "1_", "and_", "pos_", "<_", "len_", "(_", "s_", ")_", "-_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "news", "ub", "2_", "=_", "self_", "._", "add", "Word_", "(_", "D_", "[_", "word_", "]_", "._", "sub", "2_", ",_", "s_", ",_", "pos_", "+_", "2_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "D_", "[_", "word_", "]_", "._", "set\\u", "sub", "1_", "(_", "news", "ub", "1_", ")_", "\\u\\u\\uNEWLINE\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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unnecessary pass
osrg/ryu/ryu/services/protocols/bgp/utils/internable.py
[ { "content": " def intern(self):\n \"\"\"Returns either itself or a canonical copy of itself.\"\"\"\n\n # If this is an interned object, return it\n if hasattr(self, '_interned'):\n return self._internable_stats.incr('self')\n\n #\n # Got to find or create an interned object identical to this\n # one. Auto-initialize the class if need be.\n #\n kls = self.__class__\n\n if not hasattr(kls, dict_name):\n kls._internable_init()\n\n obj = kls._internable_dict.get(self)\n if (obj):\n # Found an interned copy.\n kls._internable_stats.incr('found')\n return obj\n\n # Create an interned copy. Take care to only keep a weak\n # reference to the object itself.\n def object_collected(obj):\n kls._internable_stats.incr('collected')\n # print(\"Object %s garbage collected\" % obj)\n pass\n\n ref = weakref.ref(self, object_collected)\n kls._internable_dict[self] = ref\n self._interned = True\n kls._internable_stats.incr('inserted')\n return self", "metadata": "root.Internable.intern", "header": "['class', 'Internable', '(', 'object', ')', ':', '___EOS___']", "index": 69 } ]
[ { "span": "pass", "start_line": 96, "start_column": 12, "end_line": 96, "end_column": 16 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "class_", "Intern", "able_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "intern", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "eit", "her", " ", "its", "elf", " ", "or", " ", "a", " ", "canonical", " ", "copy", " ", "of", " ", "its", "elf", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "this", " ", "is", " ", "an", " ", "interne", "d", " ", "object", ",", " ", "return", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "self_", ",_", "'\\u", "interne", "d", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "intern", "able", "\\u", "stats_", "._", "incr_", "(_", "'", "self", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Got", " ", "to", " ", "find", " ", "or", " ", "create", " ", "an", " ", "interne", "d", " ", "object", " ", "identi", "cal", " ", "to", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "one", ".", " ", "Auto", "-", "initialize", " ", "the", " ", "class", " ", "if", " ", "need", " ", "be", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kl", "s_", "=_", "self_", "._", "\\u\\u", "class\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "hasattr_", "(_", "kl", "s_", ",_", "dict", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kl", "s_", "._", "\\u", "intern", "able", "\\u", "init_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "obj_", "=_", "kl", "s_", "._", "\\u", "intern", "able", "\\u", "dict_", "._", "get_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Foun", "d", " ", "an", " ", "interne", "d", " ", "copy", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kl", "s_", "._", "\\u", "intern", "able", "\\u", "stats_", "._", "incr_", "(_", "'", "found", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "an", " ", "interne", "d", " ", "copy", ".", " ", "Tak", "e", " ", "care", " ", "to", " ", "only", " ", "keep", " ", "a", " ", "weak", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "reference", " ", "to", " ", "the", " ", "object", " ", "its", "elf", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "object\\u", "collected", "_", "(_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kl", "s_", "._", "\\u", "intern", "able", "\\u", "stats_", "._", "incr_", "(_", "'", "collected", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", "(\"", "Object", " ", "%", "s", " ", "gar", "bage", " ", "collected", "\"", " ", "%", " ", "obj", ")_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ref_", "=_", "weakref_", "._", "ref_", "(_", "self_", ",_", "object\\u", "collected", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kl", "s_", "._", "\\u", "intern", "able", "\\u", "dict_", "[_", "self_", "]_", "=_", "ref_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "interne", "d_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kl", "s_", "._", "\\u", "intern", "able", "\\u", "stats_", "._", "incr_", "(_", "'", "inserted", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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n\t\tcomp = TestComponent()\n\t\tworld = TestWorld(test=comp)\n\t\tentity = Entity(world)\n\t\tself.assertTrue(entity not in comp)\n\t\tself.assertRaises(AttributeError, getattr, entity, 'foo')", "metadata": "root.EntityTestCase.test_accessor_getattr_for_nonexistant_component", "header": "['class', 'EntityTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 47 }, { "content": "\tdef test_accessor_getattr_for_non_member_entity(self):\n\t\tfrom grease import Entity\n\t\tcomp = TestComponent()\n\t\tworld = TestWorld(test=comp)\n\t\tentity = Entity(world)\n\t\taccessor = entity.test\n\t\tself.assertFalse(entity in comp)\n\t\tself.assertRaises(AttributeError, getattr, accessor, 'attr')", "metadata": "root.EntityTestCase.test_accessor_getattr_for_non_member_entity", "header": "['class', 'EntityTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 55 }, { "content": "\tdef test_accessor_getattr_for_member_entity(self):\n\t\tfrom grease import Entity\n\t\tcomp = TestComponent()\n\t\tworld = TestWorld(test=comp)\n\t\tentity = Entity(world)\n\t\tcomp.set(entity)\n\t\tself.assertTrue(entity in comp)\n\t\tself.assertEqual(entity.test.attr, 'deadbeef')", "metadata": "root.EntityTestCase.test_accessor_getattr_for_member_entity", "header": "['class', 'EntityTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 64 }, { "content": "\tdef test_accessor_setattr_adds_non_member_entity(self):\n\t\tfrom grease import Entity\n\t\tcomp = TestComponent()\n\t\tworld = TestWorld(test=comp)\n\t\tentity = Entity(world)\n\t\tself.assertFalse(entity in comp)\n\t\tentity.test.attr = 'foobar'\n\t\tself.assertEqual(entity.test.attr, 'foobar')\n\t\tself.assertTrue(entity in comp)", "metadata": "root.EntityTestCase.test_accessor_setattr_adds_non_member_entity", "header": "['class', 'EntityTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 73 }, { "content": "\tdef test_accessor_setattr_for_member_entity(self):\n\t\tfrom grease import Entity\n\t\tcomp = TestComponent()\n\t\tworld = TestWorld(test=comp)\n\t\tentity = Entity(world)\n\t\tcomp.set(entity)\n\t\tself.assertNotEqual(entity.test.attr, 'spam')\n\t\tentity.test.attr = 'spam'\n\t\tself.assertTrue(entity in comp)\n\t\tself.assertEqual(entity.test.attr, 'spam')", "metadata": "root.EntityTestCase.test_accessor_setattr_for_member_entity", "header": "['class', 'EntityTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 83 }, { "content": "\tdef test_delattr(self):\n\t\tfrom grease import Entity\n\t\tcomp = TestComponent()\n\t\tworld = TestWorld(test=comp)\n\t\tentity = Entity(world)\n\t\tcomp.set(entity)\n\t\tself.assertTrue(entity in comp)\n\t\tdel entity.test\n\t\tself.assertFalse(entity in comp)", "metadata": "root.EntityTestCase.test_delattr", "header": "['class', 'EntityTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 110 }, { "content": "\tdef test_entity_id(self):\n\t\tfrom grease import Entity\n\t\tworld = TestWorld()\n\t\tentity1 = Entity(world)\n\t\tentity2 = Entity(world)\n\t\tself.assertTrue(entity1.entity_id > 0)\n\t\tself.assertTrue(entity2.entity_id > 0)\n\t\tself.assertNotEqual(entity1.entity_id, entity2.entity_id)", "metadata": "root.EntityTestCase.test_entity_id", "header": "['class', 'EntityTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 120 }, { "content": "\tdef test_setattr_nonmember_entity(self):\n\t\tfrom grease.entity import EntityComponentAccessor\n\t\tfrom grease import Entity\n\t\tworld = TestWorld()\n\t\tentity = Entity(world)\n\t\tcomponent = TestComponent()\n\t\taccessor = EntityComponentAccessor(component, entity)\n\t\tself.assertRaises(AttributeError, getattr, entity, 'baz')\n\t\tself.assertTrue(entity not in component)\n\t\taccessor.baz = 1000\n\t\tself.assertTrue(entity in component)\n\t\tself.assertEqual(accessor.baz, 1000)\n\t\tself.assertEqual(component[entity].baz, 1000)", "metadata": "root.EntityComponentAccessorTestCase.test_setattr_nonmember_entity", "header": "['class', 'EntityComponentAccessorTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 202 } ]
[ { "span": "self.assertTrue(entity not in comp)", "start_line": 52, "start_column": 2, "end_line": 52, "end_column": 37 }, { "span": "self.assertFalse(entity in comp)", "start_line": 61, "start_column": 2, "end_line": 61, "end_column": 34 }, { "span": "self.assertTrue(entity in comp)", "start_line": 70, "start_column": 2, "end_line": 70, "end_column": 33 }, { "span": "self.assertFalse(entity in comp)", "start_line": 78, "start_column": 2, "end_line": 78, "end_column": 34 }, { "span": "self.assertTrue(entity in comp)", "start_line": 81, "start_column": 2, "end_line": 81, "end_column": 33 }, { "span": "self.assertTrue(entity in comp)", "start_line": 91, "start_column": 2, "end_line": 91, "end_column": 33 }, { "span": "self.assertTrue(entity in comp)", "start_line": 116, "start_column": 2, "end_line": 116, "end_column": 33 }, { "span": "self.assertFalse(entity in comp)", "start_line": 118, "start_column": 2, "end_line": 118, "end_column": 34 }, { "span": "self.assertTrue(entity1.entity_id > 0)", "start_line": 125, "start_column": 2, "end_line": 125, "end_column": 40 }, { "span": "self.assertTrue(entity2.entity_id > 0)", "start_line": 126, "start_column": 2, "end_line": 126, "end_column": 40 }, { "span": "self.assertTrue(entity not in component)", "start_line": 210, "start_column": 2, "end_line": 210, "end_column": 42 }, { "span": "self.assertTrue(entity in component)", "start_line": 212, "start_column": 2, "end_line": 212, "end_column": 38 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Entit", "y", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "accessor", "\\u", "getattr", "\\u", "for", "\\u", "nonexist", "ant", "\\u", "component_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "from_", "gre", "ase_", "import_", "Entity_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "comp_", "=_", "Test", "Component_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "world_", "=_", "Test", "World_", "(_", "test_", "=_", "comp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entity_", "=_", "Entity_", "(_", "world_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "entity_", "not_", "in_", "comp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Attribute", "Error_", ",_", "getattr_", ",_", "entity_", ",_", "'", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entit", "y", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "accessor", "\\u", "getattr", "\\u", "for", "\\u", "non", "\\u", "member", "\\u", "entity_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "from_", "gre", "ase_", "import_", "Entity_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "comp_", "=_", "Test", "Component_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "world_", "=_", "Test", "World_", "(_", "test_", "=_", "comp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entity_", "=_", "Entity_", "(_", "world_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "accessor_", "=_", "entity_", "._", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "entity_", "in_", "comp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Attribute", "Error_", ",_", "getattr_", ",_", "accessor_", ",_", "'", "attr", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entit", "y", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "accessor", "\\u", "getattr", "\\u", "for", "\\u", "member", "\\u", "entity_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "from_", "gre", "ase_", "import_", "Entity_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "comp_", "=_", "Test", "Component_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "world_", "=_", "Test", "World_", "(_", "test_", "=_", "comp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entity_", "=_", "Entity_", "(_", "world_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "comp_", "._", "set_", "(_", "entity_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "entity_", "in_", "comp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "entity_", "._", "test_", "._", "attr_", ",_", "'", "dead", "beef", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entit", "y", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "accessor", "\\u", "setattr", "\\u", "adds", "\\u", "non", "\\u", "member", "\\u", "entity_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "from_", "gre", "ase_", "import_", "Entity_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "comp_", "=_", "Test", "Component_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "world_", "=_", "Test", "World_", "(_", "test_", "=_", "comp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entity_", "=_", "Entity_", "(_", "world_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "entity_", "in_", "comp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entity_", "._", "test_", "._", "attr_", "=_", "'", "fooba", "r", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "entity_", "._", "test_", "._", "attr_", ",_", "'", "fooba", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "entity_", "in_", "comp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entit", "y", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "accessor", "\\u", "setattr", "\\u", "for", "\\u", "member", "\\u", "entity_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "from_", "gre", "ase_", "import_", "Entity_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "comp_", "=_", "Test", "Component_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "world_", "=_", "Test", "World_", "(_", "test_", "=_", "comp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entity_", "=_", "Entity_", "(_", "world_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "comp_", "._", "set_", "(_", "entity_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "entity_", "._", "test_", "._", "attr_", ",_", "'", "spam", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entity_", "._", "test_", "._", "attr_", "=_", "'", "spam", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "entity_", "in_", "comp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "entity_", "._", "test_", "._", "attr_", ",_", "'", "spam", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entit", "y", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "delattr", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "from_", "gre", "ase_", "import_", "Entity_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "comp_", "=_", "Test", "Component_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "world_", "=_", "Test", "World_", "(_", "test_", "=_", "comp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entity_", "=_", "Entity_", "(_", "world_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "comp_", "._", "set_", "(_", "entity_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "entity_", "in_", "comp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "entity_", "._", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "entity_", "in_", "comp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entit", "y", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "entity", "\\u", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "from_", "gre", "ase_", "import_", "Entity_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "world_", "=_", "Test", "World_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entity", "1_", "=_", "Entity_", "(_", "world_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entity", "2_", "=_", "Entity_", "(_", "world_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "entity", "1_", "._", "entity", "\\u", "id_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "entity", "2_", "._", "entity", "\\u", "id_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "entity", "1_", "._", "entity", "\\u", "id_", ",_", "entity", "2_", "._", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entit", "y", "Compo", "nent", "Accessor", "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", "setattr", "\\u", "non", "member", "\\u", "entity_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "from_", "gre", "ase_", "._", "entity_", "import_", "Entit", "y", "Compo", "nent", "Accessor", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "gre", "ase_", "import_", "Entity_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "world_", "=_", "Test", "World_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entity_", "=_", "Entity_", "(_", "world_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "component_", "=_", "Test", "Component_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "accessor_", "=_", "Entit", "y", "Compo", "nent", "Accessor", "_", "(_", "component_", ",_", "entity_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Attribute", "Error_", ",_", "getattr_", ",_", "entity_", ",_", "'", "ba", "z", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "entity_", "not_", "in_", "component_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "accessor_", "._", "baz_", "=_", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "entity_", "in_", "component_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "accessor_", "._", "baz_", ",_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "component_", "[_", "entity_", "]_", "._", "baz_", ",_", "1000_", ")_", "\\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, 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 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
Esri/solutions-geoprocessing-toolbox/suitability/toolboxes/scripts/MultidimensionSupplementalTools/MultidimensionSupplementalTools/Scripts/mds/tools/make_netcdf_regularpointslayer.py
[ { "content": " def execute(self, parameters, messages):\n \"\"\"The source code of the tool.\"\"\"\n\n # Describe the supplied netCDF File.\n ncFP = arcpy.NetCDFFileProperties(parameters[0].valueAsText)\n selectedVars = parameters[1].valueAsText.split(';')\n\n # Coordinate variables can be identified via values of their standard\n # name attribute or values of their untis attribute.\n\n XCoordNamesList = [\"longitude\", \"projection_x_coordinate\",\n \"grid_longitude\"]\n YCoordNamesList = [\"latitude\", \"projection_y_coordinate\",\n \"grid_longitude\"]\n XUnitNamesList = [\"degrees_east\", \"degree_east\", \"degree_E\",\n \"degrees_E\", \"degreeE\", \"degreesE\" ]\n YUnitNamesList = [\"degrees_north\", \"degree_north\", \"degree_N\",\n \"degrees_N\", \"degreeN\", \"degreesN\"]\n XAxisNameList = [\"X\"]\n YAxisNameList = [\"Y\"]\n\n # Case 1: Independent latitude, Longitude, Vertical and Time Axes\n # Get the dimensions associated with the first variable. We can use a\n # single variable because tool validation guarentees that all the\n # selected variables have the same dimensions.\n dimNames = ncFP.getDimensionsByVariable(str(selectedVars[0]))\n x_variable = \"\"\n y_variable = \"\"\n for dimension in dimNames:\n # Per CF 1.6 (Chapter 5, preamble): \"All of a variable's dimensions\n # that are latitude, longitude, vertical, or time dimensions must\n # have corresponding coordinate variables, i.e., one-dimensional\n # variables with the same name as the dimension.\"\n # Identify the coordinate variable by its standard name or units.\n\n try:\n SNattributeValue = ncFP.getAttributeValue(dimension,\n \"standard_name\")\n except:\n SNattributeValue = \"missing\"\n\n try:\n UNattributeValue = ncFP.getAttributeValue(dimension, \"units\")\n except:\n UNattributeValue = \"missing\"\n\n try:\n AXattributeValue = ncFP.getAttributeValue(dimension,\"axis\")\n except:\n AXattributeValue = \"missing\"\n\n if SNattributeValue in XCoordNamesList:\n x_variable = dimension\n if SNattributeValue in YCoordNamesList:\n y_variable = dimension\n if UNattributeValue in XUnitNamesList:\n x_variable = dimension\n if UNattributeValue in YUnitNamesList:\n y_variable = dimension\n if AXattributeValue in XAxisNameList:\n x_variable = dimension\n if AXattributeValue in YAxisNameList:\n y_variable = dimension\n\n # Set the row dimensions parameter of the Make NetCDF Feature Layer tool\n # to the names of the latitude and longitude dimensions\n rowDimensions = \"\"\n rowDimensions = x_variable + \";\" + y_variable\n\n\n # Case #2: 2 dimensional lat/long coordinate variable\n # If unsuccessful in locating variable for x and y coordinates based on\n # latitude and longitude, check to see if variable of interest is\n # georeferenced via a 2 dimensional lat/long coordinate variable\n\n # Coordinate Variable Method will only work if CDL conforms to the\n # CF 1.6 convention (section 2.4) that \"All other dimensions should,\n # whenever possible, be placed to the left of the spatiotemporal\n # dimensions.\"\n\n if (not x_variable) or (not y_variable):\n try:\n coordAttributeValue = ncFP.getAttributeValue(str(selectedVars[0]),\n \"coordinates\")\n coordVariables = coordAttributeValue.split(' ')\n for element in coordVariables:\n try:\n SNattributeValue = ncFP.getAttributeValue(element,\n \"standard_name\")\n except:\n SNattributeValue = \"missing\"\n\n try:\n UNattributeValue = ncFP.getAttributeValue(element,\n \"units\")\n except:\n UNattributeValue = \"missing\"\n\n try:\n AXattributeValue = ncFP.getAttributeValue(element,\n \"axis\")\n except:\n AXattributeValue = \"missing\"\n\n if SNattributeValue in XCoordNamesList:\n x_variable = element\n if SNattributeValue in YCoordNamesList:\n y_variable = element\n if UNattributeValue in XUnitNamesList:\n x_variable = element\n if UNattributeValue in YUnitNamesList:\n y_variable = element\n if AXattributeValue in XAxisNameList:\n x_variable = element\n if AXattributeValue in YAxisNameList:\n y_variable = element\n\n # Set the row dimensions parameter of the Make NetCDF Feature\n # Layer tool to the names of the coordinate variables\n dimNames = ncFP.getDimensionsByVariable(str(selectedVars[0]))\n rowDimensions = str(dimNames[-1]) + \";\" + str(dimNames[-2])\n\n\n except:\n CoordAttributeValue = \"missing\"\n\n # Convert the python list of selected variables into a single\n # (comma delimited string if necessary.\n if selectedVars.count > 1:\n variable_list = ','.join([str(x) for x in selectedVars])\n else:\n variable_list = selectedVars[0]\n\n if (x_variable) and (y_variable):\n if (debug):\n arcpy.AddWarning(\"netCDFFile Name: %s\" \\\n % parameters[0].valueAsText)\n arcpy.AddWarning(\"Variable List: %s\" % variable_list)\n arcpy.AddWarning(\"x_variable: %s\" % x_variable)\n arcpy.AddWarning(\"y_variable: %s\" % y_variable)\n arcpy.AddWarning(\"Output Feature Layer: %s \" \\\n % parameters[2].valueAsText)\n arcpy.AddWarning(\"Row Dimensions: %s \" % rowDimensions)\n\n result1 = arcpy.MakeNetCDFFeatureLayer_md(parameters[0].valueAsText,\n variable_list,\n x_variable,\n y_variable,\n parameters[2].value,\n rowDimensions)\n # Force the netCDF Feature Layer to be added to the display\n arcpy.SetParameter(3, result1)\n else:\n arcpy.AddError(\"Unable to automatically determine x and y \" +\n \"variables from the netCDF file. Use Make NetCDF \" +\n \"Feature Layer tool.\")\n return", "metadata": "root.MakeNetCDFRegularPointsLayer.execute", "header": "['class', 'MakeNetCDFRegularPointsLayer', '(', 'object', ')', ':', '___EOS___']", "index": 105 } ]
[ { "span": "CoordAttributeValue ", "start_line": 229, "start_column": 16, "end_line": 229, "end_column": 35 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Make", "Net", "CD", "FR", "eg", "ular", "Point", "s", "Layer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute_", "(_", "self_", ",_", "parameters_", ",_", "messages_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "The", " ", "source", " ", "code", " ", "of", " ", "the", " ", "tool", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Describe", " ", "the", " ", "supplie", "d", " ", "net", "CD", "F", " ", "File", "._", "\\u\\u\\uNL\\u\\u\\u_", "nc", "FP", "_", "=_", "arcpy_", "._", "Net", "CD", "FF", "ile", "Properties_", "(_", "parameters_", "[_", "0_", "]_", "._", "value", "As", "Text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "selecte", "d", "Vars_", "=_", "parameters_", "[_", "1_", "]_", "._", "value", "As", "Text_", "._", "split_", "(_", "';'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Coordinat", "e", " ", "variab", "les", " ", "can", " ", "be", " ", "identifi", "ed", " ", "via", " ", "values", " ", "of", " ", "thei", "r", " ", "standard_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "name", " ", "attribute", " ", "or", " ", "values", " ", "of", " ", "thei", "r", " ", "unti", "s", " ", "attribute", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "XC", "oor", "d", "Names", "List_", "=_", "[_", "\"", "longitude", "\"_", ",_", "\"", "projecti", "on", "\\u", "x", "\\u", "coordinate", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "grid", "\\u", "longitude", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "YC", "oor", "d", "Names", "List_", "=_", "[_", "\"", "latitude", "\"_", ",_", "\"", "projecti", "on", "\\u", "y", "\\u", "coordinate", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "grid", "\\u", "longitude", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "XU", "nit", "Names", "List_", "=_", "[_", "\"", "degr", "ees", "\\u", "east", "\"_", ",_", "\"", "degr", "ee", "\\u", "east", "\"_", ",_", "\"", "degr", "ee", "\\u", "E", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "degr", "ees", "\\u", "E", "\"_", ",_", "\"", "degr", "ee", "E", "\"_", ",_", "\"", "degr", "ees", "E", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "YU", "nit", "Names", "List_", "=_", "[_", "\"", "degr", "ees", "\\u", "north", "\"_", ",_", "\"", "degr", "ee", "\\u", "north", "\"_", ",_", "\"", "degr", "ee", "\\u", "N", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "degr", "ees", "\\u", "N", "\"_", ",_", "\"", "degr", "ee", "N", "\"_", ",_", "\"", "degr", "ees", "N", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "XA", "xis", "Name", "List_", "=_", "[_", "\"", "X", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "YA", "xis", "Name", "List_", "=_", "[_", "\"", "Y", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Case", " ", "1", ":", " ", "Inde", "pend", "ent", " ", "latitude", ",", " ", "Long", "itu", "de", ",", " ", "Vertica", "l", " ", "and", " ", "Time", " ", "Axes_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "dimension", "s", " ", "associate", "d", " ", "with", " ", "the", " ", "first", " ", "variab", "le", ".", " ", " ", "We", " ", "can", " ", "use", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "single", " ", "variab", "le", " ", "bec", "aus", "e", " ", "tool", " ", "validation", " ", "gua", "rent", "ees", " ", "tha", "t", " ", "all", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "selecte", "d", " ", "variab", "les", " ", "have", " ", "the", " ", "same", " ", "dimension", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "dim", "Names_", "=_", "nc", "FP", "_", "._", "get", "Dimen", "sion", "s", "By", "Variable_", "(_", "str_", "(_", "selecte", "d", "Vars_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x", "\\u", "variable_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "variable_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "dimension_", "in_", "dim", "Names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Per", " ", "CF", " ", "1.6", " ", "(", "Chap", "ter", " ", "5", ",", " ", "preamble", "):", " ", "\"", "All", " ", "of", " ", "a", " ", "variab", "le", "'", "s", " ", "dimensions_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tha", "t", " ", "are", " ", "latitude", ",", " ", "longitude", ",", " ", "vertical", ",", " ", "or", " ", "time", " ", "dimension", "s", " ", "must", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "have", " ", "correspond", "ing", " ", "coordinate", " ", "variab", "les", ",", " ", "i", ".", "e", ".,", " ", "one", "-", "dimension", "al_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "variab", "les", " ", "with", " ", "the", " ", "same", " ", "name", " ", "as", " ", "the", " ", "dimension", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Identif", "y", " ", "the", " ", "coordinate", " ", "variab", "le", " ", "by", " ", "its", " ", "standard", " ", "name", " ", "or", " ", "unit", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "SN", "attribute", "Value_", "=_", "nc", "FP", "_", "._", "get", "Attribute", "Value_", "(_", "dimension_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "standard", "\\u", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "SN", "attribute", "Value_", "=_", "\"", "missi", "ng", "\"_", "\\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 ", " _", "UN", "attribute", "Value_", "=_", "nc", "FP", "_", "._", "get", "Attribute", "Value_", "(_", "dimension_", ",_", "\"", "unit", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "UN", "attribute", "Value_", "=_", "\"", "missi", "ng", "\"_", "\\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 ", " _", "AX", "attribute", "Value_", "=_", "nc", "FP", "_", "._", "get", "Attribute", "Value_", "(_", "dimension_", ",_", "\"", "axis", "\"_", ")_", "\\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 ", " _", "AX", "attribute", "Value_", "=_", "\"", "missi", "ng", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "SN", "attribute", "Value_", "in_", "XC", "oor", "d", "Names", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "variable_", "=_", "dimension_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "SN", "attribute", "Value_", "in_", "YC", "oor", "d", "Names", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "y", "\\u", "variable_", "=_", "dimension_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "UN", "attribute", "Value_", "in_", "XU", "nit", "Names", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "variable_", "=_", "dimension_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "UN", "attribute", "Value_", "in_", "YU", "nit", "Names", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "y", "\\u", "variable_", "=_", "dimension_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "AX", "attribute", "Value_", "in_", "XA", "xis", "Name", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "variable_", "=_", "dimension_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "AX", "attribute", "Value_", "in_", "YA", "xis", "Name", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "y", "\\u", "variable_", "=_", "dimension_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "the", " ", "row", " ", "dimension", "s", " ", "parameter", " ", "of", " ", "the", " ", "Make", " ", "Net", "CD", "F", " ", "Feature", " ", "Layer", " ", "tool_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "the", " ", "names", " ", "of", " ", "the", " ", "latitude", " ", "and", " ", "longitude", " ", "dimensions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "row", "Dimensions_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row", "Dimensions_", "=_", "x", "\\u", "variable_", "+_", "\";\"_", "+_", "y", "\\u", "variable_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Case", " ", "#", "2", ":", " ", "2", " ", "dimension", "al", " ", "lat", "/", "long", " ", "coordinate", " ", "variable_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "unsuc", "cess", "ful", " ", "in", " ", "locat", "ing", " ", "variab", "le", " ", "for", " ", "x", " ", "and", " ", "y", " ", "coordinate", "s", " ", "based", " ", "on_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "latitude", " ", "and", " ", "longitude", ",", " ", "check", " ", "to", " ", "see", " ", "if", " ", "variab", "le", " ", "of", " ", "interest", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "geor", "efer", "ence", "d", " ", "via", " ", "a", " ", "2", " ", "dimension", "al", " ", "lat", "/", "long", " ", "coordinate", " ", "variable_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Coordinat", "e", " ", "Varia", "ble", " ", "Meth", "od", " ", "will", " ", "only", " ", "work", " ", "if", " ", "CD", "L", " ", "conform", "s", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "CF", " ", "1.6", " ", "convention", " ", "(", "section", " ", "2.4", ")", " ", "tha", "t", " ", "\"", "All", " ", "other", " ", "dimension", "s", " ", "shou", "ld", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whe", "neve", "r", " ", "possib", "le", ",", " ", "be", " ", "place", "d", " ", "to", " ", "the", " ", "left", " ", "of", " ", "the", " ", "spat", "iot", "emp", "ora", "l_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "dimension", "s", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "not_", "x", "\\u", "variable_", ")_", "or_", "(_", "not_", "y", "\\u", "variable_", ")_", ":_", "\\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 ", " _", "coord", "Attribute", "Value_", "=_", "nc", "FP", "_", "._", "get", "Attribute", "Value_", "(_", "str_", "(_", "selecte", "d", "Vars_", "[_", "0_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "coordinate", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "coord", "Variables_", "=_", "coord", "Attribute", "Value_", "._", "split_", "(_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "element_", "in_", "coord", "Variables_", ":_", "\\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 ", " ", " _", "SN", "attribute", "Value_", "=_", "nc", "FP", "_", "._", "get", "Attribute", "Value_", "(_", "element_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "standard", "\\u", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "SN", "attribute", "Value_", "=_", "\"", "missi", "ng", "\"_", "\\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 ", " ", " _", "UN", "attribute", "Value_", "=_", "nc", "FP", "_", "._", "get", "Attribute", "Value_", "(_", "element_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "unit", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "UN", "attribute", "Value_", "=_", "\"", "missi", "ng", "\"_", "\\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 ", " ", " _", "AX", "attribute", "Value_", "=_", "nc", "FP", "_", "._", "get", "Attribute", "Value_", "(_", "element_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "axis", "\"_", ")_", "\\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 ", " ", " _", "AX", "attribute", "Value_", "=_", "\"", "missi", "ng", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "SN", "attribute", "Value_", "in_", "XC", "oor", "d", "Names", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "x", "\\u", "variable_", "=_", "element_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "SN", "attribute", "Value_", "in_", "YC", "oor", "d", "Names", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "y", "\\u", "variable_", "=_", "element_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "UN", "attribute", "Value_", "in_", "XU", "nit", "Names", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "x", "\\u", "variable_", "=_", "element_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "UN", "attribute", "Value_", "in_", "YU", "nit", "Names", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "y", "\\u", "variable_", "=_", "element_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "AX", "attribute", "Value_", "in_", "XA", "xis", "Name", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "x", "\\u", "variable_", "=_", "element_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "AX", "attribute", "Value_", "in_", "YA", "xis", "Name", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "y", "\\u", "variable_", "=_", "element_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "the", " ", "row", " ", "dimension", "s", " ", "parameter", " ", "of", " ", "the", " ", "Make", " ", "Net", "CD", "F", " ", "Feature_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Layer", " ", "tool", " ", "to", " ", "the", " ", "names", " ", "of", " ", "the", " ", "coordinate", " ", "variables_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dim", "Names_", "=_", "nc", "FP", "_", "._", "get", "Dimen", "sion", "s", "By", "Variable_", "(_", "str_", "(_", "selecte", "d", "Vars_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row", "Dimensions_", "=_", "str_", "(_", "dim", "Names_", "[_", "-_", "1_", "]_", ")_", "+_", "\";\"_", "+_", "str_", "(_", "dim", "Names_", "[_", "-_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Coord", "Attribute", "Value_", "=_", "\"", "missi", "ng", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Convert", " ", "the", " ", "python", " ", "list", " ", "of", " ", "selecte", "d", " ", "variab", "les", " ", "int", "o", " ", "a", " ", "single_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "comma", " ", "delim", "ited", " ", "string", " ", "if", " ", "necessar", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "selecte", "d", "Vars_", "._", "count_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "variab", "le", "\\u", "list_", "=_", "','_", "._", "join_", "(_", "[_", "str_", "(_", "x_", ")_", "for_", "x_", "in_", "selecte", "d", "Vars_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "variab", "le", "\\u", "list_", "=_", "selecte", "d", "Vars_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "x", "\\u", "variable_", ")_", "and_", "(_", "y", "\\u", "variable_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "debug_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arcpy_", "._", "Add", "Warning_", "(_", "\"", "net", "CD", "FF", "ile", " ", "Name", ":", " ", "%", "s", "\"_", "%_", "parameters_", "[_", "0_", "]_", "._", "value", "As", "Text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arcpy_", "._", "Add", "Warning_", "(_", "\"", "Varia", "ble", " ", "List", ":", " ", "%", "s", "\"_", "%_", "variab", "le", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arcpy_", "._", "Add", "Warning_", "(_", "\"", "x", "\\u", "variab", "le", ":", " ", "%", "s", "\"_", "%_", "x", "\\u", "variable_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arcpy_", "._", "Add", "Warning_", "(_", "\"", "y", "\\u", "variab", "le", ":", " ", "%", "s", "\"_", "%_", "y", "\\u", "variable_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arcpy_", "._", "Add", "Warning_", "(_", "\"", "Output", " ", "Feature", " ", "Layer", ":", " ", "%", "s", " ", "\"_", "%_", "parameters_", "[_", "2_", "]_", "._", "value", "As", "Text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arcpy_", "._", "Add", "Warning_", "(_", "\"", "Row", " ", "Dimen", "sion", "s", ":", " ", "%", "s", " ", "\"_", "%_", "row", "Dimensions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result1_", "=_", "arcpy_", "._", "Make", "Net", "CD", "FF", "eature", "Layer", "\\u", "md_", "(_", "parameters_", "[_", "0_", "]_", "._", "value", "As", "Text_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "variab", "le", "\\u", "list_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "x", "\\u", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "y", "\\u", "variable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "parameters_", "[_", "2_", "]_", "._", "value_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "row", "Dimensions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Force", " ", "the", " ", "net", "CD", "F", " ", "Feature", " ", "Layer", " ", "to", " ", "be", " ", "adde", "d", " ", "to", " ", "the", " ", "display_", "\\u\\u\\uNL\\u\\u\\u_", "arcpy_", "._", "Set", "Parameter_", "(_", "3_", ",_", "result1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arcpy_", "._", "Add", "Error_", "(_", "\"", "Una", "ble", " ", "to", " ", "automati", "call", "y", " ", "dete", "rmin", "e", " ", "x", " ", "and", " ", "y", " ", "\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "variab", "les", " ", "from", " ", "the", " ", "net", "CD", "F", " ", "file", ".", " ", "Us", "e", " ", "Make", " ", "Net", "CD", "F", " ", "\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Feature", " ", "Layer", " ", "tool", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_" ]
[ 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,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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 ]
Except block handles 'BaseException'
catap/namebench/nb_third_party/dns/entropy.py
[ { "content": " def __init__(self, seed=None):\n self.pool_index = 0\n self.digest = None\n self.next_byte = 0\n self.lock = _threading.Lock()\n try:\n import hashlib\n self.hash = hashlib.sha1()\n self.hash_len = 20\n except:\n try:\n import sha\n self.hash = sha.new()\n self.hash_len = 20\n except:\n import md5\n self.hash = md5.new()\n self.hash_len = 16\n self.pool = '\\0' * self.hash_len\n if not seed is None:\n self.stir(seed)\n self.seeded = True\n else:\n self.seeded = False", "metadata": "root.EntropyPool.__init__", "header": "['class', 'EntropyPool', '(', 'object', ')', ':', '___EOS___']", "index": 23 }, { "content": " def _maybe_seed(self):\n if not self.seeded:\n try:\n seed = os.urandom(16)\n except:\n try:\n r = file('/dev/urandom', 'r', 0)\n try:\n seed = r.read(16)\n finally:\n r.close()\n except:\n seed = str(time.time())\n self.seeded = True\n self.stir(seed, True)", "metadata": "root.EntropyPool._maybe_seed", "header": "['class', 'EntropyPool', '(', 'object', ')', ':', '___EOS___']", "index": 64 } ]
[ { "span": "except:", "start_line": 32, "start_column": 8, "end_line": 32, "end_column": 15 }, { "span": "except:", "start_line": 37, "start_column": 12, "end_line": 37, "end_column": 19 }, { "span": "except:", "start_line": 68, "start_column": 12, "end_line": 68, "end_column": 19 }, { "span": "except:", "start_line": 75, "start_column": 16, "end_line": 75, "end_column": 23 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Entr", "opy", "Pool_", "(_", "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_", ",_", "seed_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "pool", "\\u", "index_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "digest_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "next", "\\u", "byte_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lock_", "=_", "\\u", "threading_", "._", "Lock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "hashlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hash_", "=_", "hashlib_", "._", "sha1_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hash", "\\u", "len_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "sha_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hash_", "=_", "sha_", "._", "new_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hash", "\\u", "len_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "md5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hash_", "=_", "md5_", "._", "new_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hash", "\\u", "len_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "pool_", "=_", "'\\\\", "0", "'_", "*_", "self_", "._", "hash", "\\u", "len_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "seed_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "sti", "r_", "(_", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "seede", "d_", "=_", "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_", "._", "seede", "d_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entr", "opy", "Pool_", "(_", "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", "may", "be", "\\u", "seed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "seede", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "seed_", "=_", "os_", "._", "urandom_", "(_", "16_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "r_", "=_", "file_", "(_", "'/", "dev", "/", "uran", "dom", "'_", ",_", "'", "r", "'_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "seed_", "=_", "r_", "._", "read_", "(_", "16_", ")_", "\\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 ", " ", " _", "r_", "._", "close_", "(_", ")_", "\\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 ", " ", "_", "seed_", "=_", "str_", "(_", "time_", "._", "time_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "seede", "d_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sti", "r_", "(_", "seed_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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 ]
Unused import
uwdata/termite-visualizations/web2py/scripts/cpdb.py
[ { "content": "import os\nimport sys\nfrom collections import deque\nimport string\nimport argparse\nimport cStringIO\nimport operator\nimport cPickle as pickle\nfrom collections import deque\nimport math\nimport re\nimport cmd\nimport readline\ntry:\n from gluon import DAL\nexcept ImportError as err:\n print('gluon path not found')\n\n\n\n\n\n\n\n\n\n\n\nif __name__ == '__main__':\n oCopy = setCopyDB()\n db = None\n targetDB = None\n dbfolder = None\n clean = False\n model = None\n truncate = False\n\n parser = argparse.ArgumentParser(description='\\\nsamplecmd line:\\n\\\n-f ./blueLite/db_storage -i -y sqlite://storage.sqlite -Y sqlite://storage2.sqlite -d ./blueLite/pyUtils/sql/blueSQL -t True',\n epilog='')\n reqGroup = parser.add_argument_group('Required arguments')\n reqGroup.add_argument('-f', '--sourceFolder', required=True, help=\"path to the 'source' folder of the 'source' DB\")\n reqGroup.add_argument('-F', '--targetFolder', required=False, help=\"path to the 'target' folder of the 'target' DB\")\n reqGroup.add_argument('-y', '--sourceConnectionString', required=True, help=\"source db connection string ()\\n\\\n------------------------------------------------\\n\\\n\\\nsqlite://storage.db\\n\\\nmysql://username:password@localhost/test\\n\\\npostgres://username:password@localhost/test\\n\\\nmssql://username:password@localhost/test\\n\\\nfirebird://username:password@localhost/test\\n\\\noracle://username/password@test\\n\\\ndb2://username:password@test\\n\\\ningres://username:password@localhost/test\\n\\\ninformix://username:password@test\\n\\\n\\\n------------------------------------------------\")\n reqGroup.add_argument('-Y', '--targetConnectionString', required=True,\n help=\"target db type (sqlite,mySql,etc.)\")\n autoImpGroup = parser.add_argument_group('optional args (auto_import)')\n autoImpGroup.add_argument('-a', '--autoimport', required=False, help='set to True to bypass loading of the model')\n\n \"\"\"\n\n *** removing -m/-M options for now --> i need a\n better regex to match db.define('bla')...with optional db.commit()\n\n modelGroup=parser.add_argument_group('optional args (create model)')\n modelGroup.add_argument('-m','--sourcemodel'\\\n ,required=False\\\n ,help='to create a model from an existing model, point to the source model')\n modelGroup.add_argument('-M','--targetmodel'\\\n ,required=False\\\n ,help='to create a model from an existing model, point to the target model')\n\n \"\"\"\n\n miscGroup = parser.add_argument_group('optional args/tasks')\n miscGroup.add_argument('-i', '--interactive', required=False, action='store_true', help='run in interactive mode')\n miscGroup.add_argument(\n '-d', '--dal', required=False, help='path to dal.py')\n miscGroup.add_argument('-t', '--truncate', choices=['True', 'False'], help='delete the records but *not* the table of the SOURCE DB')\n miscGroup.add_argument('-b', '--tables', required=False, type=list, help='optional list (comma delimited) of SOURCE tables to truncate, defaults to all')\n miscGroup.add_argument('-c', '--clean', required=False, help='delete the DB,tables and the log file, WARNING: this is unrecoverable')\n\n args = parser.parse_args()\n db = None\n mDal = None\n\n try:\n oCopy.sourceFolder = args.sourceFolder\n oCopy.targetFolder = args.sourceFolder\n sourceItems = string.split(args.sourceConnectionString, '://')\n oCopy.sourcedbType = sourceItems[0]\n oCopy.sourcedbName = sourceItems[1]\n targetItems = string.split(args.targetConnectionString, '://')\n oCopy.targetdbType = targetItems[0]\n oCopy.targetdbName = targetItems[1]\n except Exception, err:\n print('EXCEPTION: {0}'.format(err))\n\n if args.dal:\n try:\n autoImport = True\n if args.autoimport:\n autoImport = args.autoimport\n #sif not DAL in globals:\n #if not sys.path.__contains__():\n oCopy.dalPath = args.dal\n mDal = oCopy._getDal()\n db = oCopy.instDB(args.sourceFolder, args.sourceConnectionString,\n autoImport)\n except Exception, err:\n print('EXCEPTION: could not set DAL\\n{0}'.format(err))\n if args.truncate:\n try:\n if args.truncate:\n if args.tables:\n tables = string.split(string.strip(args.tables), ',')\n else:\n oCopy.truncatetables([])\n except Exception, err:\n print('EXCEPTION: could not truncate tables\\n{0}'.format(err))\n try:\n if args.clean:\n oCopy.delete_DB_tables(oCopy.targetFolder, oCopy.targetType)\n except Exception, err:\n print('EXCEPTION: could not clean db\\n{0}'.format(err))\n\n \"\"\"\n *** goes with -m/-M options... removed for now\n\n if args.sourcemodel:\n try:\n oCopy.sourceModel=args.sourcemodel\n oCopy.targetModel=args.sourcemodel\n oCopy.createModel()\n except Exception, err:\n print('EXCEPTION: could not create model\\n\\\nsource model: {0}\\n\\\ntarget model: {1}\\n\\\n{2}'.format(args.sourcemodel,args.targetmodel,err))\n \"\"\"\n\n if args.sourceFolder:\n try:\n oCopy.sourceFolder = os.path.abspath(args.sourceFolder)\n oCopy.createfolderPath(oCopy.sourceFolder)\n except Exception, err:\n print('EXCEPTION: could not create folder path\\n{0}'.format(err))\n else:\n oCopy.dbStorageFolder = os.path.abspath(os.getcwd())\n if args.targetFolder:\n try:\n oCopy.targetFolder = os.path.abspath(args.targetFolder)\n oCopy.createfolderPath(oCopy.targetFolder)\n except Exception, err:\n print('EXCEPTION: could not create folder path\\n{0}'.format(err))\n if not args.interactive:\n try:\n oCopy.copyDB()\n except Exception, err:\n print('EXCEPTION: could not make a copy of the database\\n{0}'.format(err))\n else:\n s = dalShell()\n s.shell(db)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class refTable(object):\n\n\n\n\n", "metadata": "root.refTable", "header": "['module', '___EOS___']", "index": 19 }, { "content": " def __init__(self):\n self.columns = None\n self.rows = None", "metadata": "root.refTable.__init__", "header": "['class', 'refTable', '(', 'object', ')', ':', '___EOS___']", "index": 20 }, { "content": " def getcolHeader(self, colHeader):\n return \"{0}\".format(' | '.join([string.join(string.strip('**{0}**'.format(item)),\n '') for item in colHeader]))", "metadata": "root.refTable.getcolHeader", "header": "['class', 'refTable', '(', 'object', ')', ':', '___EOS___']", "index": 24 }, { "content": " def wrapTable(\n self, rows, hasHeader=False, headerChar='-', delim=' | ', justify='left',\n separateRows=False, prefix='', postfix='', wrapfunc=lambda x: x):\n\n def rowWrapper(row):\n\n '''---\n newRows is returned like\n [['w'], ['x'], ['y'], ['z']]\n ---'''\n newRows = [wrapfunc(item).split('\\n') for item in row]\n self.rows = newRows\n '''---\n rowList gives like newRows but\n formatted like [[w, x, y, z]]\n ---'''\n rowList = [[substr or '' for substr in item]\n for item in map(None, *newRows)]\n return rowList\n\n logicalRows = [rowWrapper(row) for row in rows]\n\n columns = map(None, *reduce(operator.add, logicalRows))\n self.columns = columns\n\n maxWidths = [max(\n [len(str\n (item)) for\n item in column]\n ) for column\n in columns]\n\n rowSeparator = headerChar * (len(prefix) + len(postfix) + sum(maxWidths) +\n len(delim) * (len(maxWidths) - 1))\n\n justify = {'center': str\n .center,\n 'right': str\n .rjust,\n 'left': str.\n ljust\n }[justify\n .lower(\n )]\n\n output = cStringIO.StringIO()\n\n if separateRows:\n print >> output, rowSeparator\n\n for physicalRows in logicalRows:\n for row in physicalRows:\n print >> output,\\\n prefix + delim.join([\n justify(str(item), width) for (\n item, width) in zip(row, maxWidths)]\n ) + postfix\n\n if separateRows or hasHeader:\n print >> output, rowSeparator\n hasHeader = False\n return output.getvalue()", "metadata": "root.refTable.wrapTable", "header": "['class', 'refTable', '(', 'object', ')', ':', '___EOS___']", "index": 28 }, { "content": " def wrap_onspace(self, text, width):\n return reduce(lambda line, word, width=width: '{0}{1}{2}'\n .format(line, ' \\n'[(len(\n line[line.rfind('\\n'\n ) + 1:]) + len(\n word.split('\\n', 1)[0]) >=\n width)], word), text.split(' '))", "metadata": "root.refTable.wrap_onspace", "header": "['class', 'refTable', '(', 'object', ')', ':', '___EOS___']", "index": 91 }, { "content": " def wrap_onspace_strict(self, text, width):\n wordRegex = re.compile(r'\\S{' + str(width) + r',}')\n return self.wrap_onspace(\n wordRegex.sub(\n lambda m: self.\n wrap_always(\n m.group(), width), text\n ), width)", "metadata": "root.refTable.wrap_onspace_strict", "header": "['class', 'refTable', '(', 'object', ')', ':', '___EOS___']", "index": 99 }, { "content": " def wrap_always(self, text, width):\n return '\\n'.join(\n [text[width * i:width * (i + 1\n )] for i in xrange(\n int(math.ceil(1. * len(\n text) / width)))])", "metadata": "root.refTable.wrap_always", "header": "['class', 'refTable', '(', 'object', ')', ':', '___EOS___']", "index": 108 }, { "content": "class tableHelper():\n\n\n\n", "metadata": "root.tableHelper", "header": "['module', '___EOS___']", "index": 116 }, { "content": " def __init__(self):\n self.oTable = refTable()", "metadata": "root.tableHelper.__init__", "header": "['class', 'tableHelper', '(', ')', ':', '___EOS___']", "index": 117 }, { "content": " def getAsRows(self, data):\n return [row.strip().split(',') for row in data.splitlines()]", "metadata": "root.tableHelper.getAsRows", "header": "['class', 'tableHelper', '(', ')', ':', '___EOS___']", "index": 120 }, { "content": " def getTable_noWrap(self, data, header=None):\n rows = self.getAsRows(data)\n if header is not None:\n hRows = [header] + rows\n else:\n hRows = rows\n table = self.oTable.wrapTable(hRows, hasHeader=True)\n return table", "metadata": "root.tableHelper.getTable_noWrap", "header": "['class', 'tableHelper', '(', ')', ':', '___EOS___']", "index": 123 }, { "content": " def getTable_Wrap(self, data, wrapStyle, header=None, width=65):\n wrapper = None\n if len(wrapStyle) > 1:\n rows = self.getAsRows(data)\n if header is not None:\n hRows = [header] + rows\n else:\n hRows = rows\n\n for wrapper in (self.oTable.wrap_always,\n self.oTable.wrap_onspace,\n self.oTable.wrap_onspace_strict):\n return self.oTable.wrapTable(hRows, hasHeader=True, separateRows=True, prefix='| ', postfix=' |', wrapfunc=lambda x:\n wrapper(x, width))\n else:\n return self.getTable_noWrap(data, header)", "metadata": "root.tableHelper.getTable_Wrap", "header": "['class', 'tableHelper', '(', ')', ':', '___EOS___']", "index": 132 }, { "content": " def getAsErrorTable(self, err):\n return self.getTable_Wrap(err, None)", "metadata": "root.tableHelper.getAsErrorTable", "header": "['class', 'tableHelper', '(', ')', ':', '___EOS___']", "index": 149 }, { "content": "class console:\n\n\n\n\n\n\n\n '''---\n DEFAULT COMMANDS (begins with cmd_)\n ---'''\n\n\n\n\n\n", "metadata": "root.console", "header": "['module', '___EOS___']", "index": 153 }, { "content": " def __init__(self, prompt, banner=None):\n self.prompt = prompt\n self.banner = banner\n self.commands = {}\n self.commandSort = []\n self.db = None\n\n for i in dir(self):\n if \"cmd_\" == i[:4]:\n cmd = i.split(\"cmd_\")[1].lower()\n self.commands[cmd] = getattr(self, i)\n try:\n self.commandSort.append((int(self\n .commands[cmd].__doc__.split(\n \"|\")[0]), cmd))\n except:\n pass\n\n self.commandSort.sort()\n self.commandSort = [i[1] for i in self.commandSort]\n\n self.var_DEBUG = False\n self.var_tableStyle = ''\n\n self.configvars = {}\n for i in dir(self):\n if \"var_\" == i[:4]:\n var = i.split(\"var_\")[1]\n self.configvars[var] = i", "metadata": "root.console.__init__", "header": "['class', 'console', ':', '___EOS___']", "index": 154 }, { "content": " def setBanner(self, banner):\n self.banner = banner", "metadata": "root.console.setBanner", "header": "['class', 'console', ':', '___EOS___']", "index": 184 }, { "content": " def execCmd(self, db):\n self.db = db\n print self.banner\n while True:\n try:\n command = raw_input(self.prompt)\n try:\n self.execCommand(command)\n except:\n self.execute(command)\n except KeyboardInterrupt:\n break\n except EOFError:\n break\n except Exception, a:\n self.printError(a)\n print (\"\\r\\n\\r\\nBye!...\")\n sys.exit(0)", "metadata": "root.console.execCmd", "header": "['class', 'console', ':', '___EOS___']", "index": 187 }, { "content": " def printError(self, err):\n sys.stderr.write(\"Error: {0}\\r\\n\".format(str(err),))\n if self.var_DEBUG:\n pass", "metadata": "root.console.printError", "header": "['class', 'console', ':', '___EOS___']", "index": 206 }, { "content": " def execute(self, cmd):\n try:\n if not '-table ' in cmd:\n exec '{0}'.format(cmd)\n else:\n file = None\n table = None\n\n fields = []\n items = string.split(cmd, ' ')\n invalidParams = []\n table = self.getTable(items[1])\n allowedParams = ['fields', 'file']\n for i in items:\n if '=' in i and not string.split(i, '=')[0] in allowedParams:\n try:\n invalidParams.append(i)\n except Exception, err:\n raise Exception('invalid parameter\\n{0}'.format(i))\n else:\n if 'file=' in i:\n file = os.path.abspath(string.strip(string.split(\n i, '=')[1]))\n if 'fields=' in i:\n for field in string.split(string.split(i, '=')[1], ','):\n if field in self.db[table].fields:\n fields.append(string.strip(field))\n\n if len(invalidParams) > 0:\n print('the following parameter(s) is not valid\\n{0}'.format(\n string.join(invalidParams, ',')))\n else:\n try:\n self.cmd_table(table, file, fields)\n except Exception, err:\n print('could not generate table for table {0}\\n{1}'\n .format(table, err))\n except Exception, err:\n print('sorry, can not do that!\\n{0}'.format(err))", "metadata": "root.console.execute", "header": "['class', 'console', ':', '___EOS___']", "index": 211 }, { "content": " def getTable(self, tbl):\n for mTbl in db.tables:\n if tbl in mTbl:\n if mTbl.startswith(tbl):\n return mTbl", "metadata": "root.console.getTable", "header": "['class', 'console', ':', '___EOS___']", "index": 251 }, { "content": " def execCommand(self, cmd):\n words = cmd.split(\" \")\n words = [i for i in words if i]\n if not words:\n return\n cmd, parameters = words[0].lower(), words[1:]\n\n if not cmd in self.commands:\n raise Exception(\n \"Command {0} not found. Try 'help'\\r\\n\".format(cmd))\n\n self.commands[cmd](*parameters)", "metadata": "root.console.execCommand", "header": "['class', 'console', ':', '___EOS___']", "index": 257 }, { "content": " def cmd_clear(self, numlines=100):\n \"\"\"-5|clear|clear the screen\"\"\"\n if os.name == \"posix\":\n '''---\n Unix/Linux/MacOS/BSD/etc\n ---'''\n os.system('clear')\n elif os.name in (\"nt\", \"dos\", \"ce\"):\n '''---\n Windows\n ---'''\n os.system('CLS')\n else:\n '''---\n Fallback for other operating systems.\n ---'''\n print '\\n' * numlines", "metadata": "root.console.cmd_clear", "header": "['class', 'console', ':', '___EOS___']", "index": 273 }, { "content": " def cmd_table(self, tbl, file=None, fields=[]):\n \"\"\"-4|-table [TABLENAME] optional[file=None] [fields=None]|\\\nthe default tableStyle is no_wrap - use the 'set x y' command to change the style\\n\\\nstyle choices:\n\\twrap_always\n\\twrap_onspace\n\\twrap_onspace_strict\n\\tno_wrap (value '')\\n\n\\t the 2nd optional param is a path to a file where the table will be written\n\\t the 3rd optional param is a list of fields you want displayed\\n\"\"\"\n table = None\n for mTbl in db.tables:\n if tbl in mTbl:\n if mTbl.startswith(tbl):\n table = mTbl\n break\n oTable = tableHelper()\n '''---\n tablestyle:\n wrap_always\n wrap_onspace\n wrap_onspace_strict\n or set set to \"\" for no wrapping\n ---'''\n tableStyle = self.var_tableStyle\n filedNotFound = []\n table_fields = None\n if len(fields) == 0:\n table_fields = self.db[table].fields\n else:\n table_fields = fields\n\n for field in fields:\n if not field in self.db[table].fields:\n filedNotFound.append(field)\n if len(filedNotFound) == 0:\n rows = self.db(self.db[table].id > 0).select()\n rows_data = []\n for row in rows:\n rowdata = []\n for f in table_fields:\n rowdata.append('{0}'.format(row[f]))\n rows_data.append(string.join(rowdata, ','))\n data = string.join(rows_data, '\\n')\n dataTable = oTable.getTable_Wrap(data, tableStyle, table_fields)\n print('TABLE {0}\\n{1}'.format(table, dataTable))\n if file is not None:\n try:\n tail, head = os.path.split(file)\n try:\n os.makedirs(tail)\n except:\n 'do nothing, folders exist'\n oFile = open(file, 'w')\n oFile.write('TABLE: {0}\\n{1}'.format(table, dataTable))\n oFile.close()\n print('{0} has been created and populated with all available data from table {1}\\n'.format(file, table))\n except Exception, err:\n print(\"EXCEPTION: could not create table {0}\\n{1}\".format(\n table, err))\n else:\n print('the following fields are not valid [{0}]'.format(\n string.join(filedNotFound, ',')))", "metadata": "root.console.cmd_table", "header": "['class', 'console', ':', '___EOS___']", "index": 291 }, { "content": " def cmd_help(self, *args):\n '''-3|help|Show's help'''\n alldata = []\n lengths = []\n\n for i in self.commandSort:\n alldata.append(\n self.commands[i].__doc__.split(\"|\")[1:])\n\n for i in alldata:\n if len(i) > len(lengths):\n for j in range(len(i)\n - len(lengths)):\n lengths.append(0)\n\n j = 0\n while j < len(i):\n if len(i[j]) > lengths[j]:\n lengths[j] = len(i[j])\n j += 1\n\n print (\"-\" * (lengths[0] + lengths[1] + 4))\n for i in alldata:\n print ((\"%-\" + str(lengths[0]) + \"s - %-\" + str(\n lengths[1]) + \"s\") % (i[0], i[1]))\n if len(i) > 2:\n for j in i[2:]: print ((\"%\" + str(lengths[\n 0] + 9) + \"s* %s\") % (\" \", j))\n print", "metadata": "root.console.cmd_help", "header": "['class', 'console', ':', '___EOS___']", "index": 355 }, { "content": " def cmd_vars(self, *args):\n '''-2|vars|Show variables'''\n print (\"variables\\r\\n\" + \"-\" * 79)\n for i, j in self.configvars.items():\n value = self.parfmt(repr(getattr(self, j)), 52)\n print (\"| %20s | %52s |\" % (i, value[0]))\n for k in value[1:]: print (\"| %20s | %52s |\" % (\"\", k))\n if len(value) > 1:\n print(\"| %20s | %52s |\" % (\"\", \"\"))\n print (\"-\" * 79)", "metadata": "root.console.cmd_vars", "header": "['class', 'console', ':', '___EOS___']", "index": 385 }, { "content": " def parfmt(self, txt, width):\n res = []\n pos = 0\n while True:\n a = txt[pos:pos + width]\n if not a:\n break\n res.append(a)\n pos += width\n return res", "metadata": "root.console.parfmt", "header": "['class', 'console', ':', '___EOS___']", "index": 396 }, { "content": " def cmd_set(self, *args):\n '''-1|set [variable_name] [value]|Set configuration variable value|Values are an expressions (100 | string.lower('ABC') | etc.'''\n value = \" \".join(args[1:])\n if args[0] not in self.configvars:\n setattr(self, \"var_{0}\".format(args[0]), eval(value))\n setattr(self, \"var_{0}\".format(args[0]), eval(value))", "metadata": "root.console.cmd_set", "header": "['class', 'console', ':', '___EOS___']", "index": 407 }, { "content": " def cmd_clearscreen(self, numlines=50):\n '''---Clear the console.\n ---'''\n if os.name == \"posix\":\n '''---\n Unix/Linux/MacOS/BSD/etc\n ---'''\n os.system('clear')\n elif os.name in (\"nt\", \"dos\", \"ce\"):\n '''---\n Windows\n ---'''\n os.system('CLS')\n else:\n '''---\n Fallback for other operating systems.\n ---'''\n print '\\n' * numlines", "metadata": "root.console.cmd_clearscreen", "header": "['class', 'console', ':', '___EOS___']", "index": 414 }, { "content": "class dalShell(console):\n", "metadata": "root.dalShell", "header": "['module', '___EOS___']", "index": 434 }, { "content": " def __init__(self):\n pass", "metadata": "root.dalShell.__init__", "header": "['class', 'dalShell', '(', 'console', ')', ':', '___EOS___']", "index": 435 }, { "content": " def shell(self, db):\n console.__init__(self, prompt=\">>> \", banner='dal interactive shell')\n self.execCmd(db)", "metadata": "root.dalShell.shell", "header": "['class', 'dalShell', '(', 'console', ')', ':', '___EOS___']", "index": 438 }, { "content": "class setCopyDB():\n\n\n\n\n\n", "metadata": "root.setCopyDB", "header": "['module', '___EOS___']", "index": 443 }, { "content": " def __init__(self):\n '''---\n non source or target specific vars\n ---'''\n self.strModel = None\n self.dalPath = None\n self.db = None\n '''---\n source vars\n ---'''\n self.sourceModel = None\n self.sourceFolder = None\n self.sourceConnectionString = None\n self.sourcedbType = None\n self.sourcedbName = None\n '''---\n target vars\n ---'''\n self.targetdbType = None\n self.targetdbName = None\n self.targetModel = None\n self.targetFolder = None\n self.targetConnectionString = None\n self.truncate = False", "metadata": "root.setCopyDB.__init__", "header": "['class', 'setCopyDB', '(', ')', ':', '___EOS___']", "index": 444 }, { "content": " def _getDal(self):\n mDal = None\n if self.dalPath is not None:\n global DAL\n sys.path.append(self.dalPath)\n mDal = __import__(\n 'dal', globals={}, locals={}, fromlist=['DAL'], level=0)\n DAL = mDal.DAL\n return mDal", "metadata": "root.setCopyDB._getDal", "header": "['class', 'setCopyDB', '(', ')', ':', '___EOS___']", "index": 469 }, { "content": " def instDB(self, storageFolder, storageConnectionString, autoImport):\n self.db = DAL(storageConnectionString, folder=os.path.abspath(\n storageFolder), auto_import=autoImport)\n return self.db", "metadata": "root.setCopyDB.instDB", "header": "['class', 'setCopyDB', '(', ')', ':', '___EOS___']", "index": 479 }, { "content": " def delete_DB_tables(self, storageFolder, storageType):\n print 'delete_DB_tablesn\\n\\t{0}\\n\\t{1}'.format(\n storageFolder, storageType)\n dataFiles = [storageType, \"sql.log\"]\n try:\n for f in os.listdir(storageFolder):\n if \".table\" in f:\n fTable = \"{0}/{1}\".format(storageFolder, f)\n os.remove(fTable)\n print('deleted {0}'.format(fTable))\n for dFile in dataFiles:\n os.remove(\"{0}/{1}\".format(storageFolder, dFile))\n print('deleted {0}'.format(\n \"{0}/{1}\".format(storageFolder, dFile)))\n except Exception, errObj:\n print(str(errObj))", "metadata": "root.setCopyDB.delete_DB_tables", "header": "['class', 'setCopyDB', '(', ')', ':', '___EOS___']", "index": 484 }, { "content": " def truncatetables(self, tables=[]):\n if len(tables) != 0:\n try:\n print 'table value: {0}'.format(tables)\n for tbl in self.db.tables:\n for mTbl in tables:\n if mTbl.startswith(tbl):\n self.db[mTbl].truncate()\n except Exception, err:\n print('EXCEPTION: {0}'.format(err))\n else:\n try:\n for tbl in self.db.tables:\n self.db[tbl].truncate()\n except Exception, err:\n print('EXCEPTION: {0}'.format(err))", "metadata": "root.setCopyDB.truncatetables", "header": "['class', 'setCopyDB', '(', ')', ':', '___EOS___']", "index": 501 }, { "content": " def copyDB(self):\n other_db = DAL(\"{0}://{1}\".format(\n self.targetdbType, self.targetdbName), folder=self.targetFolder)\n\n print 'creating tables...'\n\n for table in self.db:\n other_db.define_table(\n table._tablename, *[field for field in table])\n '''\n should there be an option to truncAte target DB?\n if yes, then change args to allow for choice\n and set self.trancate to the art value\n\n if self.truncate==True:\n other_db[table._tablename].truncate()\n '''\n\n print 'exporting data...'\n self.db.export_to_csv_file(open('tmp.sql', 'wb'))\n\n print 'importing data...'\n other_db.import_from_csv_file(open('tmp.sql', 'rb'))\n other_db.commit()\n print 'done!'\n print 'Attention: do not run this program again or you end up with duplicate records'", "metadata": "root.setCopyDB.copyDB", "header": "['class', 'setCopyDB', '(', ')', ':', '___EOS___']", "index": 518 }, { "content": " def createfolderPath(self, folder):\n try:\n if folder is not None:\n os.makedirs(folder)\n except Exception, err:\n pass", "metadata": "root.setCopyDB.createfolderPath", "header": "['class', 'setCopyDB', '(', ')', ':', '___EOS___']", "index": 545 } ]
[ { "span": "from collections import deque", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 29 }, { "span": "import cPickle as pickle", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 24 }, { "span": "from collections import deque", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 29 }, { "span": "import cmd", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 10 }, { "span": "import readline", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 15 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "collections_", "import_", "deque_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "argparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "c", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "operator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "c", "Pickle_", "as_", "pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "collections_", "import_", "deque_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "math_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "cmd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "readline_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "gluon_", "import_", "DA", "L_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", "as_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "glu", "on", " ", "path", " ", "not", " ", "found", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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 ", " _", "o", "Copy_", "=_", "set", "Copy", "DB_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "DB_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbf", "older_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "clean_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "truncate_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", "description_", "=_", "'\\\\", "\\", "10", ";", "sample", "cmd", " ", "line", ":\\\\", "n", "\\\\", "\\", "10", ";", "-", "f", " ", "./", "blue", "Lite", "/", "db", "\\u", "storage", " ", "-", "i", " ", "-", "y", " ", "sql", "ite", "://", "storage", ".", "sql", "ite", " ", "-", "Y", " ", "sql", "ite", "://", "storage", "2", ".", "sql", "ite", " ", "-", "d", " ", "./", "blue", "Lite", "/", "py", "Ut", "il", "s", "/", "sql", "/", "blue", "SQL", " ", "-", "t", " ", "Tru", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "epilog_", "=_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req", "Group_", "=_", "parser_", "._", "add", "\\u", "argu", "ment", "\\u", "group_", "(_", "'", "Requ", "ired", " ", "argu", "ment", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req", "Group_", "._", "add", "\\u", "argument_", "(_", "'-", "f", "'_", ",_", "'--", "source", "Fold", "er", "'_", ",_", "required_", "=_", "True_", ",_", "help_", "=_", "\"", "path", " ", "to", " ", "the", " ", "'", "source", "'", " ", "folder", " ", "of", " ", "the", " ", "'", "source", "'", " ", "DB", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req", "Group_", "._", "add", "\\u", "argument_", "(_", "'-", "F", "'_", ",_", "'--", "target", "Fold", "er", "'_", ",_", "required_", "=_", "False_", ",_", "help_", "=_", "\"", "path", " ", "to", " ", "the", " ", "'", "target", "'", " ", "folder", " ", "of", " ", "the", " ", "'", "target", "'", " ", "DB", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req", "Group_", "._", "add", "\\u", "argument_", "(_", "'-", "y", "'_", ",_", "'--", "source", "Connect", "ion", "String", "'_", ",_", "required_", "=_", "True_", ",_", "help_", "=_", "\"", "source", " ", "db", " ", "connecti", "on", " ", "string", " ", "()", "\\\\", "n", "\\\\", "\\", "10", ";", "--------------", "--------------", "--------------", "------", "\\\\", "n", "\\\\", "\\", "10", ";\\\\", "\\", "10", ";", "sql", "ite", "://", "storage", ".", "db", "\\\\", "n", "\\\\", "\\", "10", ";", "mysql", "://", "user", "name", ":", "password", "@", "local", "host", "/", "test", "\\\\", "n", "\\\\", "\\", "10", ";", "postgres", "://", "user", "name", ":", "password", "@", "local", "host", "/", "test", "\\\\", "n", "\\\\", "\\", "10", ";", "mss", "ql", "://", "user", "name", ":", "password", "@", "local", "host", "/", "test", "\\\\", "n", "\\\\", "\\", "10", ";", "fire", "bird", "://", "user", "name", ":", "password", "@", "local", "host", "/", "test", "\\\\", "n", "\\\\", "\\", "10", ";", "oracle", "://", "user", "name", "/", "password", "@", "test", "\\\\", "n", "\\\\", "\\", "10", ";", "db", "2", "://", "user", "name", ":", "password", "@", "test", "\\\\", "n", "\\\\", "\\", "10", ";", "ingr", "es", "://", "user", "name", ":", "password", "@", "local", "host", "/", "test", "\\\\", "n", "\\\\", "\\", "10", ";", "inform", "ix", "://", "user", "name", ":", "password", "@", "test", "\\\\", "n", "\\\\", "\\", "10", ";\\\\", "\\", "10", ";", "--------------", "--------------", "--------------", "------", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req", "Group_", "._", "add", "\\u", "argument_", "(_", "'-", "Y", "'_", ",_", "'--", "target", "Connect", "ion", "String", "'_", ",_", "required_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "target", " ", "db", " ", "type", " ", "(", "sql", "ite", ",", "my", "Sq", "l", ",", "etc", ".)", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "auto", "Imp", "Group_", "=_", "parser_", "._", "add", "\\u", "argu", "ment", "\\u", "group_", "(_", "'", "option", "al", " ", "args", " ", "(", "auto", "\\u", "import", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "auto", "Imp", "Group_", "._", "add", "\\u", "argument_", "(_", "'-", "a", "'_", ",_", "'--", "autoi", "mpor", "t", "'_", ",_", "required_", "=_", "False_", ",_", "help_", "=_", "'", "set", " ", "to", " ", "Tru", "e", " ", "to", " ", "bypass", " ", "load", "ing", " ", "of", " ", "the", " ", "model", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "***", " ", "remo", "ving", " ", "-", "m", "/-", "M", " ", "options", " ", "for", " ", "now", " ", "-->", " ", "i", " ", "need", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "bett", "er", " ", "regex", " ", "to", " ", "match", " ", "db", ".", "defin", "e", "('", "bla", "')", "...", "with", " ", "option", "al", " ", "db", ".", "commit", "()", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "model", "Group", "=", "parser", ".", "add", "\\u", "argu", "ment", "\\u", "group", "('", "option", "al", " ", "args", " ", "(", "create", " ", "model", ")'", ")", "\\", "10", ";", " ", " ", " ", " ", "model", "Group", ".", "add", "\\u", "argu", "ment", "('", "-", "m", "','", "--", "source", "model", "'\\\\", "\\", "10", ";", " ", " ", " ", ",", "require", "d", "=", "Fal", "se", "\\\\", "\\", "10", ";", " ", " ", " ", ",", "help", "='", "to", " ", "create", " ", "a", " ", "model", " ", "from", " ", "an", " ", "exist", "ing", " ", "model", ",", " ", "point", " ", "to", " ", "the", " ", "source", " ", "model", "')", "\\", "10", ";", " ", " ", " ", " ", "model", "Group", ".", "add", "\\u", "argu", "ment", "('", "-", "M", "','", "--", "target", "model", "'\\\\", "\\", "10", ";", " ", " ", " ", ",", "require", "d", "=", "Fal", "se", "\\\\", "\\", "10", ";", " ", " ", " ", ",", "help", "='", "to", " ", "create", " ", "a", " ", "model", " ", "from", " ", "an", " ", "exist", "ing", " ", "model", ",", " ", "point", " ", "to", " ", "the", " ", "target", " ", "model", "')", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "misc", "Group_", "=_", "parser_", "._", "add", "\\u", "argu", "ment", "\\u", "group_", "(_", "'", "option", "al", " ", "args", "/", "task", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "misc", "Group_", "._", "add", "\\u", "argument_", "(_", "'-", "i", "'_", ",_", "'--", "interactive", "'_", ",_", "required_", "=_", "False_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "help_", "=_", "'", "run", " ", "in", " ", "interactive", " ", "mode", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "misc", "Group_", "._", "add", "\\u", "argument_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'-", "d", "'_", ",_", "'--", "dal", "'_", ",_", "required_", "=_", "False_", ",_", "help_", "=_", "'", "path", " ", "to", " ", "dal", ".", "py", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "misc", "Group_", "._", "add", "\\u", "argument_", "(_", "'-", "t", "'_", ",_", "'--", "truncat", "e", "'_", ",_", "choices_", "=_", "[_", "'", "Tru", "e", "'_", ",_", "'", "Fal", "se", "'_", "]_", ",_", "help_", "=_", "'", "delete", " ", "the", " ", "record", "s", " ", "but", " ", "*", "not", "*", " ", "the", " ", "table", " ", "of", " ", "the", " ", "SOU", "RC", "E", " ", "DB", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "misc", "Group_", "._", "add", "\\u", "argument_", "(_", "'-", "b", "'_", ",_", "'--", "tables", "'_", ",_", "required_", "=_", "False_", ",_", "type_", "=_", "list_", ",_", "help_", "=_", "'", "option", "al", " ", "list", " ", "(", "comma", " ", "delim", "ited", ")", " ", "of", " ", "SOU", "RC", "E", " ", "tables", " ", "to", " ", "truncat", "e", ",", " ", "default", "s", " ", "to", " ", "all", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "misc", "Group_", "._", "add", "\\u", "argument_", "(_", "'-", "c", "'_", ",_", "'--", "clean", "'_", ",_", "required_", "=_", "False_", ",_", "help_", "=_", "'", "delete", " ", "the", " ", "DB", ",", "tables", " ", "and", " ", "the", " ", "log", " ", "file", ",", " ", "WARN", "ING", ":", " ", "this", " ", "is", " ", "unre", "covera", "ble", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m", "Dal", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "o", "Copy_", "._", "source", "Folder_", "=_", "args_", "._", "source", "Folder_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "o", "Copy_", "._", "target", "Folder_", "=_", "args_", "._", "source", "Folder_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source", "Items_", "=_", "string_", "._", "split_", "(_", "args_", "._", "source", "Connect", "ion", "String_", ",_", "':/", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "o", "Copy_", "._", "sourced", "b", "Type_", "=_", "source", "Items_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "o", "Copy_", "._", "sourced", "b", "Name_", "=_", "source", "Items_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "Items_", "=_", "string_", "._", "split_", "(_", "args_", "._", "target", "Connect", "ion", "String_", ",_", "':/", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "o", "Copy_", "._", "target", "db", "Type_", "=_", "target", "Items_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "o", "Copy_", "._", "target", "db", "Name_", "=_", "target", "Items_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "EXCEPTION", ":", " ", "{", "0", "}'_", "._", "format_", "(_", "err_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "dal", "_", ":_", "\\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 ", " _", "auto", "Import_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", "._", "autoi", "mpor", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "auto", "Import_", "=_", "args_", "._", "autoi", "mpor", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "sif", " ", "not", " ", "DA", "L", " ", "in", " ", "globals", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "not", " ", "sys", ".", "path", ".\\u", "\\u", "contain", "s", "\\u\\u()", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "o", "Copy_", "._", "dal", "Path_", "=_", "args_", "._", "dal", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m", "Dal", "_", "=_", "o", "Copy_", "._", "\\u", "get", "Dal", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "=_", "o", "Copy_", "._", "inst", "DB_", "(_", "args_", "._", "source", "Folder_", ",_", "args_", "._", "source", "Connect", "ion", "String_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "auto", "Import_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "EXCEPTION", ":", " ", "coul", "d", " ", "not", " ", "set", " ", "DA", "L", "\\\\", "n", "{", "0", "}'_", "._", "format_", "(_", "err_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "truncate_", ":_", "\\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_", "args_", "._", "truncate_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "args_", "._", "tables_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "tables_", "=_", "string_", "._", "split_", "(_", "string_", "._", "strip_", "(_", "args_", "._", "tables_", ")_", ",_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "o", "Copy_", "._", "truncat", "eta", "bles_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "EXCEPTION", ":", " ", "coul", "d", " ", "not", " ", "truncat", "e", " ", "tables", "\\\\", "n", "{", "0", "}'_", "._", "format_", "(_", "err_", ")_", ")_", "\\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 ", " _", "if_", "args_", "._", "clean_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "o", "Copy_", "._", "delete", "\\u", "DB", "\\u", "tables_", "(_", "o", "Copy_", "._", "target", "Folder_", ",_", "o", "Copy_", "._", "target", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "EXCEPTION", ":", " ", "coul", "d", " ", "not", " ", "clean", " ", "db", "\\\\", "n", "{", "0", "}'_", "._", "format_", "(_", "err_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "***", " ", "go", "es", " ", "with", " ", "-", "m", "/-", "M", " ", "options", "...", " ", "remove", "d", " ", "for", " ", "now", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "args", ".", "source", "model", ":", "\\", "10", ";", " ", " ", " ", " ", "try", ":", "\\", "10", ";", " ", " ", " ", " ", "o", "Copy", ".", "source", "Model", "=", "args", ".", "source", "model", "\\", "10", ";", " ", " ", " ", " ", "o", "Copy", ".", "target", "Model", "=", "args", ".", "source", "model", "\\", "10", ";", " ", " ", " ", " ", "o", "Copy", ".", "create", "Model", "()", "\\", "10", ";", " ", " ", " ", " ", "except", " ", "Except", "ion", ",", " ", "err", ":", "\\", "10", ";", " ", " ", " ", " ", "print", "('", "EXCEPTION", ":", " ", "coul", "d", " ", "not", " ", "create", " ", "model", "\\\\", "n", "\\\\", "\\", "10", ";", "source", " ", "model", ":", " ", "{", "0", "}\\\\", "n", "\\\\", "\\", "10", ";", "target", " ", "model", ":", " ", "{", "1", "}\\\\", "n", "\\\\", "\\", "10", ";", "{", "2", "}'", ".", "format", "(", "args", ".", "source", "model", ",", "args", ".", "target", "model", ",", "err", "))\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "args_", "._", "source", "Folder_", ":_", "\\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 ", " _", "o", "Copy_", "._", "source", "Folder_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "args_", "._", "source", "Folder_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "o", "Copy_", "._", "create", "folder", "Path_", "(_", "o", "Copy_", "._", "source", "Folder_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "EXCEPTION", ":", " ", "coul", "d", " ", "not", " ", "create", " ", "folder", " ", "path", "\\\\", "n", "{", "0", "}'_", "._", "format_", "(_", "err_", ")_", ")_", "\\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 ", " _", "o", "Copy_", "._", "db", "Stor", "age", "Folder_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "os_", "._", "getcwd_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "target", "Folder_", ":_", "\\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 ", " _", "o", "Copy_", "._", "target", "Folder_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "args_", "._", "target", "Folder_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "o", "Copy_", "._", "create", "folder", "Path_", "(_", "o", "Copy_", "._", "target", "Folder_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "EXCEPTION", ":", " ", "coul", "d", " ", "not", " ", "create", " ", "folder", " ", "path", "\\\\", "n", "{", "0", "}'_", "._", "format_", "(_", "err_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "args_", "._", "interactive_", ":_", "\\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 ", " _", "o", "Copy_", "._", "copy", "DB_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "EXCEPTION", ":", " ", "coul", "d", " ", "not", " ", "make", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "databa", "se", "\\\\", "n", "{", "0", "}'_", "._", "format_", "(_", "err_", ")_", ")_", "\\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 ", " _", "s_", "=_", "dal", "Shell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "shell_", "(_", "db_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "ref", "Table_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "ref", "Table_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "columns_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rows_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ref", "Table_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "getco", "l", "Header_", "(_", "self_", ",_", "col", "Header_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"{", "0", "}\"_", "._", "format_", "(_", "'", " ", "|", " ", "'_", "._", "join_", "(_", "[_", "string_", "._", "join_", "(_", "string_", "._", "strip_", "(_", "'**", "{", "0", "}*", "*'_", "._", "format_", "(_", "item_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "''_", ")_", "for_", "item_", "in_", "col", "Header_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ref", "Table_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wrap", "Table_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "rows_", ",_", "has", "Header_", "=_", "False_", ",_", "header", "Char_", "=_", "'-'_", ",_", "delim_", "=_", "'", " ", "|", " ", "'_", ",_", "justify_", "=_", "'", "left", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "separate", "Rows_", "=_", "False_", ",_", "prefix_", "=_", "''_", ",_", "postfix_", "=_", "''_", ",_", "wrap", "func_", "=_", "lambda_", "x_", ":_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "row", "Wrapper_", "(_", "row_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "---", "\\", "10", ";", " ", " ", "new", "Row", "s", " ", "is", " ", "return", "ed", " ", "like", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "[[", "'", "w", "']", ",", " ", "['", "x", "']", ",", " ", "['", "y", "']", ",", " ", "['", "z", "']]", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "---", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "Rows_", "=_", "[_", "wrap", "func_", "(_", "item_", ")_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "for_", "item_", "in_", "row_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rows_", "=_", "new", "Rows_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "'''", "---", "\\", "10", ";", " ", " ", "row", "List", " ", "give", "s", " ", "like", " ", "new", "Row", "s", " ", "but", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "format", "ted", " ", "like", " ", "[[", "w", ",", " ", "x", ",", " ", "y", ",", " ", "z", "]]", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "---", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row", "List_", "=_", "[_", "[_", "substr_", "or_", "''_", "for_", "substr_", "in_", "item_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "item_", "in_", "map_", "(_", "None_", ",_", "*_", "new", "Rows_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "row", "List_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logical", "Rows_", "=_", "[_", "row", "Wrapper_", "(_", "row_", ")_", "for_", "row_", "in_", "rows_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "columns_", "=_", "map_", "(_", "None_", ",_", "*_", "reduce_", "(_", "operator_", "._", "add_", ",_", "logical", "Rows_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "columns_", "=_", "columns_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "max", "Wid", "ths_", "=_", "[_", "max_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "len_", "(_", "str_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "item_", ")_", ")_", "for_", "\\u\\u\\uNL\\u\\u\\u_", "item_", "in_", "column_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "for_", "column_", "\\u\\u\\uNL\\u\\u\\u_", "in_", "columns_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "row", "Separator_", "=_", "header", "Char_", "*_", "(_", "len_", "(_", "prefix_", ")_", "+_", "len_", "(_", "postfix_", ")_", "+_", "sum_", "(_", "max", "Wid", "ths_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "delim_", ")_", "*_", "(_", "len_", "(_", "max", "Wid", "ths_", ")_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "justify_", "=_", "{_", "'", "center", "'_", ":_", "str_", "\\u\\u\\uNL\\u\\u\\u_", "._", "center_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "right", "'_", ":_", "str_", "\\u\\u\\uNL\\u\\u\\u_", "._", "rjust_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "left", "'_", ":_", "str_", "._", "\\u\\u\\uNL\\u\\u\\u_", "ljust_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "[_", "justify_", "\\u\\u\\uNL\\u\\u\\u_", "._", "lower_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "output_", "=_", "c", "String", "IO_", "._", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "separate", "Rows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "output_", ",_", "row", "Separator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "physical", "Rows_", "in_", "logical", "Rows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "row_", "in_", "physical", "Rows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "output_", ",_", "prefix_", "+_", "delim_", "._", "join_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "justify_", "(_", "str_", "(_", "item_", ")_", ",_", "width_", ")_", "for_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "item_", ",_", "width_", ")_", "in_", "zip_", "(_", "row_", ",_", "max", "Wid", "ths_", ")_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "+_", "postfix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "separate", "Rows_", "or_", "has", "Header_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "output_", ",_", "row", "Separator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "has", "Header_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "output_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ref", "Table_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wrap", "\\u", "ons", "pace_", "(_", "self_", ",_", "text_", ",_", "width_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "reduce_", "(_", "lambda_", "line_", ",_", "word_", ",_", "width_", "=_", "width_", ":_", "'{", "0", "}{", "1", "}{", "2", "}'_", "\\u\\u\\uNL\\u\\u\\u_", "._", "format_", "(_", "line_", ",_", "'", " ", "\\\\", "n", "'_", "[_", "(_", "len_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "[_", "line_", "._", "rfind_", "(_", "'\\\\", "n", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "+_", "1_", ":_", "]_", ")_", "+_", "len_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "word_", "._", "split_", "(_", "'\\\\", "n", "'_", ",_", "1_", ")_", "[_", "0_", "]_", ")_", ">=_", "\\u\\u\\uNL\\u\\u\\u_", "width_", ")_", "]_", ",_", "word_", ")_", ",_", "text_", "._", "split_", "(_", "'", " ", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ref", "Table_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wrap", "\\u", "ons", "pace\\u", "strict_", "(_", "self_", ",_", "text_", ",_", "width_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "word", "Regex_", "=_", "re_", "._", "compile_", "(_", "r", "'\\\\", "S", "{'_", "+_", "str_", "(_", "width_", ")_", "+_", "r", "',", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "wrap", "\\u", "ons", "pace_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "word", "Regex_", "._", "sub_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", "m_", ":_", "self_", "._", "\\u\\u\\uNL\\u\\u\\u_", "wrap", "\\u", "alw", "ays_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "m_", "._", "group_", "(_", ")_", ",_", "width_", ")_", ",_", "text_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "width_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ref", "Table_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wrap", "\\u", "alw", "ays_", "(_", "self_", ",_", "text_", ",_", "width_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'\\\\", "n", "'_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "text_", "[_", "width_", "*_", "i_", ":_", "width_", "*_", "(_", "i_", "+_", "1_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "]_", "for_", "i_", "in_", "xrange_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "int_", "(_", "math_", "._", "ceil_", "(_", "1._", "*_", "len_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "text_", ")_", "/_", "width_", ")_", ")_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "table", "Helper_", "(_", ")_", ":_", "\\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_", "table", "Helper_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "o", "Table_", "=_", "ref", "Table_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "table", "Helper_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "As", "Rows_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "row_", "._", "strip_", "(_", ")_", "._", "split_", "(_", "','_", ")_", "for_", "row_", "in_", "data_", "._", "splitlines_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "table", "Helper_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Table", "\\u", "no", "Wrap_", "(_", "self_", ",_", "data_", ",_", "header_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rows_", "=_", "self_", "._", "get", "As", "Rows_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "header_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h", "Rows_", "=_", "[_", "header_", "]_", "+_", "rows_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h", "Rows_", "=_", "rows_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "table_", "=_", "self_", "._", "o", "Table_", "._", "wrap", "Table_", "(_", "h", "Rows_", ",_", "has", "Header_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "table_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "table", "Helper_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Table", "\\u", "Wrap_", "(_", "self_", ",_", "data_", ",_", "wrap", "Style_", ",_", "header_", "=_", "None_", ",_", "width_", "=_", "65_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "wrapper_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "wrap", "Style_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rows_", "=_", "self_", "._", "get", "As", "Rows_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "header_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h", "Rows_", "=_", "[_", "header_", "]_", "+_", "rows_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h", "Rows_", "=_", "rows_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "wrapper_", "in_", "(_", "self_", "._", "o", "Table_", "._", "wrap", "\\u", "alw", "ays_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "o", "Table_", "._", "wrap", "\\u", "ons", "pace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "o", "Table_", "._", "wrap", "\\u", "ons", "pace\\u", "strict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "o", "Table_", "._", "wrap", "Table_", "(_", "h", "Rows_", ",_", "has", "Header_", "=_", "True_", ",_", "separate", "Rows_", "=_", "True_", ",_", "prefix_", "=_", "'|", " ", "'_", ",_", "postfix_", "=_", "'", " ", "|'_", ",_", "wrap", "func_", "=_", "lambda_", "x_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "wrapper_", "(_", "x_", ",_", "width_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "Table", "\\u", "no", "Wrap_", "(_", "data_", ",_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "table", "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_", "get", "As", "Error", "Table_", "(_", "self_", ",_", "err_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "Table", "\\u", "Wrap_", "(_", "err_", ",_", "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_", "console_", ":_", "\\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\\uDEDENT\\u\\u\\u_", "'''", "---", "\\", "10", ";", " ", " ", " ", " ", " ", "DEF", "AUL", "T", " ", "COMMA", "NDS", " ", "(", "begins", " ", "with", " ", "cmd", "\\u)", "\\", "10", ";", " ", " ", " ", " ", " ", "---", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "console_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "prompt_", ",_", "banner_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "prompt_", "=_", "prompt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "banner_", "=_", "banner_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "commands_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "command", "Sort_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "dir_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\"", "cmd", "\\u\"_", "==_", "i_", "[_", ":_", "4_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "i_", "._", "split_", "(_", "\"", "cmd", "\\u\"_", ")_", "[_", "1_", "]_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "commands_", "[_", "cmd_", "]_", "=_", "getattr_", "(_", "self_", ",_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "command", "Sort_", "._", "append_", "(_", "(_", "int_", "(_", "self_", "\\u\\u\\uNL\\u\\u\\u_", "._", "commands_", "[_", "cmd_", "]_", "._", "\\u\\u", "doc\\u\\u_", "._", "split_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"|\"_", ")_", "[_", "0_", "]_", ")_", ",_", "cmd_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "command", "Sort_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "command", "Sort_", "=_", "[_", "i_", "[_", "1_", "]_", "for_", "i_", "in_", "self_", "._", "command", "Sort_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "var", "\\u", "DEBUG_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "var", "\\u", "table", "Style_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "config", "vars_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "dir_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\"", "var", "\\u\"_", "==_", "i_", "[_", ":_", "4_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "var_", "=_", "i_", "._", "split_", "(_", "\"", "var", "\\u\"_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "config", "vars_", "[_", "var_", "]_", "=_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "console_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Banner", "_", "(_", "self_", ",_", "banner_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "banner_", "=_", "banner_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "console_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "exec", "Cmd_", "(_", "self_", ",_", "db_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "db_", "=_", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "self_", "._", "banner_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "command_", "=_", "raw", "\\u", "input_", "(_", "self_", "._", "prompt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "exec", "Command_", "(_", "command_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "execute_", "(_", "command_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "EO", "FE", "rror_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "a_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "print", "Error_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "\"\\\\", "r", "\\\\", "n", "\\\\", "r", "\\\\", "n", "By", "e", "!.", "..\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "console_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "print", "Error_", "(_", "self_", ",_", "err_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stderr_", "._", "write_", "(_", "\"", "Error", ":", " ", "{", "0", "}\\\\", "r", "\\\\", "n", "\"_", "._", "format_", "(_", "str_", "(_", "err_", ")_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "var", "\\u", "DEBUG_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "console_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute_", "(_", "self_", ",_", "cmd_", ")_", ":_", "\\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_", "not_", "'-", "table", " ", "'_", "in_", "cmd_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exec_", "'{", "0", "}'_", "._", "format_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fields_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "=_", "string_", "._", "split_", "(_", "cmd_", ",_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "invalid", "Params_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "=_", "self_", "._", "get", "Table_", "(_", "items_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "allow", "ed", "Params_", "=_", "[_", "'", "fields", "'_", ",_", "'", "file", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "items_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "'='_", "in_", "i_", "and_", "not_", "string_", "._", "split_", "(_", "i_", ",_", "'='_", ")_", "[_", "0_", "]_", "in_", "allow", "ed", "Params_", ":_", "\\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 ", " ", " _", "invalid", "Params_", "._", "append_", "(_", "i_", ")_", "\\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 ", " ", " _", "raise_", "Exception_", "(_", "'", "invalid", " ", "parameter", "\\\\", "n", "{", "0", "}'_", "._", "format_", "(_", "i_", ")_", ")_", "\\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_", "'", "file", "='_", "in_", "i_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "file_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "string_", "._", "strip_", "(_", "string_", "._", "split_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "i_", ",_", "'='_", ")_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "fields", "='_", "in_", "i_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "field_", "in_", "string_", "._", "split_", "(_", "string_", "._", "split_", "(_", "i_", ",_", "'='_", ")_", "[_", "1_", "]_", ",_", "','_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "field_", "in_", "self_", "._", "db_", "[_", "table_", "]_", "._", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "fields_", "._", "append_", "(_", "string_", "._", "strip_", "(_", "field_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "invalid", "Params_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "(_", "'", "the", " ", "follow", "ing", " ", "parameter", "(", "s", ")", " ", "is", " ", "not", " ", "valid", "\\\\", "n", "{", "0", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "string_", "._", "join_", "(_", "invalid", "Params_", ",_", "','_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "cmd", "\\u", "table_", "(_", "table_", ",_", "file_", ",_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "(_", "'", "coul", "d", " ", "not", " ", "generat", "e", " ", "table", " ", "for", " ", "table", " ", "{", "0", "}\\\\", "n", "{", "1", "}'_", "\\u\\u\\uNL\\u\\u\\u_", "._", "format_", "(_", "table_", ",_", "err_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "sorr", "y", ",", " ", "can", " ", "not", " ", "do", " ", "tha", "t", "!\\\\", "n", "{", "0", "}'_", "._", "format_", "(_", "err_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "console_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Table_", "(_", "self_", ",_", "tbl_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "m", "Tb", "l_", "in_", "db_", "._", "tables_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "tbl_", "in_", "m", "Tb", "l_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "m", "Tb", "l_", "._", "startswith_", "(_", "tbl_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "m", "Tb", "l_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "console_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "exec", "Command_", "(_", "self_", ",_", "cmd_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "words_", "=_", "cmd_", "._", "split_", "(_", "\"", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "words_", "=_", "[_", "i_", "for_", "i_", "in_", "words_", "if_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "words_", ":_", "\\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_", "cmd_", ",_", "parameters_", "=_", "words_", "[_", "0_", "]_", "._", "lower_", "(_", ")_", ",_", "words_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "cmd_", "in_", "self_", "._", "commands_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Command", " ", "{", "0", "}", " ", "not", " ", "found", ".", " ", "Tr", "y", " ", "'", "help", "'\\\\", "r", "\\\\", "n", "\"_", "._", "format_", "(_", "cmd_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "commands_", "[_", "cmd_", "]_", "(_", "*_", "parameters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "console_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "cmd", "\\u", "clear_", "(_", "self_", ",_", "num", "lines_", "=_", "100_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "-", "5", "|", "clear", "|", "clear", " ", "the", " ", "screen", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "name_", "==_", "\"", "posix", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "---", "\\", "10", ";", " ", " ", "Uni", "x", "/", "Lin", "ux", "/", "Mac", "OS", "/", "BS", "D", "/", "etc", "\\", "10", ";", " ", " ", " ", " ", " ", " ", " ", " ", "---", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "system_", "(_", "'", "clear", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "os_", "._", "name_", "in_", "(_", "\"", "nt", "\"_", ",_", "\"", "dos", "\"_", ",_", "\"", "ce", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "---", "\\", "10", ";", " ", " ", "Window", "s", "\\", "10", ";", " ", " ", " ", " ", "---", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "system_", "(_", "'", "CLS", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "---", "\\", "10", ";", " ", " ", " ", "Fallback", " ", "for", " ", "other", " ", "operati", "ng", " ", "system", "s", ".", "\\", "10", ";", " ", " ", " ", " ", " ", " ", " ", "---", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "n", "'_", "*_", "num", "lines_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "console_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cmd", "\\u", "table_", "(_", "self_", ",_", "tbl_", ",_", "file_", "=_", "None_", ",_", "fields_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "-", "4", "|", "-", "table", " ", "[", "TAB", "LEN", "AME", "]", " ", "option", "al", "[", "file", "=", "Non", "e", "]", " ", "[", "fields", "=", "Non", "e", "]|", "\\\\", "\\", "10", ";", "the", " ", "default", " ", "table", "Style", " ", "is", " ", "no", "\\u", "wrap", " ", "-", " ", "use", " ", "the", " ", "'", "set", " ", "x", " ", "y", "'", " ", "command", " ", "to", " ", "change", " ", "the", " ", "style", "\\\\", "n", "\\\\", "\\", "10", ";", "style", " ", "choice", "s", ":", "\\", "10", ";\\\\", "tw", "rap", "\\u", "alw", "ay", "s", "\\", "10", ";\\\\", "tw", "rap", "\\u", "ons", "pace", "\\", "10", ";\\\\", "tw", "rap", "\\u", "ons", "pace\\u", "strict", "\\", "10", ";\\\\", "tno", "\\u", "wrap", " ", "(", "value", " ", "''", ")\\\\", "n", "\\", "10", ";\\\\", "t", " ", "the", " ", "2n", "d", " ", "option", "al", " ", "param", " ", "is", " ", "a", " ", "path", " ", "to", " ", "a", " ", "file", " ", "where", " ", "the", " ", "table", " ", "will", " ", "be", " ", "writt", "en", "\\", "10", ";\\\\", "t", " ", "the", " ", "3", "rd", " ", "option", "al", " ", "param", " ", "is", " ", "a", " ", "list", " ", "of", " ", "fields", " ", "you", " ", "want", " ", "displaye", "d", "\\\\", "n", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "m", "Tb", "l_", "in_", "db_", "._", "tables_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "tbl_", "in_", "m", "Tb", "l_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "m", "Tb", "l_", "._", "startswith_", "(_", "tbl_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "table_", "=_", "m", "Tb", "l_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "o", "Table_", "=_", "table", "Helper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "'''", "---", "\\", "10", ";", " ", " ", " ", " ", "tables", "tyl", "e", ":", "\\", "10", ";", " ", " ", "wrap", "\\u", "alw", "ay", "s", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "wrap", "\\u", "ons", "pace", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "wrap", "\\u", "ons", "pace\\u", "strict", "\\", "10", ";", " ", " ", "or", " ", "set", " ", "set", " ", "to", " ", "\"\"", " ", "for", " ", "no", " ", "wrapp", "ing", "\\", "10", ";", " ", " ", " ", " ", " ", " ", " ", " ", "---", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table", "Style_", "=_", "self_", "._", "var", "\\u", "table", "Style_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filed", "Not", "Found_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table", "\\u", "fields_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "fields_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "table", "\\u", "fields_", "=_", "self_", "._", "db_", "[_", "table_", "]_", "._", "fields_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "table", "\\u", "fields_", "=_", "fields_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "field_", "in_", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "field_", "in_", "self_", "._", "db_", "[_", "table_", "]_", "._", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filed", "Not", "Found_", "._", "append_", "(_", "field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "filed", "Not", "Found_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rows_", "=_", "self_", "._", "db_", "(_", "self_", "._", "db_", "[_", "table_", "]_", "._", "id_", ">_", "0_", ")_", "._", "select_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rows", "\\u", "data_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "rows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "row", "data_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "f_", "in_", "table", "\\u", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "row", "data_", "._", "append_", "(_", "'{", "0", "}'_", "._", "format_", "(_", "row_", "[_", "f_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rows", "\\u", "data_", "._", "append_", "(_", "string_", "._", "join_", "(_", "row", "data_", ",_", "','_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "=_", "string_", "._", "join_", "(_", "rows", "\\u", "data_", ",_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data", "Table_", "=_", "o", "Table_", "._", "get", "Table", "\\u", "Wrap_", "(_", "data_", ",_", "table", "Style_", ",_", "table", "\\u", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "TAB", "LE", " ", "{", "0", "}\\\\", "n", "{", "1", "}'_", "._", "format_", "(_", "table_", ",_", "data", "Table_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "file_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "tail_", ",_", "head_", "=_", "os_", "._", "path_", "._", "split_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "os_", "._", "makedirs_", "(_", "tail_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "'", "do", " ", "not", "hing", ",", " ", "folder", "s", " ", "exist", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "o", "File_", "=_", "open_", "(_", "file_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "o", "File_", "._", "write_", "(_", "'", "TAB", "LE", ":", " ", "{", "0", "}\\\\", "n", "{", "1", "}'_", "._", "format_", "(_", "table_", ",_", "data", "Table_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "o", "File_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'{", "0", "}", " ", "has", " ", "bee", "n", " ", "created", " ", "and", " ", "populate", "d", " ", "with", " ", "all", " ", "avail", "able", " ", "data", " ", "from", " ", "table", " ", "{", "1", "}\\\\", "n", "'_", "._", "format_", "(_", "file_", ",_", "table_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "(_", "\"", "EXCEPTION", ":", " ", "coul", "d", " ", "not", " ", "create", " ", "table", " ", "{", "0", "}\\\\", "n", "{", "1", "}\"_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "table_", ",_", "err_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "the", " ", "follow", "ing", " ", "fields", " ", "are", " ", "not", " ", "valid", " ", "[{", "0", "}]'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "string_", "._", "join_", "(_", "filed", "Not", "Found_", ",_", "','_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "console_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cmd", "\\u", "help_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "-", "3", "|", "help", "|", "Show", "'", "s", " ", "help", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "alld", "ata_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lengths_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "self_", "._", "command", "Sort_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "alld", "ata_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "commands_", "[_", "i_", "]_", "._", "\\u\\u", "doc\\u\\u_", "._", "split_", "(_", "\"|\"_", ")_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "alld", "ata_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "i_", ")_", ">_", "len_", "(_", "lengths_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "j_", "in_", "range_", "(_", "len_", "(_", "i_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "-_", "len_", "(_", "lengths_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "lengths_", "._", "append_", "(_", "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_", "j_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "j_", "<_", "len_", "(_", "i_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "i_", "[_", "j_", "]_", ")_", ">_", "lengths_", "[_", "j_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "lengths_", "[_", "j_", "]_", "=_", "len_", "(_", "i_", "[_", "j_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "j_", "+=_", "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_", "print_", "(_", "\"-\"_", "*_", "(_", "lengths_", "[_", "0_", "]_", "+_", "lengths_", "[_", "1_", "]_", "+_", "4_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "alld", "ata_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "(_", "\"%", "-\"_", "+_", "str_", "(_", "lengths_", "[_", "0_", "]_", ")_", "+_", "\"", "s", " ", " ", "-", " ", "%", "-\"_", "+_", "str_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "lengths_", "[_", "1_", "]_", ")_", "+_", "\"", "s", "\"_", ")_", "%_", "(_", "i_", "[_", "0_", "]_", ",_", "i_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "i_", ")_", ">_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "j_", "in_", "i_", "[_", "2_", ":_", "]_", ":_", "print_", "(_", "(_", "\"%\"_", "+_", "str_", "(_", "lengths_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "0_", "]_", "+_", "9_", ")_", "+_", "\"", "s", "*", " ", "%", "s", "\"_", ")_", "%_", "(_", "\"", " ", "\"_", ",_", "j_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "console_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cmd", "\\u", "vars_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "-", "2", "|", "vars", "|", "Show", " ", "variab", "les", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "variab", "les", "\\\\", "r", "\\\\", "n", "\"_", "+_", "\"-\"_", "*_", "79_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "j_", "in_", "self_", "._", "config", "vars_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "self_", "._", "par", "fmt_", "(_", "repr_", "(_", "getattr_", "(_", "self_", ",_", "j_", ")_", ")_", ",_", "52_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"|", " ", "%", "20", "s", " ", "|", " ", "%", "5", "2s", " ", "|\"_", "%_", "(_", "i_", ",_", "value_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "value_", "[_", "1_", ":_", "]_", ":_", "print_", "(_", "\"|", " ", "%", "20", "s", " ", "|", " ", "%", "5", "2s", " ", "|\"_", "%_", "(_", "\"\"_", ",_", "k_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "value_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"|", " ", "%", "20", "s", " ", "|", " ", "%", "5", "2s", " ", "|\"_", "%_", "(_", "\"\"_", ",_", "\"\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "\"-\"_", "*_", "79_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "console_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "par", "fmt_", "(_", "self_", ",_", "txt_", ",_", "width_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "txt_", "[_", "pos_", ":_", "pos_", "+_", "width_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "a_", ":_", "\\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_", "res_", "._", "append_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "+=_", "width_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "console_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cmd", "\\u", "set_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "-1", "|", "set", " ", "[", "variab", "le", "\\u", "name", "]", " ", "[", "value", "]|", "Set", " ", "configura", "tion", " ", "variab", "le", " ", "value", "|", "Value", "s", " ", "are", " ", "an", " ", "express", "ion", "s", " ", "(", "100", " ", "|", " ", "string", ".", "lower", "('", "ABC", "')", " ", "|", " ", "etc", ".'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "\"", " ", "\"_", "._", "join_", "(_", "args_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", "[_", "0_", "]_", "not_", "in_", "self_", "._", "config", "vars_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "self_", ",_", "\"", "var", "\\u{", "0", "}\"_", "._", "format_", "(_", "args_", "[_", "0_", "]_", ")_", ",_", "eval_", "(_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "setattr_", "(_", "self_", ",_", "\"", "var", "\\u{", "0", "}\"_", "._", "format_", "(_", "args_", "[_", "0_", "]_", ")_", ",_", "eval_", "(_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "console_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cmd", "\\u", "clear", "screen_", "(_", "self_", ",_", "num", "lines_", "=_", "50_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "---", "Clear", " ", "the", " ", "console", ".", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "---", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "name_", "==_", "\"", "posix", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "---", "\\", "10", ";", " ", " ", "Uni", "x", "/", "Lin", "ux", "/", "Mac", "OS", "/", "BS", "D", "/", "etc", "\\", "10", ";", " ", " ", " ", " ", " ", " ", " ", " ", "---", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "system_", "(_", "'", "clear", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "os_", "._", "name_", "in_", "(_", "\"", "nt", "\"_", ",_", "\"", "dos", "\"_", ",_", "\"", "ce", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "---", "\\", "10", ";", " ", " ", "Window", "s", "\\", "10", ";", " ", " ", " ", " ", "---", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "system_", "(_", "'", "CLS", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "---", "\\", "10", ";", " ", " ", " ", "Fallback", " ", "for", " ", "other", " ", "operati", "ng", " ", "system", "s", ".", "\\", "10", ";", " ", " ", " ", " ", " ", " ", " ", "---", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "n", "'_", "*_", "num", "lines_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "dal", "Shell_", "(_", "console_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "dal", "Shell_", "(_", "console_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "dal", "Shell_", "(_", "console_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "shell_", "(_", "self_", ",_", "db_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "console_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "prompt_", "=_", "\">>>", " ", "\"_", ",_", "banner_", "=_", "'", "dal", " ", "interactive", " ", "shell", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "exec", "Cmd_", "(_", "db_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "set", "Copy", "DB_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "set", "Copy", "DB_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "---", "\\", "10", ";", " ", " ", " ", " ", "non", " ", "source", " ", "or", " ", "target", " ", "specific", " ", "vars", "\\", "10", ";", " ", " ", " ", " ", " ", " ", " ", " ", "---", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "str", "Model_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dal", "Path_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "'''", "---", "\\", "10", ";", " ", " ", "source", " ", "vars", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "---", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "source", "Model_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "source", "Folder_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "source", "Connect", "ion", "String_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sourced", "b", "Type_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sourced", "b", "Name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "'''", "---", "\\", "10", ";", " ", " ", "target", " ", "vars", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "---", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "target", "db", "Type_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "target", "db", "Name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "target", "Model_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "target", "Folder_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "target", "Connect", "ion", "String_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "truncate_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "set", "Copy", "DB_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "Dal", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m", "Dal", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "dal", "Path_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "DA", "L_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "self_", "._", "dal", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m", "Dal", "_", "=_", "\\u\\u", "import\\u\\u_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dal", "'_", ",_", "globals_", "=_", "{_", "}_", ",_", "locals_", "=_", "{_", "}_", ",_", "froml", "ist_", "=_", "[_", "'", "DA", "L", "'_", "]_", ",_", "level_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DA", "L_", "=_", "m", "Dal", "_", "._", "DA", "L_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "m", "Dal", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "set", "Copy", "DB_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "inst", "DB_", "(_", "self_", ",_", "storage", "Folder_", ",_", "storage", "Connect", "ion", "String_", ",_", "auto", "Import_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "db_", "=_", "DA", "L_", "(_", "storage", "Connect", "ion", "String_", ",_", "folder_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "storage", "Folder_", ")_", ",_", "auto", "\\u", "import_", "=_", "auto", "Import_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "set", "Copy", "DB_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "DB", "\\u", "tables_", "(_", "self_", ",_", "storage", "Folder_", ",_", "storage", "Type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "delete", "\\u", "DB", "\\u", "tables", "n", "\\\\", "n", "\\\\", "t", "{", "0", "}\\\\", "n", "\\\\", "t", "{", "1", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "storage", "Folder_", ",_", "storage", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data", "Files_", "=_", "[_", "storage", "Type_", ",_", "\"", "sql", ".", "log", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "f_", "in_", "os_", "._", "listdir_", "(_", "storage", "Folder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\".", "table", "\"_", "in_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "f", "Table_", "=_", "\"{", "0", "}/", "{", "1", "}\"_", "._", "format_", "(_", "storage", "Folder_", ",_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "remove_", "(_", "f", "Table_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "delete", "d", " ", "{", "0", "}'_", "._", "format_", "(_", "f", "Table_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "d", "File_", "in_", "data", "Files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "remove_", "(_", "\"{", "0", "}/", "{", "1", "}\"_", "._", "format_", "(_", "storage", "Folder_", ",_", "d", "File_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "delete", "d", " ", "{", "0", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"{", "0", "}/", "{", "1", "}\"_", "._", "format_", "(_", "storage", "Folder_", ",_", "d", "File_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "err", "Obj_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "str_", "(_", "err", "Obj_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "set", "Copy", "DB_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "truncat", "eta", "bles_", "(_", "self_", ",_", "tables_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "tables_", ")_", "!=_", "0_", ":_", "\\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 ", " _", "print_", "'", "table", " ", "value", ":", " ", "{", "0", "}'_", "._", "format_", "(_", "tables_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "tbl_", "in_", "self_", "._", "db_", "._", "tables_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "m", "Tb", "l_", "in_", "tables_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "m", "Tb", "l_", "._", "startswith_", "(_", "tbl_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "db_", "[_", "m", "Tb", "l_", "]_", "._", "truncate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "EXCEPTION", ":", " ", "{", "0", "}'_", "._", "format_", "(_", "err_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tbl_", "in_", "self_", "._", "db_", "._", "tables_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "db_", "[_", "tbl_", "]_", "._", "truncate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "EXCEPTION", ":", " ", "{", "0", "}'_", "._", "format_", "(_", "err_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "set", "Copy", "DB_", "(_", ")_", ":_", "\\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_", "copy", "DB_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "other", "\\u", "db_", "=_", "DA", "L_", "(_", "\"{", "0", "}:", "//", "{", "1", "}\"_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "target", "db", "Type_", ",_", "self_", "._", "target", "db", "Name_", ")_", ",_", "folder_", "=_", "self_", "._", "target", "Folder_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "creati", "ng", " ", "tables", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "table_", "in_", "self_", "._", "db_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "other", "\\u", "db_", "._", "defin", "e\\u", "table_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "table_", "._", "\\u", "tablename_", ",_", "*_", "[_", "field_", "for_", "field_", "in_", "table_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "'''", "\\", "10", ";", " ", " ", " ", " ", "shou", "ld", " ", "there", " ", "be", " ", "an", " ", "option", " ", "to", " ", "trunc", "At", "e", " ", "target", " ", "DB", "?", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "ye", "s", ",", " ", "then", " ", "change", " ", "args", " ", "to", " ", "allow", " ", "for", " ", "choice", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "set", " ", "self", ".", "tran", "cate", " ", "to", " ", "the", " ", "art", " ", "value", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "self", ".", "truncat", "e", "==", "Tru", "e", ":", "\\", "10", ";", " ", " ", " ", " ", "other", "\\u", "db", "[", "table", ".\\u", "tablename", "].", "truncat", "e", "()", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'", "export", "ing", " ", "data", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db_", "._", "export", "\\u", "to", "\\u", "csv", "\\u", "file_", "(_", "open_", "(_", "'", "tmp", ".", "sql", "'_", ",_", "'", "wb", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "import", "ing", " ", "data", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "db_", "._", "import", "\\u", "from", "\\u", "csv", "\\u", "file_", "(_", "open_", "(_", "'", "tmp", ".", "sql", "'_", ",_", "'", "rb", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "db_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "don", "e", "!'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Atten", "tion", ":", " ", "do", " ", "not", " ", "run", " ", "this", " ", "program", " ", "again", " ", "or", " ", "you", " ", "end", " ", "up", " ", "with", " ", "duplicat", "e", " ", "record", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "set", "Copy", "DB_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "folder", "Path_", "(_", "self_", ",_", "folder_", ")_", ":_", "\\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_", "folder_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "folder_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
jpwatts/django-positions/positions/examples/migration/migrations/0002_insert_test_data.py
[ { "content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\nimport positions.fields\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def add_test_data(apps, schema_editor):\n # We can't import the Person model directly as it may be a newer\n # version than this migration expects. We use the historical version.\n MigrationTest = apps.get_model(\"migration\", \"MigrationTest\")\n test_record = MigrationTest.objects.create(name='Test Name', age=99, favorite_color='Red')", "metadata": "root.add_test_data", "header": "['module', '___EOS___']", "index": 7 }, { "content": "class Migration(migrations.Migration):\n\n dependencies = [\n ('migration', '0001_initial'),\n ]\n\n operations = [\n migrations.RunPython(add_test_data),\n ]", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 13 } ]
[ { "span": "from django.db import models, migrations", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 40 }, { "span": "import positions.fields", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 23 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", ",_", "migrations_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "positions_", "._", "fields_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "add", "\\u", "test\\u", "data_", "(_", "apps_", ",_", "schema", "\\u", "editor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "can", "'", "t", " ", "import", " ", "the", " ", "Person", " ", "model", " ", "direct", "ly", " ", "as", " ", "it", " ", "may", " ", "be", " ", "a", " ", "newe", "r_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "version", " ", "than", " ", "this", " ", "migrati", "on", " ", "expect", "s", ".", " ", "We", " ", "use", " ", "the", " ", "historical", " ", "version", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Migrat", "ion", "Test_", "=_", "apps_", "._", "get", "\\u", "model_", "(_", "\"", "migrati", "on", "\"_", ",_", "\"", "Migrat", "ion", "Test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "record_", "=_", "Migrat", "ion", "Test_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "Test", " ", "Name", "'_", ",_", "age_", "=_", "99_", ",_", "favorite", "\\u", "color_", "=_", "'", "Red", "'_", ")_", "\\u\\u\\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_", "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_", "(_", "'", "migrati", "on", "'_", ",_", "'", "0001", "\\u", "initial", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "operations_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "migrations_", "._", "Run", "Python_", "(_", "add", "\\u", "test\\u", "data_", ")_", ",_", "\\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, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
AppScale/appscale/AppServer/lib/django-0.96/django/db/models/__init__.py
[ { "content": "from django.conf import settings\nfrom django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured\nfrom django.core import validators\nfrom django.db import backend, connection\nfrom django.db.models.loading import get_apps, get_app, get_models, get_model, register_models\nfrom django.db.models.query import Q\nfrom django.db.models.manager import Manager\nfrom django.db.models.base import Model, AdminOptions\nfrom django.db.models.fields import *\nfrom django.db.models.fields.related import ForeignKey, OneToOneField, ManyToManyField, ManyToOneRel, ManyToManyRel, OneToOneRel, TABULAR, STACKED\nfrom django.db.models.fields.generic import GenericRelation, GenericRel, GenericForeignKey\nfrom django.db.models import signals\nfrom django.utils.functional import curry\nfrom django.utils.text import capfirst\n\n# Admin stages.\nADD, CHANGE, BOTH = 1, 2, 3\n\n# Decorator. Takes a function that returns a tuple in this format:\n# (viewname, viewargs, viewkwargs)\n# Returns a function that calls urlresolvers.reverse() on that data, to return\n# the URL for those parameters.\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def permalink(func):\n from django.core.urlresolvers import reverse\n def inner(*args, **kwargs):\n bits = func(*args, **kwargs)\n viewname = bits[0]\n return reverse(bits[0], None, *bits[1:3])\n return inner", "metadata": "root.permalink", "header": "['module', '___EOS___']", "index": 22 }, { "content": "class LazyDate(object):\n \"\"\"\n Use in limit_choices_to to compare the field to dates calculated at run time\n instead of when the model is loaded. For example::\n\n ... limit_choices_to = {'date__gt' : models.LazyDate(days=-3)} ...\n\n which will limit the choices to dates greater than three days ago.\n \"\"\"\n\n\n\n", "metadata": "root.LazyDate", "header": "['module', '___EOS___']", "index": 30 }, { "content": " def __init__(self, **kwargs):\n self.delta = datetime.timedelta(**kwargs)", "metadata": "root.LazyDate.__init__", "header": "['class', 'LazyDate', '(', 'object', ')', ':', '___EOS___']", "index": 39 }, { "content": " def __str__(self):\n return str(self.__get_value__())", "metadata": "root.LazyDate.__str__", "header": "['class', 'LazyDate', '(', 'object', ')', ':', '___EOS___']", "index": 42 }, { "content": " def __repr__(self):\n return \"<LazyDate: %s>\" % self.delta", "metadata": "root.LazyDate.__repr__", "header": "['class', 'LazyDate', '(', 'object', ')', ':', '___EOS___']", "index": 45 }, { "content": " def __get_value__(self):\n return (datetime.datetime.now() + self.delta).date()", "metadata": "root.LazyDate.__get_value__", "header": "['class', 'LazyDate', '(', 'object', ')', ':', '___EOS___']", "index": 48 }, { "content": " def __getattr__(self, attr):\n if attr == 'delta':\n # To fix ticket #3377. Note that normal accesses to LazyDate.delta\n # (after construction) will still work, because they don't go\n # through __getattr__). This is mainly needed for unpickling.\n raise AttributeError\n return getattr(self.__get_value__(), attr)", "metadata": "root.LazyDate.__getattr__", "header": "['class', 'LazyDate', '(', 'object', ')', ':', '___EOS___']", "index": 51 } ]
[ { "span": "from django.conf import settings", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 32 }, { "span": "from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 75 }, { "span": "from django.core import validators", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 34 }, { "span": "from django.db import backend, connection", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 41 }, { "span": "from django.db.models.loading import get_apps, get_app, get_models, get_model, register_models", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 94 }, { "span": "from django.db.models.query import Q", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 36 }, { "span": "from django.db.models.manager import Manager", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 44 }, { "span": "from django.db.models.base import Model, AdminOptions", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 53 }, { "span": "from django.db.models.fields.related import ForeignKey, OneToOneField, ManyToManyField, ManyToOneRel, ManyToManyRel, OneToOneRel, TABULAR, STACKED", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 146 }, { "span": "from django.db.models.fields.generic import GenericRelation, GenericRel, GenericForeignKey", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 90 }, { "span": "from django.db.models import signals", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 36 }, { "span": "from django.utils.functional import curry", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 41 }, { "span": "from django.utils.text import capfirst", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 38 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "exceptions_", "import_", "Object", "Do", "es", "Not", "Exist_", ",_", "Impro", "perl", "y", "Configured_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "import_", "validators_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "backend_", ",_", "connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "loading_", "import_", "get", "\\u", "apps_", ",_", "get", "\\u", "app_", ",_", "get", "\\u", "models_", ",_", "get", "\\u", "model_", ",_", "register", "\\u", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "query_", "import_", "Q_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "manager_", "import_", "Manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "base_", "import_", "Model_", ",_", "Admi", "n", "Options_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "fields_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "fields_", "._", "related_", "import_", "Fore", "ign", "Key_", ",_", "One", "To", "One", "Field_", ",_", "Many", "To", "Many", "Field_", ",_", "Many", "To", "One", "Rel", "_", ",_", "Many", "To", "Many", "Rel", "_", ",_", "One", "To", "One", "Rel", "_", ",_", "TAB", "ULA", "R_", ",_", "STACK", "ED_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "fields_", "._", "generic_", "import_", "Gene", "ric", "Relation_", ",_", "Gene", "ric", "Rel", "_", ",_", "Gene", "ric", "Fore", "ign", "Key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "import_", "signals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "functional_", "import_", "curr", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "text_", "import_", "cap", "first_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Admi", "n", " ", "stage", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "ADD_", ",_", "CHANGE", "_", ",_", "BOTH_", "=_", "1_", ",_", "2_", ",_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Decorat", "or", ".", " ", "Tak", "es", " ", "a", " ", "function", " ", "tha", "t", " ", "return", "s", " ", "a", " ", "tuple", " ", "in", " ", "this", " ", "format", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "view", "name", ",", " ", "view", "args", ",", " ", "view", "kwarg", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Return", "s", " ", "a", " ", "function", " ", "tha", "t", " ", "calls", " ", "urlr", "eso", "lver", "s", ".", "reverse", "()", " ", "on", " ", "tha", "t", " ", "data", ",", " ", "to", " ", "return_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "URL", " ", "for", " ", "tho", "se", " ", "parameter", "s", "._", "\\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_", "permalink", "_", "(_", "func_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "django_", "._", "core_", "._", "urlresolvers_", "import_", "reverse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "inner_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bits_", "=_", "func_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view", "name_", "=_", "bits_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "reverse_", "(_", "bits_", "[_", "0_", "]_", ",_", "None_", ",_", "*_", "bits_", "[_", "1_", ":_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "inner_", "\\u\\u\\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_", "La", "zy", "Date_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "in", " ", "limit", "\\u", "choice", "s", "\\u", "to", " ", "to", " ", "compare", " ", "the", " ", "field", " ", "to", " ", "dates", " ", "calculated", " ", "at", " ", "run", " ", "time", "\\", "10", ";", " ", " ", " ", " ", "inst", "ead", " ", "of", " ", "whe", "n", " ", "the", " ", "model", " ", "is", " ", "load", "ed", ".", " ", " ", "For", " ", "example", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "...", " ", "limit", "\\u", "choice", "s", "\\u", "to", " ", "=", " ", "{", "'", "date", "\\u\\u", "gt", "'", " ", ":", " ", "model", "s", ".", "La", "zy", "Date", "(", "day", "s", "=-", "3", ")}", " ", "...", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "whi", "ch", " ", "will", " ", "limit", " ", "the", " ", "choice", "s", " ", "to", " ", "dates", " ", "great", "er", " ", "than", " ", "three", " ", "day", "s", " ", "ago", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "La", "zy", "Date_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "delta_", "=_", "datetime_", "._", "timedelta_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "La", "zy", "Date_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "str_", "(_", "self_", "._", "\\u\\u", "get", "\\u", "value", "\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "La", "zy", "Date_", "(_", "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_", "\"<", "La", "zy", "Date", ":", " ", "%", "s", ">\"_", "%_", "self_", "._", "delta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "La", "zy", "Date_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "get", "\\u", "value", "\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "+_", "self_", "._", "delta_", ")_", "._", "date_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "La", "zy", "Date_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "getattr\\u\\u_", "(_", "self_", ",_", "attr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "attr_", "==_", "'", "delta", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "To", " ", "fix", " ", "tick", "et", " ", "#", "337", "7", ".", " ", "Not", "e", " ", "tha", "t", " ", "normal", " ", "accesse", "s", " ", "to", " ", "La", "zy", "Date", ".", "delta_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "after", " ", "constructi", "on", ")", " ", "will", " ", "still", " ", "work", ",", " ", "bec", "aus", "e", " ", "the", "y", " ", "don", "'", "t", " ", "go_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "through", " ", "\\u\\u", "getattr", "\\u\\u)", ".", " ", "Thi", "s", " ", "is", " ", "mainl", "y", " ", "need", "ed", " ", "for", " ", "unp", "ick", "ling", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Attribute", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "getattr_", "(_", "self_", "._", "\\u\\u", "get", "\\u", "value", "\\u\\u_", "(_", ")_", ",_", "attr_", ")_" ]
[ 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, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 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, 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, 2, 2, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
espeed/bulbs/bulbs/rexster/__init__.py
[ { "content": "# -*- coding: utf-8 -*-\n#\n# Copyright 2012 James Thornton (http://jamesthornton.com)\n# BSD License (see LICENSE for details)\n#\nfrom bulbs.config import Config, DEBUG, INFO, WARNING, ERROR, CRITICAL\nfrom bulbs.element import Vertex, VertexProxy, Edge, EdgeProxy\nfrom bulbs.model import Node, NodeProxy, Relationship, RelationshipProxy\n\nfrom .graph import Graph\nfrom .client import RexsterClient, REXSTER_URI\nfrom .index import ManualIndex, AutomaticIndex, \\\n VertexIndexProxy, EdgeIndexProxy\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from bulbs.config import Config, DEBUG, INFO, WARNING, ERROR, CRITICAL", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 70 }, { "span": "from bulbs.element import Vertex, VertexProxy, Edge, EdgeProxy", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 62 }, { "span": "from bulbs.model import Node, NodeProxy, Relationship, RelationshipProxy", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 72 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2012", " ", "Jam", "es", " ", "Tho", "rn", "ton", " ", "(", "http", "://", "jam", "est", "horn", "ton", ".", "com", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "BS", "D", " ", "License", " ", "(", "see", " ", "LICENSE", " ", "for", " ", "deta", "il", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "bulb", "s_", "._", "config_", "import_", "Config_", ",_", "DEBUG_", ",_", "INFO_", ",_", "WARNING_", ",_", "ERROR_", ",_", "CRITICAL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bulb", "s_", "._", "element_", "import_", "Vertex_", ",_", "Vertex", "Proxy_", ",_", "Edge_", ",_", "Ed", "ge", "Proxy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bulb", "s_", "._", "model_", "import_", "Node_", ",_", "Node", "Proxy_", ",_", "Relationship", "_", ",_", "Relationship", "Proxy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "graph_", "import_", "Graph_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "client_", "import_", "Re", "xst", "er", "Client_", ",_", "RE", "XS", "TER", "\\u", "URI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "index_", "import_", "Manu", "al", "Index_", ",_", "Automat", "ic", "Index_", ",_", "Vertex", "Index", "Proxy_", ",_", "Ed", "ge", "Index", "Proxy_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
osrf/rosbook/code/basics/src/simple_action_server.py
[ { "content": "#! /usr/bin/env python\n# BEGIN ALL\n#! /usr/bin/env python\nimport rospy\n\n# BEGIN PART_1\nimport time\nimport actionlib\nfrom basics.msg import TimerAction, TimerGoal, TimerResult\n# END PART_1\n\n# BEGIN PART_2\n\nrospy.init_node('timer_action_server')\nserver = actionlib.SimpleActionServer('timer', TimerAction, do_timer, False)\nserver.start()\nrospy.spin()\n# END ALL\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def do_timer(goal):\n start_time = time.time()\n time.sleep(goal.time_to_wait.to_sec())\n # END PART_2\n # BEGIN PART_3\n result = TimerResult()\n result.time_elapsed = rospy.Duration.from_sec(time.time() - start_time)\n result.updates_sent = 0\n # END PART_3\n # BEGIN PART_4\n server.set_succeeded(result)\n # END PART_4", "metadata": "root.do_timer", "header": "['module', '___EOS___']", "index": 12 } ]
[ { "span": "from basics.msg import TimerAction, TimerGoal, TimerResult", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 58 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", " ", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "BEGIN", " ", "ALL_", "\\u\\u\\uNL\\u\\u\\u_", "#!", " ", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "rospy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "BEGIN", " ", "PART", "\\u", "1_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "action", "lib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "basics", "_", "._", "msg_", "import_", "Time", "r", "Action_", ",_", "Time", "r", "Goal", "_", ",_", "Time", "r", "Result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "END", " ", "PART", "\\u", "1_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "BEGIN", " ", "PART", "\\u", "2_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rospy_", "._", "init", "\\u", "node_", "(_", "'", "timer", "\\u", "action", "\\u", "server", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "server_", "=_", "action", "lib_", "._", "Simple", "Action", "Server_", "(_", "'", "timer", "'_", ",_", "Time", "r", "Action_", ",_", "do", "\\u", "timer_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "server_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rospy_", "._", "spin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "END", " ", "ALL_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "do", "\\u", "timer_", "(_", "goal_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "time_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "goal_", "._", "time", "\\u", "to", "\\u", "wait_", "._", "to", "\\u", "sec_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "END", " ", "PART", "\\u", "2_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "BEGIN", " ", "PART", "\\u", "3_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "Time", "r", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "time", "\\u", "elapsed_", "=_", "rospy_", "._", "Duration_", "._", "from", "\\u", "sec_", "(_", "time_", "._", "time_", "(_", ")_", "-_", "start", "\\u", "time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "update", "s", "\\u", "sent_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "END", " ", "PART", "\\u", "3_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "BEGIN", " ", "PART", "\\u", "4_", "\\u\\u\\uNL\\u\\u\\u_", "server_", "._", "set\\u", "succeeded_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "END", " ", "PART", "\\u", "4_", "\\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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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/GafferSceneTest/SetFilterTest.py
[ { "content": "\tdef test( self ) :\n\n\t\tp1 = GafferScene.Plane()\n\t\tp2 = GafferScene.Plane()\n\t\tg = GafferScene.Group()\n\n\t\tg[\"in\"][0].setInput( p1[\"out\"] )\n\t\tg[\"in\"][1].setInput( p2[\"out\"] )\n\n\t\ts = GafferScene.Set()\n\t\ts[\"in\"].setInput( g[\"out\"] )\n\t\ts[\"paths\"].setValue( IECore.StringVectorData( [ \"/group/plane\" ] ) )\n\n\t\tf = GafferScene.SetFilter()\n\t\tf[\"set\"].setValue( \"set\" )\n\n\t\ta = GafferScene.StandardAttributes()\n\t\ta[\"in\"].setInput( s[\"out\"] )\n\t\ta[\"attributes\"][\"doubleSided\"][\"enabled\"].setValue( True )\n\t\ta[\"filter\"].setInput( f[\"out\"] )\n\n\t\tself.assertSceneValid( a[\"out\"] )\n\n\t\tself.assertTrue( \"doubleSided\" in a[\"out\"].attributes( \"/group/plane\" ) )\n\t\tself.assertTrue( \"doubleSided\" not in a[\"out\"].attributes( \"/group/plane1\" ) )\n\t\tself.assertTrue( \"doubleSided\" not in a[\"out\"].attributes( \"/group\" ) )\n\n\t\ts[\"paths\"].setValue( IECore.StringVectorData( [ \"/group\" ] ) )\n\n\t\tself.assertSceneValid( a[\"out\"] )\n\n\t\tself.assertTrue( \"doubleSided\" not in a[\"out\"].attributes( \"/group/plane\" ) )\n\t\tself.assertTrue( \"doubleSided\" not in a[\"out\"].attributes( \"/group/plane1\" ) )\n\t\tself.assertTrue( \"doubleSided\" in a[\"out\"].attributes( \"/group\" ) )", "metadata": "root.SetFilterTest.test", "header": "['class', 'SetFilterTest', '(', 'GafferSceneTest', '.', 'SceneTestCase', ')', ':', '___EOS___']", "index": 47 }, { "content": "\tdef testAffects( self ) :\n\n\t\tp1 = GafferScene.Plane()\n\t\tp2 = GafferScene.Plane()\n\t\tg = GafferScene.Group()\n\n\t\tg[\"in\"][0].setInput( p1[\"out\"] )\n\t\tg[\"in\"][1].setInput( p2[\"out\"] )\n\n\t\ts = GafferScene.Set()\n\t\ts[\"in\"].setInput( g[\"out\"] )\n\n\t\ta = GafferScene.StandardAttributes()\n\t\ta[\"in\"].setInput( s[\"out\"] )\n\n\t\t# no filter attached - changing a set should affect only\n\t\t# the globals.\n\n\t\tcs = GafferTest.CapturingSlot( a.plugDirtiedSignal() )\n\n\t\ts[\"paths\"].setValue( IECore.StringVectorData( [ \"/group\" ] ) )\n\t\tself.assertTrue( a[\"out\"][\"set\"] in set( [ c[0] for c in cs ] ) )\n\t\tself.assertTrue( a[\"out\"][\"attributes\"] not in set( [ c[0] for c in cs ] ) )\n\n\t\t# attach a filter - changing a set should affect the\n\t\t# attributes too.\n\n\t\tf = GafferScene.SetFilter()\n\t\ta[\"filter\"].setInput( f[\"out\"] )\n\n\t\tcs = GafferTest.CapturingSlot( a.plugDirtiedSignal() )\n\n\t\ts[\"paths\"].setValue( IECore.StringVectorData( [ \"/group/plane\" ] ) )\n\n\t\tself.assertTrue( a[\"out\"][\"set\"] in set( [ c[0] for c in cs ] ) )\n\t\tself.assertTrue( a[\"out\"][\"attributes\"] in set( [ c[0] for c in cs ] ) )", "metadata": "root.SetFilterTest.testAffects", "header": "['class', 'SetFilterTest', '(', 'GafferSceneTest', '.', 'SceneTestCase', ')', ':', '___EOS___']", "index": 82 }, { "content": "\tdef testMultipleStreams( self ) :\n\n\t\tp1 = GafferScene.Plane()\n\t\tg1 = GafferScene.Group()\n\t\tg1[\"in\"][0].setInput( p1[\"out\"] )\n\t\ts1 = GafferScene.Set()\n\t\ts1[\"in\"].setInput( g1[\"out\"] )\n\t\ts1[\"paths\"].setValue( IECore.StringVectorData( [ \"/group\" ] ) )\n\n\t\tp2 = GafferScene.Plane()\n\t\tg2 = GafferScene.Group()\n\t\tg2[\"in\"][0].setInput( p2[\"out\"] )\n\t\ts2 = GafferScene.Set()\n\t\ts2[\"in\"].setInput( g2[\"out\"] )\n\t\ts2[\"paths\"].setValue( IECore.StringVectorData( [ \"/group/plane\" ] ) )\n\n\t\tf = GafferScene.SetFilter()\n\t\tf[\"set\"].setValue( \"set\" )\n\n\t\ta1 = GafferScene.StandardAttributes()\n\t\ta1[\"in\"].setInput( s1[\"out\"] )\n\t\ta1[\"attributes\"][\"doubleSided\"][\"enabled\"].setValue( True )\n\t\ta1[\"filter\"].setInput( f[\"out\"] )\n\n\t\ta2 = GafferScene.StandardAttributes()\n\t\ta2[\"in\"].setInput( s2[\"out\"] )\n\t\ta2[\"attributes\"][\"doubleSided\"][\"enabled\"].setValue( True )\n\t\ta2[\"filter\"].setInput( f[\"out\"] )\n\n\t\tself.assertSceneValid( a1[\"out\"] )\n\t\tself.assertSceneValid( a2[\"out\"] )\n\n\t\tself.assertTrue( \"doubleSided\" in a1[\"out\"].attributes( \"/group\" ) )\n\t\tself.assertTrue( \"doubleSided\" not in a1[\"out\"].attributes( \"/group/plane\" ) )\n\n\t\tself.assertTrue( \"doubleSided\" not in a2[\"out\"].attributes( \"/group\" ) )\n\t\tself.assertTrue( \"doubleSided\" in a2[\"out\"].attributes( \"/group/plane\" ) )", "metadata": "root.SetFilterTest.testMultipleStreams", "header": "['class', 'SetFilterTest', '(', 'GafferSceneTest', '.', 'SceneTestCase', ')', ':', '___EOS___']", "index": 119 }, { "content": "\tdef testNonExistentSets( self ) :\n\n\t\tp = GafferScene.Plane()\n\t\tp[\"sets\"].setValue( \"flatThings\" )\n\n\t\ta = GafferScene.StandardAttributes()\n\t\ta[\"in\"].setInput( p[\"out\"] )\n\t\ta[\"attributes\"][\"doubleSided\"][\"enabled\"].setValue( True )\n\n\t\tself.assertTrue( \"doubleSided\" in a[\"out\"].attributes( \"/plane\" ).keys() )\n\n\t\tf = GafferScene.SetFilter()\n\t\ta[\"filter\"].setInput( f[\"out\"] )\n\n\t\tself.assertFalse( \"doubleSided\" in a[\"out\"].attributes( \"/plane\" ).keys() )\n\n\t\tf[\"set\"].setValue( \"nonExistent\" )\n\t\tself.assertFalse( \"doubleSided\" in a[\"out\"].attributes( \"/plane\" ).keys() )\n\n\t\tf[\"set\"].setValue( \"flatThings\" )\n\t\tself.assertTrue( \"doubleSided\" in a[\"out\"].attributes( \"/plane\" ).keys() )", "metadata": "root.SetFilterTest.testNonExistentSets", "header": "['class', 'SetFilterTest', '(', 'GafferSceneTest', '.', 'SceneTestCase', ')', ':', '___EOS___']", "index": 188 } ]
[ { "span": "self.assertTrue( \"doubleSided\" in a[\"out\"].attributes( \"/group/plane\" ) )", "start_line": 70, "start_column": 2, "end_line": 70, "end_column": 75 }, { "span": "self.assertTrue( \"doubleSided\" not in a[\"out\"].attributes( \"/group/plane1\" ) )", "start_line": 71, "start_column": 2, "end_line": 71, "end_column": 80 }, { "span": "self.assertTrue( \"doubleSided\" not in a[\"out\"].attributes( \"/group\" ) )", "start_line": 72, "start_column": 2, "end_line": 72, "end_column": 73 }, { "span": "self.assertTrue( \"doubleSided\" not in a[\"out\"].attributes( \"/group/plane\" ) )", "start_line": 78, "start_column": 2, "end_line": 78, "end_column": 79 }, { "span": "self.assertTrue( \"doubleSided\" not in a[\"out\"].attributes( \"/group/plane1\" ) )", "start_line": 79, "start_column": 2, "end_line": 79, "end_column": 80 }, { "span": "self.assertTrue( \"doubleSided\" in a[\"out\"].attributes( \"/group\" ) )", "start_line": 80, "start_column": 2, "end_line": 80, "end_column": 69 }, { "span": "self.assertTrue( a[\"out\"][\"set\"] in set( [ c[0] for c in cs ] ) )", "start_line": 103, "start_column": 2, "end_line": 103, "end_column": 67 }, { "span": "self.assertTrue( a[\"out\"][\"attributes\"] not in set( [ c[0] for c in cs ] ) )", "start_line": 104, "start_column": 2, "end_line": 104, "end_column": 78 }, { "span": "self.assertTrue( a[\"out\"][\"set\"] in set( [ c[0] for c in cs ] ) )", "start_line": 116, "start_column": 2, "end_line": 116, "end_column": 67 }, { "span": "self.assertTrue( a[\"out\"][\"attributes\"] in set( [ c[0] for c in cs ] ) )", "start_line": 117, "start_column": 2, "end_line": 117, "end_column": 74 }, { "span": "self.assertTrue( \"doubleSided\" in a1[\"out\"].attributes( \"/group\" ) )", "start_line": 151, "start_column": 2, "end_line": 151, "end_column": 70 }, { "span": "self.assertTrue( \"doubleSided\" not in a1[\"out\"].attributes( \"/group/plane\" ) )", "start_line": 152, "start_column": 2, "end_line": 152, "end_column": 80 }, { "span": "self.assertTrue( \"doubleSided\" not in a2[\"out\"].attributes( \"/group\" ) )", "start_line": 154, "start_column": 2, "end_line": 154, "end_column": 74 }, { "span": "self.assertTrue( \"doubleSided\" in a2[\"out\"].attributes( \"/group/plane\" ) )", "start_line": 155, "start_column": 2, "end_line": 155, "end_column": 76 }, { "span": "self.assertTrue( \"doubleSided\" in a[\"out\"].attributes( \"/plane\" ).keys() )", "start_line": 197, "start_column": 2, "end_line": 197, "end_column": 76 }, { "span": "self.assertFalse( \"doubleSided\" in a[\"out\"].attributes( \"/plane\" ).keys() )", "start_line": 202, "start_column": 2, "end_line": 202, "end_column": 77 }, { "span": "self.assertFalse( \"doubleSided\" in a[\"out\"].attributes( \"/plane\" ).keys() )", "start_line": 205, "start_column": 2, "end_line": 205, "end_column": 77 }, { "span": "self.assertTrue( \"doubleSided\" in a[\"out\"].attributes( \"/plane\" ).keys() )", "start_line": 208, "start_column": 2, "end_line": 208, "end_column": 76 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Set", "Filter", "Test_", "(_", "Ga", "ffer", "Scen", "e", "Test_", "._", "Scen", "e", "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_", "p1_", "=_", "Ga", "ffer", "Scene_", "._", "Plane_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2_", "=_", "Ga", "ffer", "Scene_", "._", "Plane_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "=_", "Ga", "ffer", "Scene_", "._", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "g_", "[_", "\"", "in", "\"_", "]_", "[_", "0_", "]_", "._", "set", "Input_", "(_", "p1_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "[_", "\"", "in", "\"_", "]_", "[_", "1_", "]_", "._", "set", "Input_", "(_", "p2_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "Ga", "ffer", "Scene_", "._", "Set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "g_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "[_", "\"", "path", "s", "\"_", "]_", "._", "set", "Value_", "(_", "IE", "Core_", "._", "String", "Vector", "Data_", "(_", "[_", "\"/", "group", "/", "plane", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "Ga", "ffer", "Scene_", "._", "Set", "Filter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "[_", "\"", "set", "\"_", "]_", "._", "set", "Value_", "(_", "\"", "set", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "Ga", "ffer", "Scene_", "._", "Standard", "Attributes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "s_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "\"", "attribute", "s", "\"_", "]_", "[_", "\"", "double", "Side", "d", "\"_", "]_", "[_", "\"", "enable", "d", "\"_", "]_", "._", "set", "Value_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "\"", "filter", "\"_", "]_", "._", "set", "Input_", "(_", "f_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Scen", "e", "Valid_", "(_", "a_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "in_", "a_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "group", "/", "plane", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "not_", "in_", "a_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "group", "/", "plane", "1", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "not_", "in_", "a_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "group", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "[_", "\"", "path", "s", "\"_", "]_", "._", "set", "Value_", "(_", "IE", "Core_", "._", "String", "Vector", "Data_", "(_", "[_", "\"/", "group", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Scen", "e", "Valid_", "(_", "a_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "not_", "in_", "a_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "group", "/", "plane", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "not_", "in_", "a_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "group", "/", "plane", "1", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "in_", "a_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "group", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Set", "Filter", "Test_", "(_", "Ga", "ffer", "Scen", "e", "Test_", "._", "Scen", "e", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Affect", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "p1_", "=_", "Ga", "ffer", "Scene_", "._", "Plane_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2_", "=_", "Ga", "ffer", "Scene_", "._", "Plane_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "=_", "Ga", "ffer", "Scene_", "._", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "g_", "[_", "\"", "in", "\"_", "]_", "[_", "0_", "]_", "._", "set", "Input_", "(_", "p1_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "[_", "\"", "in", "\"_", "]_", "[_", "1_", "]_", "._", "set", "Input_", "(_", "p2_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "Ga", "ffer", "Scene_", "._", "Set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "g_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "Ga", "ffer", "Scene_", "._", "Standard", "Attributes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "s_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "no", " ", "filter", " ", "attache", "d", " ", "-", " ", "chang", "ing", " ", "a", " ", "set", " ", "shou", "ld", " ", "affect", " ", "only_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "globals", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cs_", "=_", "Ga", "ffer", "Test_", "._", "Captur", "ing", "Slot_", "(_", "a_", "._", "plug", "Dir", "tied", "Signal_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "[_", "\"", "path", "s", "\"_", "]_", "._", "set", "Value_", "(_", "IE", "Core_", "._", "String", "Vector", "Data_", "(_", "[_", "\"/", "group", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "a_", "[_", "\"", "out", "\"_", "]_", "[_", "\"", "set", "\"_", "]_", "in_", "set_", "(_", "[_", "c_", "[_", "0_", "]_", "for_", "c_", "in_", "cs_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "a_", "[_", "\"", "out", "\"_", "]_", "[_", "\"", "attribute", "s", "\"_", "]_", "not_", "in_", "set_", "(_", "[_", "c_", "[_", "0_", "]_", "for_", "c_", "in_", "cs_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "attach", " ", "a", " ", "filter", " ", "-", " ", "chang", "ing", " ", "a", " ", "set", " ", "shou", "ld", " ", "affect", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "attribute", "s", " ", "too", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "Ga", "ffer", "Scene_", "._", "Set", "Filter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "\"", "filter", "\"_", "]_", "._", "set", "Input_", "(_", "f_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cs_", "=_", "Ga", "ffer", "Test_", "._", "Captur", "ing", "Slot_", "(_", "a_", "._", "plug", "Dir", "tied", "Signal_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "[_", "\"", "path", "s", "\"_", "]_", "._", "set", "Value_", "(_", "IE", "Core_", "._", "String", "Vector", "Data_", "(_", "[_", "\"/", "group", "/", "plane", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "a_", "[_", "\"", "out", "\"_", "]_", "[_", "\"", "set", "\"_", "]_", "in_", "set_", "(_", "[_", "c_", "[_", "0_", "]_", "for_", "c_", "in_", "cs_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "a_", "[_", "\"", "out", "\"_", "]_", "[_", "\"", "attribute", "s", "\"_", "]_", "in_", "set_", "(_", "[_", "c_", "[_", "0_", "]_", "for_", "c_", "in_", "cs_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Set", "Filter", "Test_", "(_", "Ga", "ffer", "Scen", "e", "Test_", "._", "Scen", "e", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Multipl", "e", "Stream", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "p1_", "=_", "Ga", "ffer", "Scene_", "._", "Plane_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g1_", "=_", "Ga", "ffer", "Scene_", "._", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g1_", "[_", "\"", "in", "\"_", "]_", "[_", "0_", "]_", "._", "set", "Input_", "(_", "p1_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s1_", "=_", "Ga", "ffer", "Scene_", "._", "Set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s1_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "g1_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s1_", "[_", "\"", "path", "s", "\"_", "]_", "._", "set", "Value_", "(_", "IE", "Core_", "._", "String", "Vector", "Data_", "(_", "[_", "\"/", "group", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p2_", "=_", "Ga", "ffer", "Scene_", "._", "Plane_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g2_", "=_", "Ga", "ffer", "Scene_", "._", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g2_", "[_", "\"", "in", "\"_", "]_", "[_", "0_", "]_", "._", "set", "Input_", "(_", "p2_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s2_", "=_", "Ga", "ffer", "Scene_", "._", "Set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s2_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "g2_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s2_", "[_", "\"", "path", "s", "\"_", "]_", "._", "set", "Value_", "(_", "IE", "Core_", "._", "String", "Vector", "Data_", "(_", "[_", "\"/", "group", "/", "plane", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "Ga", "ffer", "Scene_", "._", "Set", "Filter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "[_", "\"", "set", "\"_", "]_", "._", "set", "Value_", "(_", "\"", "set", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a1_", "=_", "Ga", "ffer", "Scene_", "._", "Standard", "Attributes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a1_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "s1_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a1_", "[_", "\"", "attribute", "s", "\"_", "]_", "[_", "\"", "double", "Side", "d", "\"_", "]_", "[_", "\"", "enable", "d", "\"_", "]_", "._", "set", "Value_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a1_", "[_", "\"", "filter", "\"_", "]_", "._", "set", "Input_", "(_", "f_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a2_", "=_", "Ga", "ffer", "Scene_", "._", "Standard", "Attributes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a2_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "s2_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a2_", "[_", "\"", "attribute", "s", "\"_", "]_", "[_", "\"", "double", "Side", "d", "\"_", "]_", "[_", "\"", "enable", "d", "\"_", "]_", "._", "set", "Value_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a2_", "[_", "\"", "filter", "\"_", "]_", "._", "set", "Input_", "(_", "f_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Scen", "e", "Valid_", "(_", "a1_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Scen", "e", "Valid_", "(_", "a2_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "in_", "a1_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "group", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "not_", "in_", "a1_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "group", "/", "plane", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "not_", "in_", "a2_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "group", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "in_", "a2_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "group", "/", "plane", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Set", "Filter", "Test_", "(_", "Ga", "ffer", "Scen", "e", "Test_", "._", "Scen", "e", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Non", "Exist", "ent", "Sets_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "p_", "=_", "Ga", "ffer", "Scene_", "._", "Plane_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "\"", "sets", "\"_", "]_", "._", "set", "Value_", "(_", "\"", "flat", "Thin", "gs", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "Ga", "ffer", "Scene_", "._", "Standard", "Attributes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "p_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "\"", "attribute", "s", "\"_", "]_", "[_", "\"", "double", "Side", "d", "\"_", "]_", "[_", "\"", "enable", "d", "\"_", "]_", "._", "set", "Value_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "in_", "a_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "plane", "\"_", ")_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "Ga", "ffer", "Scene_", "._", "Set", "Filter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "\"", "filter", "\"_", "]_", "._", "set", "Input_", "(_", "f_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "\"", "double", "Side", "d", "\"_", "in_", "a_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "plane", "\"_", ")_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "[_", "\"", "set", "\"_", "]_", "._", "set", "Value_", "(_", "\"", "non", "Exist", "ent", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "\"", "double", "Side", "d", "\"_", "in_", "a_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "plane", "\"_", ")_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "[_", "\"", "set", "\"_", "]_", "._", "set", "Value_", "(_", "\"", "flat", "Thin", "gs", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "in_", "a_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "plane", "\"_", ")_", "._", "keys_", "(_", ")_", ")_", "\\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, 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 1, 1, 2 ]
Unreachable code
infinitezxc/kaggle-avazu/script/ftrl_2.py
[ { "content": "'''\n DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE\n Version 2, December 2004\n\nCopyright (C) 2004 Sam Hocevar <sam@hocevar.net>\n\nEveryone is permitted to copy and distribute verbatim or modified\ncopies of this license document, and changing it is allowed as long\nas the name is changed.\n\n DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE\n TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n 0. You just DO WHAT THE FUCK YOU WANT TO.\n'''\n\n\nfrom datetime import datetime\nfrom csv import DictReader\nfrom math import exp, log, sqrt\nimport marshal\n\n\n# TL; DR, the main training process starts on line: 250,\n# you may want to start reading the code from there\n\n\n##############################################################################\n# parameters #################################################################\n##############################################################################\n\n# A, paths\ntrain = '../train_pre_1b' # path to training file\ntest = '../test_pre_1b' # path to testing file\nsubmission = '../ftrl_2' # path of to be outputted submission file\n\n# B, model\nalpha = .05 # learning rate\nbeta = 1. # smoothing parameter for adaptive learning rate\nL1 = .4 # L1 regularization, larger value means more regularized\nL2 = .1 # L2 regularization, larger value means more regularized\n\n# C, feature/hash trick\nD = 2 ** 26 # number of weights to use\ninteraction = True # whether to enable poly2 feature interactions\nSUB = True\n\n# D, training/validation\nepoch = 3 # learn training data for N passes\nholdafter = 30 if SUB else 28 # data after date N (exclusive) are used as validation\nholdout = None # use every N training instance for holdout validation\n\n#interactions\ninter_s = \"ac,bc,bi,bk,ci,ck,cm,cn,in,jc,cw,tc,xc,yc,zc,1c,2c,3c,4c,x1,x2,x3,x4,xy,xz\" #site\ninter = []\ninter_s2 = \"af,bf,bi,bk,fi,fk,fm,fn,in,jf,fw,tf,xf,yf,zf,1f,2f,3f,4f,x1,x2,x3,x4,xy,xz\" #app\ninter2 = []\nfeatdict = {\"a\":\"C1\",\"b\":\"banner_pos\",\"c\":\"site_id\",\"d\":\"site_domain\",\"e\":\"site_category\",\"f\":\"app_id\",\"g\":\"app_domain\",\"h\":\"app_category\",\"i\":\"device_id\",\"j\":\"ips\",\"k\":\"device_model\",\"l\":\"device_type\",\"m\":\"device_conn_type\",\"n\":\"C14\",\"o\":\"C15\",\"p\":\"C16\",\"q\":\"C17\",\"r\":\"C18\",\"s\":\"C19\",\"t\":\"C20\",\"u\":\"C21\",\"w\":\"ipcate\",\"x\":\"C22\",\"y\":\"C23\",\"z\":\"C24\",\"1\":\"C25\",\"2\":\"C26\",\"3\":\"C27\",\"4\":\"C28\"}\nfor i in inter_s.split(\",\"):\n inter.append((featdict[i[0]],featdict[i[1]]))\nfor i in inter_s2.split(\",\"):\n inter2.append((featdict[i[0]],featdict[i[1]]))\nfor i in xrange(29,49):\n\tco = \"C\" + str(i)\n\tinter.append((co,\"site_id\"))\n\tinter2.append((co,\"app_id\"))\nipcate = marshal.load(open(\"../testcate\"))\n\n\n##############################################################################\n# class, function, generator definitions #####################################\n##############################################################################\n\n\n\n\n\n\n##############################################################################\n# start training #############################################################\n##############################################################################\n\nstart = datetime.now()\n\n# initialize ourselves a learner\nlearner1 = ftrl_proximal(alpha, beta, L1, L2, D, interaction)\nlearner2 = ftrl_proximal(alpha, beta, L1, L2, D, interaction)\n\n# start training\nfor e in xrange(epoch):\n loss1 = 0.\n loss2 = 0.\n count1 = 1\n count2 = 1\n loss = 0.\n count = 1\n localcount = 0\n learner1.alpha = 0.05 - 0.01 * e\n learner2.alpha = 0.05 - 0.01 * e\n for t, date, ID, x, y, isApp in data(train, D): # data is a generator\n # t: just a instance counter\n # date: you know what this is\n # ID: id provided in original data\n # x: features\n # y: label (click)\n\n # step 1, get prediction from learner\n if not isApp:\n p = learner1.predict(x)\n else:\n p = learner2.predict(x)\n \n #print progress\n localcount += 1\n if localcount % 1000000 == 0:\n if (holdafter and date > holdafter) or (holdout and t % holdout == 0):\n print \"valid: \" + str(localcount)\n else:\n print \"train: \" + str(localcount)\n\n if (holdafter and date > holdafter) or (holdout and t % holdout == 0):\n # step 2-1, calculate validation loss\n # we do not train with the validation data so that our\n # validation loss is an accurate estimation\n #\n # holdafter: train instances from day 1 to day N\n # validate with instances from day N + 1 and after\n #\n # holdout: validate with every N instance, train with others\n loss += logloss(p,y)\n count += 1\n if isApp:\n loss1 += logloss(p, y)\n count1 += 1\n else:\n loss2 += logloss(p, y)\n count2 += 1\n else:\n # step 2-2, update learner with label (click) information\n if not isApp:\n learner1.update(x, p, y)\n else:\n learner2.update(x, p, y)\n if not SUB:\n print('Epoch %d finished, validation logloss: %f, logloss1: %f, logloss2: %f, elapsed time: %s' % (e, loss/count, loss1/count1, loss2/count2, str(datetime.now() - start)))\n\n##############################################################################\n# start testing, and build Kaggle's submission file ##########################\n##############################################################################\n\nsub()", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "print('Epoch %d finished, validation logloss: %f, logloss1: %f, logloss2: %f, elapsed time: %s' % (e, loss/count, loss1/count1, loss2/count2, str(datetime.now() - start)))", "start_line": 332, "start_column": 8, "end_line": 332, "end_column": 179 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "'''", "\\", "10", ";", " ", " ", " ", "DO", " ", "WH", "AT", " ", "THE", " ", "FU", "CK", " ", "YOU", " ", "WAN", "T", " ", "TO", " ", "PUBLIC", " ", "LICENSE", "\\", "10", ";", " ", "Version", " ", "2", ",", " ", "Dece", "mber", " ", "2004", "\\", "10", ";", "\\", "10", ";", "Copy", "right", " ", "(", "C", ")", " ", "2004", " ", "Sam", " ", "Ho", "ce", "var", " ", "<", "sam", "@", "hoc", "eva", "r", ".", "net", ">", "\\", "10", ";", "\\", "10", ";", "Every", "one", " ", "is", " ", "permit", "ted", " ", "to", " ", "copy", " ", "and", " ", "distribute", " ", "verba", "tim", " ", "or", " ", "modifi", "ed", "\\", "10", ";", "copie", "s", " ", "of", " ", "this", " ", "license", " ", "document", ",", " ", "and", " ", "chang", "ing", " ", "it", " ", "is", " ", "allow", "ed", " ", "as", " ", "long", "\\", "10", ";", "as", " ", "the", " ", "name", " ", "is", " ", "change", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", "DO", " ", "WH", "AT", " ", "THE", " ", "FU", "CK", " ", "YOU", " ", "WAN", "T", " ", "TO", " ", "PUBLIC", " ", "LICENSE", "\\", "10", ";", " ", " ", "TERM", "S", " ", "AND", " ", "CONDITION", "S", " ", "FOR", " ", "COPY", "ING", ",", " ", "DISTRI", "BUT", "ION", " ", "AND", " ", "MODI", "FICATION", "\\", "10", ";", "\\", "10", ";", " ", "0.", " ", "You", " ", "just", " ", "DO", " ", "WH", "AT", " ", "THE", " ", "FU", "CK", " ", "YOU", " ", "WAN", "T", " ", "TO", ".", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "datetime_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "csv_", "import_", "Dict", "Reader_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "math_", "import_", "exp_", ",_", "log_", ",_", "sqrt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "marshal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TL", ";", " ", "DR", ",", " ", "the", " ", "main", " ", "train", "ing", " ", "process", " ", "starts", " ", "on", " ", "line", ":", " ", "250", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "you", " ", "may", " ", "want", " ", "to", " ", "start", " ", "readi", "ng", " ", "the", " ", "code", " ", "from", " ", "there", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "parameter", "s", " ", "###########", "###########", "###########", "###########", "###########", "#########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", ",", " ", "paths_", "\\u\\u\\uNL\\u\\u\\u_", "train_", "=_", "'../", "train", "\\u", "pre", "\\u", "1b", "'_", "#", " ", "path", " ", "to", " ", "train", "ing", " ", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test_", "=_", "'../", "test\\u", "pre", "\\u", "1b", "'_", "#", " ", "path", " ", "to", " ", "testi", "ng", " ", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "submission_", "=_", "'../", "ftr", "l\\u", "2", "'_", "#", " ", "path", " ", "of", " ", "to", " ", "be", " ", "output", "ted", " ", "subm", "ission", " ", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "B", ",", " ", "model_", "\\u\\u\\uNL\\u\\u\\u_", "alpha_", "=_", ".05_", "#", " ", "learn", "ing", " ", "rate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "beta_", "=_", "1._", "#", " ", "smoothing", " ", "parameter", " ", "for", " ", "adapti", "ve", " ", "learn", "ing", " ", "rate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "L1_", "=_", ".4_", "#", " ", "L1", " ", "regularization", ",", " ", "large", "r", " ", "value", " ", "means", " ", "more", " ", "regulari", "zed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "L2_", "=_", ".1_", "#", " ", "L", "2", " ", "regularization", ",", " ", "large", "r", " ", "value", " ", "means", " ", "more", " ", "regulari", "zed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "C", ",", " ", "feature", "/", "hash", " ", "trick", "_", "\\u\\u\\uNL\\u\\u\\u_", "D_", "=_", "2_", "**_", "26_", "#", " ", "number", " ", "of", " ", "weight", "s", " ", "to", " ", "use_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "interaction_", "=_", "True_", "#", " ", "whe", "ther", " ", "to", " ", "enable", " ", "poly", "2", " ", "feature", " ", "interactions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SUB", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "D", ",", " ", "train", "ing", "/", "validation_", "\\u\\u\\uNL\\u\\u\\u_", "epoch_", "=_", "3_", "#", " ", "learn", " ", "train", "ing", " ", "data", " ", "for", " ", "N", " ", "passes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hold", "after_", "=_", "30_", "if_", "SUB", "_", "else_", "28_", "#", " ", "data", " ", "after", " ", "date", " ", "N", " ", "(", "exclu", "sive", ")", " ", "are", " ", "used", " ", "as", " ", "validation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hold", "out_", "=_", "None_", "#", " ", "use", " ", "every", " ", "N", " ", "train", "ing", " ", "instance", " ", "for", " ", "hold", "out", " ", "validation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "interactions_", "\\u\\u\\uNL\\u\\u\\u_", "inter", "\\u", "s_", "=_", "\"", "ac", ",", "bc", ",", "bi", ",", "bk", ",", "ci", ",", "ck", ",", "cm", ",", "cn", ",", "in", ",", "jc", ",", "cw", ",", "tc", ",", "xc", ",", "yc", ",", "zc", ",", "1c", ",", "2c", ",", "3c", ",", "4c", ",", "x1", ",", "x2", ",", "x3", ",", "x4", ",", "xy", ",", "xz", "\"_", "#", "site_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inter_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inter", "\\u", "s2_", "=_", "\"", "af", ",", "bf", ",", "bi", ",", "bk", ",", "fi", ",", "fk", ",", "fm", ",", "fn", ",", "in", ",", "jf", ",", "fw", ",", "tf", ",", "xf", ",", "yf", ",", "zf", ",", "1f", ",", "2f", ",", "3f", ",", "4f", ",", "x1", ",", "x2", ",", "x3", ",", "x4", ",", "xy", ",", "xz", "\"_", "#", "app_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inter", "2_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "feat", "dict_", "=_", "{_", "\"", "a", "\"_", ":_", "\"", "C1", "\"_", ",_", "\"", "b", "\"_", ":_", "\"", "banner", "\\u", "pos", "\"_", ",_", "\"", "c", "\"_", ":_", "\"", "site", "\\u", "id", "\"_", ",_", "\"", "d", "\"_", ":_", "\"", "site", "\\u", "domain", "\"_", ",_", "\"", "e", "\"_", ":_", "\"", "site", "\\u", "category", "\"_", ",_", "\"", "f", "\"_", ":_", "\"", "app", "\\u", "id", "\"_", ",_", "\"", "g", "\"_", ":_", "\"", "app", "\\u", "domain", "\"_", ",_", "\"", "h", "\"_", ":_", "\"", "app", "\\u", "category", "\"_", ",_", "\"", "i", "\"_", ":_", "\"", "device", "\\u", "id", "\"_", ",_", "\"", "j", "\"_", ":_", "\"", "ips", "\"_", ",_", "\"", "k", "\"_", ":_", "\"", "device", "\\u", "model", "\"_", ",_", "\"", "l", "\"_", ":_", "\"", "device", "\\u", "type", "\"_", ",_", "\"", "m", "\"_", ":_", "\"", "device", "\\u", "conn", "\\u", "type", "\"_", ",_", "\"", "n", "\"_", ":_", "\"", "C1", "4", "\"_", ",_", "\"", "o", "\"_", ":_", "\"", "C1", "5", "\"_", ",_", "\"", "p", "\"_", ":_", "\"", "C1", "6", "\"_", ",_", "\"", "q", "\"_", ":_", "\"", "C1", "7", "\"_", ",_", "\"", "r", "\"_", ":_", "\"", "C1", "8", "\"_", ",_", "\"", "s", "\"_", ":_", "\"", "C1", "9", "\"_", ",_", "\"", "t", "\"_", ":_", "\"", "C2", "0", "\"_", ",_", "\"", "u", "\"_", ":_", "\"", "C2", "1", "\"_", ",_", "\"", "w", "\"_", ":_", "\"", "ipc", "ate", "\"_", ",_", "\"", "x", "\"_", ":_", "\"", "C2", "2", "\"_", ",_", "\"", "y", "\"_", ":_", "\"", "C2", "3", "\"_", ",_", "\"", "z", "\"_", ":_", "\"", "C2", "4", "\"_", ",_", "\"", "1", "\"_", ":_", "\"", "C2", "5", "\"_", ",_", "\"", "2", "\"_", ":_", "\"", "C2", "6", "\"_", ",_", "\"", "3", "\"_", ":_", "\"", "C2", "7", "\"_", ",_", "\"", "4", "\"_", ":_", "\"", "C2", "8", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "inter", "\\u", "s_", "._", "split_", "(_", "\",\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "inter_", "._", "append_", "(_", "(_", "feat", "dict_", "[_", "i_", "[_", "0_", "]_", "]_", ",_", "feat", "dict_", "[_", "i_", "[_", "1_", "]_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "inter", "\\u", "s2_", "._", "split_", "(_", "\",\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "inter", "2_", "._", "append_", "(_", "(_", "feat", "dict_", "[_", "i_", "[_", "0_", "]_", "]_", ",_", "feat", "dict_", "[_", "i_", "[_", "1_", "]_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "29_", ",_", "49_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "co_", "=_", "\"", "C", "\"_", "+_", "str_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inter_", "._", "append_", "(_", "(_", "co_", ",_", "\"", "site", "\\u", "id", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inter", "2_", "._", "append_", "(_", "(_", "co_", ",_", "\"", "app", "\\u", "id", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ipc", "ate_", "=_", "marshal_", "._", "load_", "(_", "open_", "(_", "\"..", "/", "testc", "ate", "\"_", ")_", ")_", "\\u\\u\\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_", "#", " ", "class", ",", " ", "function", ",", " ", "generat", "or", " ", "definit", "ion", "s", " ", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "start", " ", "train", "ing", " ", "###########", "###########", "###########", "###########", "###########", "######", "_", "\\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_", "start_", "=_", "datetime_", "._", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "initialize", " ", "ours", "elv", "es", " ", "a", " ", "learner_", "\\u\\u\\uNL\\u\\u\\u_", "learner", "1_", "=_", "ftr", "l\\u", "proxim", "al_", "(_", "alpha_", ",_", "beta_", ",_", "L1_", ",_", "L2_", ",_", "D_", ",_", "interaction_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learner", "2_", "=_", "ftr", "l\\u", "proxim", "al_", "(_", "alpha_", ",_", "beta_", ",_", "L1_", ",_", "L2_", ",_", "D_", ",_", "interaction_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "start", " ", "training_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "e_", "in_", "xrange_", "(_", "epoch_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loss", "1_", "=_", "0._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loss", "2_", "=_", "0._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count", "1_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count", "2_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loss_", "=_", "0._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "local", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learner", "1_", "._", "alpha_", "=_", "0.05_", "-_", "0.01_", "*_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learner", "2_", "._", "alpha_", "=_", "0.05_", "-_", "0.01_", "*_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "t_", ",_", "date_", ",_", "ID_", ",_", "x_", ",_", "y_", ",_", "is", "App_", "in_", "data_", "(_", "train_", ",_", "D_", ")_", ":_", "#", " ", "data", " ", "is", " ", "a", " ", "generator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "t", ":", " ", "just", " ", "a", " ", "instance", " ", "counter_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "date", ":", " ", "you", " ", "know", " ", "what", " ", "this", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "ID", ":", " ", "id", " ", "provided", " ", "in", " ", "original", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "x", ":", " ", "features_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "y", ":", " ", "label", " ", "(", "click", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "step", " ", "1", ",", " ", "get", " ", "predicti", "on", " ", "from", " ", "learner_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "is", "App_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "learner", "1_", "._", "predict_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "learner", "2_", "._", "predict_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "progress_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "local", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "local", "count_", "%_", "1000000_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "hold", "after_", "and_", "date_", ">_", "hold", "after_", ")_", "or_", "(_", "hold", "out_", "and_", "t_", "%_", "hold", "out_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "valid", ":", " ", "\"_", "+_", "str_", "(_", "local", "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 ", " _", "print_", "\"", "train", ":", " ", "\"_", "+_", "str_", "(_", "local", "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_", "if_", "(_", "hold", "after_", "and_", "date_", ">_", "hold", "after_", ")_", "or_", "(_", "hold", "out_", "and_", "t_", "%_", "hold", "out_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "step", " ", "2", "-1", ",", " ", "calcul", "ate", " ", "validation", " ", "loss_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "we", " ", "do", " ", "not", " ", "train", " ", "with", " ", "the", " ", "validation", " ", "data", " ", "so", " ", "tha", "t", " ", "our_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "validation", " ", "loss", " ", "is", " ", "an", " ", "accurate", " ", "estimati", "on_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hold", "after", ":", " ", "train", " ", "instance", "s", " ", "from", " ", "day", " ", "1", " ", "to", " ", "day", " ", "N_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "validat", "e", " ", "with", " ", "instance", "s", " ", "from", " ", "day", " ", "N", " ", "+", " ", "1", " ", "and", " ", "after_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hold", "out", ":", " ", "validat", "e", " ", "with", " ", "every", " ", "N", " ", "instance", ",", " ", "train", " ", "with", " ", "others_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loss_", "+=_", "loglo", "ss_", "(_", "p_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "App_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loss", "1_", "+=_", "loglo", "ss_", "(_", "p_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count", "1_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loss", "2_", "+=_", "loglo", "ss_", "(_", "p_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count", "2_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "step", " ", "2", "-", "2", ",", " ", "update", " ", "learner", " ", "with", " ", "label", " ", "(", "click", ")", " ", "information_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "is", "App_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "learner", "1_", "._", "update_", "(_", "x_", ",_", "p_", ",_", "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 ", " _", "learner", "2_", "._", "update_", "(_", "x_", ",_", "p_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "SUB", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Epoch", " ", "%", "d", " ", "finish", "ed", ",", " ", "validation", " ", "loglo", "ss", ":", " ", "%", "f", ",", " ", "loglo", "ss", "1", ":", " ", "%", "f", ",", " ", "loglo", "ss", "2", ":", " ", "%", "f", ",", " ", "ela", "pse", "d", " ", "time", ":", " ", "%", "s", "'_", "%_", "(_", "e_", ",_", "loss_", "/_", "count_", ",_", "loss", "1_", "/_", "count", "1_", ",_", "loss", "2_", "/_", "count", "2_", ",_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", "-_", "start_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "start", " ", "testi", "ng", ",", " ", "and", " ", "build", " ", "Ka", "ggle", "'", "s", " ", "subm", "ission", " ", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sub_", "(_", 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1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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/ofam/src/src/foam/sfa/rspecs/elements/versions/ocfvtNode.py
[ { "content": "from foam.sfa.util.xrn import Xrn\nfrom foam.sfa.util.xml import XpathFilter\n\nfrom foam.sfa.rspecs.elements.node import Node\nfrom foam.sfa.rspecs.elements.sliver import Sliver\nfrom foam.sfa.rspecs.elements.location import Location\nfrom foam.sfa.rspecs.elements.ocf_vt_server import OcfVtServer\nfrom foam.sfa.rspecs.elements.hardware_type import HardwareType\nfrom foam.sfa.rspecs.elements.disk_image import DiskImage\nfrom foam.sfa.rspecs.elements.interface import Interface\nfrom foam.sfa.rspecs.elements.bwlimit import BWlimit\nfrom foam.sfa.rspecs.elements.pltag import PLTag\nfrom foam.sfa.rspecs.elements.versions.pgv2Services import PGv2Services \nfrom foam.sfa.rspecs.elements.versions.pgv2SliverType import PGv2SliverType \nfrom foam.sfa.rspecs.elements.versions.pgv2Interface import PGv2Interface \n\n\nfrom foam.sfa.rspecs.elements.range import Range\nfrom foam.sfa.rspecs.elements.network_interface import NetworkInterface\nfrom foam.sfa.rspecs.elements.versions.ocfvtSlivers import OcfVtSlivers\n\n#from sfa.util.sfalogging import logger\n\n#from sfa.planetlab.plxrn import xrn_to_hostname\n\nif __name__ == '__main__':\n from foam.sfa.rspecs.rspec import RSpec\n #import pdb\n r = RSpec('/tmp/emulab.rspec')\n r2 = RSpec(version = 'OcfVt')\n nodes = OcfVtNode.get_nodes(r.xml)\n OcfVtNode.add_nodes(r2.xml.root, nodes)\n #pdb.set_trace()\n \n \n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def xrn_to_hostname(a=None,b=None):\n\treturn a", "metadata": "root.xrn_to_hostname", "header": "['module', '___EOS___']", "index": 24 }, { "content": "class OcfVtNode:\n\n\n\n\n\n", "metadata": "root.OcfVtNode", "header": "['module', '___EOS___']", "index": 27 }, { "content": " @staticmethod\n def add_nodes(xml, nodes):\n\n\tnetwork_elems = xml.xpath('//network')\n if len(network_elems) > 0:\n network_elem = network_elems[0]\n elif len(nodes) > 0 and nodes[0].get('component_manager_id'):\n network_urn = nodes[0]['component_manager_id']\n network_elem = xml.add_element('network', name = Xrn(network_urn).get_hrn())\n else:\n network_elem = xml\n\n\t\n node_elems = []\n for node in nodes:\n node_fields = ['component_manager_id', 'component_id', 'client_id', 'sliver_id', 'exclusive']\n node_elem = network_elem.add_instance('node', node, node_fields)\n node_elems.append(node_elem)\n # set component name\n if node.get('component_id'):\n component_name = xrn_to_hostname(node['component_id'])\n node_elem.set('component_name', component_name)\n\t if node.get('hostname'):\n simple_elem = node_elem.add_element('hostname')\n simple_elem.set_text(node['hostname'])\n # set hardware types\n\t \n if node.get('hardware_types'):\n for hardware_type in node.get('hardware_types', []):\n\t\t for field in OcfVtServer.fields:\t\n\t\t #node_elem.add_instance(field,{field:hardware_type[field]},[])#XXX Ugly notation\n\t\t\tsimple_elem = node_elem.add_element(field)\n\t\t\tsimple_elem.set_text(hardware_type[field])\n # set location\n if node.get('location'):\n node_elem.add_instance('location', node['location'], Location.fields) \n # set interfaces\n PGv2Interface.add_interfaces(node_elem, node.get('interfaces'))\n #if node.get('interfaces'):\n # for interface in node.get('interfaces', []):\n # node_elem.add_instance('interface', interface, ['component_id', 'client_id'])\n # set available element\n if node.get('boot_state'):\n if node.get('boot_state').lower() == 'boot':\n available_elem = node_elem.add_element('available', now='true')\n else:\n available_elem = node_elem.add_element('available', now='false')\n # add services\n\t if node.get('services'):\n\t\tfor service in node.get('services',[]):\n\t\t fields = service.fields\n\t\t s = node_elem.add_element('service', type=str(service.__class__.__name__))\n\t\t for field in fields:\n\t\t\tif service[field]:\n\t\t\t\tsimple_elem = s.add_element(field)#node_elem.add_element(field)\n \tsimple_elem.set_text(service[field])\n #PGv2Services.add_services(node_elem, node.get('services', [])) \n # add slivers\n slivers = node.get('slivers', [])\n if slivers:\n\t\tfor sliver in slivers:\n\t\t\tfields = sliver.fields\n\t\t\ts = node_elem.add_element('sliver', type=str(sliver.__class__.__name__))\n\t\t\tfor field in fields:\n\t\t\t\tif sliver[field]:\n\t\t\t\t\tsimple_elem = s.add_element(field)#node_elem.add_element(field)\n \tsimple_elem.set_text(sliver[field])\n\n # we must still advertise the available sliver types\n #slivers = Sliver({'type': 'plab-vserver'})\n # we must also advertise the available initscripts\n #slivers['tags'] = []\n #if node.get('pl_initscripts'): \n # for initscript in node.get('pl_initscripts', []):\n # slivers['tags'].append({'name': 'initscript', 'value': initscript['name']})\n #PGv2SliverType.add_slivers(node_elem, slivers)\n return node_elems", "metadata": "root.OcfVtNode.add_nodes", "header": "['class', 'OcfVtNode', ':', '___EOS___']", "index": 28 }, { "content": " @staticmethod\n def get_nodes(xml, filter={}):\n #xpath = '//node%s | //default:node%s' % (XpathFilter.xpath(filter), XpathFilter.xpath(filter))\n xpath = '//rspec/network/node'\n\tnode_elems = xml.xpath(xpath)\n return OcfVtNode.get_node_objs(node_elems)", "metadata": "root.OcfVtNode.get_nodes", "header": "['class', 'OcfVtNode', ':', '___EOS___']", "index": 106 }, { "content": " @staticmethod\n def get_nodes_with_slivers(xml, filter={}):\n #xpath = '//node[count(sliver-type)>0] | //default:node[count(default:sliver-type) > 0]' \n\txpath = '//rspec/network/node'\n node_elems = xml.xpath(xpath)\n\tif not node_elems:\n\t\tnode_elems = xml.xpath('//RSpec/network/node')\n return OcfVtNode.get_node_objs(node_elems)", "metadata": "root.OcfVtNode.get_nodes_with_slivers", "header": "['class', 'OcfVtNode', ':', '___EOS___']", "index": 113 }, { "content": " @staticmethod\n def get_node_objs(node_elems):\n nodes = []\n for node_elem in node_elems:\n node = Node(node_elem.attrib, node_elem)\n nodes.append(node)\n\t \n if 'component_id' in node_elem.attrib:\n node['authority_id'] = Xrn(node_elem.attrib['component_id']).get_authority_urn()\n \n # get hardware types\n hardware_type_elems = node_elem.xpath('./hardware_type | ./default:hardware_type')\n node['hardware_types'] = [hw_type.get_instance(HardwareType) for hw_type in hardware_type_elems]\n \n # get location\n location_elems = node_elem.xpath('./location | ./default:location')\n locations = [location_elem.get_instance(Location) for location_elem in location_elems]\n if len(locations) > 0:\n node['location'] = locations[0]\n\n # get interfaces\n iface_elems = node_elem.xpath('./interface | ./default:interface')\n node['interfaces'] = [iface_elem.get_instance(Interface) for iface_elem in iface_elems]\n\n # get services\n\t service_elems = node_elem.xpath('./services | ./default:service')\n\t if service_elems:\n \tnode['services'] = PGv2Services.get_services(node_elem)\n \n # get slivers\n\t sliver_elems = node_elem.xpath('./sliver | ./default:slivers')\n\t if sliver_elems:\n node['slivers'] = OcfVtSlivers.get_slivers(sliver_elems)\n\t\n available_elems = node_elem.xpath('./available | ./default:available')\n if len(available_elems) > 0 and 'name' in available_elems[0].attrib:\n if available_elems[0].attrib.get('now', '').lower() == 'true': \n node['boot_state'] = 'boot'\n else: \n node['boot_state'] = 'disabled' \n\n return nodes", "metadata": "root.OcfVtNode.get_node_objs", "header": "['class', 'OcfVtNode', ':', '___EOS___']", "index": 122 }, { "content": " @staticmethod\n def add_slivers(xml, slivers):\n component_ids = []\n for sliver in slivers:\n filter = {}\n if isinstance(sliver, str):\n filter['component_id'] = '*%s*' % sliver\n sliver = {}\n elif 'component_id' in sliver and sliver['component_id']:\n filter['component_id'] = '*%s*' % sliver['component_id']\n if not filter: \n continue\n nodes = OcfVtNode.get_nodes(xml, filter)\n if not nodes:\n continue\n node = nodes[0]\n PGv2SliverType.add_slivers(node, sliver)", "metadata": "root.OcfVtNode.add_slivers", "header": "['class', 'OcfVtNode', ':', '___EOS___']", "index": 166 }, { "content": " @staticmethod\n def remove_slivers(xml, hostnames):\n for hostname in hostnames:\n nodes = OcfVtNode.get_nodes(xml, {'component_id': '*%s*' % hostname})\n for node in nodes:\n slivers = OcfVtSliverType.get_slivers(node.element)\n for sliver in slivers:\n node.element.remove(sliver.element) ", "metadata": "root.OcfVtNode.remove_slivers", "header": "['class', 'OcfVtNode', ':', '___EOS___']", "index": 184 } ]
[ { "span": "from foam.sfa.util.xml import XpathFilter", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 41 }, { "span": "from foam.sfa.rspecs.elements.sliver import Sliver", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 50 }, { "span": "from foam.sfa.rspecs.elements.disk_image import DiskImage", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 57 }, { "span": "from foam.sfa.rspecs.elements.bwlimit import BWlimit", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 52 }, { "span": "from foam.sfa.rspecs.elements.pltag import PLTag", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 48 }, { "span": "from foam.sfa.rspecs.elements.range import Range", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 48 }, { "span": "from foam.sfa.rspecs.elements.network_interface import NetworkInterface", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 71 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "foa", "m_", "._", "sfa", "_", "._", "util_", "._", "xr", "n_", "import_", "Xr", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "foa", "m_", "._", "sfa", "_", "._", "util_", "._", "xml_", "import_", "Xp", "ath", "Filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "foa", "m_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "node_", "import_", "Node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "foa", "m_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "sli", "ver_", "import_", "Sli", "ver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "foa", "m_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "location_", "import_", "Location_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "foa", "m_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "oc", "f", "\\u", "vt", "\\u", "server_", "import_", "Oc", "f", "Vt", "Server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "foa", "m_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "hard", "ware", "\\u", "type_", "import_", "Hard", "ware", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "foa", "m_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "disk", "\\u", "image_", "import_", "Disk", "Image_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "foa", "m_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "interface_", "import_", "Interface_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "foa", "m_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "bw", "limit_", "import_", "BW", "limit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "foa", "m_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "plt", "ag_", "import_", "PL", "Tag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "foa", "m_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "versions_", "._", "pg", "v2", "Services_", "import_", "PG", "v2", "Services_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "foa", "m_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "versions_", "._", "pg", "v2", "Sli", "ver", "Type_", "import_", "PG", "v2", "Sli", "ver", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "foa", "m_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "versions_", "._", "pg", "v2", "Interface_", "import_", "PG", "v2", "Interface_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "foa", "m_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "range_", "import_", "Range_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "foa", "m_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "network", "\\u", "interface_", "import_", "Network", "Interface_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "foa", "m_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "versions_", "._", "oc", "fv", "t", "Sli", "vers_", "import_", "Oc", "f", "Vt", "Sli", "vers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "from", " ", "sfa", ".", "util", ".", "sfa", "logg", "ing", " ", "import", " ", "logger_", "\\u\\u\\uNL\\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\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\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 ", " _", "from_", "foa", "m_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "rsp", "ec_", "import_", "RS", "pec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "import", " ", "pdb_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "RS", "pec_", "(_", "'/", "tmp", "/", "emu", "lab", ".", "rsp", "ec", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r2_", "=_", "RS", "pec_", "(_", "version_", "=_", "'", "Oc", "f", "Vt", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nodes_", "=_", "Oc", "f", "Vt", "Node_", "._", "get", "\\u", "nodes_", "(_", "r_", "._", "xml_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Oc", "f", "Vt", "Node_", "._", "add", "\\u", "nodes_", "(_", "r2_", "._", "xml_", "._", "root_", ",_", "nodes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "pdb", ".", "set\\u", "trace", "()", "_", "\\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_", "xr", "n", "\\u", "to", "\\u", "hostname_", "(_", "a_", "=_", "None_", ",_", "b_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "return_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Oc", "f", "Vt", "Node_", ":_", "\\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\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Oc", "f", "Vt", "Node_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "add", "\\u", "nodes_", "(_", "xml_", ",_", "nodes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "network", "\\u", "elems_", "=_", "xml_", "._", "xpath_", "(_", "'//", "network", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "network", "\\u", "elems_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "network", "\\u", "elem_", "=_", "network", "\\u", "elems_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "nodes_", ")_", ">_", "0_", "and_", "nodes_", "[_", "0_", "]_", "._", "get_", "(_", "'", "component", "\\u", "manage", "r", "\\u", "id", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "network", "\\u", "urn_", "=_", "nodes_", "[_", "0_", "]_", "[_", "'", "component", "\\u", "manage", "r", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "network", "\\u", "elem_", "=_", "xml_", "._", "add", "\\u", "element_", "(_", "'", "network", "'_", ",_", "name_", "=_", "Xr", "n_", "(_", "network", "\\u", "urn_", ")_", "._", "get", "\\u", "hr", "n_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "network", "\\u", "elem_", "=_", "xml_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "node", "\\u", "elems_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "node_", "in_", "nodes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node", "\\u", "fields_", "=_", "[_", "'", "component", "\\u", "manage", "r", "\\u", "id", "'_", ",_", "'", "component", "\\u", "id", "'_", ",_", "'", "client", "\\u", "id", "'_", ",_", "'", "sli", "ver", "\\u", "id", "'_", ",_", "'", "exclu", "sive", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "elem_", "=_", "network", "\\u", "elem_", "._", "add", "\\u", "instance_", "(_", "'", "node", "'_", ",_", "node_", ",_", "node", "\\u", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "elems_", "._", "append_", "(_", "node", "\\u", "elem_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set", " ", "component", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "node_", "._", "get_", "(_", "'", "component", "\\u", "id", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "component", "\\u", "name_", "=_", "xr", "n", "\\u", "to", "\\u", "hostname_", "(_", "node_", "[_", "'", "component", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "elem_", "._", "set_", "(_", "'", "component", "\\u", "name", "'_", ",_", "component", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "node_", "._", "get_", "(_", "'", "host", "name", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "simple", "\\u", "elem_", "=_", "node", "\\u", "elem_", "._", "add", "\\u", "element_", "(_", "'", "host", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "simple", "\\u", "elem_", "._", "set\\u", "text_", "(_", "node_", "[_", "'", "host", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set", " ", "hard", "ware", " ", "types_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "node_", "._", "get_", "(_", "'", "hard", "ware", "\\u", "types", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "hard", "ware", "\\u", "type_", "in_", "node_", "._", "get_", "(_", "'", "hard", "ware", "\\u", "types", "'_", ",_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t _", "for_", "field_", "in_", "Oc", "f", "Vt", "Server_", "._", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "node", "\\u", "elem", ".", "add", "\\u", "instance", "(", "field", ",{", "field", ":", "hard", "ware", "\\u", "type", "[", "field", "]},", "[]", ")#", "XX", "X", " ", "Ug", "ly", " ", "notation", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "simple", "\\u", "elem_", "=_", "node", "\\u", "elem_", "._", "add", "\\u", "element_", "(_", "field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "simple", "\\u", "elem_", "._", "set\\u", "text_", "(_", "hard", "ware", "\\u", "type_", "[_", "field_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set", " ", "location_", "\\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_", "node_", "._", "get_", "(_", "'", "location", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node", "\\u", "elem_", "._", "add", "\\u", "instance_", "(_", "'", "location", "'_", ",_", "node_", "[_", "'", "location", "'_", "]_", ",_", "Location_", "._", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set", " ", "interfaces_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "PG", "v2", "Interface_", "._", "add", "\\u", "interfaces_", "(_", "node", "\\u", "elem_", ",_", "node_", "._", "get_", "(_", "'", "interface", "s", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "node", ".", "get", "('", "interface", "s", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "for", " ", "interface", " ", "in", " ", " ", "node", ".", "get", "('", "interface", "s", "',", " ", "[]", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "node", "\\u", "elem", ".", "add", "\\u", "instance", "('", "interface", "',", " ", "interface", ",", " ", "['", "component", "\\u", "id", "',", " ", "'", "client", "\\u", "id", "'])", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", " ", "avail", "able", " ", "element_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "node_", "._", "get_", "(_", "'", "boot", "\\u", "state", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "node_", "._", "get_", "(_", "'", "boot", "\\u", "state", "'_", ")_", "._", "lower_", "(_", ")_", "==_", "'", "boot", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "avail", "able", "\\u", "elem_", "=_", "node", "\\u", "elem_", "._", "add", "\\u", "element_", "(_", "'", "avail", "able", "'_", ",_", "now_", "=_", "'", "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 ", " ", "_", "avail", "able", "\\u", "elem_", "=_", "node", "\\u", "elem_", "._", "add", "\\u", "element_", "(_", "'", "avail", "able", "'_", ",_", "now_", "=_", "'", "fal", "se", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "services_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "node_", "._", "get_", "(_", "'", "service", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "for_", "service_", "in_", "node_", "._", "get_", "(_", "'", "service", "s", "'_", ",_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t ", "_", "fields_", "=_", "service_", "._", "fields_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "node", "\\u", "elem_", "._", "add", "\\u", "element_", "(_", "'", "service", "'_", ",_", "type_", "=_", "str_", "(_", "service_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "field_", "in_", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "service_", "[_", "field_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "simple", "\\u", "elem_", "=_", "s_", "._", "add", "\\u", "element_", "(_", "field_", ")_", "#", "node", "\\u", "elem", ".", "add", "\\u", "element", "(", "field", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "simple", "\\u", "elem_", "._", "set\\u", "text_", "(_", "service_", "[_", "field_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "PG", "v2", "Service", "s", ".", "add", "\\u", "service", "s", "(", "node", "\\u", "elem", ",", " ", "node", ".", "get", "('", "service", "s", "',", " ", "[]", "))", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "sli", "vers_", "\\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_", "sli", "vers_", "=_", "node_", "._", "get_", "(_", "'", "sli", "vers", "'_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sli", "vers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "for_", "sli", "ver_", "in_", "sli", "vers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "fields_", "=_", "sli", "ver_", "._", "fields_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "node", "\\u", "elem_", "._", "add", "\\u", "element_", "(_", "'", "sli", "ver", "'_", ",_", "type_", "=_", "str_", "(_", "sli", "ver_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "field_", "in_", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "if_", "sli", "ver_", "[_", "field_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "simple", "\\u", "elem_", "=_", "s_", "._", "add", "\\u", "element_", "(_", "field_", ")_", "#", "node", "\\u", "elem", ".", "add", "\\u", "element", "(", "field", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "simple", "\\u", "elem_", "._", "set\\u", "text_", "(_", "sli", "ver_", "[_", "field_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "must", " ", "still", " ", "advertise", " ", "the", " ", "avail", "able", " ", "sli", "ver", " ", "types_", "\\u\\u\\uNL\\u\\u\\u_", "#", "sli", "vers", " ", "=", " ", "Sli", "ver", "({", "'", "type", "':", " ", "'", "pla", "b", "-", "vserver", "'})", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "must", " ", "als", "o", " ", "advertise", " ", "the", " ", "avail", "able", " ", "inits", "cript", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", "sli", "vers", "['", "tags", "']", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "node", ".", "get", "('", "pl", "\\u", "inits", "cript", "s", "')", ":", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "for", " ", "inits", "cript", " ", "in", " ", "node", ".", "get", "('", "pl", "\\u", "inits", "cript", "s", "',", " ", "[]", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "sli", "vers", "['", "tags", "']", ".", "append", "({", "'", "name", "':", " ", "'", "inits", "cript", "',", " ", "'", "value", "':", " ", "inits", "cript", "['", "name", "']}", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "PG", "v2", "Sli", "ver", "Type", ".", "add", "\\u", "sli", "vers", "(", "node", "\\u", "elem", ",", " ", "sli", "vers", ")_", "\\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_", "return_", "node", "\\u", "elems_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Oc", "f", "Vt", "Node_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "nodes_", "(_", "xml_", ",_", "filter_", "=_", "{_", "}_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "xpa", "th", " ", "=", " ", "'//", "node", "%", "s", " ", "|", " ", "//", "default", ":", "node", "%", "s", "'", " ", "%", " ", "(", "Xp", "ath", "Filter", ".", "xpa", "th", "(", "filter", "),", " ", "Xp", "ath", "Filter", ".", "xpa", "th", "(", "filter", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xpath_", "=_", "'//", "rsp", "ec", "/", "network", "/", "node", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "elems_", "=_", "xml_", "._", "xpath_", "(_", "xpath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Oc", "f", "Vt", "Node_", "._", "get", "\\u", "node", "\\u", "objs_", "(_", "node", "\\u", "elems_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Oc", "f", "Vt", "Node_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "nodes", "\\u", "with", "\\u", "sli", "vers_", "(_", "xml_", ",_", "filter_", "=_", "{_", "}_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "xpa", "th", " ", "=", " ", "'//", "node", "[", "count", "(", "sli", "ver", "-", "type", ")>", "0", "]", " ", "|", " ", "//", "default", ":", "node", "[", "count", "(", "default", ":", "sli", "ver", "-", "type", ")", " ", ">", " ", "0", "]'", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "xpath_", "=_", "'//", "rsp", "ec", "/", "network", "/", "node", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "elems_", "=_", "xml_", "._", "xpath_", "(_", "xpath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "node", "\\u", "elems_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "node", "\\u", "elems_", "=_", "xml_", "._", "xpath_", "(_", "'//", "RS", "pec", "/", "network", "/", "node", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Oc", "f", "Vt", "Node_", "._", "get", "\\u", "node", "\\u", "objs_", "(_", "node", "\\u", "elems_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Oc", "f", "Vt", "Node_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "node", "\\u", "objs_", "(_", "node", "\\u", "elems_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nodes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "node", "\\u", "elem_", "in_", "node", "\\u", "elems_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node_", "=_", "Node_", "(_", "node", "\\u", "elem_", "._", "attrib_", ",_", "node", "\\u", "elem_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nodes_", "._", "append_", "(_", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "component", "\\u", "id", "'_", "in_", "node", "\\u", "elem_", "._", "attrib_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node_", "[_", "'", "authori", "ty", "\\u", "id", "'_", "]_", "=_", "Xr", "n_", "(_", "node", "\\u", "elem_", "._", "attrib_", "[_", "'", "component", "\\u", "id", "'_", "]_", ")_", "._", "get", "\\u", "authori", "ty", "\\u", "urn_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "hard", "ware", " ", "types_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "hard", "ware", "\\u", "type", "\\u", "elems_", "=_", "node", "\\u", "elem_", "._", "xpath_", "(_", "'./", "hard", "ware", "\\u", "type", " ", "|", " ", "./", "default", ":", "hard", "ware", "\\u", "type", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node_", "[_", "'", "hard", "ware", "\\u", "types", "'_", "]_", "=_", "[_", "hw", "\\u", "type_", "._", "get", "\\u", "instance_", "(_", "Hard", "ware", "Type_", ")_", "for_", "hw", "\\u", "type_", "in_", "hard", "ware", "\\u", "type", "\\u", "elems_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "location_", "\\u\\u\\uNL\\u\\u\\u_", "location", "\\u", "elems_", "=_", "node", "\\u", "elem_", "._", "xpath_", "(_", "'./", "location", " ", "|", " ", "./", "default", ":", "location", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "locations_", "=_", "[_", "location", "\\u", "elem_", "._", "get", "\\u", "instance_", "(_", "Location_", ")_", "for_", "location", "\\u", "elem_", "in_", "location", "\\u", "elems_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "locations_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node_", "[_", "'", "location", "'_", "]_", "=_", "locations_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "interfaces_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ifa", "ce", "\\u", "elems_", "=_", "node", "\\u", "elem_", "._", "xpath_", "(_", "'./", "interface", " ", "|", " ", "./", "default", ":", "interface", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node_", "[_", "'", "interface", "s", "'_", "]_", "=_", "[_", "ifa", "ce", "\\u", "elem_", "._", "get", "\\u", "instance_", "(_", "Interface_", ")_", "for_", "ifa", "ce", "\\u", "elem_", "in_", "ifa", "ce", "\\u", "elems_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "services_", "\\u\\u\\uNL\\u\\u\\u_", "service", "\\u", "elems_", "=_", "node", "\\u", "elem_", "._", "xpath_", "(_", "'./", "service", "s", " ", "|", " ", "./", "default", ":", "service", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "service", "\\u", "elems_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " ", "\t_", "node_", "[_", "'", "service", "s", "'_", "]_", "=_", "PG", "v2", "Services_", "._", "get", "\\u", "services_", "(_", "node", "\\u", "elem_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "sli", "vers_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sli", "ver", "\\u", "elems_", "=_", "node", "\\u", "elem_", "._", "xpath_", "(_", "'./", "sli", "ver", " ", "|", " ", "./", "default", ":", "sli", "vers", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sli", "ver", "\\u", "elems_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node_", "[_", "'", "sli", "vers", "'_", "]_", "=_", "Oc", "f", "Vt", "Sli", "vers_", "._", "get", "\\u", "sli", "vers_", "(_", "sli", "ver", "\\u", "elems_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "avail", "able", "\\u", "elems_", "=_", "node", "\\u", "elem_", "._", "xpath_", "(_", "'./", "avail", "able", " ", "|", " ", "./", "default", ":", "avail", "able", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "avail", "able", "\\u", "elems_", ")_", ">_", "0_", "and_", "'", "name", "'_", "in_", "avail", "able", "\\u", "elems_", "[_", "0_", "]_", "._", "attrib_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "avail", "able", "\\u", "elems_", "[_", "0_", "]_", "._", "attrib_", "._", "get_", "(_", "'", "now", "'_", ",_", "''_", ")_", "._", "lower_", "(_", ")_", "==_", "'", "true", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "node_", "[_", "'", "boot", "\\u", "state", "'_", "]_", "=_", "'", "boot", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "node_", "[_", "'", "boot", "\\u", "state", "'_", "]_", "=_", "'", "disable", "d", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "nodes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Oc", "f", "Vt", "Node_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "add", "\\u", "sli", "vers_", "(_", "xml_", ",_", "sli", "vers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "component", "\\u", "ids_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "sli", "ver_", "in_", "sli", "vers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filter_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "sli", "ver_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filter_", "[_", "'", "component", "\\u", "id", "'_", "]_", "=_", "'*", "%", "s", "*'_", "%_", "sli", "ver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sli", "ver_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "component", "\\u", "id", "'_", "in_", "sli", "ver_", "and_", "sli", "ver_", "[_", "'", "component", "\\u", "id", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filter_", "[_", "'", "component", "\\u", "id", "'_", "]_", "=_", "'*", "%", "s", "*'_", "%_", "sli", "ver_", "[_", "'", "component", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "filter_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "nodes_", "=_", "Oc", "f", "Vt", "Node_", "._", "get", "\\u", "nodes_", "(_", "xml_", ",_", "filter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "nodes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "node_", "=_", "nodes_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PG", "v2", "Sli", "ver", "Type_", "._", "add", "\\u", "sli", "vers_", "(_", "node_", ",_", "sli", "ver_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Oc", "f", "Vt", "Node_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "remove", "\\u", "sli", "vers_", "(_", "xml_", ",_", "hostnames", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "hostname_", "in_", "hostnames", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nodes_", "=_", "Oc", "f", "Vt", "Node_", "._", "get", "\\u", "nodes_", "(_", "xml_", ",_", "{_", "'", "component", "\\u", "id", "'_", ":_", "'*", "%", "s", "*'_", "%_", "hostname_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "node_", "in_", "nodes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sli", "vers_", "=_", "Oc", "f", "Vt", "Sli", "ver", "Type_", "._", "get", "\\u", "sli", "vers_", "(_", "node_", "._", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "sli", "ver_", "in_", "sli", "vers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "node_", "._", "element_", "._", "remove_", "(_", "sli", "ver_", "._", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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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 ]
Module is imported more than once
neuropoly/spinalcordtoolbox/testing/test_sct_propseg.py
[ { "content": "#!/usr/bin/env python\n#########################################################################################\n#\n# Test function sct_propseg\n#\n# ---------------------------------------------------------------------------------------\n# Copyright (c) 2014 Polytechnique Montreal <www.neuro.polymtl.ca>\n# Author: Augustin Roux\n# modified: 2014/10/09\n#\n# About the license: see the file LICENSE.TXT\n#########################################################################################\n\nimport sct_utils as sct\nimport commands\nimport sct_propseg\nfrom msct_parser import Parser\nfrom pandas import DataFrame\nimport os.path\nimport time, random\nfrom copy import deepcopy\n\n\n\n\nif __name__ == \"__main__\":\n # call main function\n test()", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def test(path_data='', parameters=''):\n verbose = 0\n\n # parameters\n if not parameters:\n parameters = '-i t2/t2.nii.gz -c t2'\n\n dice_threshold = 0.95\n\n parser = sct_propseg.get_parser()\n dict_param = parser.parse(parameters.split(), check_file_exist=False)\n dict_param_with_path = parser.add_path_to_file(deepcopy(dict_param), path_data, input_file=True)\n param_with_path = parser.dictionary_to_string(dict_param_with_path)\n\n # Check if input files exist\n if not (os.path.isfile(dict_param_with_path['-i'])):\n status = 200\n output = 'ERROR: the file(s) provided to test function do not exist in folder: ' + path_data\n return status, output, DataFrame(\n data={'status': status, 'output': output, 'dice_segmentation': float('nan')}, index=[path_data])\n\n contrast_folder = ''\n input_filename = ''\n if dict_param['-i'][0] == '/':\n dict_param['-i'] = dict_param['-i'][1:]\n input_split = dict_param['-i'].split('/')\n if len(input_split) == 2:\n contrast_folder = input_split[0] + '/'\n input_filename = input_split[1]\n else:\n input_filename = input_split[0]\n if not contrast_folder: # if no contrast folder, send error.\n status = 201\n output = 'ERROR: when extracting the contrast folder from input file in command line: ' + dict_param[\n '-i'] + ' for ' + path_data\n return status, output, DataFrame(\n data={'status': status, 'output': output, 'dice_segmentation': float('nan')}, index=[path_data])\n\n import time, random\n subject_folder = path_data.split('/')\n if subject_folder[-1] == '' and len(subject_folder) > 1:\n subject_folder = subject_folder[-2]\n else:\n subject_folder = subject_folder[-1]\n path_output = sct.slash_at_the_end('sct_propseg_' + subject_folder + '_' + time.strftime(\"%y%m%d%H%M%S\") + '_' + str(random.randint(1, 1000000)), slash=1)\n param_with_path += ' -ofolder ' + path_output\n\n # run command\n cmd = 'sct_propseg ' + param_with_path\n output = '\\n====================================================================================================\\n'\\\n + cmd + \\\n '\\n====================================================================================================\\n\\n' # copy command\n time_start = time.time()\n status, o = sct.run(cmd, verbose)\n output += o\n duration = time.time() - time_start\n\n # extract name of manual segmentation\n # by convention, manual segmentation are called inputname_seg_manual.nii.gz where inputname is the filename\n # of the input image\n segmentation_filename = path_output + sct.add_suffix(input_filename, '_seg')\n manual_segmentation_filename = path_data + contrast_folder + sct.add_suffix(input_filename, '_seg_manual')\n\n dice_segmentation = float('nan')\n\n # if command ran without error, test integrity\n if status == 0:\n # compute dice coefficient between generated image and image from database\n cmd = 'sct_dice_coefficient -i ' + segmentation_filename + ' -d ' + manual_segmentation_filename\n status, output = sct.run(cmd, verbose)\n # parse output and compare to acceptable threshold\n dice_segmentation = float(output.split('3D Dice coefficient = ')[1].split('\\n')[0])\n if dice_segmentation < dice_threshold:\n status = 99\n\n # transform results into Pandas structure\n results = DataFrame(data={'status': status, 'output': output, 'dice_segmentation': dice_segmentation, 'duration [s]': duration}, index=[path_data])\n\n return status, output, results", "metadata": "root.test", "header": "['module', '___EOS___']", "index": 23 } ]
[ { "span": "import time, random", "start_line": 61, "start_column": 4, "end_line": 61, "end_column": 23 } ]
[ { "span": "import time, random", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 19 } ]
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_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "function", " ", "sct", "\\u", "props", "eg_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2014", " ", "Poly", "technique", " ", "Mont", "real", " ", "<", "www", ".", "neuro", ".", "poly", "mt", "l", ".", "ca", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Author", ":", " ", "August", "in", " ", "Rou", "x_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "modifi", "ed", ":", " ", "2014", "/", "10", "/", "09_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Abo", "ut", " ", "the", " ", "license", ":", " ", "see", " ", "the", " ", "file", " ", "LICENSE", ".", "TXT", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sct", "\\u", "utils_", "as_", "sct", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "commands_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sct", "\\u", "props", "eg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "msc", "t", "\\u", "parser_", "import_", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pandas_", "import_", "Data", "Frame_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "._", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", ",_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "copy_", "import_", "deepcopy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "#", " ", "call", " ", "main", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test_", "(_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test_", "(_", "path", "\\u", "data_", "=_", "''_", ",_", "parameters_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "verbose_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "parameters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parameters_", "=_", "'-", "i", " ", "t2", "/", "t2", ".", "ni", "i", ".", "gz", " ", "-", "c", " ", "t2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dice", "\\u", "threshold_", "=_", "0.95_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "=_", "sct", "\\u", "props", "eg_", "._", "get", "\\u", "parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dict", "\\u", "param_", "=_", "parser_", "._", "parse_", "(_", "parameters_", "._", "split_", "(_", ")_", ",_", "check", "\\u", "file", "\\u", "exist_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dict", "\\u", "param", "\\u", "with", "\\u", "path_", "=_", "parser_", "._", "add", "\\u", "path", "\\u", "to", "\\u", "file_", "(_", "deepcopy_", "(_", "dict", "\\u", "param_", ")_", ",_", "path", "\\u", "data_", ",_", "input", "\\u", "file_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "with", "\\u", "path_", "=_", "parser_", "._", "dictionar", "y", "\\u", "to", "\\u", "string_", "(_", "dict", "\\u", "param", "\\u", "with", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "if", " ", "input", " ", "files", " ", "exist_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "(_", "os_", "._", "path_", "._", "isfile_", "(_", "dict", "\\u", "param", "\\u", "with", "\\u", "path_", "[_", "'-", "i", "'_", "]_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "status_", "=_", "200_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output_", "=_", "'", "ERROR", ":", " ", "the", " ", "file", "(", "s", ")", " ", "provided", " ", "to", " ", "test", " ", "function", " ", "do", " ", "not", " ", "exist", " ", "in", " ", "folder", ":", " ", "'_", "+_", "path", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "status_", ",_", "output_", ",_", "Data", "Frame_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "status", "'_", ":_", "status_", ",_", "'", "output", "'_", ":_", "output_", ",_", "'", "dice", "\\u", "segmentation", "'_", ":_", "float_", "(_", "'", "nan", "'_", ")_", "}_", ",_", "index_", "=_", "[_", "path", "\\u", "data_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "contrast", "\\u", "folder_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input", "\\u", "filename_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "dict", "\\u", "param_", "[_", "'-", "i", "'_", "]_", "[_", "0_", "]_", "==_", "'/'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dict", "\\u", "param_", "[_", "'-", "i", "'_", "]_", "=_", "dict", "\\u", "param_", "[_", "'-", "i", "'_", "]_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "input", "\\u", "split_", "=_", "dict", "\\u", "param_", "[_", "'-", "i", "'_", "]_", "._", "split_", "(_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "input", "\\u", "split_", ")_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "contrast", "\\u", "folder_", "=_", "input", "\\u", "split_", "[_", "0_", "]_", "+_", "'/'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input", "\\u", "filename_", "=_", "input", "\\u", "split_", "[_", "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 ", " _", "input", "\\u", "filename_", "=_", "input", "\\u", "split_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "contrast", "\\u", "folder_", ":_", "#", " ", "if", " ", "no", " ", "contrast", " ", "folder", ",", " ", "send", " ", "error", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "status_", "=_", "201_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output_", "=_", "'", "ERROR", ":", " ", "whe", "n", " ", "extracti", "ng", " ", "the", " ", "contrast", " ", "folder", " ", "from", " ", "input", " ", "file", " ", "in", " ", "command", " ", "line", ":", " ", "'_", "+_", "dict", "\\u", "param_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'-", "i", "'_", "]_", "+_", "'", " ", "for", " ", "'_", "+_", "path", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "status_", ",_", "output_", ",_", "Data", "Frame_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "status", "'_", ":_", "status_", ",_", "'", "output", "'_", ":_", "output_", ",_", "'", "dice", "\\u", "segmentation", "'_", ":_", "float_", "(_", "'", "nan", "'_", ")_", "}_", ",_", "index_", "=_", "[_", "path", "\\u", "data_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "time_", ",_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subject", "\\u", "folder_", "=_", "path", "\\u", "data_", "._", "split_", "(_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "subject", "\\u", "folder_", "[_", "-_", "1_", "]_", "==_", "''_", "and_", "len_", "(_", "subject", "\\u", "folder_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subject", "\\u", "folder_", "=_", "subject", "\\u", "folder_", "[_", "-_", "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 ", " _", "subject", "\\u", "folder_", "=_", "subject", "\\u", "folder_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "path", "\\u", "output_", "=_", "sct", "_", "._", "slash", "\\u", "at", "\\u", "the", "\\u", "end_", "(_", "'", "sct", "\\u", "props", "eg", "\\u'_", "+_", "subject", "\\u", "folder_", "+_", "'\\u'_", "+_", "time_", "._", "strftime_", "(_", "\"%", "y", "%", "m", "%", "d", "%", "H", "%", "M", "%", "S", "\"_", ")_", "+_", "'\\u'_", "+_", "str_", "(_", "random_", "._", "randint_", "(_", "1_", ",_", "1000000_", ")_", ")_", ",_", "slash_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "with", "\\u", "path_", "+=_", "'", " ", "-", "of", "older", " ", "'_", "+_", "path", "\\u", "output_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "run", " ", "command_", "\\u\\u\\uNL\\u\\u\\u_", "cmd_", "=_", "'", "sct", "\\u", "props", "eg", " ", "'_", "+_", "param", "\\u", "with", "\\u", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output_", "=_", "'\\\\", "n", "==============", "==============", "==============", "==============", "==============", "==============", "==============", "==", "\\\\", "n", "'_", "+_", "cmd_", "+_", "'\\\\", "n", "==============", "==============", "==============", "==============", "==============", "==============", "==============", "==", "\\\\", "n", "\\\\", "n", "'_", "#", " ", "copy", " ", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time", "\\u", "start_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", ",_", "o_", "=_", "sct", "_", "._", "run_", "(_", "cmd_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output_", "+=_", "o_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "duration_", "=_", "time_", "._", "time_", "(_", ")_", "-_", "time", "\\u", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "extract", " ", "name", " ", "of", " ", "manu", "al", " ", "segmentation_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "by", " ", "convention", ",", " ", "manu", "al", " ", "segmentation", " ", "are", " ", "call", "ed", " ", "input", "name", "\\u", "seg", "\\u", "manu", "al", ".", "ni", "i", ".", "gz", " ", "where", " ", "input", "name", " ", "is", " ", "the", " ", "filename_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "the", " ", "input", " ", "image_", "\\u\\u\\uNL\\u\\u\\u_", "segmentation", "\\u", "filename_", "=_", "path", "\\u", "output_", "+_", "sct", "_", "._", "add", "\\u", "suffix_", "(_", "input", "\\u", "filename_", ",_", "'\\u", "seg", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "manu", "al", "\\u", "segmentation", "\\u", "filename_", "=_", "path", "\\u", "data_", "+_", "contrast", "\\u", "folder_", "+_", "sct", "_", "._", "add", "\\u", "suffix_", "(_", "input", "\\u", "filename_", ",_", "'\\u", "seg", "\\u", "manu", "al", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dice", "\\u", "segmentation_", "=_", "float_", "(_", "'", "nan", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "command", " ", "ran", " ", "with", "out", " ", "error", ",", " ", "test", " ", "integrity", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "status_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "compute", " ", "dice", " ", "coefficient", " ", "bet", "ween", " ", "generat", "ed", " ", "image", " ", "and", " ", "image", " ", "from", " ", "database_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "'", "sct", "\\u", "dice", "\\u", "coefficient", " ", "-", "i", " ", "'_", "+_", "segmentation", "\\u", "filename_", "+_", "'", " ", "-", "d", " ", "'_", "+_", "manu", "al", "\\u", "segmentation", "\\u", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", ",_", "output_", "=_", "sct", "_", "._", "run_", "(_", "cmd_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "parse", " ", "output", " ", "and", " ", "compare", " ", "to", " ", "acceptabl", "e", " ", "threshold_", "\\u\\u\\uNL\\u\\u\\u_", "dice", "\\u", "segmentation_", "=_", "float_", "(_", "output_", "._", "split_", "(_", "'", "3", "D", " ", "Dic", "e", " ", "coefficient", " ", "=", " ", "'_", ")_", "[_", "1_", "]_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "dice", "\\u", "segmentation_", "<_", "dice", "\\u", "threshold_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "status_", "=_", "99_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "transform", " ", "results", " ", "int", "o", " ", "Pan", "das", " ", "structure_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "Data", "Frame_", "(_", "data_", "=_", "{_", "'", "status", "'_", ":_", "status_", ",_", "'", "output", "'_", ":_", "output_", ",_", "'", "dice", "\\u", "segmentation", "'_", ":_", "dice", "\\u", "segmentation_", ",_", "'", "duration", " ", "[", "s", "]'_", ":_", "duration_", "}_", ",_", "index_", "=_", "[_", "path", "\\u", "data_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "status_", ",_", "output_", ",_", "results_", "\\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, 3, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
WDR/WDR/lib/tests/wdrtest/manifest.py
[ { "content": " def testUpdateEnumWithInvalidValue(self):\n \"\"\"Attempting to assign invalid enum value to an attribute\"\"\"\n cell = getid1(\n '/Cell:%(cellName)s/'\n % topology\n )\n self.assertEquals(cell.cellDiscoveryProtocol, 'TCP')\n failure = 0\n try:\n importConfigurationManifest(\n 'wdrtest/manifests/basic/enum_attribute_invalid.wdrc', topology\n )\n failure = 1\n except:\n pass\n self.assertFalse(failure, 'should fail on invalid enum value')\n self.assertEquals(cell.cellDiscoveryProtocol, 'TCP')", "metadata": "root.BasicManifestImportTest.testUpdateEnumWithInvalidValue", "header": "['class', 'BasicManifestImportTest', '(', 'AbstractConfigTest', ')', ':', '___EOS___']", "index": 333 }, { "content": " def testFailOnInvalidType(self):\n \"\"\"Attempting use invalid object type\"\"\"\n failure = 0\n try:\n importConfigurationManifest(\n 'wdrtest/manifests/basic/fail_on_invalid_type.wdrc', topology\n )\n failure = 1\n except:\n pass\n self.assertFalse(failure, 'should fail on invalid type')", "metadata": "root.BasicManifestImportTest.testFailOnInvalidType", "header": "['class', 'BasicManifestImportTest', '(', 'AbstractConfigTest', ')', ':', '___EOS___']", "index": 351 }, { "content": " def testFailOnInvalidKey(self):\n \"\"\"Attempting use invalid object attribute in key\"\"\"\n failure = 0\n try:\n importConfigurationManifest(\n 'wdrtest/manifests/basic/fail_on_invalid_key.wdrc', topology\n )\n failure = 1\n except:\n pass\n self.assertFalse(failure, 'should fail on invalid key')", "metadata": "root.BasicManifestImportTest.testFailOnInvalidKey", "header": "['class', 'BasicManifestImportTest', '(', 'AbstractConfigTest', ')', ':', '___EOS___']", "index": 363 }, { "content": " def testFailOnInvalidAttribute(self):\n \"\"\"Attempting use invalid object attribute\"\"\"\n failure = 0\n try:\n importConfigurationManifest(\n 'wdrtest/manifests/basic/fail_on_invalid_attribute.wdrc',\n topology\n )\n failure = 1\n except:\n pass\n self.assertFalse(failure, 'should fail on invalid attribute')", "metadata": "root.BasicManifestImportTest.testFailOnInvalidAttribute", "header": "['class', 'BasicManifestImportTest', '(', 'AbstractConfigTest', ')', ':', '___EOS___']", "index": 375 }, { "content": " def test_non_unique_template(self):\n try:\n importConfigurationManifest(\n 'wdrtest/manifests/templates/non_unique_template.wdrc',\n topology\n )\n except:\n return\n self.fail('non-unique template name should raise exception')", "metadata": "root.TemplatesTest.test_non_unique_template", "header": "['class', 'TemplatesTest', '(', 'AbstractConfigTest', ')', ':', '___EOS___']", "index": 908 }, { "content": " def test_non_existent_template(self):\n try:\n importConfigurationManifest(\n 'wdrtest/manifests/templates/non_existent_template.wdrc',\n topology\n )\n except:\n return\n self.fail('non-unique template name should raise exception')", "metadata": "root.TemplatesTest.test_non_existent_template", "header": "['class', 'TemplatesTest', '(', 'AbstractConfigTest', ')', ':', '___EOS___']", "index": 926 } ]
[ { "span": "except:", "start_line": 346, "start_column": 8, "end_line": 346, "end_column": 15 }, { "span": "except:", "start_line": 359, "start_column": 8, "end_line": 359, "end_column": 15 }, { "span": "except:", "start_line": 371, "start_column": 8, "end_line": 371, "end_column": 15 }, { "span": "except:", "start_line": 384, "start_column": 8, "end_line": 384, "end_column": 15 }, { "span": "except:", "start_line": 914, "start_column": 8, "end_line": 914, "end_column": 15 }, { "span": "except:", "start_line": 932, "start_column": 8, "end_line": 932, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Basic", "Manifest", "Import", "Test_", "(_", "Abstract", "Config", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Update", "Enum", "With", "Inva", "lid", "Value_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Atte", "mpt", "ing", " ", "to", " ", "assign", " ", "invalid", " ", "enum", " ", "value", " ", "to", " ", "an", " ", "attribute", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cell_", "=_", "geti", "d1_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'/", "Cel", "l", ":", "%", "(", "cell", "Name", ")", "s", "/'_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "topology_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "cell_", "._", "cell", "Discover", "y", "Protocol_", ",_", "'", "TC", "P", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "failure_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import", "Configura", "tion", "Manifest", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "wd", "rte", "st", "/", "manifests", "/", "basic", "/", "enum", "\\u", "attribute", "\\u", "invalid", ".", "wd", "rc", "'_", ",_", "topology_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "failure_", "=_", "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 ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "failure_", ",_", "'", "shou", "ld", " ", "fail", " ", "on", " ", "invalid", " ", "enum", " ", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "cell_", "._", "cell", "Discover", "y", "Protocol_", ",_", "'", "TC", "P", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Manifest", "Import", "Test_", "(_", "Abstract", "Config", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Fail", "On", "Inva", "lid", "Type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Atte", "mpt", "ing", " ", "use", " ", "invalid", " ", "object", " ", "type", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "failure_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import", "Configura", "tion", "Manifest", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "wd", "rte", "st", "/", "manifests", "/", "basic", "/", "fail", "\\u", "on", "\\u", "invalid", "\\u", "type", ".", "wd", "rc", "'_", ",_", "topology_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "failure_", "=_", "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 ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "failure_", ",_", "'", "shou", "ld", " ", "fail", " ", "on", " ", "invalid", " ", "type", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Manifest", "Import", "Test_", "(_", "Abstract", "Config", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Fail", "On", "Inva", "lid", "Key_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Atte", "mpt", "ing", " ", "use", " ", "invalid", " ", "object", " ", "attribute", " ", "in", " ", "key", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "failure_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import", "Configura", "tion", "Manifest", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "wd", "rte", "st", "/", "manifests", "/", "basic", "/", "fail", "\\u", "on", "\\u", "invalid", "\\u", "key", ".", "wd", "rc", "'_", ",_", "topology_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "failure_", "=_", "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 ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "failure_", ",_", "'", "shou", "ld", " ", "fail", " ", "on", " ", "invalid", " ", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Manifest", "Import", "Test_", "(_", "Abstract", "Config", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Fail", "On", "Inva", "lid", "Attribute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Atte", "mpt", "ing", " ", "use", " ", "invalid", " ", "object", " ", "attribute", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "failure_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import", "Configura", "tion", "Manifest", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "wd", "rte", "st", "/", "manifests", "/", "basic", "/", "fail", "\\u", "on", "\\u", "invalid", "\\u", "attribute", ".", "wd", "rc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "topology_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "failure_", "=_", "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 ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "failure_", ",_", "'", "shou", "ld", " ", "fail", " ", "on", " ", "invalid", " ", "attribute", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Templa", "tes", "Test_", "(_", "Abstract", "Config", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "non", "\\u", "unique", "\\u", "template_", "(_", "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 ", " _", "import", "Configura", "tion", "Manifest", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "wd", "rte", "st", "/", "manifests", "/", "template", "s", "/", "non", "\\u", "unique", "\\u", "template", ".", "wd", "rc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "topology_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "fail_", "(_", "'", "non", "-", "unique", " ", "template", " ", "name", " ", "shou", "ld", " ", "raise", " ", "exception", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Templa", "tes", "Test_", "(_", "Abstract", "Config", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "non", "\\u", "existen", "t", "\\u", "template_", "(_", "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 ", " _", "import", "Configura", "tion", "Manifest", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "wd", "rte", "st", "/", "manifests", "/", "template", "s", "/", "non", "\\u", "existen", "t", "\\u", "template", ".", "wd", "rc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "topology_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "fail_", "(_", "'", "non", "-", "unique", " ", "template", " ", "name", " ", "shou", "ld", " ", "raise", " ", "exception", "'_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
darknessomi/musicbox/NEMbox/storage.py
[ { "content": " def load(self):\n try:\n self.file = file(self.storage_path, 'r')\n self.database = json.loads(self.file.read())\n self.file.close()\n except:\n self.__init__()\n if not self.check_version():\n self.save()", "metadata": "root.Storage.load", "header": "['class', 'Storage', '(', 'Singleton', ')', ':', '___EOS___']", "index": 81 } ]
[ { "span": "except:", "start_line": 86, "start_column": 8, "end_line": 86, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Storage_", "(_", "Singleton_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load_", "(_", "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 ", " _", "self_", "._", "file_", "=_", "file_", "(_", "self_", "._", "storage", "\\u", "path_", ",_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "database_", "=_", "json_", "._", "loads_", "(_", "self_", "._", "file_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "file_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "self_", "._", "check", "\\u", "version_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "save_", "(_", ")_", "\\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, 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 ]
`__eq__` not overridden when adding attributes
mne-tools/mne-python/mne/io/constants.py
[ { "content": "class Bunch(dict):\n \"\"\" Container object for datasets: dictionnary-like object that\n exposes its keys as attributes.\n \"\"\"\n", "metadata": "root.Bunch", "header": "['module', '___EOS___']", "index": 6 }, { "content": " def __init__(self, **kwargs):\n dict.__init__(self, kwargs)\n self.__dict__ = self", "metadata": "root.Bunch.__init__", "header": "['class', 'Bunch', '(', 'dict', ')', ':', '___EOS___']", "index": 11 } ]
[ { "span": "class Bunch(dict):", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 18 } ]
[ { "span": "self.__dict__ ", "start_line": 13, "start_column": 8, "end_line": 13, "end_column": 21 } ]
1
false
[ "[CLS]_", "`_", "\\u\\u", "eq\\u\\u_", "`_", "not_", "overrid", "den_", "when_", "addin", "g_", "attributes_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Bun", "ch_", "(_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Containe", "r", " ", "object", " ", "for", " ", "dataset", "s", ":", " ", "diction", "nary", "-", "like", " ", "object", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "expos", "es", " ", "its", " ", "keys", " ", "as", " ", "attribute", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Bun", "ch_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dict_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "dict\\u\\u_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 3, 1, 1, 1, 2, 2, 2 ]
Unused local variable
chrisdembia/agent-bicycle/randlov1998/tasks_old.py
[ { "content": " def getObservation(self):\n (theta, thetad, omega, omegad, omegadd,\n xf, yf, xb, yb, psi, psig) = self.env.getSensors()\n # TODO not calling superclass to do normalization, etc.\n return self.env.getSensors()[0:5]", "metadata": "root.BalanceTask.getObservation", "header": "['class', 'BalanceTask', '(', 'pybrain', '.', 'rl', '.', 'environments', '.', 'EpisodicTask', ')', ':', '___EOS___']", "index": 98 } ]
[ { "span": "theta,", "start_line": 99, "start_column": 9, "end_line": 99, "end_column": 14 }, { "span": "thetad,", "start_line": 99, "start_column": 16, "end_line": 99, "end_column": 22 }, { "span": "omega,", "start_line": 99, "start_column": 24, "end_line": 99, "end_column": 29 }, { "span": "omegad,", "start_line": 99, "start_column": 31, "end_line": 99, "end_column": 37 }, { "span": "omegadd,", "start_line": 99, "start_column": 39, "end_line": 99, "end_column": 46 }, { "span": "xf,", "start_line": 100, "start_column": 16, "end_line": 100, "end_column": 18 }, { "span": "yf,", "start_line": 100, "start_column": 20, "end_line": 100, "end_column": 22 }, { "span": "xb,", "start_line": 100, "start_column": 24, "end_line": 100, "end_column": 26 }, { "span": "yb,", "start_line": 100, "start_column": 28, "end_line": 100, "end_column": 30 }, { "span": "psi,", "start_line": 100, "start_column": 32, "end_line": 100, "end_column": 35 }, { "span": "psig)", "start_line": 100, "start_column": 37, "end_line": 100, "end_column": 41 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Balance", "Task_", "(_", "pyb", "rain_", "._", "rl_", "._", "environments_", "._", "Episod", "ic", "Task_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Observation", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "theta_", ",_", "theta", "d_", ",_", "omega_", ",_", "omega", "d_", ",_", "omega", "dd_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "xf_", ",_", "yf", "_", ",_", "xb_", ",_", "yb", "_", ",_", "psi_", ",_", "psi", "g_", ")_", "=_", "self_", "._", "env_", "._", "get", "Sensors", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", " ", "not", " ", "calling", " ", "superclass", " ", "to", " ", "do", " ", "normaliza", "tion", ",", " ", "etc", "._", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "env_", "._", "get", "Sensors", "_", "(_", ")_", "[_", "0_", ":_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 1, 2, 0, 2, 0, 1, 2, 0, 1, 2, 2, 0, 2, 0, 1, 2, 0, 2, 0, 1, 2, 0, 2, 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 ]
Except block handles 'BaseException'
scikit-learn/scikit-learn/sklearn/externals/joblib/logger.py
[ { "content": " def __init__(self, logfile=None, logdir=None):\n if logfile is not None and logdir is not None:\n raise ValueError('Cannot specify both logfile and logdir')\n # XXX: Need argument docstring\n self.last_time = time.time()\n self.start_time = self.last_time\n if logdir is not None:\n logfile = os.path.join(logdir, 'joblib.log')\n self.logfile = logfile\n if logfile is not None:\n mkdirp(os.path.dirname(logfile))\n if os.path.exists(logfile):\n # Rotate the logs\n for i in range(1, 9):\n try:\n shutil.move(logfile + '.%i' % i,\n logfile + '.%i' % (i + 1))\n except:\n \"No reason failing here\"\n # Use a copy rather than a move, so that a process\n # monitoring this file does not get lost.\n try:\n shutil.copy(logfile, logfile + '.1')\n except:\n \"No reason failing here\"\n try:\n with open(logfile, 'w') as logfile:\n logfile.write('\\nLogging joblib python script\\n')\n logfile.write('\\n---%s---\\n' % time.ctime(self.last_time))\n except:\n \"\"\" Multiprocessing writing to files can create race\n conditions. Rather fail silently than crash the\n computation.\n \"\"\"\n # XXX: We actually need a debug flag to disable this\n # silent failure.", "metadata": "root.PrintTime.__init__", "header": "['class', 'PrintTime', '(', 'object', ')', ':', '___EOS___']", "index": 95 }, { "content": " def __call__(self, msg='', total=False):\n \"\"\" Print the time elapsed between the last call and the current\n call, with an optional message.\n \"\"\"\n if not total:\n time_lapse = time.time() - self.last_time\n full_msg = \"%s: %s\" % (msg, format_time(time_lapse))\n else:\n # FIXME: Too much logic duplicated\n time_lapse = time.time() - self.start_time\n full_msg = \"%s: %.2fs, %.1f min\" % (msg, time_lapse,\n time_lapse / 60)\n print(full_msg, file=sys.stderr)\n if self.logfile is not None:\n try:\n with open(self.logfile, 'a') as f:\n print(full_msg, file=f)\n except:\n \"\"\" Multiprocessing writing to files can create race\n conditions. Rather fail silently than crash the\n calculation.\n \"\"\"\n # XXX: We actually need a debug flag to disable this\n # silent failure.\n self.last_time = time.time()", "metadata": "root.PrintTime.__call__", "header": "['class', 'PrintTime', '(', 'object', ')', ':', '___EOS___']", "index": 132 } ]
[ { "span": "except:", "start_line": 112, "start_column": 20, "end_line": 112, "end_column": 27 }, { "span": "except:", "start_line": 118, "start_column": 16, "end_line": 118, "end_column": 23 }, { "span": "except:", "start_line": 124, "start_column": 12, "end_line": 124, "end_column": 19 }, { "span": "except:", "start_line": 149, "start_column": 12, "end_line": 149, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Print", "Time_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "logfile_", "=_", "None_", ",_", "logdir_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "logfile_", "is_", "not_", "None_", "and_", "logdir_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "Cann", "ot", " ", "speci", "fy", " ", "bot", "h", " ", "logfile", " ", "and", " ", "logdi", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "XX", "X", ":", " ", "Ne", "ed", " ", "argu", "ment", " ", "docstring_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "last", "\\u", "time_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "start", "\\u", "time_", "=_", "self_", "._", "last", "\\u", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "logdir_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logfile_", "=_", "os_", "._", "path_", "._", "join_", "(_", "logdir_", ",_", "'", "joblib", ".", "log", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "logfile_", "=_", "logfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "logfile_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mkd", "ir", "p_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "logfile_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "logfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Rotate", " ", "the", " ", "logs_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "range_", "(_", "1_", ",_", "9_", ")_", ":_", "\\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 ", " ", " _", "shutil_", "._", "move_", "(_", "logfile_", "+_", "'.", "%", "i", "'_", "%_", "i_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "logfile_", "+_", "'.", "%", "i", "'_", "%_", "(_", "i_", "+_", "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 ", " ", " _", "\"", "No", " ", "reason", " ", "faili", "ng", " ", "here", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Us", "e", " ", "a", " ", "copy", " ", "rat", "her", " ", "than", " ", "a", " ", "move", ",", " ", "so", " ", "tha", "t", " ", "a", " ", "process_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "monitorin", "g", " ", "this", " ", "file", " ", "doe", "s", " ", "not", " ", "get", " ", "lost", "._", "\\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 ", " ", "_", "shutil_", "._", "copy_", "(_", "logfile_", ",_", "logfile_", "+_", "'.", "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 ", " ", "_", "\"", "No", " ", "reason", " ", "faili", "ng", " ", "here", "\"_", "\\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 ", " _", "with_", "open_", "(_", "logfile_", ",_", "'", "w", "'_", ")_", "as_", "logfile_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "logfile_", "._", "write_", "(_", "'\\\\", "n", "Log", "ging", " ", "joblib", " ", "python", " ", "script", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logfile_", "._", "write_", "(_", "'\\\\", "n", "---", "%", "s", "---", "\\\\", "n", "'_", "%_", "time_", "._", "ctime_", "(_", "self_", "._", "last", "\\u", "time_", ")_", ")_", "\\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 ", " _", "\"\"\"", " ", "Multi", "process", "ing", " ", "writ", "ing", " ", "to", " ", "files", " ", "can", " ", "create", " ", "race", "\\", "10", ";", " ", " ", "condition", "s", ".", " ", "Rat", "her", " ", "fail", " ", "silently", " ", "than", " ", "crash", " ", "the", "\\", "10", ";", " ", " ", "computation", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "XX", "X", ":", " ", "We", " ", "actual", "ly", " ", "need", " ", "a", " ", "debug", " ", "flag", " ", "to", " ", "disable", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sile", "nt", " ", "fail", "ure", "._", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Print", "Time_", "(_", "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\\u", "call\\u\\u_", "(_", "self_", ",_", "msg_", "=_", "''_", ",_", "total_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Print", " ", "the", " ", "time", " ", "ela", "pse", "d", " ", "bet", "ween", " ", "the", " ", "last", " ", "call", " ", "and", " ", "the", " ", "current", "\\", "10", ";", " ", " ", " ", " ", "call", ",", " ", "with", " ", "an", " ", "option", "al", " ", "message", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "total_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time", "\\u", "lap", "se_", "=_", "time_", "._", "time_", "(_", ")_", "-_", "self_", "._", "last", "\\u", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "full", "\\u", "msg_", "=_", "\"%", "s", ":", " ", "%", "s", "\"_", "%_", "(_", "msg_", ",_", "format\\u", "time_", "(_", "time", "\\u", "lap", "se_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "FIX", "ME", ":", " ", "Too", " ", "muc", "h", " ", "logic", " ", "duplicated", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time", "\\u", "lap", "se_", "=_", "time_", "._", "time_", "(_", ")_", "-_", "self_", "._", "start", "\\u", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "full", "\\u", "msg_", "=_", "\"%", "s", ":", " ", "%", ".2", "fs", ",", " ", "%", ".1", "f", " ", "min", "\"_", "%_", "(_", "msg_", ",_", "time", "\\u", "lap", "se_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "time", "\\u", "lap", "se_", "/_", "60_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "full", "\\u", "msg_", ",_", "file_", "=_", "sys_", "._", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logfile_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "self_", "._", "logfile_", ",_", "'", "a", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "(_", "full", "\\u", "msg_", ",_", "file_", "=_", "f_", ")_", "\\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 ", " _", "\"\"\"", " ", "Multi", "process", "ing", " ", "writ", "ing", " ", "to", " ", "files", " ", "can", " ", "create", " ", "race", "\\", "10", ";", " ", " ", "condition", "s", ".", " ", "Rat", "her", " ", "fail", " ", "silently", " ", "than", " ", "crash", " ", "the", "\\", "10", ";", " ", " ", "calculati", "on", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "XX", "X", ":", " ", "We", " ", "actual", "ly", " ", "need", " ", "a", " ", "debug", " ", "flag", " ", "to", " ", "disable", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sile", "nt", " ", "fail", "ure", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "last", "\\u", "time_", "=_", "time_", "._", "time_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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 ]
Unused import
linkedin/Zopkio/examples/server_client/test_suites/multiple_iteration_test3.py
[ { "content": "# Copyright 2015 LinkedIn Corp.\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n\nimport os\nimport time\n\nimport perf\nimport zopkio.runtime as runtime\nimport zopkio.test_utils as testutilities\n\n\nSMALL_SAMPLE = create_sample(3)\nMEDIUM_SAMPLE = create_sample(100)\nLARGE_SAMPLE = create_sample(1000)\ntest_phase = 3\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def create_sample(n):\n sample_list = []\n for i in xrange(1,n+1):\n sample_list.append(i)\n return sample_list", "metadata": "root.create_sample", "header": "['module', '___EOS___']", "index": 26 }, { "content": "def test_single_client_perf():\n \"\"\"\n Tests the performance of a server when handling single client\n \"\"\"\n #Leaving the print for proof of order\n print \"test_single_client_perf\"\n client_deployer = runtime.get_deployer(\"AdditionClient\")\n client_deployer.start(\"client1\", configs={\"args\": \"localhost 8000\".split() + MEDIUM_SAMPLE, \"sync\": True})", "metadata": "root.test_single_client_perf", "header": "['module', '___EOS___']", "index": 37 }, { "content": "def validate_single_client_perf():\n \"\"\"\n Validate server max qps is >100 and mean latency is <0.2 sec\n \"\"\"\n print \"validate_single_client_perf\"\n metrics = runtime.get_active_test_metrics(\"test_single_client_perf\")\n assert metrics[\"server1-perf\"][\"qps\"][\"max\"] > 100, \"qps too low\"\n assert metrics[\"server1-perf\"][\"latency\"][\"max\"] < 0.2, \"latency too high\"", "metadata": "root.validate_single_client_perf", "header": "['module', '___EOS___']", "index": 47 } ]
[ { "span": "import os", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 9 }, { "span": "import time", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 11 }, { "span": "import perf", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 11 }, { "span": "import zopkio.test_utils as testutilities", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 41 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "201", "5", " ", "Linke", "d", "In", " ", "Cor", "p", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "to", " ", "the", " ", "Ap", "ache", " ", "Sof", "twa", "re", " ", "Foun", "dati", "on", " ", "(", "AS", "F", ")", " ", "under", " ", "one_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "or", " ", "more", " ", "contributor", " ", "license", " ", "agreement", "s", ".", " ", " ", "See", " ", "the", " ", "NOTICE", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "with", " ", "this", " ", "work", " ", "for", " ", "addition", "al", " ", "information_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "regarding", " ", "copyr", "ight", " ", "owner", "ship", ".", " ", " ", "The", " ", "AS", "F", " ", "license", "s", " ", "this", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "you", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "License", "\");", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "ance_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "the", " ", "License", ".", " ", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "software", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", ".", " ", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and", " ", "limit", "ations_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "perf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "zop", "ki", "o_", "._", "runtime_", "as_", "runtime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "zop", "ki", "o_", "._", "test\\u", "utils_", "as_", "testu", "tili", "ties_", "\\u\\u\\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_", "SMALL", "\\u", "SAMPLE", "_", "=_", "create", "\\u", "sample_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "MEDIUM", "\\u", "SAMPLE", "_", "=_", "create", "\\u", "sample_", "(_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LARGE", "\\u", "SAMPLE", "_", "=_", "create", "\\u", "sample_", "(_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "phase_", "=_", "3_", "\\u\\u\\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_", "create", "\\u", "sample_", "(_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sample", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "1_", ",_", "n_", "+_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sample", "\\u", "list_", "._", "append_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "sample", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "single", "\\u", "client", "\\u", "perf_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Test", "s", " ", "the", " ", "perform", "anc", "e", " ", "of", " ", "a", " ", "server", " ", "whe", "n", " ", "handling", " ", "single", " ", "client", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Leav", "ing", " ", "the", " ", "print", " ", "for", " ", "proof", " ", "of", " ", "order_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"", "test\\u", "single", "\\u", "client", "\\u", "perf", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client", "\\u", "deploye", "r_", "=_", "runtime_", "._", "get", "\\u", "deploye", "r_", "(_", "\"", "Addition", "Client", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client", "\\u", "deploye", "r_", "._", "start_", "(_", "\"", "client", "1", "\"_", ",_", "configs_", "=_", "{_", "\"", "args", "\"_", ":_", "\"", "local", "host", " ", "800", "0", "\"_", "._", "split_", "(_", ")_", "+_", "MEDIUM", "\\u", "SAMPLE", "_", ",_", "\"", "sync", "\"_", ":_", "True_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validat", "e\\u", "single", "\\u", "client", "\\u", "perf_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Validate", " ", "server", " ", "max", " ", "qp", "s", " ", "is", " ", ">", "100", " ", "and", " ", "mean", " ", "latenc", "y", " ", "is", " ", "<", "0.", "2", " ", "sec", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "validat", "e\\u", "single", "\\u", "client", "\\u", "perf", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metrics_", "=_", "runtime_", "._", "get", "\\u", "active", "\\u", "test\\u", "metrics_", "(_", "\"", "test\\u", "single", "\\u", "client", "\\u", "perf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "metrics_", "[_", "\"", "server", "1", "-", "perf", "\"_", "]_", "[_", "\"", "qp", "s", "\"_", "]_", "[_", "\"", "max", "\"_", "]_", ">_", "100_", ",_", "\"", "qp", "s", " ", "too", " ", "low", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "metrics_", "[_", "\"", "server", "1", "-", "perf", "\"_", "]_", "[_", "\"", "latenc", "y", "\"_", "]_", "[_", "\"", "max", "\"_", "]_", "<_", "0.2_", ",_", "\"", "latenc", "y", " ", "too", " ", "high", "\"_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
AppScale/appscale/AppServer/google/appengine/ext/django/main.py
[ { "content": "#!/usr/bin/env python\n#\n# Copyright 2007 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n\n\"\"\"Main handler script for running Django applications on App Engine.\"\"\"\n\n\n\n\n\n\n\n\n\n\nimport logging\nimport os\n\nfrom google.appengine.api import lib_config\n\n\n\n\n\n\n\n\n\n\n\n_config_handle = lib_config.register(\n 'django', {'settings_module': os.getenv('DJANGO_SETTINGS_MODULE',\n 'settings')})\nsettings_path = _config_handle.settings_module\n\nfrom google.appengine.ext.webapp import util\n\n\n\n\nos.environ['DJANGO_SETTINGS_MODULE'] = settings_path\n\nif os.environ.get('APPENGINE_RUNTIME') == 'python':\n\n\n import google.appengine.ext.webapp.template\nelse:\n\n try:\n import django\n except ImportError:\n msg = (\n 'django must be included in the \"libraries:\" clause of your app.yaml '\n 'file when using the django_wsgi builtin.')\n logging.error(msg)\n raise RuntimeError(msg)\n\nfrom django.core import management\nfrom django.core.handlers import wsgi\n\n\n\n\n\ntry:\n settings = __import__(settings_path)\n management.setup_environ(settings, original_settings_path=settings_path)\nexcept ImportError:\n\n\n\n pass\n\napp = wsgi.WSGIHandler()\n\n\n\n\nif __name__ == '__main__':\n main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def main():\n \"\"\"Main program. Run the Django WSGIApplication.\"\"\"\n util.run_wsgi_app(app)", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 90 } ]
[ { "span": "import google.appengine.ext.webapp.template", "start_line": 59, "start_column": 2, "end_line": 59, "end_column": 45 }, { "span": "import django", "start_line": 63, "start_column": 4, "end_line": 63, "end_column": 17 } ]
[]
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", " ", "2007", " ", "Goo", "gle", " ", "Inc", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Main", " ", "handler", " ", "script", " ", "for", " ", "runn", "ing", " ", "Dj", "ang", "o", " ", "applica", "tion", "s", " ", "on", " ", "App", " ", "Engine", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "api_", "import_", "lib", "\\u", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "config", "\\u", "handle_", "=_", "lib", "\\u", "config_", "._", "register_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "django", "'_", ",_", "{_", "'", "settings", "\\u", "module", "'_", ":_", "os_", "._", "getenv_", "(_", "'", "DJANGO", "\\u", "SETTING", "S", "\\u", "MODUL", "E", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "settings", "'_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "settings", "\\u", "path_", "=_", "\\u", "config", "\\u", "handle_", "._", "settings", "\\u", "module_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "ext_", "._", "webapp_", "import_", "util_", "\\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_", "os_", "._", "environ_", "[_", "'", "DJANGO", "\\u", "SETTING", "S", "\\u", "MODUL", "E", "'_", "]_", "=_", "settings", "\\u", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "os_", "._", "environ_", "._", "get_", "(_", "'", "APPEN", "GIN", "E", "\\u", "RUNT", "IME", "'_", ")_", "==_", "'", "python", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "google_", "._", "appengine_", "._", "ext_", "._", "webapp_", "._", "template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "django_", "\\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 ", " _", "msg_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "django", " ", "must", " ", "be", " ", "include", "d", " ", "in", " ", "the", " ", "\"", "librar", "ies", ":\"", " ", "clause", " ", "of", " ", "your", " ", "app", ".", "yaml", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "file", " ", "whe", "n", " ", "usi", "ng", " ", "the", " ", "django", "\\u", "wsgi", " ", "bui", "lti", "n", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Run", "time", "Error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "django_", "._", "core_", "import_", "management_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "handlers_", "import_", "wsgi_", "\\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_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "settings_", "=_", "\\u\\u", "import\\u\\u_", "(_", "settings", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "management_", "._", "setup", "\\u", "environ_", "(_", "settings_", ",_", "original", "\\u", "settings", "\\u", "path_", "=_", "settings", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "app_", "=_", "wsgi_", "._", "WS", "GI", "Handler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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 ", " _", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Main", " ", "program", ".", " ", "Run", " ", "the", " ", "Dj", "ang", "o", " ", "WS", "GI", "Applica", "tion", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "util_", "._", "run", "\\u", "wsgi", "\\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 ]
Unused local variable
ppwwyyxx/tensorpack/examples/svhn-digit-convnet.py
[ { "content": " def _get_cost(self, input_vars, is_training):\n image, label = input_vars\n keep_prob = tf.constant(0.5 if is_training else 1.0)\n\n image = image / 128.0 - 1\n\n l = Conv2D('conv1', image, 24, 5, padding='VALID')\n l = MaxPooling('pool1', l, 2, padding='SAME')\n l = Conv2D('conv2', l, 32, 3, padding='VALID')\n l = Conv2D('conv3', l, 32, 3, padding='VALID')\n l = MaxPooling('pool2', l, 2, padding='SAME')\n l = Conv2D('conv4', l, 64, 3, padding='VALID')\n\n l = tf.nn.dropout(l, keep_prob)\n l = FullyConnected('fc0', l, 512,\n b_init=tf.constant_initializer(0.1))\n # fc will have activation summary by default. disable for the output layer\n logits = FullyConnected('linear', l, out_dim=10, nl=tf.identity)\n prob = tf.nn.softmax(logits, name='output')\n\n cost = tf.nn.sparse_softmax_cross_entropy_with_logits(logits, label)\n cost = tf.reduce_mean(cost, name='cross_entropy_loss')\n tf.add_to_collection(MOVING_SUMMARY_VARS_KEY, cost)\n\n # compute the number of failed samples, for ClassificationError to use at test time\n wrong = prediction_incorrect(logits, label)\n nr_wrong = tf.reduce_sum(wrong, name='wrong')\n # monitor training error\n tf.add_to_collection(\n MOVING_SUMMARY_VARS_KEY, tf.reduce_mean(wrong, name='train_error'))\n\n # weight decay on all W of fc layers\n wd_cost = regularize_cost('fc.*/W', l2_regularizer(0.00001))\n tf.add_to_collection(MOVING_SUMMARY_VARS_KEY, wd_cost)\n\n add_param_summary([('.*/W', ['histogram', 'sparsity'])]) # monitor W\n return tf.add_n([cost, wd_cost], name='cost')", "metadata": "root.Model._get_cost", "header": "['class', 'Model', '(', 'ModelDesc', ')', ':', '___EOS___']", "index": 30 }, { "content": "def get_config():\n #anchors = np.mgrid[0:4,0:4][:,1:,1:].transpose(1,2,0).reshape((-1,2)) / 4.0\n # prepare dataset\n d1 = dataset.SVHNDigit('train')\n d2 = dataset.SVHNDigit('extra')\n train = RandomMixData([d1, d2])\n test = dataset.SVHNDigit('test')\n\n augmentors = [\n imgaug.Resize((40, 40)),\n imgaug.Brightness(30),\n imgaug.Contrast((0.5,1.5)),\n imgaug.GaussianDeform( # this is slow\n [(0.2, 0.2), (0.2, 0.8), (0.8,0.8), (0.8,0.2)],\n (40,40), 0.2, 3),\n ]\n train = AugmentImageComponent(train, augmentors)\n train = BatchData(train, 128)\n nr_proc = 5\n train = PrefetchData(train, 5, nr_proc)\n step_per_epoch = train.size()\n\n augmentors = [\n imgaug.Resize((40, 40)),\n ]\n test = AugmentImageComponent(test, augmentors)\n test = BatchData(test, 128, remainder=True)\n\n sess_config = get_default_sess_config(0.8)\n\n lr = tf.train.exponential_decay(\n learning_rate=1e-3,\n global_step=get_global_step_var(),\n decay_steps=train.size() * 60,\n decay_rate=0.2, staircase=True, name='learning_rate')\n tf.scalar_summary('learning_rate', lr)\n\n return TrainConfig(\n dataset=train,\n optimizer=tf.train.AdamOptimizer(lr),\n callbacks=Callbacks([\n StatPrinter(),\n ModelSaver(),\n InferenceRunner(dataset_test,\n [ScalarStats('cost'), ClassificationError()])\n ]),\n session_config=sess_config,\n model=Model(),\n step_per_epoch=step_per_epoch,\n max_epoch=350,\n )", "metadata": "root.get_config", "header": "['module', '___EOS___']", "index": 68 } ]
[ { "span": "prob ", "start_line": 48, "start_column": 8, "end_line": 48, "end_column": 12 }, { "span": "nr_wrong ", "start_line": 56, "start_column": 8, "end_line": 56, "end_column": 16 }, { "span": "test ", "start_line": 94, "start_column": 4, "end_line": 94, "end_column": 8 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Model_", "(_", "Model", "Desc_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "cost_", "(_", "self_", ",_", "input", "\\u", "vars_", ",_", "is", "\\u", "training_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "image_", ",_", "label_", "=_", "input", "\\u", "vars_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keep", "\\u", "prob_", "=_", "tf_", "._", "constant_", "(_", "0.5_", "if_", "is", "\\u", "training_", "else_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "image_", "=_", "image_", "/_", "128", ".0_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "l_", "=_", "Conv", "2", "D_", "(_", "'", "conv", "1", "'_", ",_", "image_", ",_", "24_", ",_", "5_", ",_", "padding_", "=_", "'", "VALID", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Max", "Pooling", "_", "(_", "'", "pool", "1", "'_", ",_", "l_", ",_", "2_", ",_", "padding_", "=_", "'", "SAM", "E", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Conv", "2", "D_", "(_", "'", "conv2", "'_", ",_", "l_", ",_", "32_", ",_", "3_", ",_", "padding_", "=_", "'", "VALID", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Conv", "2", "D_", "(_", "'", "conv3", "'_", ",_", "l_", ",_", "32_", ",_", "3_", ",_", "padding_", "=_", "'", "VALID", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Max", "Pooling", "_", "(_", "'", "pool", "2", "'_", ",_", "l_", ",_", "2_", ",_", "padding_", "=_", "'", "SAM", "E", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Conv", "2", "D_", "(_", "'", "conv", "4", "'_", ",_", "l_", ",_", "64_", ",_", "3_", ",_", "padding_", "=_", "'", "VALID", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "l_", "=_", "tf_", "._", "nn_", "._", "dropout_", "(_", "l_", ",_", "keep", "\\u", "prob_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Full", "y", "Connected_", "(_", "'", "fc", "0", "'_", ",_", "l_", ",_", "512_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "b", "\\u", "init_", "=_", "tf_", "._", "constant", "\\u", "initializer_", "(_", "0.1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "fc", " ", "will", " ", "have", " ", "activation", " ", "summar", "y", " ", "by", " ", "default", ".", " ", "disable", " ", "for", " ", "the", " ", "output", " ", "layer_", "\\u\\u\\uNL\\u\\u\\u_", "logits_", "=_", "Full", "y", "Connected_", "(_", "'", "linear", "'_", ",_", "l_", ",_", "out", "\\u", "dim_", "=_", "10_", ",_", "nl_", "=_", "tf_", "._", "identity_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "=_", "tf_", "._", "nn_", "._", "softmax_", "(_", "logits_", ",_", "name_", "=_", "'", "output", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cost_", "=_", "tf_", "._", "nn_", "._", "spars", "e\\u", "soft", "max", "\\u", "cross", "\\u", "entr", "opy", "\\u", "with", "\\u", "logits_", "(_", "logits_", ",_", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cost_", "=_", "tf_", "._", "reduce", "\\u", "mean_", "(_", "cost_", ",_", "name_", "=_", "'", "cross", "\\u", "entr", "opy", "\\u", "loss", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tf_", "._", "add", "\\u", "to", "\\u", "collection_", "(_", "MOVI", "NG", "\\u", "SUMMARY", "\\u", "VARS", "\\u", "KEY_", ",_", "cost_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "compute", " ", "the", " ", "number", " ", "of", " ", "fail", "ed", " ", "samples", ",", " ", "for", " ", "Classificat", "ion", "Error", " ", "to", " ", "use", " ", "at", " ", "test", " ", "time_", "\\u\\u\\uNL\\u\\u\\u_", "wrong", "_", "=_", "predicti", "on", "\\u", "incorrect", "_", "(_", "logits_", ",_", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nr", "\\u", "wrong", "_", "=_", "tf_", "._", "reduce", "\\u", "sum_", "(_", "wrong", "_", ",_", "name_", "=_", "'", "wrong", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "monit", "or", " ", "train", "ing", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "tf_", "._", "add", "\\u", "to", "\\u", "collection_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "MOVI", "NG", "\\u", "SUMMARY", "\\u", "VARS", "\\u", "KEY_", ",_", "tf_", "._", "reduce", "\\u", "mean_", "(_", "wrong", "_", ",_", "name_", "=_", "'", "train", "\\u", "error", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "weight", " ", "deca", "y", " ", "on", " ", "all", " ", "W", " ", "of", " ", "fc", " ", "layers_", "\\u\\u\\uNL\\u\\u\\u_", "wd", "\\u", "cost_", "=_", "regulari", "ze", "\\u", "cost_", "(_", "'", "fc", ".*", "/", "W", "'_", ",_", "l2", "\\u", "regularizer_", "(_", "0.00001", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tf_", "._", "add", "\\u", "to", "\\u", "collection_", "(_", "MOVI", "NG", "\\u", "SUMMARY", "\\u", "VARS", "\\u", "KEY_", ",_", "wd", "\\u", "cost_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "add", "\\u", "param", "\\u", "summary_", "(_", "[_", "(_", "'.*", "/", "W", "'_", ",_", "[_", "'", "histo", "gram", "'_", ",_", "'", "sparsity", "'_", "]_", ")_", "]_", ")_", "#", " ", "monit", "or", " ", "W_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "tf_", "._", "add", "\\u", "n_", "(_", "[_", "cost_", ",_", "wd", "\\u", "cost_", "]_", ",_", "name_", "=_", "'", "cost", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "config_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "anchors", " ", "=", " ", "np", ".", "mgr", "id", "[", "0", ":", "4", ",", "0", ":", "4", "][", ":,", "1", ":,", "1", ":]", ".", "transpose", "(", "1", ",", "2", ",", "0", ").", "reshape", "((", "-1", ",", "2", "))", " ", "/", " ", "4.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "prepar", "e", " ", "dataset_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d1_", "=_", "dataset_", "._", "SV", "HN", "Digit", "_", "(_", "'", "train", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d2_", "=_", "dataset_", "._", "SV", "HN", "Digit", "_", "(_", "'", "extra", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train_", "=_", "Random", "Mix", "Data_", "(_", "[_", "d1_", ",_", "d2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test_", "=_", "dataset_", "._", "SV", "HN", "Digit", "_", "(_", "'", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "augment", "ors_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "img", "aug_", "._", "Resize", "_", "(_", "(_", "40_", ",_", "40_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "img", "aug_", "._", "Bright", "ness_", "(_", "30_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "img", "aug_", "._", "Contras", "t_", "(_", "(_", "0.5_", ",_", "1.5_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "img", "aug_", "._", "Gaussian", "Def", "orm_", "(_", "#", " ", "this", " ", "is", " ", "slow_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "0.2_", ",_", "0.2_", ")_", ",_", "(_", "0.2_", ",_", "0.8_", ")_", ",_", "(_", "0.8_", ",_", "0.8_", ")_", ",_", "(_", "0.8_", ",_", "0.2_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "40_", ",_", "40_", ")_", ",_", "0.2_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train_", "=_", "Augment", "Image", "Component_", "(_", "train_", ",_", "augment", "ors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train_", "=_", "Bat", "ch", "Data_", "(_", "train_", ",_", "128_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nr", "\\u", "proc_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train_", "=_", "Prefe", "tch", "Data_", "(_", "train_", ",_", "5_", ",_", "nr", "\\u", "proc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "step", "\\u", "per", "\\u", "epoch_", "=_", "train_", "._", "size_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "augment", "ors_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "img", "aug_", "._", "Resize", "_", "(_", "(_", "40_", ",_", "40_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test_", "=_", "Augment", "Image", "Component_", "(_", "test_", ",_", "augment", "ors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test_", "=_", "Bat", "ch", "Data_", "(_", "test_", ",_", "128_", ",_", "remainder_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sess", "\\u", "config_", "=_", "get", "\\u", "default", "\\u", "sess", "\\u", "config_", "(_", "0.8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lr_", "=_", "tf_", "._", "train_", "._", "exponential", "\\u", "decay_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "rate_", "=_", "1e-3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "global", "\\u", "step_", "=_", "get", "\\u", "global", "\\u", "step", "\\u", "var_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "deca", "y", "\\u", "steps_", "=_", "train_", "._", "size_", "(_", ")_", "*_", "60_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "deca", "y", "\\u", "rate_", "=_", "0.2_", ",_", "stair", "case_", "=_", "True_", ",_", "name_", "=_", "'", "learn", "ing", "\\u", "rate", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tf_", "._", "scala", "r", "\\u", "summary_", "(_", "'", "learn", "ing", "\\u", "rate", "'_", ",_", "lr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "Train", "Config_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "dataset_", "=_", "train_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "optimizer_", "=_", "tf_", "._", "train_", "._", "Adam", "Optimizer_", "(_", "lr_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "callbacks_", "=_", "Callbacks_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "Stat", "Printer_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Model", "Saver_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Infer", "ence", "Runner_", "(_", "dataset", "\\u", "test_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "Scala", "r", "Stats_", "(_", "'", "cost", "'_", ")_", ",_", "Classificat", "ion", "Error_", "(_", ")_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "session", "\\u", "config_", "=_", "sess", "\\u", "config_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "Model_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "step", "\\u", "per", "\\u", "epoch_", "=_", "step", "\\u", "per", "\\u", "epoch_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "epoch_", "=_", "350_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\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,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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Variable defined multiple times
BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/api-ref/ext/rest_parameters.py
[ { "content": " def run(self):\n lineno = self.state_machine.abs_line_number()\n target = nodes.target()\n section = nodes.section(classes=[\"detail-control\"])\n # env = self.state.document.settings.env\n # env.app.info(\"Parent %s\" % self.state.parent.attributes)\n\n node = rest_method()\n\n # TODO(sdague): this is a super simplistic parser, should be\n # more robust.\n method, sep, url = self.content[0].partition(' ')\n\n node['method'] = method\n node['url'] = url\n node['target'] = self.state.parent.attributes['ids'][0]\n\n # We need to build a temporary target that we can replace\n # later in the processing to get the TOC to resolve correctly.\n temp_target = \"%s-selector\" % node['target']\n target = nodes.target(ids=[temp_target])\n self.state.add_target(temp_target, '', target, lineno)\n section += node\n\n return [target, section]", "metadata": "root.RestMethodDirective.run", "header": "['class', 'RestMethodDirective', '(', 'Directive', ')', ':', '___NEWLINE___', '___NL___', '# this enables content in the directive', '___NL___', '___EOS___']", "index": 72 } ]
[ { "span": "target ", "start_line": 74, "start_column": 8, "end_line": 74, "end_column": 14 } ]
[ { "span": "target ", "start_line": 92, "start_column": 8, "end_line": 92, "end_column": 14 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Rest", "Meth", "od", "Directive", "_", "(_", "Directive", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "enable", "s", " ", "content", " ", "in", " ", "the", " ", "directive_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lineno_", "=_", "self_", "._", "state", "\\u", "machine_", "._", "abs", "\\u", "line", "\\u", "number_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "nodes_", "._", "target_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "section_", "=_", "nodes_", "._", "section_", "(_", "classes_", "=_", "[_", "\"", "deta", "il", "-", "control", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "env", " ", "=", " ", "self", ".", "state", ".", "document", ".", "settings", ".", "env_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "env", ".", "app", ".", "info", "(\"", "Parent", " ", "%", "s", "\"", " ", "%", " ", "self", ".", "state", ".", "parent", ".", "attribute", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "node_", "=_", "rest", "\\u", "method_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", "(", "sda", "gue", "):", " ", "this", " ", "is", " ", "a", " ", "super", " ", "simpli", "stic", " ", "parser", ",", " ", "shou", "ld", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "more", " ", "robust", "._", "\\u\\u\\uNL\\u\\u\\u_", "method_", ",_", "sep_", ",_", "url_", "=_", "self_", "._", "content_", "[_", "0_", "]_", "._", "partition_", "(_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "node_", "[_", "'", "method", "'_", "]_", "=_", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node_", "[_", "'", "url", "'_", "]_", "=_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node_", "[_", "'", "target", "'_", "]_", "=_", "self_", "._", "state_", "._", "parent_", "._", "attributes_", "[_", "'", "ids", "'_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "need", " ", "to", " ", "build", " ", "a", " ", "temporar", "y", " ", "target", " ", "tha", "t", " ", "we", " ", "can", " ", "replace_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "late", "r", " ", "in", " ", "the", " ", "process", "ing", " ", "to", " ", "get", " ", "the", " ", "TOC", " ", "to", " ", "resolve", " ", "correct", "ly", "._", "\\u\\u\\uNL\\u\\u\\u_", "temp", "\\u", "target_", "=_", "\"%", "s", "-", "select", "or", "\"_", "%_", "node_", "[_", "'", "target", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "nodes_", "._", "target_", "(_", "ids_", "=_", "[_", "temp", "\\u", "target_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "state_", "._", "add", "\\u", "target_", "(_", "temp", "\\u", "target_", ",_", "''_", ",_", "target_", ",_", "lineno_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "section_", "+=_", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "[_", "target_", ",_", "section_", "]_", "\\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, 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, 2, 2, 2, 2, 2, 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 ]
Unused import
rackerlabs/openstack-guest-agents-unix/tools/ci/agent_test_runner.py
[ { "content": "#!/usr/bin/env python\n\nimport time\nimport os\nfrom ConfigParser import RawConfigParser\nimport fabric\nfrom fabric.api import env, run\nfrom fabric.operations import put\nimport server_creator\n\n\n\n\n\n\n\n\n\n\n\n\ninstall_agent_and_run_tests()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def install_python_and_curl():\n #Redhat Releases\n run(\"if [ -f /etc/redhat-release ]; \"\n \"then IF_PYTHON=`which python > /dev/null ; echo $?` ; if [[ $IF_PYTHON == '1' ]]; \"\n \"then apt-get -y install python; fi;\"\n \"IF_PYTHON=`which curl > /dev/null ; echo $?` ; if [[ $IF_PYTHON == '1' ]]; \"\n \"then apt-get -y install curl; fi fi\")\n\n #Open-SuSE image\n run(\"if [ -f /etc/SuSE-release ]; \"\n \"then IF_PYTHON=`which python > /dev/null ; echo $?` ; if [[ $IF_PYTHON == '1' ]]; \"\n \"then zypper install -y python; fi;\"\n \"IF_PYTHON=`which curl > /dev/null ; echo $?` ; if [[ $IF_PYTHON == '1' ]]; \"\n \"then zypper install -y curl; fi fi\")\n\n #Debian images\n run(\"if [ -f /etc/debian_version ]; \"\n \"then IF_PYTHON=`which python > /dev/null ; echo $?` ; if [[ $IF_PYTHON == '1' ]]; \"\n \"then apt-get install -y python; fi;\"\n \"IF_PYTHON=`which curl > /dev/null ; echo $?` ; if [[ $IF_PYTHON == '1' ]]; \"\n \"then apt-get install -y curl; fi fi\")\n\n #FreeBSD images\n run(\"if [ `uname -s` == 'FreeBSD' ]; \"\n \"then IF_PYTHON=`which python > /dev/null ; echo $?` ; \"\n \"if [[ $IF_PYTHON == '1' ]]; then pkg_add -r python; fi;\"\n \"IF_BASH=`which bash > /dev/null ; echo $?` ; \"\n \"if [[ $IF_BASH == '1' ]]; then pkg_add -r bash; fi;\"\n \"IF_PYTHON=`which curl > /dev/null ; echo $?` ; \"\n \"if [[ $IF_PYTHON == '1' ]]; then pkg_add -r curl; fi \"\n \"fi\")", "metadata": "root.install_python_and_curl", "header": "['module', '___EOS___']", "index": 11 }, { "content": "def install_agent():\n run(\n \"curl -OkL https://raw.github.com/rackerlabs\"\n \"/openstack-guest-agents-unix/master/tests/functional/install_agent.py\")\n run(\"python install_agent.py\")\n run(\"rm -rf install_agent.py\")", "metadata": "root.install_agent", "header": "['module', '___EOS___']", "index": 44 }, { "content": "def run_tests():\n run(\"curl -OkL https://raw.github.com/rackerlabs/\"\n \"openstack-guest-agents-unix/master/tests/functional/agent_tester.py\")\n run(\"python agent_tester.py\")\n run(\"rm -rf agent_tester.py\")", "metadata": "root.run_tests", "header": "['module', '___EOS___']", "index": 52 }, { "content": "def install_agent_and_run_tests():\n load_config()\n install_python_and_curl()\n install_agent()\n print(\"Going for reboot\")\n time.sleep(5)\n fabric.operations.reboot(120)\n run_tests()", "metadata": "root.install_agent_and_run_tests", "header": "['module', '___EOS___']", "index": 59 }, { "content": "def load_config():\n fabfile = server_creator.create_server(120)\n config = RawConfigParser()\n config.read(os.path.join(os.getcwd(), fabfile))\n hosts = config.get('credentials', 'ipv4')\n user = config.get('credentials', 'username')\n print user\n print hosts\n env.host_string = user + \"@\" + hosts\n env.password = config.get('credentials', 'adminpass')", "metadata": "root.load_config", "header": "['module', '___EOS___']", "index": 69 } ]
[ { "span": "from fabric.operations import put", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 33 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Config", "Parser_", "import_", "Ra", "w", "Config", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "fabric_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fabric_", "._", "api_", "import_", "env_", ",_", "run_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fabric_", "._", "operations_", "import_", "put_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "server", "\\u", "creator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "install", "\\u", "agent", "\\u", "and", "\\u", "run", "\\u", "tests_", "(_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "install", "\\u", "python", "\\u", "and", "\\u", "curl_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Red", "hat", " ", "Release", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "run_", "(_", "\"", "if", " ", "[", " ", "-", "f", " ", "/", "etc", "/", "red", "hat", "-", "release", " ", "];", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "then", " ", "IF", "\\u", "PYTHON", "=", "`", "whi", "ch", " ", "python", " ", ">", " ", "/", "dev", "/", "null", " ", ";", " ", "echo", " ", "$", "?", "`", " ", ";", " ", "if", " ", "[[", " ", "$", "IF", "\\u", "PYTHON", " ", "==", " ", "'", "1", "'", " ", "]]", ";", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "then", " ", "apt", "-", "get", " ", "-", "y", " ", "install", " ", "python", ";", " ", "fi", ";\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "IF", "\\u", "PYTHON", "=", "`", "whi", "ch", " ", "curl", " ", ">", " ", "/", "dev", "/", "null", " ", ";", " ", "echo", " ", "$", "?", "`", " ", ";", " ", "if", " ", "[[", " ", "$", "IF", "\\u", "PYTHON", " ", "==", " ", "'", "1", "'", " ", "]]", ";", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "then", " ", "apt", "-", "get", " ", "-", "y", " ", "install", " ", "curl", ";", " ", "fi", " ", "fi", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Open", "-", "Su", "SE", " ", "image_", "\\u\\u\\uNL\\u\\u\\u_", "run_", "(_", "\"", "if", " ", "[", " ", "-", "f", " ", "/", "etc", "/", "Su", "SE", "-", "release", " ", "];", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "then", " ", "IF", "\\u", "PYTHON", "=", "`", "whi", "ch", " ", "python", " ", ">", " ", "/", "dev", "/", "null", " ", ";", " ", "echo", " ", "$", "?", "`", " ", ";", " ", "if", " ", "[[", " ", "$", "IF", "\\u", "PYTHON", " ", "==", " ", "'", "1", "'", " ", "]]", ";", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "then", " ", "zy", "pper", " ", "install", " ", "-", "y", " ", "python", ";", " ", "fi", ";\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "IF", "\\u", "PYTHON", "=", "`", "whi", "ch", " ", "curl", " ", ">", " ", "/", "dev", "/", "null", " ", ";", " ", "echo", " ", "$", "?", "`", " ", ";", " ", "if", " ", "[[", " ", "$", "IF", "\\u", "PYTHON", " ", "==", " ", "'", "1", "'", " ", "]]", ";", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "then", " ", "zy", "pper", " ", "install", " ", "-", "y", " ", "curl", ";", " ", "fi", " ", "fi", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Deb", "ian", " ", "images_", "\\u\\u\\uNL\\u\\u\\u_", "run_", "(_", "\"", "if", " ", "[", " ", "-", "f", " ", "/", "etc", "/", "debi", "an", "\\u", "version", " ", "];", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "then", " ", "IF", "\\u", "PYTHON", "=", "`", "whi", "ch", " ", "python", " ", ">", " ", "/", "dev", "/", "null", " ", ";", " ", "echo", " ", "$", "?", "`", " ", ";", " ", "if", " ", "[[", " ", "$", "IF", "\\u", "PYTHON", " ", "==", " ", "'", "1", "'", " ", "]]", ";", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "then", " ", "apt", "-", "get", " ", "install", " ", "-", "y", " ", "python", ";", " ", "fi", ";\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "IF", "\\u", "PYTHON", "=", "`", "whi", "ch", " ", "curl", " ", ">", " ", "/", "dev", "/", "null", " ", ";", " ", "echo", " ", "$", "?", "`", " ", ";", " ", "if", " ", "[[", " ", "$", "IF", "\\u", "PYTHON", " ", "==", " ", "'", "1", "'", " ", "]]", ";", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "then", " ", "apt", "-", "get", " ", "install", " ", "-", "y", " ", "curl", ";", " ", "fi", " ", "fi", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Free", "BS", "D", " ", "images_", "\\u\\u\\uNL\\u\\u\\u_", "run_", "(_", "\"", "if", " ", "[", " ", "`", "una", "me", " ", "-", "s", "`", " ", "==", " ", "'", "Free", "BS", "D", "'", " ", "];", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "then", " ", "IF", "\\u", "PYTHON", "=", "`", "whi", "ch", " ", "python", " ", ">", " ", "/", "dev", "/", "null", " ", ";", " ", "echo", " ", "$", "?", "`", " ", ";", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "if", " ", "[[", " ", "$", "IF", "\\u", "PYTHON", " ", "==", " ", "'", "1", "'", " ", "]]", ";", " ", "then", " ", "pkg", "\\u", "add", " ", "-", "r", " ", "python", ";", " ", "fi", ";\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "IF", "\\u", "BAS", "H", "=", "`", "whi", "ch", " ", "bash", " ", ">", " ", "/", "dev", "/", "null", " ", ";", " ", "echo", " ", "$", "?", "`", " ", ";", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "if", " ", "[[", " ", "$", "IF", "\\u", "BAS", "H", " ", "==", " ", "'", "1", "'", " ", "]]", ";", " ", "then", " ", "pkg", "\\u", "add", " ", "-", "r", " ", "bash", ";", " ", "fi", ";\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "IF", "\\u", "PYTHON", "=", "`", "whi", "ch", " ", "curl", " ", ">", " ", "/", "dev", "/", "null", " ", ";", " ", "echo", " ", "$", "?", "`", " ", ";", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "if", " ", "[[", " ", "$", "IF", "\\u", "PYTHON", " ", "==", " ", "'", "1", "'", " ", "]]", ";", " ", "then", " ", "pkg", "\\u", "add", " ", "-", "r", " ", "curl", ";", " ", "fi", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fi", "\"_", ")_", "\\u\\u\\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_", "install", "\\u", "agent_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "run_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "curl", " ", "-", "Ok", "L", " ", "https", "://", "raw", ".", "git", "hub", ".", "com", "/", "rack", "erl", "abs", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"/", "openst", "ack", "-", "guest", "-", "agent", "s", "-", "unix", "/", "master", "/", "tests", "/", "functional", "/", "install", "\\u", "agent", ".", "py", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run_", "(_", "\"", "python", " ", "install", "\\u", "agent", ".", "py", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run_", "(_", "\"", "rm", " ", "-", "rf", " ", "install", "\\u", "agent", ".", "py", "\"_", ")_", "\\u\\u\\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_", "run", "\\u", "tests_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "run_", "(_", "\"", "curl", " ", "-", "Ok", "L", " ", "https", "://", "raw", ".", "git", "hub", ".", "com", "/", "rack", "erl", "abs", "/\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "openst", "ack", "-", "guest", "-", "agent", "s", "-", "unix", "/", "master", "/", "tests", "/", "functional", "/", "agent", "\\u", "teste", "r", ".", "py", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run_", "(_", "\"", "python", " ", "agent", "\\u", "teste", "r", ".", "py", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run_", "(_", "\"", "rm", " ", "-", "rf", " ", "agent", "\\u", "teste", "r", ".", "py", "\"_", ")_", "\\u\\u\\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_", "install", "\\u", "agent", "\\u", "and", "\\u", "run", "\\u", "tests_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "load", "\\u", "config_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "install", "\\u", "python", "\\u", "and", "\\u", "curl_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "install", "\\u", "agent_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Go", "ing", " ", "for", " ", "rebo", "ot", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fabric_", "._", "operations_", "._", "reboot_", "(_", "120_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run", "\\u", "tests_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load", "\\u", "config_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fab", "file_", "=_", "server", "\\u", "creator_", "._", "create", "\\u", "server_", "(_", "120_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config_", "=_", "Ra", "w", "Config", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config_", "._", "read_", "(_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "getcwd_", "(_", ")_", ",_", "fab", "file_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hosts_", "=_", "config_", "._", "get_", "(_", "'", "cred", "ential", "s", "'_", ",_", "'", "ipv", "4", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "config_", "._", "get_", "(_", "'", "cred", "ential", "s", "'_", ",_", "'", "user", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "hosts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env_", "._", "host", "\\u", "string_", "=_", "user_", "+_", "\"@\"_", "+_", "hosts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env_", "._", "password_", "=_", "config_", "._", "get_", "(_", "'", "cred", "ential", "s", "'_", ",_", "'", "admin", "pass", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
rwl/muntjac/muntjac/demo/sampler/features/layouts/__init__.py
[ { "content": "\nfrom muntjac.demo.sampler.features.layouts.CustomLayouts import CustomLayouts\nfrom muntjac.demo.sampler.features.layouts.SplitPanelBasic import SplitPanelBasic\nfrom muntjac.demo.sampler.features.layouts.SplitPanelPositioning import SplitPanelPositioning\nfrom muntjac.demo.sampler.features.layouts.WebLayout import WebLayout\nfrom muntjac.demo.sampler.features.layouts.CssLayouts import CssLayouts\nfrom muntjac.demo.sampler.features.layouts.LayoutSpacing import LayoutSpacing\nfrom muntjac.demo.sampler.features.layouts.VerticalLayoutBasic import VerticalLayoutBasic\nfrom muntjac.demo.sampler.features.layouts.HorizontalLayoutBasic import HorizontalLayoutBasic\nfrom muntjac.demo.sampler.features.layouts.ExpandingComponent import ExpandingComponent\nfrom muntjac.demo.sampler.features.layouts.LayoutAlignment import LayoutAlignment\nfrom muntjac.demo.sampler.features.layouts.ClickableLayoutBasic import ClickableLayoutBasic\nfrom muntjac.demo.sampler.features.layouts.LayoutMargin import LayoutMargin\nfrom muntjac.demo.sampler.features.layouts.GridLayoutBasic import GridLayoutBasic\nfrom muntjac.demo.sampler.features.layouts.ApplicationLayout import ApplicationLayout\nfrom muntjac.demo.sampler.features.layouts.AbsoluteLayoutBasic import AbsoluteLayoutBasic\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from muntjac.demo.sampler.features.layouts.CustomLayouts import CustomLayouts", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 77 }, { "span": "from muntjac.demo.sampler.features.layouts.SplitPanelBasic import SplitPanelBasic", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 81 }, { "span": "from muntjac.demo.sampler.features.layouts.SplitPanelPositioning import SplitPanelPositioning", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 93 }, { "span": "from muntjac.demo.sampler.features.layouts.WebLayout import WebLayout", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 69 }, { "span": "from muntjac.demo.sampler.features.layouts.CssLayouts import CssLayouts", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 71 }, { "span": "from muntjac.demo.sampler.features.layouts.LayoutSpacing import LayoutSpacing", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 77 }, { "span": "from muntjac.demo.sampler.features.layouts.VerticalLayoutBasic import VerticalLayoutBasic", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 89 }, { "span": "from muntjac.demo.sampler.features.layouts.HorizontalLayoutBasic import HorizontalLayoutBasic", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 93 }, { "span": "from muntjac.demo.sampler.features.layouts.ExpandingComponent import ExpandingComponent", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 87 }, { "span": "from muntjac.demo.sampler.features.layouts.LayoutAlignment import LayoutAlignment", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 81 }, { "span": "from muntjac.demo.sampler.features.layouts.ClickableLayoutBasic import ClickableLayoutBasic", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 91 }, { "span": "from muntjac.demo.sampler.features.layouts.LayoutMargin import LayoutMargin", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 75 }, { "span": "from muntjac.demo.sampler.features.layouts.GridLayoutBasic import GridLayoutBasic", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 81 }, { "span": "from muntjac.demo.sampler.features.layouts.ApplicationLayout import ApplicationLayout", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 85 }, { "span": "from muntjac.demo.sampler.features.layouts.AbsoluteLayoutBasic import AbsoluteLayoutBasic", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 89 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "mun", "tj", "ac_", "._", "demo_", "._", "sampler_", "._", "features_", "._", "layouts", "_", "._", "Custom", "Lay", "outs_", "import_", "Custom", "Lay", "outs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mun", "tj", "ac_", "._", "demo_", "._", "sampler_", "._", "features_", "._", "layouts", "_", "._", "Split", "Pane", "l", "Basic_", "import_", "Split", "Pane", "l", "Basic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mun", "tj", "ac_", "._", "demo_", "._", "sampler_", "._", "features_", "._", "layouts", "_", "._", "Split", "Pane", "l", "Position", "ing_", "import_", "Split", "Pane", "l", "Position", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mun", "tj", "ac_", "._", "demo_", "._", "sampler_", "._", "features_", "._", "layouts", "_", "._", "Web", "Layout_", "import_", "Web", "Layout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mun", "tj", "ac_", "._", "demo_", "._", "sampler_", "._", "features_", "._", "layouts", "_", "._", "Cs", "s", "Lay", "outs_", "import_", "Cs", "s", "Lay", "outs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mun", "tj", "ac_", "._", "demo_", "._", "sampler_", "._", "features_", "._", "layouts", "_", "._", "Lay", "out", "Spacing_", "import_", "Lay", "out", "Spacing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mun", "tj", "ac_", "._", "demo_", "._", "sampler_", "._", "features_", "._", "layouts", "_", "._", "Vertica", "l", "Lay", "out", "Basic_", "import_", "Vertica", "l", "Lay", "out", "Basic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mun", "tj", "ac_", "._", "demo_", "._", "sampler_", "._", "features_", "._", "layouts", "_", "._", "Horiz", "onta", "l", "Lay", "out", "Basic_", "import_", "Horiz", "onta", "l", "Lay", "out", "Basic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mun", "tj", "ac_", "._", "demo_", "._", "sampler_", "._", "features_", "._", "layouts", "_", "._", "Expand", "ing", "Component_", "import_", "Expand", "ing", "Component_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mun", "tj", "ac_", "._", "demo_", "._", "sampler_", "._", "features_", "._", "layouts", "_", "._", "Lay", "out", "Alignment_", "import_", "Lay", "out", "Alignment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mun", "tj", "ac_", "._", "demo_", "._", "sampler_", "._", "features_", "._", "layouts", "_", "._", "Click", "able", "Lay", "out", "Basic_", "import_", "Click", "able", "Lay", "out", "Basic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mun", "tj", "ac_", "._", "demo_", "._", "sampler_", "._", "features_", "._", "layouts", "_", "._", "Lay", "out", "Margin_", "import_", "Lay", "out", "Margin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mun", "tj", "ac_", "._", "demo_", "._", "sampler_", "._", "features_", "._", "layouts", "_", "._", "Grid", "Lay", "out", "Basic_", "import_", "Grid", "Lay", "out", "Basic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mun", "tj", "ac_", "._", "demo_", "._", "sampler_", "._", "features_", "._", "layouts", "_", "._", "Applica", "tion", "Layout_", "import_", "Applica", "tion", "Layout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mun", "tj", "ac_", "._", "demo_", "._", "sampler_", "._", "features_", "._", "layouts", "_", "._", "Abs", "olute", "Lay", "out", "Basic_", "import_", "Abs", "olute", "Lay", "out", "Basic_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 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, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 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, 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, 1, 1, 1, 1, 1, 1 ]
`__eq__` not overridden when adding attributes
AppScale/appscale/AppServer/lib/django-1.5/django/db/models/fields/__init__.py
[ { "content": "@total_ordering\nclass Field(object):\n \"\"\"Base class for all field types\"\"\"\n\n # Designates whether empty strings fundamentally are allowed at the\n # database level.\n empty_strings_allowed = True\n\n # These track each time a Field instance is created. Used to retain order.\n # The auto_creation_counter is used for fields that Django implicitly\n # creates, creation_counter is used for all user-specified fields.\n creation_counter = 0\n auto_creation_counter = -1\n default_validators = [] # Default set of validators\n default_error_messages = {\n 'invalid_choice': _('Value %r is not a valid choice.'),\n 'null': _('This field cannot be null.'),\n 'blank': _('This field cannot be blank.'),\n 'unique': _('%(model_name)s with this %(field_label)s '\n 'already exists.'),\n }\n\n # Generic field type description, usually overriden by subclasses\n description = property(_description)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n choices = property(_get_choices)\n\n flatchoices = property(_get_flatchoices)\n\n\n\n", "metadata": "root.Field", "header": "['module', '___EOS___']", "index": 51 }, { "content": " def _description(self):\n return _('Field of type: %(field_type)s') % {\n 'field_type': self.__class__.__name__\n }", "metadata": "root.Field._description", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 74 }, { "content": " def __init__(self, verbose_name=None, name=None, primary_key=False,\n max_length=None, unique=False, blank=False, null=False,\n db_index=False, rel=None, default=NOT_PROVIDED, editable=True,\n serialize=True, unique_for_date=None, unique_for_month=None,\n unique_for_year=None, choices=None, help_text='', db_column=None,\n db_tablespace=None, auto_created=False, validators=[],\n error_messages=None):\n self.name = name\n self.verbose_name = verbose_name\n self.primary_key = primary_key\n self.max_length, self._unique = max_length, unique\n self.blank, self.null = blank, null\n self.rel = rel\n self.default = default\n self.editable = editable\n self.serialize = serialize\n self.unique_for_date, self.unique_for_month = (unique_for_date,\n unique_for_month)\n self.unique_for_year = unique_for_year\n self._choices = choices or []\n self.help_text = help_text\n self.db_column = db_column\n self.db_tablespace = db_tablespace or settings.DEFAULT_INDEX_TABLESPACE\n self.auto_created = auto_created\n\n # Set db_index to True if the field has a relationship and doesn't\n # explicitly set db_index.\n self.db_index = db_index\n\n # Adjust the appropriate creation counter, and save our local copy.\n if auto_created:\n self.creation_counter = Field.auto_creation_counter\n Field.auto_creation_counter -= 1\n else:\n self.creation_counter = Field.creation_counter\n Field.creation_counter += 1\n\n self.validators = self.default_validators + validators\n\n messages = {}\n for c in reversed(self.__class__.__mro__):\n messages.update(getattr(c, 'default_error_messages', {}))\n messages.update(error_messages or {})\n self.error_messages = messages", "metadata": "root.Field.__init__", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 80 }, { "content": " def __eq__(self, other):\n # Needed for @total_ordering\n if isinstance(other, Field):\n return self.creation_counter == other.creation_counter\n return NotImplemented", "metadata": "root.Field.__eq__", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 125 }, { "content": " def __lt__(self, other):\n # This is needed because bisect does not take a comparison function.\n if isinstance(other, Field):\n return self.creation_counter < other.creation_counter\n return NotImplemented", "metadata": "root.Field.__lt__", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 131 }, { "content": " def __hash__(self):\n return hash(self.creation_counter)", "metadata": "root.Field.__hash__", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 137 }, { "content": " def __deepcopy__(self, memodict):\n # We don't have to deepcopy very much here, since most things are not\n # intended to be altered after initial creation.\n obj = copy.copy(self)\n if self.rel:\n obj.rel = copy.copy(self.rel)\n memodict[id(self)] = obj\n return obj", "metadata": "root.Field.__deepcopy__", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 140 }, { "content": " def to_python(self, value):\n \"\"\"\n Converts the input value into the expected Python data type, raising\n django.core.exceptions.ValidationError if the data can't be converted.\n Returns the converted value. Subclasses should override this.\n \"\"\"\n return value", "metadata": "root.Field.to_python", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 149 }, { "content": " def run_validators(self, value):\n if value in validators.EMPTY_VALUES:\n return\n\n errors = []\n for v in self.validators:\n try:\n v(value)\n except exceptions.ValidationError as e:\n if hasattr(e, 'code') and e.code in self.error_messages:\n message = self.error_messages[e.code]\n if e.params:\n message = message % e.params\n errors.append(message)\n else:\n errors.extend(e.messages)\n if errors:\n raise exceptions.ValidationError(errors)", "metadata": "root.Field.run_validators", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 157 }, { "content": " def validate(self, value, model_instance):\n \"\"\"\n Validates value and throws ValidationError. Subclasses should override\n this to provide validation logic.\n \"\"\"\n if not self.editable:\n # Skip validation for non-editable fields.\n return\n\n if self._choices and value not in validators.EMPTY_VALUES:\n for option_key, option_value in self.choices:\n if isinstance(option_value, (list, tuple)):\n # This is an optgroup, so look inside the group for\n # options.\n for optgroup_key, optgroup_value in option_value:\n if value == optgroup_key:\n return\n elif value == option_key:\n return\n msg = self.error_messages['invalid_choice'] % value\n raise exceptions.ValidationError(msg)\n\n if value is None and not self.null:\n raise exceptions.ValidationError(self.error_messages['null'])\n\n if not self.blank and value in validators.EMPTY_VALUES:\n raise exceptions.ValidationError(self.error_messages['blank'])", "metadata": "root.Field.validate", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 176 }, { "content": " def clean(self, value, model_instance):\n \"\"\"\n Convert the value's type and run validation. Validation errors\n from to_python and validate are propagated. The correct value is\n returned if no error is raised.\n \"\"\"\n value = self.to_python(value)\n self.validate(value, model_instance)\n self.run_validators(value)\n return value", "metadata": "root.Field.clean", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 204 }, { "content": " def db_type(self, connection):\n \"\"\"\n Returns the database column data type for this field, for the provided\n connection.\n \"\"\"\n # The default implementation of this method looks at the\n # backend-specific DATA_TYPES dictionary, looking up the field by its\n # \"internal type\".\n #\n # A Field class can implement the get_internal_type() method to specify\n # which *preexisting* Django Field class it's most similar to -- i.e.,\n # a custom field might be represented by a TEXT column type, which is\n # the same as the TextField Django field type, which means the custom\n # field's get_internal_type() returns 'TextField'.\n #\n # But the limitation of the get_internal_type() / data_types approach\n # is that it cannot handle database column types that aren't already\n # mapped to one of the built-in Django field types. In this case, you\n # can implement db_type() instead of get_internal_type() to specify\n # exactly which wacky database column type you want to use.\n data = DictWrapper(self.__dict__, connection.ops.quote_name, \"qn_\")\n try:\n return (connection.creation.data_types[self.get_internal_type()]\n % data)\n except KeyError:\n return None", "metadata": "root.Field.db_type", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 215 }, { "content": " @property\n def unique(self):\n return self._unique or self.primary_key", "metadata": "root.Field.unique", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 242 }, { "content": " def set_attributes_from_name(self, name):\n if not self.name:\n self.name = name\n self.attname, self.column = self.get_attname_column()\n if self.verbose_name is None and self.name:\n self.verbose_name = self.name.replace('_', ' ')", "metadata": "root.Field.set_attributes_from_name", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 246 }, { "content": " def contribute_to_class(self, cls, name):\n self.set_attributes_from_name(name)\n self.model = cls\n cls._meta.add_field(self)\n if self.choices:\n setattr(cls, 'get_%s_display' % self.name,\n curry(cls._get_FIELD_display, field=self))", "metadata": "root.Field.contribute_to_class", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 253 }, { "content": " def get_attname(self):\n return self.name", "metadata": "root.Field.get_attname", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 261 }, { "content": " def get_attname_column(self):\n attname = self.get_attname()\n column = self.db_column or attname\n return attname, column", "metadata": "root.Field.get_attname_column", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 264 }, { "content": " def get_cache_name(self):\n return '_%s_cache' % self.name", "metadata": "root.Field.get_cache_name", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 269 }, { "content": " def get_internal_type(self):\n return self.__class__.__name__", "metadata": "root.Field.get_internal_type", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 272 }, { "content": " def pre_save(self, model_instance, add):\n \"\"\"\n Returns field's value just before saving.\n \"\"\"\n return getattr(model_instance, self.attname)", "metadata": "root.Field.pre_save", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 275 }, { "content": " def get_prep_value(self, value):\n \"\"\"\n Perform preliminary non-db specific value checks and conversions.\n \"\"\"\n return value", "metadata": "root.Field.get_prep_value", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 281 }, { "content": " def get_db_prep_value(self, value, connection, prepared=False):\n \"\"\"Returns field's value prepared for interacting with the database\n backend.\n\n Used by the default implementations of ``get_db_prep_save``and\n `get_db_prep_lookup```\n \"\"\"\n if not prepared:\n value = self.get_prep_value(value)\n return value", "metadata": "root.Field.get_db_prep_value", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 287 }, { "content": " def get_db_prep_save(self, value, connection):\n \"\"\"\n Returns field's value prepared for saving into a database.\n \"\"\"\n return self.get_db_prep_value(value, connection=connection,\n prepared=False)", "metadata": "root.Field.get_db_prep_save", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 298 }, { "content": " def get_prep_lookup(self, lookup_type, value):\n \"\"\"\n Perform preliminary non-db specific lookup checks and conversions\n \"\"\"\n if hasattr(value, 'prepare'):\n return value.prepare()\n if hasattr(value, '_prepare'):\n return value._prepare()\n\n if lookup_type in (\n 'regex', 'iregex', 'month', 'day', 'week_day', 'search',\n 'contains', 'icontains', 'iexact', 'startswith', 'istartswith',\n 'endswith', 'iendswith', 'isnull'\n ):\n return value\n elif lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte'):\n return self.get_prep_value(value)\n elif lookup_type in ('range', 'in'):\n return [self.get_prep_value(v) for v in value]\n elif lookup_type == 'year':\n try:\n return int(value)\n except ValueError:\n raise ValueError(\"The __year lookup type requires an integer \"\n \"argument\")\n\n raise TypeError(\"Field has invalid lookup: %s\" % lookup_type)", "metadata": "root.Field.get_prep_lookup", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 305 }, { "content": " def get_db_prep_lookup(self, lookup_type, value, connection,\n prepared=False):\n \"\"\"\n Returns field's value prepared for database lookup.\n \"\"\"\n if not prepared:\n value = self.get_prep_lookup(lookup_type, value)\n if hasattr(value, 'get_compiler'):\n value = value.get_compiler(connection=connection)\n if hasattr(value, 'as_sql') or hasattr(value, '_as_sql'):\n # If the value has a relabel_aliases method, it will need to\n # be invoked before the final SQL is evaluated\n if hasattr(value, 'relabel_aliases'):\n return value\n if hasattr(value, 'as_sql'):\n sql, params = value.as_sql()\n else:\n sql, params = value._as_sql(connection=connection)\n return QueryWrapper(('(%s)' % sql), params)\n\n if lookup_type in ('regex', 'iregex', 'month', 'day', 'week_day',\n 'search'):\n return [value]\n elif lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte'):\n return [self.get_db_prep_value(value, connection=connection,\n prepared=prepared)]\n elif lookup_type in ('range', 'in'):\n return [self.get_db_prep_value(v, connection=connection,\n prepared=prepared) for v in value]\n elif lookup_type in ('contains', 'icontains'):\n return [\"%%%s%%\" % connection.ops.prep_for_like_query(value)]\n elif lookup_type == 'iexact':\n return [connection.ops.prep_for_iexact_query(value)]\n elif lookup_type in ('startswith', 'istartswith'):\n return [\"%s%%\" % connection.ops.prep_for_like_query(value)]\n elif lookup_type in ('endswith', 'iendswith'):\n return [\"%%%s\" % connection.ops.prep_for_like_query(value)]\n elif lookup_type == 'isnull':\n return []\n elif lookup_type == 'year':\n if self.get_internal_type() == 'DateField':\n return connection.ops.year_lookup_bounds_for_date_field(value)\n else:\n return connection.ops.year_lookup_bounds(value)", "metadata": "root.Field.get_db_prep_lookup", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 333 }, { "content": " def has_default(self):\n \"\"\"\n Returns a boolean of whether this field has a default value.\n \"\"\"\n return self.default is not NOT_PROVIDED", "metadata": "root.Field.has_default", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 378 }, { "content": " def get_default(self):\n \"\"\"\n Returns the default value for this field.\n \"\"\"\n if self.has_default():\n if callable(self.default):\n return self.default()\n return force_text(self.default, strings_only=True)\n if (not self.empty_strings_allowed or (self.null and\n not connection.features.interprets_empty_strings_as_nulls)):\n return None\n return \"\"", "metadata": "root.Field.get_default", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 384 }, { "content": " def get_validator_unique_lookup_type(self):\n return '%s__exact' % self.name", "metadata": "root.Field.get_validator_unique_lookup_type", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 397 }, { "content": " def get_choices(self, include_blank=True, blank_choice=BLANK_CHOICE_DASH):\n \"\"\"Returns choices with a default blank choices included, for use\n as SelectField choices for this field.\"\"\"\n first_choice = include_blank and blank_choice or []\n if self.choices:\n return first_choice + list(self.choices)\n rel_model = self.rel.to\n if hasattr(self.rel, 'get_related_field'):\n lst = [(getattr(x, self.rel.get_related_field().attname),\n smart_text(x))\n for x in rel_model._default_manager.complex_filter(\n self.rel.limit_choices_to)]\n else:\n lst = [(x._get_pk_val(), smart_text(x))\n for x in rel_model._default_manager.complex_filter(\n self.rel.limit_choices_to)]\n return first_choice + lst", "metadata": "root.Field.get_choices", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 400 }, { "content": " def get_choices_default(self):\n return self.get_choices()", "metadata": "root.Field.get_choices_default", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 418 }, { "content": " def get_flatchoices(self, include_blank=True,\n blank_choice=BLANK_CHOICE_DASH):\n \"\"\"\n Returns flattened choices with a default blank choice included.\n \"\"\"\n first_choice = include_blank and blank_choice or []\n return first_choice + list(self.flatchoices)", "metadata": "root.Field.get_flatchoices", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 421 }, { "content": " def _get_val_from_obj(self, obj):\n if obj is not None:\n return getattr(obj, self.attname)\n else:\n return self.get_default()", "metadata": "root.Field._get_val_from_obj", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 429 }, { "content": " def value_to_string(self, obj):\n \"\"\"\n Returns a string value of this field from the passed obj.\n This is used by the serialization framework.\n \"\"\"\n return smart_text(self._get_val_from_obj(obj))", "metadata": "root.Field.value_to_string", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 435 }, { "content": " def bind(self, fieldmapping, original, bound_field_class):\n return bound_field_class(self, fieldmapping, original)", "metadata": "root.Field.bind", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 442 }, { "content": " def _get_choices(self):\n if isinstance(self._choices, collections.Iterator):\n choices, self._choices = tee(self._choices)\n return choices\n else:\n return self._choices", "metadata": "root.Field._get_choices", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 445 }, { "content": " def _get_flatchoices(self):\n \"\"\"Flattened version of choices tuple.\"\"\"\n flat = []\n for choice, value in self.choices:\n if isinstance(value, (list, tuple)):\n flat.extend(value)\n else:\n flat.append((choice,value))\n return flat", "metadata": "root.Field._get_flatchoices", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 453 }, { "content": " def save_form_data(self, instance, data):\n setattr(instance, self.name, data)", "metadata": "root.Field.save_form_data", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 464 }, { "content": " def formfield(self, form_class=forms.CharField, **kwargs):\n \"\"\"\n Returns a django.forms.Field instance for this database Field.\n \"\"\"\n defaults = {'required': not self.blank,\n 'label': capfirst(self.verbose_name),\n 'help_text': self.help_text}\n if self.has_default():\n if callable(self.default):\n defaults['initial'] = self.default\n defaults['show_hidden_initial'] = True\n else:\n defaults['initial'] = self.get_default()\n if self.choices:\n # Fields with choices get special treatment.\n include_blank = (self.blank or\n not (self.has_default() or 'initial' in kwargs))\n defaults['choices'] = self.get_choices(include_blank=include_blank)\n defaults['coerce'] = self.to_python\n if self.null:\n defaults['empty_value'] = None\n form_class = forms.TypedChoiceField\n # Many of the subclass-specific formfield arguments (min_value,\n # max_value) don't apply for choice fields, so be sure to only pass\n # the values that TypedChoiceField will understand.\n for k in list(kwargs):\n if k not in ('coerce', 'empty_value', 'choices', 'required',\n 'widget', 'label', 'initial', 'help_text',\n 'error_messages', 'show_hidden_initial'):\n del kwargs[k]\n defaults.update(kwargs)\n return form_class(**defaults)", "metadata": "root.Field.formfield", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 467 }, { "content": " def value_from_object(self, obj):\n \"\"\"\n Returns the value of this field in the given model instance.\n \"\"\"\n return getattr(obj, self.attname)", "metadata": "root.Field.value_from_object", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 500 }, { "content": " def __repr__(self):\n \"\"\"\n Displays the module, class and name of the field.\n \"\"\"\n path = '%s.%s' % (self.__class__.__module__, self.__class__.__name__)\n name = getattr(self, 'name', None)\n if name is not None:\n return '<%s: %s>' % (path, name)\n return '<%s>' % path", "metadata": "root.Field.__repr__", "header": "['class', 'Field', '(', 'object', ')', ':', '___EOS___']", "index": 506 }, { "content": "class DateField(Field):\n empty_strings_allowed = False\n default_error_messages = {\n 'invalid': _(\"'%s' value has an invalid date format. It must be \"\n \"in YYYY-MM-DD format.\"),\n 'invalid_date': _(\"'%s' value has the correct format (YYYY-MM-DD) \"\n \"but it is an invalid date.\"),\n }\n description = _(\"Date (without time)\")\n\n\n\n\n\n\n\n\n\n", "metadata": "root.DateField", "header": "['module', '___EOS___']", "index": 661 }, { "content": " def __init__(self, verbose_name=None, name=None, auto_now=False,\n auto_now_add=False, **kwargs):\n self.auto_now, self.auto_now_add = auto_now, auto_now_add\n if auto_now or auto_now_add:\n kwargs['editable'] = False\n kwargs['blank'] = True\n Field.__init__(self, verbose_name, name, **kwargs)", "metadata": "root.DateField.__init__", "header": "['class', 'DateField', '(', 'Field', ')', ':', '___EOS___']", "index": 671 }, { "content": " def get_internal_type(self):\n return \"DateField\"", "metadata": "root.DateField.get_internal_type", "header": "['class', 'DateField', '(', 'Field', ')', ':', '___EOS___']", "index": 679 }, { "content": " def to_python(self, value):\n if value is None:\n return value\n if isinstance(value, datetime.datetime):\n if settings.USE_TZ and timezone.is_aware(value):\n # Convert aware datetimes to the default time zone\n # before casting them to dates (#17742).\n default_timezone = timezone.get_default_timezone()\n value = timezone.make_naive(value, default_timezone)\n return value.date()\n if isinstance(value, datetime.date):\n return value\n\n try:\n parsed = parse_date(value)\n if parsed is not None:\n return parsed\n except ValueError:\n msg = self.error_messages['invalid_date'] % value\n raise exceptions.ValidationError(msg)\n\n msg = self.error_messages['invalid'] % value\n raise exceptions.ValidationError(msg)", "metadata": "root.DateField.to_python", "header": "['class', 'DateField', '(', 'Field', ')', ':', '___EOS___']", "index": 682 }, { "content": " def pre_save(self, model_instance, add):\n if self.auto_now or (self.auto_now_add and add):\n value = datetime.date.today()\n setattr(model_instance, self.attname, value)\n return value\n else:\n return super(DateField, self).pre_save(model_instance, add)", "metadata": "root.DateField.pre_save", "header": "['class', 'DateField', '(', 'Field', ')', ':', '___EOS___']", "index": 706 }, { "content": " def contribute_to_class(self, cls, name):\n super(DateField,self).contribute_to_class(cls, name)\n if not self.null:\n setattr(cls, 'get_next_by_%s' % self.name,\n curry(cls._get_next_or_previous_by_FIELD, field=self,\n is_next=True))\n setattr(cls, 'get_previous_by_%s' % self.name,\n curry(cls._get_next_or_previous_by_FIELD, field=self,\n is_next=False))", "metadata": "root.DateField.contribute_to_class", "header": "['class', 'DateField', '(', 'Field', ')', ':', '___EOS___']", "index": 714 }, { "content": " def get_prep_lookup(self, lookup_type, value):\n # For \"__month\", \"__day\", and \"__week_day\" lookups, convert the value\n # to an int so the database backend always sees a consistent type.\n if lookup_type in ('month', 'day', 'week_day'):\n return int(value)\n return super(DateField, self).get_prep_lookup(lookup_type, value)", "metadata": "root.DateField.get_prep_lookup", "header": "['class', 'DateField', '(', 'Field', ')', ':', '___EOS___']", "index": 724 }, { "content": " def get_prep_value(self, value):\n return self.to_python(value)", "metadata": "root.DateField.get_prep_value", "header": "['class', 'DateField', '(', 'Field', ')', ':', '___EOS___']", "index": 731 }, { "content": " def get_db_prep_value(self, value, connection, prepared=False):\n # Casts dates into the format expected by the backend\n if not prepared:\n value = self.get_prep_value(value)\n return connection.ops.value_to_db_date(value)", "metadata": "root.DateField.get_db_prep_value", "header": "['class', 'DateField', '(', 'Field', ')', ':', '___EOS___']", "index": 734 }, { "content": " def value_to_string(self, obj):\n val = self._get_val_from_obj(obj)\n return '' if val is None else val.isoformat()", "metadata": "root.DateField.value_to_string", "header": "['class', 'DateField', '(', 'Field', ')', ':', '___EOS___']", "index": 740 }, { "content": " def formfield(self, **kwargs):\n defaults = {'form_class': forms.DateField}\n defaults.update(kwargs)\n return super(DateField, self).formfield(**defaults)", "metadata": "root.DateField.formfield", "header": "['class', 'DateField', '(', 'Field', ')', ':', '___EOS___']", "index": 744 }, { "content": "class DecimalField(Field):\n empty_strings_allowed = False\n default_error_messages = {\n 'invalid': _(\"'%s' value must be a decimal number.\"),\n }\n description = _(\"Decimal number\")\n\n\n\n\n\n\n\n", "metadata": "root.DecimalField", "header": "['module', '___EOS___']", "index": 846 }, { "content": " def __init__(self, verbose_name=None, name=None, max_digits=None,\n decimal_places=None, **kwargs):\n self.max_digits, self.decimal_places = max_digits, decimal_places\n Field.__init__(self, verbose_name, name, **kwargs)", "metadata": "root.DecimalField.__init__", "header": "['class', 'DecimalField', '(', 'Field', ')', ':', '___EOS___']", "index": 853 }, { "content": " def get_internal_type(self):\n return \"DecimalField\"", "metadata": "root.DecimalField.get_internal_type", "header": "['class', 'DecimalField', '(', 'Field', ')', ':', '___EOS___']", "index": 858 }, { "content": " def to_python(self, value):\n if value is None:\n return value\n try:\n return decimal.Decimal(value)\n except decimal.InvalidOperation:\n msg = self.error_messages['invalid'] % value\n raise exceptions.ValidationError(msg)", "metadata": "root.DecimalField.to_python", "header": "['class', 'DecimalField', '(', 'Field', ')', ':', '___EOS___']", "index": 861 }, { "content": " def _format(self, value):\n if isinstance(value, six.string_types) or value is None:\n return value\n else:\n return self.format_number(value)", "metadata": "root.DecimalField._format", "header": "['class', 'DecimalField', '(', 'Field', ')', ':', '___EOS___']", "index": 870 }, { "content": " def format_number(self, value):\n \"\"\"\n Formats a number into a string with the requisite number of digits and\n decimal places.\n \"\"\"\n # Method moved to django.db.backends.util.\n #\n # It is preserved because it is used by the oracle backend\n # (django.db.backends.oracle.query), and also for\n # backwards-compatibility with any external code which may have used\n # this method.\n from django.db.backends import util\n return util.format_number(value, self.max_digits, self.decimal_places)", "metadata": "root.DecimalField.format_number", "header": "['class', 'DecimalField', '(', 'Field', ')', ':', '___EOS___']", "index": 876 }, { "content": " def get_db_prep_save(self, value, connection):\n return connection.ops.value_to_db_decimal(self.to_python(value),\n self.max_digits, self.decimal_places)", "metadata": "root.DecimalField.get_db_prep_save", "header": "['class', 'DecimalField', '(', 'Field', ')', ':', '___EOS___']", "index": 890 }, { "content": " def get_prep_value(self, value):\n return self.to_python(value)", "metadata": "root.DecimalField.get_prep_value", "header": "['class', 'DecimalField', '(', 'Field', ')', ':', '___EOS___']", "index": 894 }, { "content": " def formfield(self, **kwargs):\n defaults = {\n 'max_digits': self.max_digits,\n 'decimal_places': self.decimal_places,\n 'form_class': forms.DecimalField,\n }\n defaults.update(kwargs)\n return super(DecimalField, self).formfield(**defaults)", "metadata": "root.DecimalField.formfield", "header": "['class', 'DecimalField', '(', 'Field', ')', ':', '___EOS___']", "index": 897 }, { "content": "class FilePathField(Field):\n description = _(\"File path\")\n\n\n", "metadata": "root.FilePathField", "header": "['module', '___EOS___']", "index": 926 }, { "content": " def __init__(self, verbose_name=None, name=None, path='', match=None,\n recursive=False, allow_files=True, allow_folders=False, **kwargs):\n self.path, self.match, self.recursive = path, match, recursive\n self.allow_files, self.allow_folders = allow_files, allow_folders\n kwargs['max_length'] = kwargs.get('max_length', 100)\n Field.__init__(self, verbose_name, name, **kwargs)", "metadata": "root.FilePathField.__init__", "header": "['class', 'FilePathField', '(', 'Field', ')', ':', '___EOS___']", "index": 929 }, { "content": " def formfield(self, **kwargs):\n defaults = {\n 'path': self.path,\n 'match': self.match,\n 'recursive': self.recursive,\n 'form_class': forms.FilePathField,\n 'allow_files': self.allow_files,\n 'allow_folders': self.allow_folders,\n }\n defaults.update(kwargs)\n return super(FilePathField, self).formfield(**defaults)", "metadata": "root.FilePathField.formfield", "header": "['class', 'FilePathField', '(', 'Field', ')', ':', '___EOS___']", "index": 936 }, { "content": " def get_internal_type(self):\n return \"FilePathField\"", "metadata": "root.FilePathField.get_internal_type", "header": "['class', 'FilePathField', '(', 'Field', ')', ':', '___EOS___']", "index": 948 }, { "content": "class GenericIPAddressField(Field):\n empty_strings_allowed = True\n description = _(\"IP address\")\n default_error_messages = {}\n\n\n\n\n\n", "metadata": "root.GenericIPAddressField", "header": "['module', '___EOS___']", "index": 1045 }, { "content": " def __init__(self, verbose_name=None, name=None, protocol='both',\n unpack_ipv4=False, *args, **kwargs):\n self.unpack_ipv4 = unpack_ipv4\n self.default_validators, invalid_error_message = \\\n validators.ip_address_validators(protocol, unpack_ipv4)\n self.default_error_messages['invalid'] = invalid_error_message\n kwargs['max_length'] = 39\n Field.__init__(self, verbose_name, name, *args, **kwargs)", "metadata": "root.GenericIPAddressField.__init__", "header": "['class', 'GenericIPAddressField', '(', 'Field', ')', ':', '___EOS___']", "index": 1050 }, { "content": " def get_internal_type(self):\n return \"GenericIPAddressField\"", "metadata": "root.GenericIPAddressField.get_internal_type", "header": "['class', 'GenericIPAddressField', '(', 'Field', ')', ':', '___EOS___']", "index": 1059 }, { "content": " def to_python(self, value):\n if value and ':' in value:\n return clean_ipv6_address(value,\n self.unpack_ipv4, self.error_messages['invalid'])\n return value", "metadata": "root.GenericIPAddressField.to_python", "header": "['class', 'GenericIPAddressField', '(', 'Field', ')', ':', '___EOS___']", "index": 1062 }, { "content": " def get_db_prep_value(self, value, connection, prepared=False):\n if not prepared:\n value = self.get_prep_value(value)\n return value or None", "metadata": "root.GenericIPAddressField.get_db_prep_value", "header": "['class', 'GenericIPAddressField', '(', 'Field', ')', ':', '___EOS___']", "index": 1068 }, { "content": " def get_prep_value(self, value):\n if value and ':' in value:\n try:\n return clean_ipv6_address(value, self.unpack_ipv4)\n except exceptions.ValidationError:\n pass\n return value", "metadata": "root.GenericIPAddressField.get_prep_value", "header": "['class', 'GenericIPAddressField', '(', 'Field', ')', ':', '___EOS___']", "index": 1073 }, { "content": " def formfield(self, **kwargs):\n defaults = {'form_class': forms.GenericIPAddressField}\n defaults.update(kwargs)\n return super(GenericIPAddressField, self).formfield(**defaults)", "metadata": "root.GenericIPAddressField.formfield", "header": "['class', 'GenericIPAddressField', '(', 'Field', ')', ':', '___EOS___']", "index": 1081 }, { "content": "class TimeField(Field):\n empty_strings_allowed = False\n default_error_messages = {\n 'invalid': _(\"'%s' value has an invalid format. It must be in \"\n \"HH:MM[:ss[.uuuuuu]] format.\"),\n 'invalid_time': _(\"'%s' value has the correct format \"\n \"(HH:MM[:ss[.uuuuuu]]) but it is an invalid time.\"),\n }\n description = _(\"Time\")\n\n\n\n\n\n\n\n", "metadata": "root.TimeField", "header": "['module', '___EOS___']", "index": 1202 }, { "content": " def __init__(self, verbose_name=None, name=None, auto_now=False,\n auto_now_add=False, **kwargs):\n self.auto_now, self.auto_now_add = auto_now, auto_now_add\n if auto_now or auto_now_add:\n kwargs['editable'] = False\n kwargs['blank'] = True\n Field.__init__(self, verbose_name, name, **kwargs)", "metadata": "root.TimeField.__init__", "header": "['class', 'TimeField', '(', 'Field', ')', ':', '___EOS___']", "index": 1212 }, { "content": " def get_internal_type(self):\n return \"TimeField\"", "metadata": "root.TimeField.get_internal_type", "header": "['class', 'TimeField', '(', 'Field', ')', ':', '___EOS___']", "index": 1220 }, { "content": " def to_python(self, value):\n if value is None:\n return None\n if isinstance(value, datetime.time):\n return value\n if isinstance(value, datetime.datetime):\n # Not usually a good idea to pass in a datetime here (it loses\n # information), but this can be a side-effect of interacting with a\n # database backend (e.g. Oracle), so we'll be accommodating.\n return value.time()\n\n try:\n parsed = parse_time(value)\n if parsed is not None:\n return parsed\n except ValueError:\n msg = self.error_messages['invalid_time'] % value\n raise exceptions.ValidationError(msg)\n\n msg = self.error_messages['invalid'] % value\n raise exceptions.ValidationError(msg)", "metadata": "root.TimeField.to_python", "header": "['class', 'TimeField', '(', 'Field', ')', ':', '___EOS___']", "index": 1223 }, { "content": " def pre_save(self, model_instance, add):\n if self.auto_now or (self.auto_now_add and add):\n value = datetime.datetime.now().time()\n setattr(model_instance, self.attname, value)\n return value\n else:\n return super(TimeField, self).pre_save(model_instance, add)", "metadata": "root.TimeField.pre_save", "header": "['class', 'TimeField', '(', 'Field', ')', ':', '___EOS___']", "index": 1245 }, { "content": " def get_prep_value(self, value):\n return self.to_python(value)", "metadata": "root.TimeField.get_prep_value", "header": "['class', 'TimeField', '(', 'Field', ')', ':', '___EOS___']", "index": 1253 }, { "content": " def get_db_prep_value(self, value, connection, prepared=False):\n # Casts times into the format expected by the backend\n if not prepared:\n value = self.get_prep_value(value)\n return connection.ops.value_to_db_time(value)", "metadata": "root.TimeField.get_db_prep_value", "header": "['class', 'TimeField', '(', 'Field', ')', ':', '___EOS___']", "index": 1256 }, { "content": " def value_to_string(self, obj):\n val = self._get_val_from_obj(obj)\n return '' if val is None else val.isoformat()", "metadata": "root.TimeField.value_to_string", "header": "['class', 'TimeField', '(', 'Field', ')', ':', '___EOS___']", "index": 1262 }, { "content": " def formfield(self, **kwargs):\n defaults = {'form_class': forms.TimeField}\n defaults.update(kwargs)\n return super(TimeField, self).formfield(**defaults)", "metadata": "root.TimeField.formfield", "header": "['class', 'TimeField', '(', 'Field', ')', ':', '___EOS___']", "index": 1266 } ]
[ { "span": "class DateField(Field):", "start_line": 661, "start_column": 0, "end_line": 661, "end_column": 23 }, { "span": "class DecimalField(Field):", "start_line": 846, "start_column": 0, "end_line": 846, "end_column": 26 }, { "span": "class FilePathField(Field):", "start_line": 926, "start_column": 0, "end_line": 926, "end_column": 27 }, { "span": "class GenericIPAddressField(Field):", "start_line": 1045, "start_column": 0, "end_line": 1045, "end_column": 35 }, { "span": "class TimeField(Field):", "start_line": 1202, "start_column": 0, "end_line": 1202, "end_column": 23 } ]
[ { "span": "def __eq__(self, other):", "start_line": 125, "start_column": 4, "end_line": 125, "end_column": 28 }, { "span": "self.auto_now,", "start_line": 673, "start_column": 8, "end_line": 673, "end_column": 21 }, { "span": "self.auto_now_add ", "start_line": 673, "start_column": 23, "end_line": 673, "end_column": 40 }, { "span": "self.max_digits,", "start_line": 855, "start_column": 8, "end_line": 855, "end_column": 23 }, { "span": "self.decimal_places ", "start_line": 855, "start_column": 25, "end_line": 855, "end_column": 44 }, { "span": "self.path,", "start_line": 931, "start_column": 8, "end_line": 931, "end_column": 17 }, { "span": "self.match,", "start_line": 931, "start_column": 19, "end_line": 931, "end_column": 29 }, { "span": "self.recursive ", "start_line": 931, "start_column": 31, "end_line": 931, "end_column": 45 }, { "span": "self.allow_files,", "start_line": 932, "start_column": 8, "end_line": 932, "end_column": 24 }, { "span": "self.allow_folders ", "start_line": 932, "start_column": 26, "end_line": 932, "end_column": 44 }, { "span": "self.unpack_ipv4 ", "start_line": 1052, "start_column": 8, "end_line": 1052, "end_column": 24 }, { "span": "self.default_validators,", "start_line": 1053, "start_column": 8, "end_line": 1053, "end_column": 31 }, { "span": "self.auto_now,", "start_line": 1214, "start_column": 8, "end_line": 1214, "end_column": 21 }, { "span": "self.auto_now_add ", "start_line": 1214, "start_column": 23, "end_line": 1214, "end_column": 40 } ]
1
false
[ "[CLS]_", "`_", "\\u\\u", "eq\\u\\u_", "`_", "not_", "overrid", "den_", "when_", "addin", "g_", "attributes_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "total", "\\u", "ordering_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Base", " ", "class", " ", "for", " ", "all", " ", "field", " ", "types", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Designat", "es", " ", "whe", "ther", " ", "empty", " ", "string", "s", " ", "fund", "amental", "ly", " ", "are", " ", "allow", "ed", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "level", "._", "\\u\\u\\uNL\\u\\u\\u_", "empty", "\\u", "string", "s", "\\u", "allowed_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", "se", " ", "track", " ", "each", " ", "time", " ", "a", " ", "Field", " ", "instance", " ", "is", " ", "created", ".", " ", "Us", "ed", " ", "to", " ", "retain", " ", "order", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "auto", "\\u", "creati", "on", "\\u", "counter", " ", "is", " ", "used", " ", "for", " ", "fields", " ", "tha", "t", " ", "Dj", "ang", "o", " ", "implicit", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", "s", ",", " ", "creati", "on", "\\u", "counter", " ", "is", " ", "used", " ", "for", " ", "all", " ", "user", "-", "specified", " ", "fields", "._", "\\u\\u\\uNL\\u\\u\\u_", "creati", "on", "\\u", "counter_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "auto", "\\u", "creati", "on", "\\u", "counter_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default", "\\u", "validators_", "=_", "[_", "]_", "#", " ", "Default", " ", "set", " ", "of", " ", "validators_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default", "\\u", "error", "\\u", "messages_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "invalid", "\\u", "choice", "'_", ":_", "\\u_", "(_", "'", "Value", " ", "%", "r", " ", "is", " ", "not", " ", "a", " ", "valid", " ", "choice", ".'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "null", "'_", ":_", "\\u_", "(_", "'", "Thi", "s", " ", "field", " ", "cann", "ot", " ", "be", " ", "null", ".'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "blank", "'_", ":_", "\\u_", "(_", "'", "Thi", "s", " ", "field", " ", "cann", "ot", " ", "be", " ", "blank", ".'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "unique", "'_", ":_", "\\u_", "(_", "'%", "(", "model", "\\u", "name", ")", "s", " ", "with", " ", "this", " ", "%", "(", "field", "\\u", "label", ")", "s", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "alr", "ead", "y", " ", "exist", "s", ".'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Gene", "ric", " ", "field", " ", "type", " ", "description", ",", " ", "usual", "ly", " ", "override", "n", " ", "by", " ", "subclasses", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "description_", "=_", "property_", "(_", "\\u", "description_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "choices_", "=_", "property_", "(_", "\\u", "get", "\\u", "choices_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "flat", "choices_", "=_", "property_", "(_", "\\u", "get", "\\u", "flat", "choices_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\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_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "description_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u_", "(_", "'", "Field", " ", "of", " ", "type", ":", " ", "%", "(", "field", "\\u", "type", ")", "s", "'_", ")_", "%_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "field", "\\u", "type", "'_", ":_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", "=_", "None_", ",_", "name_", "=_", "None_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "length_", "=_", "None_", ",_", "unique_", "=_", "False_", ",_", "blank_", "=_", "False_", ",_", "null_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "index_", "=_", "False_", ",_", "rel_", "=_", "None_", ",_", "default_", "=_", "NOT", "\\u", "PROVI", "DED", "_", ",_", "editable_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "serialize_", "=_", "True_", ",_", "unique", "\\u", "for", "\\u", "date_", "=_", "None_", ",_", "unique", "\\u", "for", "\\u", "month_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "unique", "\\u", "for", "\\u", "year_", "=_", "None_", ",_", "choices_", "=_", "None_", ",_", "help", "\\u", "text_", "=_", "''_", ",_", "db", "\\u", "column_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "tables", "pace_", "=_", "None_", ",_", "auto", "\\u", "created_", "=_", "False_", ",_", "validators_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error", "\\u", "messages_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "verbo", "se", "\\u", "name_", "=_", "verbo", "se", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "primary", "\\u", "key_", "=_", "primary", "\\u", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "max", "\\u", "length_", ",_", "self_", "._", "\\u", "unique_", "=_", "max", "\\u", "length_", ",_", "unique_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "blank_", ",_", "self_", "._", "null_", "=_", "blank_", ",_", "null_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rel_", "=_", "rel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "default_", "=_", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "editable_", "=_", "editable_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "serialize_", "=_", "serialize_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "unique", "\\u", "for", "\\u", "date_", ",_", "self_", "._", "unique", "\\u", "for", "\\u", "month_", "=_", "(_", "unique", "\\u", "for", "\\u", "date_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "unique", "\\u", "for", "\\u", "month_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "unique", "\\u", "for", "\\u", "year_", "=_", "unique", "\\u", "for", "\\u", "year_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "choices_", "=_", "choices_", "or_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "help", "\\u", "text_", "=_", "help", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db", "\\u", "column_", "=_", "db", "\\u", "column_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db", "\\u", "tables", "pace_", "=_", "db", "\\u", "tables", "pace_", "or_", "settings_", "._", "DEF", "AUL", "T", "\\u", "INDE", "X", "\\u", "TABLES", "PACE", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "auto", "\\u", "created_", "=_", "auto", "\\u", "created_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "db", "\\u", "index", " ", "to", " ", "Tru", "e", " ", "if", " ", "the", " ", "field", " ", "has", " ", "a", " ", "relation", "ship", " ", "and", " ", "doe", "sn", "'", "t_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "explicit", "ly", " ", "set", " ", "db", "\\u", "index", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "index_", "=_", "db", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Adjust", " ", "the", " ", "appropr", "iate", " ", "creati", "on", " ", "counter", ",", " ", "and", " ", "save", " ", "our", " ", "local", " ", "copy", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "auto", "\\u", "created_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "creati", "on", "\\u", "counter_", "=_", "Field_", "._", "auto", "\\u", "creati", "on", "\\u", "counter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Field_", "._", "auto", "\\u", "creati", "on", "\\u", "counter_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "creati", "on", "\\u", "counter_", "=_", "Field_", "._", "creati", "on", "\\u", "counter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Field_", "._", "creati", "on", "\\u", "counter_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "validators_", "=_", "self_", "._", "default", "\\u", "validators_", "+_", "validators_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "messages_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "c_", "in_", "reversed_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "mro", "\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "messages_", "._", "update_", "(_", "getattr_", "(_", "c_", ",_", "'", "default", "\\u", "error", "\\u", "message", "s", "'_", ",_", "{_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "messages_", "._", "update_", "(_", "error", "\\u", "messages_", "or_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error", "\\u", "messages_", "=_", "messages_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "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_", "#", " ", "Needed", " ", "for", " ", "@", "total", "\\u", "ordering_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "other_", ",_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "creati", "on", "\\u", "counter_", "==_", "other_", "._", "creati", "on", "\\u", "counter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Not", "Implemented_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "lt\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "need", "ed", " ", "bec", "aus", "e", " ", "bisect", " ", "doe", "s", " ", "not", " ", "take", " ", "a", " ", "compa", "ris", "on", " ", "function", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "other_", ",_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "creati", "on", "\\u", "counter_", "<_", "other_", "._", "creati", "on", "\\u", "counter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Not", "Implemented_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "hash\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "hash_", "(_", "self_", "._", "creati", "on", "\\u", "counter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "deepc", "opy", "\\u\\u_", "(_", "self_", ",_", "memo", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "don", "'", "t", " ", "have", " ", "to", " ", "deepc", "opy", " ", "very", " ", "muc", "h", " ", "here", ",", " ", "sinc", "e", " ", "most", " ", "thing", "s", " ", "are", " ", "not_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "inten", "ded", " ", "to", " ", "be", " ", "alter", "ed", " ", "after", " ", "initial", " ", "creati", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "=_", "copy_", "._", "copy_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "rel_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "._", "rel_", "=_", "copy_", "._", "copy_", "(_", "self_", "._", "rel_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "memo", "dict_", "[_", "id_", "(_", "self_", ")_", "]_", "=_", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "python_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Convert", "s", " ", "the", " ", "input", " ", "value", " ", "int", "o", " ", "the", " ", "expected", " ", "Pyth", "on", " ", "data", " ", "type", ",", " ", "rais", "ing", "\\", "10", ";", " ", " ", " ", " ", "django", ".", "core", ".", "exception", "s", ".", "Validat", "ion", "Error", " ", "if", " ", "the", " ", "data", " ", "can", "'", "t", " ", "be", " ", "convert", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "convert", "ed", " ", "value", ".", " ", "Subc", "lasse", "s", " ", "shou", "ld", " ", "override", " ", "this", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run", "\\u", "validators_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "in_", "validators_", "._", "EMP", "TY", "\\u", "VALUES_", ":_", "\\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_", "errors_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "v_", "in_", "self_", "._", "validators_", ":_", "\\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 ", " _", "v_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "exceptions_", "._", "Validat", "ion", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "e_", ",_", "'", "code", "'_", ")_", "and_", "e_", "._", "code_", "in_", "self_", "._", "error", "\\u", "messages_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "message_", "=_", "self_", "._", "error", "\\u", "messages_", "[_", "e_", "._", "code_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "e_", "._", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "message_", "=_", "message_", "%_", "e_", "._", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "errors_", "._", "append_", "(_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "errors_", "._", "extend_", "(_", "e_", "._", "messages_", ")_", "\\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_", "errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "errors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "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_", "validate_", "(_", "self_", ",_", "value_", ",_", "model", "\\u", "instance_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Validate", "s", " ", "value", " ", "and", " ", "throw", "s", " ", "Validat", "ion", "Error", ".", " ", "Subc", "lasse", "s", " ", "shou", "ld", " ", "override", "\\", "10", ";", " ", " ", " ", " ", "this", " ", "to", " ", "provide", " ", "validation", " ", "logic", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "editable_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ski", "p", " ", "validation", " ", "for", " ", "non", "-", "edita", "ble", " ", "fields", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "choices_", "and_", "value_", "not_", "in_", "validators_", "._", "EMP", "TY", "\\u", "VALUES_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "option", "\\u", "key_", ",_", "option", "\\u", "value_", "in_", "self_", "._", "choices_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "option", "\\u", "value_", ",_", "(_", "list_", ",_", "tuple_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "an", " ", "opt", "group", ",", " ", "so", " ", "look", " ", "insi", "de", " ", "the", " ", "group", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "options", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "opt", "group", "\\u", "key_", ",_", "opt", "group", "\\u", "value_", "in_", "option", "\\u", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "value_", "==_", "opt", "group", "\\u", "key_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "value_", "==_", "option", "\\u", "key_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg_", "=_", "self_", "._", "error", "\\u", "messages_", "[_", "'", "invalid", "\\u", "choice", "'_", "]_", "%_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "value_", "is_", "None_", "and_", "not_", "self_", "._", "null_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "self_", "._", "error", "\\u", "messages_", "[_", "'", "null", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "self_", "._", "blank_", "and_", "value_", "in_", "validators_", "._", "EMP", "TY", "\\u", "VALUES_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "self_", "._", "error", "\\u", "messages_", "[_", "'", "blank", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "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_", "clean_", "(_", "self_", ",_", "value_", ",_", "model", "\\u", "instance_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Convert", " ", "the", " ", "value", "'", "s", " ", "type", " ", "and", " ", "run", " ", "validation", ".", " ", "Validat", "ion", " ", "error", "s", "\\", "10", ";", " ", " ", " ", " ", "from", " ", "to", "\\u", "python", " ", "and", " ", "validat", "e", " ", "are", " ", "propagate", "d", ".", " ", "The", " ", "correct", " ", "value", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "return", "ed", " ", "if", " ", "no", " ", "error", " ", "is", " ", "raise", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "self_", "._", "to", "\\u", "python_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "validate_", "(_", "value_", ",_", "model", "\\u", "instance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "run", "\\u", "validators_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "db", "\\u", "type_", "(_", "self_", ",_", "connection_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "databa", "se", " ", "column", " ", "data", " ", "type", " ", "for", " ", "this", " ", "field", ",", " ", "for", " ", "the", " ", "provided", "\\", "10", ";", " ", " ", " ", " ", "connecti", "on", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "default", " ", "implementation", " ", "of", " ", "this", " ", "method", " ", "look", "s", " ", "at", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "back", "end", "-", "specific", " ", "DATA", "\\u", "TYPES", " ", "dictionar", "y", ",", " ", "look", "ing", " ", "up", " ", "the", " ", "field", " ", "by", " ", "its_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "internal", " ", "type", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "Field", " ", "class", " ", "can", " ", "implement", " ", "the", " ", "get", "\\u", "internal", "\\u", "type", "()", " ", "method", " ", "to", " ", "speci", "fy_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whi", "ch", " ", "*", "pree", "xist", "ing", "*", " ", "Dj", "ang", "o", " ", "Field", " ", "class", " ", "it", "'", "s", " ", "most", " ", "similar", " ", "to", " ", "--", " ", "i", ".", "e", ".,", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "custom", " ", "field", " ", "mig", "ht", " ", "be", " ", "represent", "ed", " ", "by", " ", "a", " ", "TEXT", " ", "column", " ", "type", ",", " ", "whi", "ch", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "same", " ", "as", " ", "the", " ", "Text", "Field", " ", "Dj", "ang", "o", " ", "field", " ", "type", ",", " ", "whi", "ch", " ", "means", " ", "the", " ", "custom_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "field", "'", "s", " ", "get", "\\u", "internal", "\\u", "type", "()", " ", "return", "s", " ", "'", "Text", "Field", "'.", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Bu", "t", " ", "the", " ", "limit", "ation", " ", "of", " ", "the", " ", "get", "\\u", "internal", "\\u", "type", "()", " ", "/", " ", "data\\u", "types", " ", "appro", "ach", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "tha", "t", " ", "it", " ", "cann", "ot", " ", "handle", " ", "databa", "se", " ", "column", " ", "types", " ", "tha", "t", " ", "are", "n", "'", "t", " ", "alr", "ead", "y_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "mapp", "ed", " ", "to", " ", "one", " ", "of", " ", "the", " ", "bui", "lt", "-", "in", " ", "Dj", "ang", "o", " ", "field", " ", "types", ".", " ", "In", " ", "this", " ", "case", ",", " ", "you", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "can", " ", "implement", " ", "db", "\\u", "type", "()", " ", "inst", "ead", " ", "of", " ", "get", "\\u", "internal", "\\u", "type", "()", " ", "to", " ", "speci", "fy_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "exact", "ly", " ", "whi", "ch", " ", "wa", "ck", "y", " ", "databa", "se", " ", "column", " ", "type", " ", "you", " ", "want", " ", "to", " ", "use", "._", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "Dict", "Wrapper_", "(_", "self_", "._", "\\u\\u", "dict\\u\\u_", ",_", "connection_", "._", "ops_", "._", "quote", "\\u", "name_", ",_", "\"", "qn", "\\u\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "connection_", "._", "creation_", "._", "data\\u", "types_", "[_", "self_", "._", "get", "\\u", "internal", "\\u", "type_", "(_", ")_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "unique_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "unique_", "or_", "self_", "._", "primary", "\\u", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "attribute", "s", "\\u", "from", "\\u", "name_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "attn", "ame_", ",_", "self_", "._", "column_", "=_", "self_", "._", "get", "\\u", "attn", "ame", "\\u", "column_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "verbo", "se", "\\u", "name_", "is_", "None_", "and_", "self_", "._", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "verbo", "se", "\\u", "name_", "=_", "self_", "._", "name_", "._", "replace_", "(_", "'\\u'_", ",_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "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_", "contribute", "\\u", "to", "\\u", "class_", "(_", "self_", ",_", "cls_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "attribute", "s", "\\u", "from", "\\u", "name_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model_", "=_", "cls_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "\\u", "meta_", "._", "add", "\\u", "field_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "choices_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "cls_", ",_", "'", "get", "\\u", "%", "s", "\\u", "display", "'_", "%_", "self_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "curr", "y_", "(_", "cls_", "._", "\\u", "get", "\\u", "FIE", "LD", "\\u", "display_", ",_", "field_", "=_", "self_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "attn", "ame_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "attn", "ame", "\\u", "column_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "attn", "ame_", "=_", "self_", "._", "get", "\\u", "attn", "ame_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "column_", "=_", "self_", "._", "db", "\\u", "column_", "or_", "attn", "ame_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "attn", "ame_", ",_", "column_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "cache", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'\\u", "%", "s", "\\u", "cache", "'_", "%_", "self_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pre", "\\u", "save_", "(_", "self_", ",_", "model", "\\u", "instance_", ",_", "add_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "field", "'", "s", " ", "value", " ", "just", " ", "bef", "ore", " ", "saving", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "getattr_", "(_", "model", "\\u", "instance_", ",_", "self_", "._", "attn", "ame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "prep", "\\u", "value_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Perform", " ", "prel", "imina", "ry", " ", "non", "-", "db", " ", "specific", " ", "value", " ", "checks", " ", "and", " ", "conversions", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "db", "\\u", "prep", "\\u", "value_", "(_", "self_", ",_", "value_", ",_", "connection_", ",_", "prepared", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "field", "'", "s", " ", "value", " ", "prepared", " ", "for", " ", "interacti", "ng", " ", "with", " ", "the", " ", "databa", "se", "\\", "10", ";", " ", " ", " ", " ", "back", "end", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Us", "ed", " ", "by", " ", "the", " ", "default", " ", "implementation", "s", " ", "of", " ", "``", "get", "\\u", "db", "\\u", "prep", "\\u", "save", "``", "and", "\\", "10", ";", " ", " ", " ", " ", "`", "get", "\\u", "db", "\\u", "prep", "\\u", "look", "up", "```", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "prepared", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "self_", "._", "get", "\\u", "prep", "\\u", "value_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "db", "\\u", "prep", "\\u", "save_", "(_", "self_", ",_", "value_", ",_", "connection_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "field", "'", "s", " ", "value", " ", "prepared", " ", "for", " ", "saving", " ", "int", "o", " ", "a", " ", "databa", "se", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "get", "\\u", "db", "\\u", "prep", "\\u", "value_", "(_", "value_", ",_", "connection_", "=_", "connection_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "prepared", "_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "prep", "\\u", "lookup_", "(_", "self_", ",_", "look", "up", "\\u", "type_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Perform", " ", "prel", "imina", "ry", " ", "non", "-", "db", " ", "specific", " ", "look", "up", " ", "checks", " ", "and", " ", "conversions", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "value_", ",_", "'", "prepar", "e", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "._", "prepare_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "value_", ",_", "'\\u", "prepar", "e", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "._", "\\u", "prepare_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "look", "up", "\\u", "type_", "in_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "regex", "'_", ",_", "'", "ire", "gex", "'_", ",_", "'", "month", "'_", ",_", "'", "day", "'_", ",_", "'", "week", "\\u", "day", "'_", ",_", "'", "search", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "contain", "s", "'_", ",_", "'", "icon", "tain", "s", "'_", ",_", "'", "iex", "act", "'_", ",_", "'", "startswith", "'_", ",_", "'", "ista", "rts", "with", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ends", "with", "'_", ",_", "'", "ien", "ds", "with", "'_", ",_", "'", "isn", "ull", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "look", "up", "\\u", "type_", "in_", "(_", "'", "exact", "'_", ",_", "'", "gt", "'_", ",_", "'", "gte", "'_", ",_", "'", "lt", "'_", ",_", "'", "lte", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "\\u", "prep", "\\u", "value_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "look", "up", "\\u", "type_", "in_", "(_", "'", "range", "'_", ",_", "'", "in", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "self_", "._", "get", "\\u", "prep", "\\u", "value_", "(_", "v_", ")_", "for_", "v_", "in_", "value_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "look", "up", "\\u", "type_", "==_", "'", "year", "'_", ":_", "\\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_", "int_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "The", " ", "\\u\\u", "year", " ", "look", "up", " ", "type", " ", "require", "s", " ", "an", " ", "integ", "er", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "argu", "ment", "\"_", ")_", "\\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_", "(_", "\"", "Field", " ", "has", " ", "invalid", " ", "look", "up", ":", " ", "%", "s", "\"_", "%_", "look", "up", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "db", "\\u", "prep", "\\u", "lookup_", "(_", "self_", ",_", "look", "up", "\\u", "type_", ",_", "value_", ",_", "connection_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "prepared", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "field", "'", "s", " ", "value", " ", "prepared", " ", "for", " ", "databa", "se", " ", "look", "up", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "prepared", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "self_", "._", "get", "\\u", "prep", "\\u", "lookup_", "(_", "look", "up", "\\u", "type_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "value_", ",_", "'", "get", "\\u", "compiler", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "value_", "._", "get", "\\u", "compiler_", "(_", "connection_", "=_", "connection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "value_", ",_", "'", "as", "\\u", "sql", "'_", ")_", "or_", "hasattr_", "(_", "value_", ",_", "'\\u", "as", "\\u", "sql", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "value", " ", "has", " ", "a", " ", "rela", "bel", "\\u", "alias", "es", " ", "method", ",", " ", "it", " ", "will", " ", "need", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "be", " ", "invoke", "d", " ", "bef", "ore", " ", "the", " ", "final", " ", "SQL", " ", "is", " ", "evaluate", "d_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "value_", ",_", "'", "rela", "bel", "\\u", "alias", "es", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "value_", ",_", "'", "as", "\\u", "sql", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", ",_", "params_", "=_", "value_", "._", "as", "\\u", "sql_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", ",_", "params_", "=_", "value_", "._", "\\u", "as", "\\u", "sql_", "(_", "connection_", "=_", "connection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Query", "Wrapper_", "(_", "(_", "'(", "%", "s", ")'_", "%_", "sql_", ")_", ",_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "look", "up", "\\u", "type_", "in_", "(_", "'", "regex", "'_", ",_", "'", "ire", "gex", "'_", ",_", "'", "month", "'_", ",_", "'", "day", "'_", ",_", "'", "week", "\\u", "day", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "search", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "value_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "look", "up", "\\u", "type_", "in_", "(_", "'", "exact", "'_", ",_", "'", "gt", "'_", ",_", "'", "gte", "'_", ",_", "'", "lt", "'_", ",_", "'", "lte", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "self_", "._", "get", "\\u", "db", "\\u", "prep", "\\u", "value_", "(_", "value_", ",_", "connection_", "=_", "connection_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "prepared", "_", "=_", "prepared", "_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "look", "up", "\\u", "type_", "in_", "(_", "'", "range", "'_", ",_", "'", "in", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "self_", "._", "get", "\\u", "db", "\\u", "prep", "\\u", "value_", "(_", "v_", ",_", "connection_", "=_", "connection_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "prepared", "_", "=_", "prepared", "_", ")_", "for_", "v_", "in_", "value_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "look", "up", "\\u", "type_", "in_", "(_", "'", "contain", "s", "'_", ",_", "'", "icon", "tain", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "\"%%", "%", "s", "%%\"_", "%_", "connection_", "._", "ops_", "._", "prep", "\\u", "for", "\\u", "like", "\\u", "query_", "(_", "value_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "look", "up", "\\u", "type_", "==_", "'", "iex", "act", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "connection_", "._", "ops_", "._", "prep", "\\u", "for", "\\u", "iex", "act", "\\u", "query_", "(_", "value_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "look", "up", "\\u", "type_", "in_", "(_", "'", "startswith", "'_", ",_", "'", "ista", "rts", "with", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "\"%", "s", "%%\"_", "%_", "connection_", "._", "ops_", "._", "prep", "\\u", "for", "\\u", "like", "\\u", "query_", "(_", "value_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "look", "up", "\\u", "type_", "in_", "(_", "'", "ends", "with", "'_", ",_", "'", "ien", "ds", "with", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "\"%%", "%", "s", "\"_", "%_", "connection_", "._", "ops_", "._", "prep", "\\u", "for", "\\u", "like", "\\u", "query_", "(_", "value_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "look", "up", "\\u", "type_", "==_", "'", "isn", "ull", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "look", "up", "\\u", "type_", "==_", "'", "year", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "get", "\\u", "internal", "\\u", "type_", "(_", ")_", "==_", "'", "Date", "Field", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "connection_", "._", "ops_", "._", "year", "\\u", "look", "up", "\\u", "bound", "s", "\\u", "for", "\\u", "date", "\\u", "field_", "(_", "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 ", " _", "return_", "connection_", "._", "ops_", "._", "year", "\\u", "look", "up", "\\u", "bounds_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "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_", "has", "\\u", "default_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "boolean", " ", "of", " ", "whe", "ther", " ", "this", " ", "field", " ", "has", " ", "a", " ", "default", " ", "value", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "default_", "is_", "not_", "NOT", "\\u", "PROVI", "DED", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "default_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "default", " ", "value", " ", "for", " ", "this", " ", "field", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "default_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "callable_", "(_", "self_", "._", "default_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "default_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "force", "\\u", "text_", "(_", "self_", "._", "default_", ",_", "string", "s", "\\u", "only_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "not_", "self_", "._", "empty", "\\u", "string", "s", "\\u", "allowed_", "or_", "(_", "self_", "._", "null_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "connection_", "._", "features_", "._", "interpret", "s", "\\u", "empty", "\\u", "string", "s", "\\u", "as", "\\u", "null", "s_", ")_", ")_", ":_", "\\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_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "validator", "\\u", "unique", "\\u", "look", "up", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'%", "s", "\\u\\u", "exact", "'_", "%_", "self_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "choices_", "(_", "self_", ",_", "include", "\\u", "blank_", "=_", "True_", ",_", "blank", "\\u", "choice_", "=_", "BLANK", "\\u", "CHOICE", "\\u", "DAS", "H_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "choice", "s", " ", "with", " ", "a", " ", "default", " ", "blank", " ", "choice", "s", " ", "include", "d", ",", " ", "for", " ", "use", "\\", "10", ";", " ", " ", " ", " ", "as", " ", "Select", "Field", " ", "choice", "s", " ", "for", " ", "this", " ", "field", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "first", "\\u", "choice_", "=_", "include", "\\u", "blank_", "and_", "blank", "\\u", "choice_", "or_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "choices_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "first", "\\u", "choice_", "+_", "list_", "(_", "self_", "._", "choices_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rel", "\\u", "model_", "=_", "self_", "._", "rel_", "._", "to_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "self_", "._", "rel_", ",_", "'", "get", "\\u", "relate", "d\\u", "field", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lst_", "=_", "[_", "(_", "getattr_", "(_", "x_", ",_", "self_", "._", "rel_", "._", "get", "\\u", "relate", "d\\u", "field_", "(_", ")_", "._", "attn", "ame_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "smart", "\\u", "text_", "(_", "x_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "rel", "\\u", "model_", "._", "\\u", "default", "\\u", "manager_", "._", "complex", "\\u", "filter_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "rel_", "._", "limit", "\\u", "choice", "s", "\\u", "to_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lst_", "=_", "[_", "(_", "x_", "._", "\\u", "get", "\\u", "pk", "\\u", "val_", "(_", ")_", ",_", "smart", "\\u", "text_", "(_", "x_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "rel", "\\u", "model_", "._", "\\u", "default", "\\u", "manager_", "._", "complex", "\\u", "filter_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "rel_", "._", "limit", "\\u", "choice", "s", "\\u", "to_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "first", "\\u", "choice_", "+_", "lst_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "choice", "s", "\\u", "default_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "\\u", "choices_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "flat", "choices_", "(_", "self_", ",_", "include", "\\u", "blank_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "blank", "\\u", "choice_", "=_", "BLANK", "\\u", "CHOICE", "\\u", "DAS", "H_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "flattened", " ", "choice", "s", " ", "with", " ", "a", " ", "default", " ", "blank", " ", "choice", " ", "include", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "first", "\\u", "choice_", "=_", "include", "\\u", "blank_", "and_", "blank", "\\u", "choice_", "or_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "first", "\\u", "choice_", "+_", "list_", "(_", "self_", "._", "flat", "choices_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "val", "\\u", "from", "\\u", "obj_", "(_", "self_", ",_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "obj_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "getattr_", "(_", "obj_", ",_", "self_", "._", "attn", "ame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "\\u", "default_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "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_", "value", "\\u", "to", "\\u", "string_", "(_", "self_", ",_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "string", " ", "value", " ", "of", " ", "this", " ", "field", " ", "from", " ", "the", " ", "pass", "ed", " ", "obj", ".", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "used", " ", "by", " ", "the", " ", "serializ", "ation", " ", "frame", "work", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "smart", "\\u", "text_", "(_", "self_", "._", "\\u", "get", "\\u", "val", "\\u", "from", "\\u", "obj_", "(_", "obj_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "bind_", "(_", "self_", ",_", "field", "mapping_", ",_", "original_", ",_", "bound", "\\u", "field", "\\u", "class_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "bound", "\\u", "field", "\\u", "class_", "(_", "self_", ",_", "field", "mapping_", ",_", "original_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "choices_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "self_", "._", "\\u", "choices_", ",_", "collections_", "._", "Iterator_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "choices_", ",_", "self_", "._", "\\u", "choices_", "=_", "tee", "_", "(_", "self_", "._", "\\u", "choices_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "choices_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "choices_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "get", "\\u", "flat", "choices_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Flatt", "ened", " ", "version", " ", "of", " ", "choice", "s", " ", "tuple", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flat_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "choice_", ",_", "value_", "in_", "self_", "._", "choices_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "value_", ",_", "(_", "list_", ",_", "tuple_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flat_", "._", "extend_", "(_", "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 ", " _", "flat_", "._", "append_", "(_", "(_", "choice_", ",_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "flat_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "save", "\\u", "form", "\\u", "data_", "(_", "self_", ",_", "instance_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "instance_", ",_", "self_", "._", "name_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "form", "\\u", "class_", "=_", "forms_", "._", "Char", "Field_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "django", ".", "forms", ".", "Field", " ", "instance", " ", "for", " ", "this", " ", "databa", "se", " ", "Field", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "=_", "{_", "'", "require", "d", "'_", ":_", "not_", "self_", "._", "blank_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "label", "'_", ":_", "cap", "first_", "(_", "self_", "._", "verbo", "se", "\\u", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "help", "\\u", "text", "'_", ":_", "self_", "._", "help", "\\u", "text_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "default_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "callable_", "(_", "self_", "._", "default_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "[_", "'", "initial", "'_", "]_", "=_", "self_", "._", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "[_", "'", "show", "\\u", "hidden", "\\u", "initial", "'_", "]_", "=_", "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 ", " _", "defaults_", "[_", "'", "initial", "'_", "]_", "=_", "self_", "._", "get", "\\u", "default_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "choices_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Field", "s", " ", "with", " ", "choice", "s", " ", "get", " ", "special", " ", "treatment", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "include", "\\u", "blank_", "=_", "(_", "self_", "._", "blank_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "(_", "self_", "._", "has", "\\u", "default_", "(_", ")_", "or_", "'", "initial", "'_", "in_", "kwargs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "[_", "'", "choice", "s", "'_", "]_", "=_", "self_", "._", "get", "\\u", "choices_", "(_", "include", "\\u", "blank_", "=_", "include", "\\u", "blank_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "[_", "'", "coerce", "'_", "]_", "=_", "self_", "._", "to", "\\u", "python_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "null_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "[_", "'", "empty", "\\u", "value", "'_", "]_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "form", "\\u", "class_", "=_", "forms_", "._", "Type", "d", "Choi", "ce", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Many", " ", "of", " ", "the", " ", "subclass", "-", "specific", " ", "formfi", "eld", " ", "argu", "ment", "s", " ", "(", "min", "\\u", "value", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "max", "\\u", "value", ")", " ", "don", "'", "t", " ", "appl", "y", " ", "for", " ", "choice", " ", "fields", ",", " ", "so", " ", "be", " ", "sure", " ", "to", " ", "only", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "values", " ", "tha", "t", " ", "Type", "d", "Choi", "ce", "Field", " ", "will", " ", "underst", "and", "._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", "in_", "list_", "(_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "k_", "not_", "in_", "(_", "'", "coerce", "'_", ",_", "'", "empty", "\\u", "value", "'_", ",_", "'", "choice", "s", "'_", ",_", "'", "require", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "widget", "'_", ",_", "'", "label", "'_", ",_", "'", "initial", "'_", ",_", "'", "help", "\\u", "text", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "error", "\\u", "message", "s", "'_", ",_", "'", "show", "\\u", "hidden", "\\u", "initial", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "del_", "kwargs_", "[_", "k_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "form", "\\u", "class_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "value", "\\u", "from", "\\u", "object_", "(_", "self_", ",_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "value", " ", "of", " ", "this", " ", "field", " ", "in", " ", "the", " ", "give", "n", " ", "model", " ", "instance", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "getattr_", "(_", "obj_", ",_", "self_", "._", "attn", "ame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field_", "(_", "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 ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Display", "s", " ", "the", " ", "module", ",", " ", "class", " ", "and", " ", "name", " ", "of", " ", "the", " ", "field", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "'%", "s", ".", "%", "s", "'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "module\\u\\u_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "getattr_", "(_", "self_", ",_", "'", "name", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "name_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'<", "%", "s", ":", " ", "%", "s", ">'_", "%_", "(_", "path_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "'<", "%", "s", ">'_", "%_", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "empty", "\\u", "string", "s", "\\u", "allowed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default", "\\u", "error", "\\u", "messages_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "invalid", "'_", ":_", "\\u_", "(_", "\"'", "%", "s", "'", " ", "value", " ", "has", " ", "an", " ", "invalid", " ", "date", " ", "format", ".", " ", "It", " ", "must", " ", "be", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "in", " ", "YYY", "Y", "-", "MM", "-", "DD", " ", "format", ".\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "invalid", "\\u", "date", "'_", ":_", "\\u_", "(_", "\"'", "%", "s", "'", " ", "value", " ", "has", " ", "the", " ", "correct", " ", "format", " ", "(", "YYY", "Y", "-", "MM", "-", "DD", ")", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "but", " ", "it", " ", "is", " ", "an", " ", "invalid", " ", "date", ".\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "description_", "=_", "\\u_", "(_", "\"", "Date", " ", "(", "with", "out", " ", "time", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\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_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", "=_", "None_", ",_", "name_", "=_", "None_", ",_", "auto", "\\u", "now_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "auto", "\\u", "now", "\\u", "add_", "=_", "False_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "auto", "\\u", "now_", ",_", "self_", "._", "auto", "\\u", "now", "\\u", "add_", "=_", "auto", "\\u", "now_", ",_", "auto", "\\u", "now", "\\u", "add_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "auto", "\\u", "now_", "or_", "auto", "\\u", "now", "\\u", "add_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'", "edita", "ble", "'_", "]_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "blank", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Field_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", ",_", "name_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Date", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "python_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "value_", ",_", "datetime_", "._", "datetime_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "settings_", "._", "USE", "\\u", "TZ_", "and_", "timezone_", "._", "is", "\\u", "aware_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Convert", " ", "awa", "re", " ", "datetimes", " ", "to", " ", "the", " ", "default", " ", "time", " ", "zone_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bef", "ore", " ", "casting", " ", "them", " ", "to", " ", "dates", " ", "(", "#", "177", "4", "2", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "default", "\\u", "timezone_", "=_", "timezone_", "._", "get", "\\u", "default", "\\u", "timezone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "timezone_", "._", "make", "\\u", "naive", "_", "(_", "value_", ",_", "default", "\\u", "timezone_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "value_", "._", "date_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "value_", ",_", "datetime_", "._", "date_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\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 ", " _", "parsed_", "=_", "parse", "\\u", "date_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "parsed_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "parsed_", "\\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 ", " _", "msg_", "=_", "self_", "._", "error", "\\u", "messages_", "[_", "'", "invalid", "\\u", "date", "'_", "]_", "%_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg_", "=_", "self_", "._", "error", "\\u", "messages_", "[_", "'", "invalid", "'_", "]_", "%_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pre", "\\u", "save_", "(_", "self_", ",_", "model", "\\u", "instance_", ",_", "add_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "auto", "\\u", "now_", "or_", "(_", "self_", "._", "auto", "\\u", "now", "\\u", "add_", "and_", "add_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "datetime_", "._", "date_", "._", "today_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "setattr_", "(_", "model", "\\u", "instance_", ",_", "self_", "._", "attn", "ame_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "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 ", " _", "return_", "super_", "(_", "Date", "Field_", ",_", "self_", ")_", "._", "pre", "\\u", "save_", "(_", "model", "\\u", "instance_", ",_", "add_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "contribute", "\\u", "to", "\\u", "class_", "(_", "self_", ",_", "cls_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Date", "Field_", ",_", "self_", ")_", "._", "contribute", "\\u", "to", "\\u", "class_", "(_", "cls_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "null_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "cls_", ",_", "'", "get", "\\u", "next", "\\u", "by", "\\u", "%", "s", "'_", "%_", "self_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "curr", "y_", "(_", "cls_", "._", "\\u", "get", "\\u", "next", "\\u", "or", "\\u", "previ", "ous", "\\u", "by", "\\u", "FIELD_", ",_", "field_", "=_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "next_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "setattr_", "(_", "cls_", ",_", "'", "get", "\\u", "previ", "ous", "\\u", "by", "\\u", "%", "s", "'_", "%_", "self_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "curr", "y_", "(_", "cls_", "._", "\\u", "get", "\\u", "next", "\\u", "or", "\\u", "previ", "ous", "\\u", "by", "\\u", "FIELD_", ",_", "field_", "=_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "next_", "=_", "False_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\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", "prep", "\\u", "lookup_", "(_", "self_", ",_", "look", "up", "\\u", "type_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "For", " ", "\"\\u\\u", "month", "\",", " ", "\"\\u\\u", "day", "\",", " ", "and", " ", "\"\\u\\u", "week", "\\u", "day", "\"", " ", "lookups", ",", " ", "convert", " ", "the", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "an", " ", "int", " ", "so", " ", "the", " ", "databa", "se", " ", "back", "end", " ", "alw", "ay", "s", " ", "see", "s", " ", "a", " ", "consistent", " ", "type", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "look", "up", "\\u", "type_", "in_", "(_", "'", "month", "'_", ",_", "'", "day", "'_", ",_", "'", "week", "\\u", "day", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "int_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "super_", "(_", "Date", "Field_", ",_", "self_", ")_", "._", "get", "\\u", "prep", "\\u", "lookup_", "(_", "look", "up", "\\u", "type_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "prep", "\\u", "value_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "to", "\\u", "python_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "db", "\\u", "prep", "\\u", "value_", "(_", "self_", ",_", "value_", ",_", "connection_", ",_", "prepared", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Cast", "s", " ", "dates", " ", "int", "o", " ", "the", " ", "format", " ", "expected", " ", "by", " ", "the", " ", "backend_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "prepared", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "self_", "._", "get", "\\u", "prep", "\\u", "value_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "connection_", "._", "ops_", "._", "value", "\\u", "to", "\\u", "db", "\\u", "date_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "value", "\\u", "to", "\\u", "string_", "(_", "self_", ",_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "val_", "=_", "self_", "._", "\\u", "get", "\\u", "val", "\\u", "from", "\\u", "obj_", "(_", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "''_", "if_", "val_", "is_", "None_", "else_", "val_", "._", "isoformat_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Date", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "'", "form", "\\u", "class", "'_", ":_", "forms_", "._", "Date", "Field_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Date", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Deci", "mal", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "empty", "\\u", "string", "s", "\\u", "allowed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default", "\\u", "error", "\\u", "messages_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "invalid", "'_", ":_", "\\u_", "(_", "\"'", "%", "s", "'", " ", "value", " ", "must", " ", "be", " ", "a", " ", "decima", "l", " ", "number", ".\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "description_", "=_", "\\u_", "(_", "\"", "Deci", "mal", " ", "number", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\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_", "Deci", "mal", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", "=_", "None_", ",_", "name_", "=_", "None_", ",_", "max", "\\u", "digits_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "decima", "l\\u", "places_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "max", "\\u", "digits_", ",_", "self_", "._", "decima", "l\\u", "places_", "=_", "max", "\\u", "digits_", ",_", "decima", "l\\u", "places_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Field_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", ",_", "name_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Deci", "mal", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Deci", "mal", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Deci", "mal", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "python_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "decimal_", "._", "Decimal_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "decimal_", "._", "Inva", "lid", "Operation_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "self_", "._", "error", "\\u", "messages_", "[_", "'", "invalid", "'_", "]_", "%_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Deci", "mal", "Field_", "(_", "Field_", ")_", ":_", "\\u\\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", "format_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "value_", ",_", "six_", "._", "string", "\\u", "types_", ")_", "or_", "value_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "format\\u", "number_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Deci", "mal", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "format\\u", "number_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Format", "s", " ", "a", " ", "number", " ", "int", "o", " ", "a", " ", "string", " ", "with", " ", "the", " ", "requisit", "e", " ", "number", " ", "of", " ", "digit", "s", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "decima", "l", " ", "place", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Meth", "od", " ", "moved", " ", "to", " ", "django", ".", "db", ".", "back", "ends", ".", "util", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "It", " ", "is", " ", "preserved", " ", "bec", "aus", "e", " ", "it", " ", "is", " ", "used", " ", "by", " ", "the", " ", "oracle", " ", "backend_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "django", ".", "db", ".", "back", "ends", ".", "oracle", ".", "query", "),", " ", "and", " ", "als", "o", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "back", "ward", "s", "-", "compatibility", " ", "with", " ", "any", " ", "external", " ", "code", " ", "whi", "ch", " ", "may", " ", "have", " ", "used_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "method", "._", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "backends_", "import_", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "util_", "._", "format\\u", "number_", "(_", "value_", ",_", "self_", "._", "max", "\\u", "digits_", ",_", "self_", "._", "decima", "l\\u", "places_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Deci", "mal", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "db", "\\u", "prep", "\\u", "save_", "(_", "self_", ",_", "value_", ",_", "connection_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "connection_", "._", "ops_", "._", "value", "\\u", "to", "\\u", "db", "\\u", "decimal_", "(_", "self_", "._", "to", "\\u", "python_", "(_", "value_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "max", "\\u", "digits_", ",_", "self_", "._", "decima", "l\\u", "places_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Deci", "mal", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "prep", "\\u", "value_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "to", "\\u", "python_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Deci", "mal", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "max", "\\u", "digit", "s", "'_", ":_", "self_", "._", "max", "\\u", "digits_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "decima", "l\\u", "place", "s", "'_", ":_", "self_", "._", "decima", "l\\u", "places_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "form", "\\u", "class", "'_", ":_", "forms_", "._", "Deci", "mal", "Field_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Deci", "mal", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "File", "Path", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "description_", "=_", "\\u_", "(_", "\"", "File", " ", "path", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "File", "Path", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", "=_", "None_", ",_", "name_", "=_", "None_", ",_", "path_", "=_", "''_", ",_", "match_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "recursive_", "=_", "False_", ",_", "allow", "\\u", "files_", "=_", "True_", ",_", "allow", "\\u", "folders_", "=_", "False_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "path_", ",_", "self_", "._", "match_", ",_", "self_", "._", "recursive_", "=_", "path_", ",_", "match_", ",_", "recursive_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "allow", "\\u", "files_", ",_", "self_", "._", "allow", "\\u", "folders_", "=_", "allow", "\\u", "files_", ",_", "allow", "\\u", "folders_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "max", "\\u", "length", "'_", "]_", "=_", "kwargs_", "._", "get_", "(_", "'", "max", "\\u", "length", "'_", ",_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Field_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", ",_", "name_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "File", "Path", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "path", "'_", ":_", "self_", "._", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "match", "'_", ":_", "self_", "._", "match_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "recurs", "ive", "'_", ":_", "self_", "._", "recursive_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "form", "\\u", "class", "'_", ":_", "forms_", "._", "File", "Path", "Field_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "allow", "\\u", "files", "'_", ":_", "self_", "._", "allow", "\\u", "files_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "allow", "\\u", "folder", "s", "'_", ":_", "self_", "._", "allow", "\\u", "folders_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "File", "Path", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "File", "Path", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "File", "Path", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Gene", "ric", "IPA", "ddress", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "empty", "\\u", "string", "s", "\\u", "allowed_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "description_", "=_", "\\u_", "(_", "\"", "IP", " ", "address", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default", "\\u", "error", "\\u", "messages_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "IPA", "ddress", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", "=_", "None_", ",_", "name_", "=_", "None_", ",_", "protocol_", "=_", "'", "bot", "h", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "unpack", "\\u", "ipv4_", "=_", "False_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "unpack", "\\u", "ipv4_", "=_", "unpack", "\\u", "ipv4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "default", "\\u", "validators_", ",_", "invalid", "\\u", "error", "\\u", "message_", "=_", "validators_", "._", "ip", "\\u", "address", "\\u", "validators_", "(_", "protocol_", ",_", "unpack", "\\u", "ipv4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "default", "\\u", "error", "\\u", "messages_", "[_", "'", "invalid", "'_", "]_", "=_", "invalid", "\\u", "error", "\\u", "message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "max", "\\u", "length", "'_", "]_", "=_", "39_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Field_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", ",_", "name_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "IPA", "ddress", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Gene", "ric", "IPA", "ddress", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "IPA", "ddress", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "python_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "and_", "':'_", "in_", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "clean", "\\u", "ipv", "6", "\\u", "address_", "(_", "value_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "unpack", "\\u", "ipv4_", ",_", "self_", "._", "error", "\\u", "messages_", "[_", "'", "invalid", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "IPA", "ddress", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "db", "\\u", "prep", "\\u", "value_", "(_", "self_", ",_", "value_", ",_", "connection_", ",_", "prepared", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "prepared", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "self_", "._", "get", "\\u", "prep", "\\u", "value_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "value_", "or_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "IPA", "ddress", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "prep", "\\u", "value_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "and_", "':'_", "in_", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "clean", "\\u", "ipv", "6", "\\u", "address_", "(_", "value_", ",_", "self_", "._", "unpack", "\\u", "ipv4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "exceptions_", "._", "Validat", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "IPA", "ddress", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "'", "form", "\\u", "class", "'_", ":_", "forms_", "._", "Gene", "ric", "IPA", "ddress", "Field_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Gene", "ric", "IPA", "ddress", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Time", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "empty", "\\u", "string", "s", "\\u", "allowed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default", "\\u", "error", "\\u", "messages_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "invalid", "'_", ":_", "\\u_", "(_", "\"'", "%", "s", "'", " ", "value", " ", "has", " ", "an", " ", "invalid", " ", "format", ".", " ", "It", " ", "must", " ", "be", " ", "in", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "HH", ":", "MM", "[:", "ss", "[.", "uu", "uu", "uu", "]]", " ", "format", ".\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "invalid", "\\u", "time", "'_", ":_", "\\u_", "(_", "\"'", "%", "s", "'", " ", "value", " ", "has", " ", "the", " ", "correct", " ", "format", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"(", "HH", ":", "MM", "[:", "ss", "[.", "uu", "uu", "uu", "]])", " ", "but", " ", "it", " ", "is", " ", "an", " ", "invalid", " ", "time", ".\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "description_", "=_", "\\u_", "(_", "\"", "Time", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\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", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", "=_", "None_", ",_", "name_", "=_", "None_", ",_", "auto", "\\u", "now_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "auto", "\\u", "now", "\\u", "add_", "=_", "False_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "auto", "\\u", "now_", ",_", "self_", "._", "auto", "\\u", "now", "\\u", "add_", "=_", "auto", "\\u", "now_", ",_", "auto", "\\u", "now", "\\u", "add_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "auto", "\\u", "now_", "or_", "auto", "\\u", "now", "\\u", "add_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'", "edita", "ble", "'_", "]_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "blank", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Field_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "verbo", "se", "\\u", "name_", ",_", "name_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "internal", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Time", "Field", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "python_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "value_", ",_", "datetime_", "._", "time_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "value_", ",_", "datetime_", "._", "datetime_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", " ", "usual", "ly", " ", "a", " ", "good", " ", "idea", " ", "to", " ", "pass", " ", "in", " ", "a", " ", "datetime", " ", "here", " ", "(", "it", " ", "lose", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "informati", "on", "),", " ", "but", " ", "this", " ", "can", " ", "be", " ", "a", " ", "side", "-", "effect", " ", "of", " ", "interacti", "ng", " ", "with", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", " ", "back", "end", " ", "(", "e", ".", "g", ".", " ", "Ora", "cle", "),", " ", "so", " ", "we", "'", "ll", " ", "be", " ", "accom", "mod", "ati", "ng", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "._", "time_", "(_", ")_", "\\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 ", " _", "parsed_", "=_", "parse", "\\u", "time_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "parsed_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "parsed_", "\\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 ", " _", "msg_", "=_", "self_", "._", "error", "\\u", "messages_", "[_", "'", "invalid", "\\u", "time", "'_", "]_", "%_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg_", "=_", "self_", "._", "error", "\\u", "messages_", "[_", "'", "invalid", "'_", "]_", "%_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "exceptions_", "._", "Validat", "ion", "Error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pre", "\\u", "save_", "(_", "self_", ",_", "model", "\\u", "instance_", ",_", "add_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "auto", "\\u", "now_", "or_", "(_", "self_", "._", "auto", "\\u", "now", "\\u", "add_", "and_", "add_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "setattr_", "(_", "model", "\\u", "instance_", ",_", "self_", "._", "attn", "ame_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "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 ", " _", "return_", "super_", "(_", "Time", "Field_", ",_", "self_", ")_", "._", "pre", "\\u", "save_", "(_", "model", "\\u", "instance_", ",_", "add_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "Field_", "(_", "Field_", ")_", ":_", "\\u\\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", "prep", "\\u", "value_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "to", "\\u", "python_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "db", "\\u", "prep", "\\u", "value_", "(_", "self_", ",_", "value_", ",_", "connection_", ",_", "prepared", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Cast", "s", " ", "times", " ", "int", "o", " ", "the", " ", "format", " ", "expected", " ", "by", " ", "the", " ", "backend_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "prepared", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "self_", "._", "get", "\\u", "prep", "\\u", "value_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "connection_", "._", "ops_", "._", "value", "\\u", "to", "\\u", "db", "\\u", "time_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "value", "\\u", "to", "\\u", "string_", "(_", "self_", ",_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "val_", "=_", "self_", "._", "\\u", "get", "\\u", "val", "\\u", "from", "\\u", "obj_", "(_", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "''_", "if_", "val_", "is_", "None_", "else_", "val_", "._", "isoformat_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "Field_", "(_", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "formfi", "eld_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "'", "form", "\\u", "class", "'_", ":_", "forms_", "._", "Time", "Field_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "Time", "Field_", ",_", "self_", ")_", "._", "formfi", "eld_", "(_", "**_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
xtrementl/focus/focus/plugin/modules/__init__.py
[ { "content": "\"\"\"\nThis package contains all the plugin modules that ship with the system.\n\"\"\"\n\n# import all the modules\nfrom focus.plugin.modules import (\n apps, im, notify, sites,\n sounds, stats, tasks, timer\n)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from focus.plugin.modules import (\n apps, im, notify, sites,\n sounds, stats, tasks, timer\n)", "start_line": 5, "start_column": 0, "end_line": 8, "end_column": 1 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Thi", "s", " ", "package", " ", "contain", "s", " ", "all", " ", "the", " ", "plugin", " ", "module", "s", " ", "tha", "t", " ", "ship", " ", "with", " ", "the", " ", "system", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "import", " ", "all", " ", "the", " ", "modules_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "focus_", "._", "plugin_", "._", "modules_", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "apps_", ",_", "im_", ",_", "notify_", ",_", "sites_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sounds", "_", ",_", "stats_", ",_", "tasks_", ",_", "timer_", "\\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, 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 ]
Nested loops with same variable
weecology/retriever/scripts/gentry.py
[ { "content": " def download(self, engine=None, debug=False):\n Script.download(self, engine, debug)\n\n self.engine.auto_create_table(Table(\"sites\"), url=self.urls[\"sites\"])\n self.engine.insert_data_from_url(self.urls[\"sites\"])\n\n self.engine.download_file(self.urls[\"stems\"], \"all_Excel.zip\")\n local_zip = zipfile.ZipFile(self.engine.format_filename(\"all_Excel.zip\"))\n filelist = local_zip.namelist()\n local_zip.close()\n self.engine.download_files_from_archive(self.urls[\"stems\"], filelist)\n\n filelist = [os.path.basename(filename) for filename in filelist]\n\n # Currently all_Excel.zip is missing CURUYUQU.xls\n # Download it separately and add it to the file list\n if not self.engine.find_file('CURUYUQU.xls'):\n self.engine.download_file(\"http://www.mobot.org/mobot/gentry/123/samerica/CURUYUQU.xls\", \"CURUYUQU.xls\", clean_line_endings=False)\n filelist.append('CURUYUQU.xls')\n\n lines = []\n tax = []\n for filename in filelist:\n print \"Extracting data from \" + filename + \"...\"\n book = xlrd.open_workbook(self.engine.format_filename(filename))\n sh = book.sheet_by_index(0)\n rows = sh.nrows\n cn = {'stems': []}\n n = 0\n for colnum, c in enumerate(sh.row(0)):\n if not Excel.empty_cell(c):\n cid = Excel.cell_value(c).lower()\n # line number column is sometimes named differently\n if cid in [\"sub\", \"number\"]:\n cid = \"line\"\n # the \"number of individuals\" column is named in various\n # different ways; they always at least contain \"nd\"\n if \"nd\" in cid:\n cid = \"count\"\n # in QUIAPACA.xls the \"number of individuals\" column is\n # misnamed \"STEMDBH\" just like the stems columns, so weep\n # for the state of scientific data and then fix manually\n if filename == \"QUIAPACA.xls\" and colnum == 13:\n cid = \"count\"\n\n # if column is a stem, add it to the list of stems;\n # otherwise, make note of the column name/number\n if \"stem\" in cid or \"dbh\" in cid:\n cn[\"stems\"].append(n)\n else:\n cn[cid] = n\n n += 1\n # sometimes, a data file does not contain a liana or count column\n if not \"liana\" in cn.keys():\n cn[\"liana\"] = -1\n if not \"count\" in cn.keys():\n cn[\"count\"] = -1\n for i in range(1, rows):\n row = sh.row(i)\n cellcount = len(row)\n # make sure the row is real, not just empty cells\n if not all(Excel.empty_cell(cell) for cell in row):\n try:\n this_line = {}\n\n def format_value(s):\n s = Excel.cell_value(s)\n return str(s).title().replace(\"\\\\\", \"/\").replace('\"', '')\n\n # get the following information from the appropriate columns\n for i in [\"line\", \"family\", \"genus\", \"species\",\n \"liana\", \"count\"]:\n if cn[i] > -1:\n this_line[i] = format_value(row[cn[i]])\n if this_line[i] == '`':\n this_line[i] = 1\n\n this_line[\"stems\"] = [Excel.cell_value(row[c])\n for c in cn[\"stems\"]\n if not Excel.empty_cell(row[c])]\n this_line[\"site\"] = filename[0:-4]\n\n lines.append(this_line)\n\n # Check how far the species is identified\n full_id = 0\n if len(this_line[\"species\"]) < 3:\n if len(this_line[\"genus\"]) < 3:\n id_level = \"family\"\n else:\n id_level = \"genus\"\n else:\n id_level = \"species\"\n full_id = 1\n tax.append((this_line[\"family\"],\n this_line[\"genus\"],\n this_line[\"species\"].lower().replace('\\\\', '').replace('\"', ''),\n id_level,\n str(full_id)))\n except:\n raise\n pass\n\n tax = sorted(tax, key=lambda group: group[0] + \" \" + group[1] + \" \" + group[2])\n unique_tax = []\n tax_dict = dict()\n tax_count = 0\n\n # Get all unique families/genera/species\n for group in tax:\n if not (group in unique_tax):\n unique_tax.append(group)\n tax_count += 1\n tax_dict[group[0:3]] = tax_count\n if tax_count % 10 == 0:\n msg = \"Generating taxonomic groups: \" + str(tax_count) + \" / \" + str(TAX_GROUPS)\n sys.stdout.write(msg + \"\\b\" * len(msg))\n print \"Generating taxonomic groups: \" + str(TAX_GROUPS) + \" / \" + str(TAX_GROUPS)\n\n\n # Create species table\n table = Table(\"species\", delimiter=\",\")\n table.columns=[(\"species_id\" , (\"pk-int\",) ),\n (\"family\" , (\"char\", ) ),\n (\"genus\" , (\"char\", ) ),\n (\"species\" , (\"char\", ) ),\n (\"id_level\" , (\"char\", 10) ),\n (\"full_id\" , (\"bool\",) )]\n\n data = [','.join([str(tax_dict[group[:3]])] + ['\"%s\"' % g for g in group])\n for group in unique_tax]\n table.pk = 'species_id'\n table.contains_pk = True\n\n self.engine.table = table\n self.engine.create_table()\n self.engine.add_to_table(data)\n\n\n # Create stems table\n table = Table(\"stems\", delimiter=\",\", contains_pk=False)\n table.columns=[(\"stem_id\" , (\"pk-auto\",) ),\n (\"line\" , (\"int\",) ),\n (\"species_id\" , (\"int\",) ),\n (\"site_code\" , (\"char\", 12) ),\n (\"liana\" , (\"char\", 10) ),\n (\"stem\" , (\"double\",) )]\n stems = []\n counts = []\n for line in lines:\n try:\n liana = line[\"liana\"]\n except KeyError:\n liana = \"\"\n species_info = [line[\"line\"],\n tax_dict[(line[\"family\"],\n line[\"genus\"],\n line[\"species\"].lower())],\n line[\"site\"],\n liana\n ]\n try:\n counts.append([str(value) for value in species_info + [line[\"count\"]]])\n except KeyError:\n pass\n\n for i in line[\"stems\"]:\n stem = species_info + [i]\n stems.append([str(value) for value in stem])\n\n data = [','.join(stem) for stem in stems]\n self.engine.table = table\n self.engine.create_table()\n self.engine.add_to_table(data)\n\n\n # Create counts table\n table = Table(\"counts\", delimiter=\",\", contains_pk=False)\n table.columns=[(\"count_id\" , (\"pk-auto\",) ),\n (\"line\" , (\"int\",) ),\n (\"species_id\" , (\"int\",) ),\n (\"site_code\" , (\"char\", 12) ),\n (\"liana\" , (\"char\", 10) ),\n (\"count\" , (\"double\",) )]\n data = [','.join(count) for count in counts]\n self.engine.table = table\n self.engine.create_table()\n self.engine.add_to_table(data)\n\n return self.engine", "metadata": "root.main.download", "header": "['class', 'main', '(', 'Script', ')', ':', '___EOS___']", "index": 38 } ]
[ { "span": "for i in [\"line\", \"family\", \"genus\", \"species\",\n \"liana\", \"count\"]:", "start_line": 108, "start_column": 24, "end_line": 109, "end_column": 52 } ]
[ { "span": "for i in range(1, rows):", "start_line": 95, "start_column": 12, "end_line": 95, "end_column": 36 } ]
1
true
[ "[CLS]_", "Nest", "ed_", "loops_", "with_", "same_", "variable_", "[SEP]_", "class_", "main_", "(_", "Script_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "download_", "(_", "self_", ",_", "engine_", "=_", "None_", ",_", "debug_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Script_", "._", "download_", "(_", "self_", ",_", "engine_", ",_", "debug_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "engine_", "._", "auto", "\\u", "create", "\\u", "table_", "(_", "Table_", "(_", "\"", "sites", "\"_", ")_", ",_", "url_", "=_", "self_", "._", "urls_", "[_", "\"", "sites", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "engine_", "._", "insert", "\\u", "data\\u", "from", "\\u", "url_", "(_", "self_", "._", "urls_", "[_", "\"", "sites", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "engine_", "._", "download", "\\u", "file_", "(_", "self_", "._", "urls_", "[_", "\"", "stem", "s", "\"_", "]_", ",_", "\"", "all", "\\u", "Exce", "l", ".", "zip", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "local", "\\u", "zip_", "=_", "zipfile_", "._", "Zip", "File_", "(_", "self_", "._", "engine_", "._", "format\\u", "filename_", "(_", "\"", "all", "\\u", "Exce", "l", ".", "zip", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filelist_", "=_", "local", "\\u", "zip_", "._", "namelist_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "local", "\\u", "zip_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "engine_", "._", "download", "\\u", "files", "\\u", "from", "\\u", "archive_", "(_", "self_", "._", "urls_", "[_", "\"", "stem", "s", "\"_", "]_", ",_", "filelist_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filelist_", "=_", "[_", "os_", "._", "path_", "._", "basename_", "(_", "filename_", ")_", "for_", "filename_", "in_", "filelist_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Curr", "ent", "ly", " ", "all", "\\u", "Exce", "l", ".", "zip", " ", "is", " ", "missi", "ng", " ", "CUR", "UY", "UQ", "U", ".", "xls", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Down", "load", " ", "it", " ", "separately", " ", "and", " ", "add", " ", "it", " ", "to", " ", "the", " ", "file", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "self_", "._", "engine_", "._", "find", "\\u", "file_", "(_", "'", "CUR", "UY", "UQ", "U", ".", "xls", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "engine_", "._", "download", "\\u", "file_", "(_", "\"", "http", "://", "www", ".", "mob", "ot", ".", "org", "/", "mob", "ot", "/", "gent", "ry", "/", "123", "/", "same", "rica", "/", "CUR", "UY", "UQ", "U", ".", "xls", "\"_", ",_", "\"", "CUR", "UY", "UQ", "U", ".", "xls", "\"_", ",_", "clean", "\\u", "line", "\\u", "ending", "s_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filelist_", "._", "append_", "(_", "'", "CUR", "UY", "UQ", "U", ".", "xls", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lines_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tax_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "filename_", "in_", "filelist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Extract", "ing", " ", "data", " ", "from", " ", "\"_", "+_", "filename_", "+_", "\"...\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "book_", "=_", "xlr", "d_", "._", "open", "\\u", "workbook_", "(_", "self_", "._", "engine_", "._", "format\\u", "filename_", "(_", "filename_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sh_", "=_", "book_", "._", "sheet", "\\u", "by", "\\u", "index_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rows_", "=_", "sh_", "._", "nrows_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cn_", "=_", "{_", "'", "stem", "s", "'_", ":_", "[_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "coln", "um_", ",_", "c_", "in_", "enumerate_", "(_", "sh_", "._", "row_", "(_", "0_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "Exce", "l_", "._", "empty", "\\u", "cell_", "(_", "c_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "cid_", "=_", "Exce", "l_", "._", "cell", "\\u", "value_", "(_", "c_", ")_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "line", " ", "number", " ", "column", " ", "is", " ", "somet", "imes", " ", "named", " ", "different", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "cid_", "in_", "[_", "\"", "sub", "\"_", ",_", "\"", "number", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "cid_", "=_", "\"", "line", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "the", " ", "\"", "number", " ", "of", " ", "individual", "s", "\"", " ", "column", " ", "is", " ", "named", " ", "in", " ", "vari", "ous_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "different", " ", "way", "s", ";", " ", "the", "y", " ", "alw", "ay", "s", " ", "at", " ", "leas", "t", " ", "contain", " ", "\"", "nd", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\"", "nd", "\"_", "in_", "cid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "cid_", "=_", "\"", "count", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "in", " ", "QUI", "AP", "ACA", ".", "xls", " ", "the", " ", "\"", "number", " ", "of", " ", "individual", "s", "\"", " ", "column", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "mis", "named", " ", "\"", "STE", "MD", "BH", "\"", " ", "just", " ", "like", " ", "the", " ", "stem", "s", " ", "column", "s", ",", " ", "so", " ", "wee", "p_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "the", " ", "state", " ", "of", " ", "scienti", "fic", " ", "data", " ", "and", " ", "then", " ", "fix", " ", "manu", "ally", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "filename_", "==_", "\"", "QUI", "AP", "ACA", ".", "xls", "\"_", "and_", "coln", "um_", "==_", "13_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "cid_", "=_", "\"", "count", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "column", " ", "is", " ", "a", " ", "stem", ",", " ", "add", " ", "it", " ", "to", " ", "the", " ", "list", " ", "of", " ", "stem", "s", ";_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", "wis", "e", ",", " ", "make", " ", "note", " ", "of", " ", "the", " ", "column", " ", "name", "/", "number_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\"", "stem", "\"_", "in_", "cid_", "or_", "\"", "dbh", "\"_", "in_", "cid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "cn_", "[_", "\"", "stem", "s", "\"_", "]_", "._", "append_", "(_", "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 ", " ", " _", "cn_", "[_", "cid_", "]_", "=_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "n_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "somet", "imes", ",", " ", "a", " ", "data", " ", "file", " ", "doe", "s", " ", "not", " ", "contain", " ", "a", " ", "lian", "a", " ", "or", " ", "count", " ", "column_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "\"", "lian", "a", "\"_", "in_", "cn_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cn_", "[_", "\"", "lian", "a", "\"_", "]_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "\"", "count", "\"_", "in_", "cn_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cn_", "[_", "\"", "count", "\"_", "]_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "1_", ",_", "rows_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "row_", "=_", "sh_", "._", "row_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cell", "count_", "=_", "len_", "(_", "row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "the", " ", "row", " ", "is", " ", "real", ",", " ", "not", " ", "just", " ", "empty", " ", "cells_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "all_", "(_", "Exce", "l_", "._", "empty", "\\u", "cell_", "(_", "cell_", ")_", "for_", "cell_", "in_", "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 ", " ", " _", "this", "\\u", "line_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "format\\u", "value_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "s_", "=_", "Exce", "l_", "._", "cell", "\\u", "value_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "str_", "(_", "s_", ")_", "._", "title_", "(_", ")_", "._", "replace_", "(_", "\"\\\\\\\\\"_", ",_", "\"/\"_", ")_", "._", "replace_", "(_", "'\"'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "the", " ", "follow", "ing", " ", "informati", "on", " ", "from", " ", "the", " ", "appropr", "iate", " ", "columns_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "[_", "\"", "line", "\"_", ",_", "\"", "famil", "y", "\"_", ",_", "\"", "genu", "s", "\"_", ",_", "\"", "specie", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "lian", "a", "\"_", ",_", "\"", "count", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "cn_", "[_", "i_", "]_", ">_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "this", "\\u", "line_", "[_", "i_", "]_", "=_", "format\\u", "value_", "(_", "row_", "[_", "cn_", "[_", "i_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "this", "\\u", "line_", "[_", "i_", "]_", "==_", "'`", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "this", "\\u", "line_", "[_", "i_", "]_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "this", "\\u", "line_", "[_", "\"", "stem", "s", "\"_", "]_", "=_", "[_", "Exce", "l_", "._", "cell", "\\u", "value_", "(_", "row_", "[_", "c_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "c_", "in_", "cn_", "[_", "\"", "stem", "s", "\"_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "Exce", "l_", "._", "empty", "\\u", "cell_", "(_", "row_", "[_", "c_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "this", "\\u", "line_", "[_", "\"", "site", "\"_", "]_", "=_", "filename_", "[_", "0_", ":_", "-_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lines_", "._", "append_", "(_", "this", "\\u", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "how", " ", "far", " ", "the", " ", "specie", "s", " ", "is", " ", "identifi", "ed_", "\\u\\u\\uNL\\u\\u\\u_", "full", "\\u", "id_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "this", "\\u", "line_", "[_", "\"", "specie", "s", "\"_", "]_", ")_", "<_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "len_", "(_", "this", "\\u", "line_", "[_", "\"", "genu", "s", "\"_", "]_", ")_", "<_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "id", "\\u", "level_", "=_", "\"", "famil", "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 ", " ", " _", "id", "\\u", "level_", "=_", "\"", "genu", "s", "\"_", "\\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 ", " ", " _", "id", "\\u", "level_", "=_", "\"", "specie", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "full", "\\u", "id_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tax_", "._", "append_", "(_", "(_", "this", "\\u", "line_", "[_", "\"", "famil", "y", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "this", "\\u", "line_", "[_", "\"", "genu", "s", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "this", "\\u", "line_", "[_", "\"", "specie", "s", "\"_", "]_", "._", "lower_", "(_", ")_", "._", "replace_", "(_", "'\\\\\\\\'_", ",_", "''_", ")_", "._", "replace_", "(_", "'\"'_", ",_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "id", "\\u", "level_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "full", "\\u", "id_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tax_", "=_", "sorted_", "(_", "tax_", ",_", "key_", "=_", "lambda_", "group_", ":_", "group_", "[_", "0_", "]_", "+_", "\"", " ", "\"_", "+_", "group_", "[_", "1_", "]_", "+_", "\"", " ", "\"_", "+_", "group_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unique", "\\u", "tax_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tax", "\\u", "dict_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tax", "\\u", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "all", " ", "unique", " ", "families", "/", "genera", "/", "species_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "group_", "in_", "tax_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "(_", "group_", "in_", "unique", "\\u", "tax_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unique", "\\u", "tax_", "._", "append_", "(_", "group_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tax", "\\u", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tax", "\\u", "dict_", "[_", "group_", "[_", "0_", ":_", "3_", "]_", "]_", "=_", "tax", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tax", "\\u", "count_", "%_", "10_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "msg_", "=_", "\"", "Generat", "ing", " ", "taxonom", "ic", " ", "group", "s", ":", " ", "\"_", "+_", "str_", "(_", "tax", "\\u", "count_", ")_", "+_", "\"", " ", "/", " ", "\"_", "+_", "str_", "(_", "TA", "X", "\\u", "GROUPS", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "msg_", "+_", "\"\\\\", "b", "\"_", "*_", "len_", "(_", "msg_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "Generat", "ing", " ", "taxonom", "ic", " ", "group", "s", ":", " ", "\"_", "+_", "str_", "(_", "TA", "X", "\\u", "GROUPS", "_", ")_", "+_", "\"", " ", "/", " ", "\"_", "+_", "str_", "(_", "TA", "X", "\\u", "GROUPS", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "specie", "s", " ", "table_", "\\u\\u\\uNL\\u\\u\\u_", "table_", "=_", "Table_", "(_", "\"", "specie", "s", "\"_", ",_", "delimiter_", "=_", "\",\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "._", "columns_", "=_", "[_", "(_", "\"", "specie", "s", "\\u", "id", "\"_", ",_", "(_", "\"", "pk", "-", "int", "\"_", ",_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "famil", "y", "\"_", ",_", "(_", "\"", "char", "\"_", ",_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "genu", "s", "\"_", ",_", "(_", "\"", "char", "\"_", ",_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "specie", "s", "\"_", ",_", "(_", "\"", "char", "\"_", ",_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "id", "\\u", "level", "\"_", ",_", "(_", "\"", "char", "\"_", ",_", "10_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "full", "\\u", "id", "\"_", ",_", "(_", "\"", "bool", "\"_", ",_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "[_", "','_", "._", "join_", "(_", "[_", "str_", "(_", "tax", "\\u", "dict_", "[_", "group_", "[_", ":_", "3_", "]_", "]_", ")_", "]_", "+_", "[_", "'\"", "%", "s", "\"'_", "%_", "g_", "for_", "g_", "in_", "group_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "group_", "in_", "unique", "\\u", "tax_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "._", "pk_", "=_", "'", "specie", "s", "\\u", "id", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "._", "contain", "s", "\\u", "pk_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "engine_", "._", "table_", "=_", "table_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "engine_", "._", "create", "\\u", "table_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "engine_", "._", "add", "\\u", "to", "\\u", "table_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "stem", "s", " ", "table_", "\\u\\u\\uNL\\u\\u\\u_", "table_", "=_", "Table_", "(_", "\"", "stem", "s", "\"_", ",_", "delimiter_", "=_", "\",\"_", ",_", "contain", "s", "\\u", "pk_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "._", "columns_", "=_", "[_", "(_", "\"", "stem", "\\u", "id", "\"_", ",_", "(_", "\"", "pk", "-", "auto", "\"_", ",_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "line", "\"_", ",_", "(_", "\"", "int", "\"_", ",_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "specie", "s", "\\u", "id", "\"_", ",_", "(_", "\"", "int", "\"_", ",_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "site", "\\u", "code", "\"_", ",_", "(_", "\"", "char", "\"_", ",_", "12_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "lian", "a", "\"_", ",_", "(_", "\"", "char", "\"_", ",_", "10_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "stem", "\"_", ",_", "(_", "\"", "double", "\"_", ",_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stem", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "counts_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "lines_", ":_", "\\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 ", " _", "lian", "a_", "=_", "line_", "[_", "\"", "lian", "a", "\"_", "]_", "\\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 ", " _", "lian", "a_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "specie", "s", "\\u", "info_", "=_", "[_", "line_", "[_", "\"", "line", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "tax", "\\u", "dict_", "[_", "(_", "line_", "[_", "\"", "famil", "y", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "[_", "\"", "genu", "s", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "[_", "\"", "specie", "s", "\"_", "]_", "._", "lower_", "(_", ")_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "[_", "\"", "site", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lian", "a_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "counts_", "._", "append_", "(_", "[_", "str_", "(_", "value_", ")_", "for_", "value_", "in_", "specie", "s", "\\u", "info_", "+_", "[_", "line_", "[_", "\"", "count", "\"_", "]_", "]_", "]_", ")_", "\\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_", "for_", "i_", "in_", "line_", "[_", "\"", "stem", "s", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stem_", "=_", "specie", "s", "\\u", "info_", "+_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stem", "s_", "._", "append_", "(_", "[_", "str_", "(_", "value_", ")_", "for_", "value_", "in_", "stem_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "=_", "[_", "','_", "._", "join_", "(_", "stem_", ")_", "for_", "stem_", "in_", "stem", "s_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "engine_", "._", "table_", "=_", "table_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "engine_", "._", "create", "\\u", "table_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "engine_", "._", "add", "\\u", "to", "\\u", "table_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "count", "s", " ", "table_", "\\u\\u\\uNL\\u\\u\\u_", "table_", "=_", "Table_", "(_", "\"", "count", "s", "\"_", ",_", "delimiter_", "=_", "\",\"_", ",_", "contain", "s", "\\u", "pk_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "._", "columns_", "=_", "[_", "(_", "\"", "count", "\\u", "id", "\"_", ",_", "(_", "\"", "pk", "-", "auto", "\"_", ",_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "line", "\"_", ",_", "(_", "\"", "int", "\"_", ",_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "specie", "s", "\\u", "id", "\"_", ",_", "(_", "\"", "int", "\"_", ",_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "site", "\\u", "code", "\"_", ",_", "(_", "\"", "char", "\"_", ",_", "12_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "lian", "a", "\"_", ",_", "(_", "\"", "char", "\"_", ",_", "10_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "count", "\"_", ",_", "(_", "\"", "double", "\"_", ",_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "[_", "','_", "._", "join_", "(_", "count_", ")_", "for_", "count_", "in_", "counts_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "engine_", "._", "table_", "=_", "table_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "engine_", "._", "create", "\\u", "table_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "engine_", "._", "add", "\\u", "to", "\\u", "table_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "engine_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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 ]
Unused local variable
coleifer/django-generic-aggregation/generic_aggregation_tests/tests.py
[ { "content": " def test_charfield_pks(self):\n a1 = CharFieldGFK.objects.create(name='a1', content_object=self.apple)\n a2 = CharFieldGFK.objects.create(name='a2', content_object=self.apple)\n o1 = CharFieldGFK.objects.create(name='o1', content_object=self.orange)\n\n annotated_qs = self.generic_annotate(Food.objects.all(), CharFieldGFK, models.Count('char_gfk__name'))\n self.assertEqual(annotated_qs.count(), 3)\n\n food_a, food_b, food_c = annotated_qs.order_by('-score')\n\n self.assertEqual(food_b.score, 1)\n self.assertEqual(food_b.name, 'orange')\n\n self.assertEqual(food_a.score, 2)\n self.assertEqual(food_a.name, 'apple')\n\n self.assertEqual(food_c.score, 0)\n self.assertEqual(food_c.name, 'peach')\n\n aggregated = self.generic_aggregate(Food.objects.all(), CharFieldGFK, models.Count('char_gfk__name'))\n self.assertEqual(aggregated, 3)", "metadata": "root.SimpleTest.test_charfield_pks", "header": "['class', 'SimpleTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 155 }, { "content": " def test_filter_cast(self):\n a1 = CharFieldGFK.objects.create(name='a1', content_object=self.apple)\n a2 = CharFieldGFK.objects.create(name='a2', content_object=self.apple)\n o1 = CharFieldGFK.objects.create(name='o1', content_object=self.orange)\n\n qs = self.generic_filter(CharFieldGFK.objects.all(), Food.objects.filter(name='apple'))\n self.assertEqual(len(qs), 2)\n\n for obj in qs:\n self.assertEqual(obj.content_object.name, 'apple')", "metadata": "root.SimpleTest.test_filter_cast", "header": "['class', 'SimpleTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 195 } ]
[ { "span": "a1 ", "start_line": 156, "start_column": 8, "end_line": 156, "end_column": 10 }, { "span": "a2 ", "start_line": 157, "start_column": 8, "end_line": 157, "end_column": 10 }, { "span": "o1 ", "start_line": 158, "start_column": 8, "end_line": 158, "end_column": 10 }, { "span": "a1 ", "start_line": 196, "start_column": 8, "end_line": 196, "end_column": 10 }, { "span": "a2 ", "start_line": 197, "start_column": 8, "end_line": 197, "end_column": 10 }, { "span": "o1 ", "start_line": 198, "start_column": 8, "end_line": 198, "end_column": 10 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Simple", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "char", "field", "\\u", "pks", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a1_", "=_", "Char", "Field", "GF", "K_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "a1", "'_", ",_", "content", "\\u", "object_", "=_", "self_", "._", "apple", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a2_", "=_", "Char", "Field", "GF", "K_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "a2", "'_", ",_", "content", "\\u", "object_", "=_", "self_", "._", "apple", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "o1_", "=_", "Char", "Field", "GF", "K_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "o", "1", "'_", ",_", "content", "\\u", "object_", "=_", "self_", "._", "orange", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "annotated", "\\u", "qs_", "=_", "self_", "._", "gener", "ic", "\\u", "annotate_", "(_", "Foo", "d_", "._", "objects_", "._", "all_", "(_", ")_", ",_", "Char", "Field", "GF", "K_", ",_", "models_", "._", "Count_", "(_", "'", "char", "\\u", "gf", "k", "\\u\\u", "name", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "annotated", "\\u", "qs_", "._", "count_", "(_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "food", "\\u", "a_", ",_", "food", "\\u", "b_", ",_", "food", "\\u", "c_", "=_", "annotated", "\\u", "qs_", "._", "order", "\\u", "by_", "(_", "'-", "score", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "food", "\\u", "b_", "._", "score_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "food", "\\u", "b_", "._", "name_", ",_", "'", "orange", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "food", "\\u", "a_", "._", "score_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "food", "\\u", "a_", "._", "name_", ",_", "'", "apple", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "food", "\\u", "c_", "._", "score_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "food", "\\u", "c_", "._", "name_", ",_", "'", "peac", "h", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "aggregated", "_", "=_", "self_", "._", "gener", "ic", "\\u", "aggregate_", "(_", "Foo", "d_", "._", "objects_", "._", "all_", "(_", ")_", ",_", "Char", "Field", "GF", "K_", ",_", "models_", "._", "Count_", "(_", "'", "char", "\\u", "gf", "k", "\\u\\u", "name", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "aggregated", "_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "filter", "\\u", "cast_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a1_", "=_", "Char", "Field", "GF", "K_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "a1", "'_", ",_", "content", "\\u", "object_", "=_", "self_", "._", "apple", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a2_", "=_", "Char", "Field", "GF", "K_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "a2", "'_", ",_", "content", "\\u", "object_", "=_", "self_", "._", "apple", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "o1_", "=_", "Char", "Field", "GF", "K_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "o", "1", "'_", ",_", "content", "\\u", "object_", "=_", "self_", "._", "orange", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "qs_", "=_", "self_", "._", "gener", "ic", "\\u", "filter_", "(_", "Char", "Field", "GF", "K_", "._", "objects_", "._", "all_", "(_", ")_", ",_", "Foo", "d_", "._", "objects_", "._", "filter_", "(_", "name_", "=_", "'", "apple", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "qs_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "obj_", "in_", "qs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "obj_", "._", "content", "\\u", "object_", "._", "name_", ",_", "'", "apple", "'_", ")_", "\\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, 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, 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, 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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 2, 2 ]
Imprecise assert
cf-platform-eng/tile-generator/ci/deployment-tests/app3_deploymenttest.py
[ { "content": "\tdef test_receives_expected_services(self):\n\t\theaders = { 'Accept': 'application/json' }\n\t\tresponse = requests.get(self.url + '/env', headers=headers)\n\t\tresponse.raise_for_status()\n\t\tenv = response.json()\n\t\tvcap_services = json.loads(env.get('VCAP_SERVICES'))\n\t\tbroker1_service = vcap_services.get('service-broker1-service', None)\n\t\tself.assertTrue(broker1_service is not None)\n\t\tself.assertEquals(len(broker1_service), 1)\n\t\tself.assertEquals(broker1_service[0].get('plan'), 'second-plan')", "metadata": "root.VerifyApp3.test_receives_expected_services", "header": "['class', 'VerifyApp3', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 34 }, { "content": "\tdef test_does_not_receive_admin_credentials(self):\n\t\theaders = { 'Accept': 'application/json' }\n\t\tresponse = requests.get(self.url + '/env', headers=headers)\n\t\tresponse.raise_for_status()\n\t\tenv = response.json()\n\t\tuser = env.get('CF_ADMIN_USER')\n\t\tusername = env.get('CF_ADMIN_USERNAME')\n\t\tpassword = env.get('CF_ADMIN_PASSWORD')\n\t\tself.assertTrue(user is None)\n\t\tself.assertTrue(username is None)\n\t\tself.assertTrue(password is None)", "metadata": "root.VerifyApp3.test_does_not_receive_admin_credentials", "header": "['class', 'VerifyApp3', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 63 } ]
[ { "span": "self.assertTrue(broker1_service is not None)", "start_line": 41, "start_column": 2, "end_line": 41, "end_column": 46 }, { "span": "self.assertTrue(user is None)", "start_line": 71, "start_column": 2, "end_line": 71, "end_column": 31 }, { "span": "self.assertTrue(username is None)", "start_line": 72, "start_column": 2, "end_line": 72, "end_column": 35 }, { "span": "self.assertTrue(password is None)", "start_line": 73, "start_column": 2, "end_line": 73, "end_column": 35 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Verify", "App", "3_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "receive", "s", "\\u", "expected", "\\u", "services_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "headers_", "=_", "{_", "'", "Accept", "'_", ":_", "'", "applica", "tion", "/", "json", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "requests_", "._", "get_", "(_", "self_", "._", "url_", "+_", "'/", "env", "'_", ",_", "headers_", "=_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "._", "raise", "\\u", "for", "\\u", "status_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env_", "=_", "response_", "._", "json_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vca", "p", "\\u", "services_", "=_", "json_", "._", "loads_", "(_", "env_", "._", "get_", "(_", "'", "VC", "AP", "\\u", "SERVICES", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broker", "1", "\\u", "service_", "=_", "vca", "p", "\\u", "services_", "._", "get_", "(_", "'", "service", "-", "broker", "1", "-", "service", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "broker", "1", "\\u", "service_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "broker", "1", "\\u", "service_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "broker", "1", "\\u", "service_", "[_", "0_", "]_", "._", "get_", "(_", "'", "plan", "'_", ")_", ",_", "'", "second", "-", "plan", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Verify", "App", "3_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "doe", "s", "\\u", "not", "\\u", "receive", "\\u", "admin", "\\u", "credentials_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "headers_", "=_", "{_", "'", "Accept", "'_", ":_", "'", "applica", "tion", "/", "json", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "requests_", "._", "get_", "(_", "self_", "._", "url_", "+_", "'/", "env", "'_", ",_", "headers_", "=_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "._", "raise", "\\u", "for", "\\u", "status_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env_", "=_", "response_", "._", "json_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "env_", "._", "get_", "(_", "'", "CF", "\\u", "ADM", "IN", "\\u", "USER", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "username_", "=_", "env_", "._", "get_", "(_", "'", "CF", "\\u", "ADM", "IN", "\\u", "USER", "NAME", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "password_", "=_", "env_", "._", "get_", "(_", "'", "CF", "\\u", "ADM", "IN", "\\u", "PASS", "WORD", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "user_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "username_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "password_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2,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1, 1, 1, 1, 1, 1, 1, 2 ]
Imprecise assert
bartdag/recodoc2/recodoc2/apps/channel/tests.py
[ { "content": " def test_apache_syncer(self):\n create_channel_db('project1', 'cf', 'coreforum',\n 'channel.syncer.common_syncers.ApacheMailSyncer', 'foo.parser',\n 'http://mail-archives.apache.org/mod_mbox/hc-httpclient-users/'\n )\n create_channel_local('project1', 'coreforum',\n 'channel.syncer.common_syncers.ApacheMailSyncer',\n 'http://mail-archives.apache.org/mod_mbox/hc-httpclient-users/'\n )\n pname = 'project1'\n cname = 'coreforum'\n toc_refresh(pname, cname)\n model = load_model(pname, STHREAD_PATH, cname)\n self.assertEqual(\n 'http://mail-archives.apache.org/mod_mbox/hc-httpclient-users/200410.mbox/date',\n model.toc_sections[0].url)\n self.assertFalse(model.toc_sections[0].downloaded)\n self.assertTrue(len(model.toc_sections) >= 79)\n for i in xrange(0, 79):\n self.assertEqual(i, model.toc_sections[i].index)\n\n toc_download_section(pname, cname, start=0, end=4)\n model = load_model(pname, STHREAD_PATH, cname)\n self.assertTrue(model.toc_sections[0].downloaded)\n self.assertTrue(model.toc_sections[1].downloaded)\n self.assertTrue(model.toc_sections[2].downloaded)\n self.assertTrue(model.toc_sections[3].downloaded)\n self.assertFalse(model.toc_sections[4].downloaded)\n self.assertEqual(316, len(model.entries))\n self.assertEqual(0, model.entries[0].index)\n self.assertFalse(model.entries[0].downloaded)\n self.assertEqual(1000, model.entries[17].index)\n self.assertEqual(1001, model.entries[18].index)\n self.assertTrue(model.entries[18].url.find('xbox.localdomain') > -1)\n\n toc_download_entries(pname, cname, 0, 1)\n model = load_model(pname, STHREAD_PATH, cname)\n self.assertTrue(model.entries[0].downloaded)\n self.assertFalse(model.entries[1].downloaded)\n path = os.path.join(settings.PROJECT_FS_ROOT,\n model.entries[0].local_paths[0])\n self.assertTrue(os.path.exists(path))", "metadata": "root.ChannelSetup.test_apache_syncer", "header": "['class', 'ChannelSetup', '(', 'TestCase', ')', ':', '___EOS___']", "index": 67 }, { "content": " def test_phpbb_syncer(self):\n create_channel_db('project1', 'cf', 'coreforum',\n 'channel.syncer.common_syncers.PHPBBForumSyncer', 'foo.parser',\n 'https://forum.hibernate.org/viewforum.php?f=1'\n )\n create_channel_local('project1', 'coreforum',\n 'channel.syncer.common_syncers.PHPBBForumSyncer',\n 'https://forum.hibernate.org/viewforum.php?f=1'\n )\n pname = 'project1'\n cname = 'coreforum'\n toc_refresh(pname, cname)\n model = load_model(pname, STHREAD_PATH, cname)\n self.assertEqual(\n 'https://forum.hibernate.org/viewforum.php?f=1&sd=a&start=0',\n model.toc_sections[0].url)\n self.assertFalse(model.toc_sections[0].downloaded)\n self.assertTrue(len(model.toc_sections) > 2349)\n for i in xrange(0, 2349):\n self.assertEqual(i, model.toc_sections[i].index)\n\n toc_download_section(pname, cname, start=0, end=4)\n model = load_model(pname, STHREAD_PATH, cname)\n self.assertTrue(model.toc_sections[0].downloaded)\n self.assertTrue(model.toc_sections[1].downloaded)\n self.assertTrue(model.toc_sections[2].downloaded)\n self.assertTrue(model.toc_sections[3].downloaded)\n self.assertFalse(model.toc_sections[4].downloaded)\n self.assertEqual(100, len(model.entries))\n self.assertEqual(0, model.entries[0].index)\n self.assertFalse(model.entries[0].downloaded)\n self.assertEqual(1000, model.entries[25].index)\n self.assertEqual(1001, model.entries[26].index)\n self.assertTrue(model.entries[26].url.find('t=59') > -1)\n\n toc_download_entries(pname, cname, 1024, 1025)\n model = load_model(pname, STHREAD_PATH, cname)\n self.assertTrue(model.entries[49].downloaded)\n self.assertFalse(model.entries[50].downloaded)\n path = os.path.join(settings.PROJECT_FS_ROOT,\n model.entries[49].local_paths[0])\n self.assertTrue(os.path.exists(path))\n path = os.path.join(settings.PROJECT_FS_ROOT,\n model.entries[49].local_paths[1])\n self.assertTrue(os.path.exists(path))", "metadata": "root.ChannelSetup.test_phpbb_syncer", "header": "['class', 'ChannelSetup', '(', 'TestCase', ')', ':', '___EOS___']", "index": 111 }, { "content": " def test_fudeclipse_syncer(self):\n create_channel_db('project1', 'cf', 'coreforum',\n 'channel.syncer.common_syncers.FUDEclipseForumSyncer',\n 'foo.parser',\n 'http://www.eclipse.org/forums/index.php/sf/thread/13/'\n )\n create_channel_local('project1', 'coreforum',\n 'channel.syncer.common_syncers.FUDEclipseForumSyncer',\n 'http://www.eclipse.org/forums/index.php/sf/thread/13/'\n )\n pname = 'project1'\n cname = 'coreforum'\n toc_refresh(pname, cname)\n model = load_model(pname, STHREAD_PATH, cname)\n self.assertEqual(\n 'http://www.eclipse.org/forums/index.php/sf/thread/13/1/0/',\n model.toc_sections[0].url)\n self.assertFalse(model.toc_sections[0].downloaded)\n\n self.assertTrue(len(model.toc_sections) >= 247)\n for i in xrange(0, 247):\n self.assertEqual(i, model.toc_sections[i].index)\n\n toc_download_section(pname, cname, start=0, end=4)\n model = load_model(pname, STHREAD_PATH, cname)\n self.assertTrue(model.toc_sections[0].downloaded)\n self.assertTrue(model.toc_sections[1].downloaded)\n self.assertTrue(model.toc_sections[2].downloaded)\n self.assertTrue(model.toc_sections[3].downloaded)\n self.assertFalse(model.toc_sections[4].downloaded)\n\n self.assertEqual(160, len(model.entries))\n self.assertEqual(0, model.entries[0].index)\n self.assertFalse(model.entries[0].downloaded)\n self.assertEqual(1000, model.entries[40].index)\n self.assertEqual(1001, model.entries[41].index)\n #self.assertTrue(model.entries[26].url.find('t=59') > -1)\n\n toc_download_entries(pname, cname, 1039, 1040)\n model = load_model(pname, STHREAD_PATH, cname)\n self.assertTrue(model.entries[79].downloaded)\n self.assertFalse(model.entries[80].downloaded)\n path = os.path.join(settings.PROJECT_FS_ROOT,\n model.entries[79].local_paths[0])\n self.assertTrue(os.path.exists(path))", "metadata": "root.ChannelSetup.test_fudeclipse_syncer", "header": "['class', 'ChannelSetup', '(', 'TestCase', ')', ':', '___EOS___']", "index": 158 }, { "content": " @transaction.autocommit\n def test_apache_parser(self):\n create_channel_db('project1', 'cf', 'coreforum',\n 'channel.syncer.common_syncers.ApacheMailSyncer', \n 'channel.parser.common_parsers.ApacheMailParser',\n 'http://mail-archives.apache.org/mod_mbox/hc-httpclient-users/'\n )\n create_channel_local('project1', 'coreforum',\n 'channel.syncer.common_syncers.ApacheMailSyncer',\n 'http://mail-archives.apache.org/mod_mbox/hc-httpclient-users/'\n )\n pname = 'project1'\n cname = 'coreforum'\n toc_refresh(pname, cname)\n toc_download_section(pname, cname, start=0, end=1)\n toc_download_entries(pname, cname, 9, 99)\n parse_channel(pname, cname, True)\n self.assertEqual(8, Message.objects.all().count())\n messages = list(Message.objects.all())\n for message in messages:\n print('{0} by {1} on {2} (wc: {3})'.format(\n message.title, message.author, message.msg_date,\n message.word_count))\n print(' {0} snippets and {1} references'.format(\n message.code_snippets.count(),\n message.code_references.count()))\n print(' Snippets:')\n for code_snippet in message.code_snippets.all():\n print(' {0}'.format(code_snippet.language))\n\n for ref in message.code_references.all():\n print(' {0}: {1}'.format(ref.kind_hint.kind, ref.content))\n\n \n # Test Snippets\n third_to_last = messages[-3]\n self.assertEqual('l', third_to_last.code_snippets.all()[0].language)\n self.assertEqual('jx', third_to_last.code_snippets.all()[1].language)\n\n # Test Refs\n fourth_to_last = messages[-4]\n refs = [ref.content.strip() for ref in\n fourth_to_last.code_references.all()]\n self.assertEqual(4, len(refs))\n self.assertTrue('EasySSLProtocolSocketFactory' in refs)\n self.assertTrue('SSL' in refs)\n\n # Test Post-Processing!\n channel = post_process_channel(pname, cname)\n self.assertEqual(4, channel.threads.count())\n\n second_thread = channel.threads.all()[1]\n self.assertEqual(3, second_thread.messages.count())\n\n indexes = [msg.index for msg in second_thread.messages.all()]\n self.assertEqual([0, 1, 2], indexes)\n self.assertFalse(second_thread.messages.all()[0].title.lower()\n .startswith('re'))\n self.assertTrue(second_thread.messages.all()[1].title.lower()\n .startswith('re'))", "metadata": "root.ChannelParserTest.test_apache_parser", "header": "['class', 'ChannelParserTest', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 223 }, { "content": " @transaction.autocommit\n def test_phpbb_parser(self):\n create_channel_db('project1', 'cf', 'coreforum',\n 'channel.syncer.common_syncers.PHPBBForumSyncer',\n 'channel.parser.common_parsers.PHPBBForumParser',\n 'https://forum.hibernate.org/viewforum.php?f=1'\n )\n create_channel_local('project1', 'coreforum',\n 'channel.syncer.common_syncers.PHPBBForumSyncer',\n 'https://forum.hibernate.org/viewforum.php?f=1'\n )\n pname = 'project1'\n cname = 'coreforum'\n toc_refresh(pname, cname)\n toc_download_section(pname, cname, start=0, end=2)\n toc_download_entries(pname, cname, 1023, 1025)\n parse_channel(pname, cname, True)\n self.assertEqual(23, Message.objects.all().count())\n messages = list(Message.objects.all())\n for message in messages:\n print(message.url)\n print('{0} by {1} on {2} (wc: {3})'.format(\n message.title, message.author, message.msg_date,\n message.word_count))\n print(' {0} snippets and {1} references'.format(\n message.code_snippets.count(),\n message.code_references.count()))\n print(' Snippets:')\n for code_snippet in message.code_snippets.all():\n print(' {0}'.format(code_snippet.language))\n\n for ref in message.code_references.all():\n print(' {0}: {1}'.format(ref.kind_hint.kind, ref.content))\n \n # Test Snippets\n first_message = messages[0]\n self.assertEqual('x', first_message.code_snippets.all()[0].language)\n\n # Test Author\n self.assertEqual(first_message.author.nickname, 'mhellkamp')\n\n # Test Date\n self.assertEqual(first_message.msg_date, datetime(2003, 8, 29, 10, 16))\n\n # Test Refs\n second_message = messages[1]\n refs = [ref.content.strip() for ref in\n second_message.code_references.all()]\n # Title is not counted.\n self.assertEqual(4, len(refs))\n self.assertTrue('DBCP' in refs)\n self.assertTrue('C3P0' in refs)", "metadata": "root.ChannelParserTest.test_phpbb_parser", "header": "['class', 'ChannelParserTest', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 284 }, { "content": " @transaction.autocommit\n def test_fudeclipse_parser(self):\n create_channel_db('project1', 'cf', 'coreforum',\n 'channel.syncer.common_syncers.FUDEclipseForumSyncer',\n 'channel.parser.common_parsers.FUDEclipseForumParser',\n 'http://www.eclipse.org/forums/index.php/sf/thread/59/'\n )\n create_channel_local('project1', 'coreforum',\n 'channel.syncer.common_syncers.FUDEclipseForumSyncer',\n 'http://www.eclipse.org/forums/index.php/sf/thread/59/'\n )\n pname = 'project1'\n cname = 'coreforum'\n toc_refresh(pname, cname)\n toc_download_section(pname, cname, start=0, end=2)\n toc_download_entries(pname, cname, 0, 6)\n parse_channel(pname, cname, True)\n self.assertEqual(18, Message.objects.all().count())\n messages = list(Message.objects.all())\n for message in messages:\n print('{0} by {1} on {2} (wc: {3})'.format(\n message.title, message.author, message.msg_date,\n message.word_count))\n print(' {0} snippets and {1} references'.format(\n message.code_snippets.count(),\n message.code_references.count()))\n print(' Snippets:')\n for code_snippet in message.code_snippets.all():\n print(' {0}'.format(code_snippet.language))\n\n for ref in message.code_references.all():\n print(' {0}: {1}'.format(ref.kind_hint.kind, ref.content))\n \n first_message = messages[0]\n\n # Test Title\n self.assertEqual(first_message.title, \n 'looping back to a previous step')\n\n # Test Author\n self.assertEqual(first_message.author.nickname, 'No real name')\n\n # Test Date\n self.assertEqual(first_message.msg_date, datetime(2010, 8, 26, 7, 50))\n\n # Test Refs\n refs = [ref.content.strip() for ref in\n first_message.code_references.all()]\n self.assertEqual(3, len(refs))\n self.assertTrue('ActivityElements' in refs)", "metadata": "root.ChannelParserTest.test_fudeclipse_parser", "header": "['class', 'ChannelParserTest', '(', 'TransactionTestCase', ')', ':', '___EOS___']", "index": 337 } ]
[ { "span": "self.assertTrue(len(model.toc_sections) >= 79)", "start_line": 84, "start_column": 8, "end_line": 84, "end_column": 54 }, { "span": "self.assertTrue(model.entries[18].url.find('xbox.localdomain') > -1)", "start_line": 100, "start_column": 8, "end_line": 100, "end_column": 76 }, { "span": "self.assertTrue(len(model.toc_sections) > 2349)", "start_line": 128, "start_column": 8, "end_line": 128, "end_column": 55 }, { "span": "self.assertTrue(model.entries[26].url.find('t=59') > -1)", "start_line": 144, "start_column": 8, "end_line": 144, "end_column": 64 }, { "span": "self.assertTrue(len(model.toc_sections) >= 247)", "start_line": 177, "start_column": 8, "end_line": 177, "end_column": 55 }, { "span": "self.assertTrue('EasySSLProtocolSocketFactory' in refs)", "start_line": 267, "start_column": 8, "end_line": 267, "end_column": 63 }, { "span": "self.assertTrue('SSL' in refs)", "start_line": 268, "start_column": 8, "end_line": 268, "end_column": 38 }, { "span": "self.assertTrue('DBCP' in refs)", "start_line": 334, "start_column": 8, "end_line": 334, "end_column": 39 }, { "span": "self.assertTrue('C3P0' in refs)", "start_line": 335, "start_column": 8, "end_line": 335, "end_column": 39 }, { "span": "self.assertTrue('ActivityElements' in refs)", "start_line": 386, "start_column": 8, "end_line": 386, "end_column": 51 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Chan", "nel", "Setup_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "apa", "che", "\\u", "sync", "er_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "create", "\\u", "channel", "\\u", "db_", "(_", "'", "project", "1", "'_", ",_", "'", "cf", "'_", ",_", "'", "core", "forum", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "channel", ".", "sync", "er", ".", "common", "\\u", "sync", "ers", ".", "Ap", "ache", "Mail", "Sync", "er", "'_", ",_", "'", "foo", ".", "parser", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "http", "://", "mail", "-", "archives", ".", "apa", "che", ".", "org", "/", "mod", "\\u", "mbox", "/", "hc", "-", "httpc", "lien", "t", "-", "users", "/'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "\\u", "channel", "\\u", "local_", "(_", "'", "project", "1", "'_", ",_", "'", "core", "forum", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "channel", ".", "sync", "er", ".", "common", "\\u", "sync", "ers", ".", "Ap", "ache", "Mail", "Sync", "er", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "http", "://", "mail", "-", "archives", ".", "apa", "che", ".", "org", "/", "mod", "\\u", "mbox", "/", "hc", "-", "httpc", "lien", "t", "-", "users", "/'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pname_", "=_", "'", "project", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cname_", "=_", "'", "core", "forum", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "toc", "\\u", "refresh_", "(_", "pname_", ",_", "cname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "load", "\\u", "model_", "(_", "pname_", ",_", "ST", "HRE", "AD", "\\u", "PATH_", ",_", "cname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "http", "://", "mail", "-", "archives", ".", "apa", "che", ".", "org", "/", "mod", "\\u", "mbox", "/", "hc", "-", "httpc", "lien", "t", "-", "users", "/", "2004", "10.", "mbox", "/", "date", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "._", "toc", "\\u", "sections_", "[_", "0_", "]_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "model_", "._", "toc", "\\u", "sections_", "[_", "0_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "model_", "._", "toc", "\\u", "sections_", ")_", ">=_", "79_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "79_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "i_", ",_", "model_", "._", "toc", "\\u", "sections_", "[_", "i_", "]_", "._", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "toc", "\\u", "download", "\\u", "section_", "(_", "pname_", ",_", "cname_", ",_", "start_", "=_", "0_", ",_", "end_", "=_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "load", "\\u", "model_", "(_", "pname_", ",_", "ST", "HRE", "AD", "\\u", "PATH_", ",_", "cname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "model_", "._", "toc", "\\u", "sections_", "[_", "0_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "model_", "._", "toc", "\\u", "sections_", "[_", "1_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "model_", "._", "toc", "\\u", "sections_", "[_", "2_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "model_", "._", "toc", "\\u", "sections_", "[_", "3_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "model_", "._", "toc", "\\u", "sections_", "[_", "4_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "316", "_", ",_", "len_", "(_", "model_", "._", "entries_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0_", ",_", "model_", "._", "entries_", "[_", "0_", "]_", "._", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "model_", "._", "entries_", "[_", "0_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1000_", ",_", "model_", "._", "entries_", "[_", "17_", "]_", "._", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1001_", ",_", "model_", "._", "entries_", "[_", "18_", "]_", "._", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "model_", "._", "entries_", "[_", "18_", "]_", "._", "url_", "._", "find_", "(_", "'", "xb", "ox", ".", "locald", "omain", "'_", ")_", ">_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "toc", "\\u", "download", "\\u", "entries_", "(_", "pname_", ",_", "cname_", ",_", "0_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "load", "\\u", "model_", "(_", "pname_", ",_", "ST", "HRE", "AD", "\\u", "PATH_", ",_", "cname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "model_", "._", "entries_", "[_", "0_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "model_", "._", "entries_", "[_", "1_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "settings_", "._", "PROJECT", "\\u", "FS", "\\u", "ROOT_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "._", "entries_", "[_", "0_", "]_", "._", "local", "\\u", "paths_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Setup_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "php", "bb", "\\u", "sync", "er_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "create", "\\u", "channel", "\\u", "db_", "(_", "'", "project", "1", "'_", ",_", "'", "cf", "'_", ",_", "'", "core", "forum", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "channel", ".", "sync", "er", ".", "common", "\\u", "sync", "ers", ".", "PH", "PB", "BF", "or", "um", "Sync", "er", "'_", ",_", "'", "foo", ".", "parser", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "https", "://", "forum", ".", "hib", "erna", "te", ".", "org", "/", "view", "forum", ".", "php", "?", "f", "=", "1", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "\\u", "channel", "\\u", "local_", "(_", "'", "project", "1", "'_", ",_", "'", "core", "forum", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "channel", ".", "sync", "er", ".", "common", "\\u", "sync", "ers", ".", "PH", "PB", "BF", "or", "um", "Sync", "er", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "https", "://", "forum", ".", "hib", "erna", "te", ".", "org", "/", "view", "forum", ".", "php", "?", "f", "=", "1", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pname_", "=_", "'", "project", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cname_", "=_", "'", "core", "forum", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "toc", "\\u", "refresh_", "(_", "pname_", ",_", "cname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "load", "\\u", "model_", "(_", "pname_", ",_", "ST", "HRE", "AD", "\\u", "PATH_", ",_", "cname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "https", "://", "forum", ".", "hib", "erna", "te", ".", "org", "/", "view", "forum", ".", "php", "?", "f", "=", "1", "&", "sd", "=", "a", "&", "start", "=", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "._", "toc", "\\u", "sections_", "[_", "0_", "]_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "model_", "._", "toc", "\\u", "sections_", "[_", "0_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "model_", "._", "toc", "\\u", "sections_", ")_", ">_", "234", "9_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "234", "9_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "i_", ",_", "model_", "._", "toc", "\\u", "sections_", "[_", "i_", "]_", "._", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "toc", "\\u", "download", "\\u", "section_", "(_", "pname_", ",_", "cname_", ",_", "start_", "=_", "0_", ",_", "end_", "=_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "load", "\\u", "model_", "(_", "pname_", ",_", "ST", "HRE", "AD", "\\u", "PATH_", ",_", "cname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "model_", "._", "toc", "\\u", "sections_", "[_", "0_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "model_", "._", "toc", "\\u", "sections_", "[_", "1_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "model_", "._", "toc", "\\u", "sections_", "[_", "2_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "model_", "._", "toc", "\\u", "sections_", "[_", "3_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "model_", "._", "toc", "\\u", "sections_", "[_", "4_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "100_", ",_", "len_", "(_", "model_", "._", "entries_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0_", ",_", "model_", "._", "entries_", "[_", "0_", "]_", "._", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "model_", "._", "entries_", "[_", "0_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1000_", ",_", "model_", "._", "entries_", "[_", "25_", "]_", "._", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1001_", ",_", "model_", "._", "entries_", "[_", "26_", "]_", "._", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "model_", "._", "entries_", "[_", "26_", "]_", "._", "url_", "._", "find_", "(_", "'", "t", "=", "5", "9", "'_", ")_", ">_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "toc", "\\u", "download", "\\u", "entries_", "(_", "pname_", ",_", "cname_", ",_", "1024_", ",_", "1025", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "load", "\\u", "model_", "(_", "pname_", ",_", "ST", "HRE", "AD", "\\u", "PATH_", ",_", "cname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "model_", "._", "entries_", "[_", "49_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "model_", "._", "entries_", "[_", "50_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "settings_", "._", "PROJECT", "\\u", "FS", "\\u", "ROOT_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "._", "entries_", "[_", "49_", "]_", "._", "local", "\\u", "paths_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "settings_", "._", "PROJECT", "\\u", "FS", "\\u", "ROOT_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "._", "entries_", "[_", "49_", "]_", "._", "local", "\\u", "paths_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Setup_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "fu", "decl", "ipse", "\\u", "sync", "er_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "create", "\\u", "channel", "\\u", "db_", "(_", "'", "project", "1", "'_", ",_", "'", "cf", "'_", ",_", "'", "core", "forum", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "channel", ".", "sync", "er", ".", "common", "\\u", "sync", "ers", ".", "FU", "DE", "clips", "e", "For", "um", "Sync", "er", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "foo", ".", "parser", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "http", "://", "www", ".", "eclipse", ".", "org", "/", "forum", "s", "/", "index", ".", "php", "/", "sf", "/", "thread", "/", "13", "/'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "\\u", "channel", "\\u", "local_", "(_", "'", "project", "1", "'_", ",_", "'", "core", "forum", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "channel", ".", "sync", "er", ".", "common", "\\u", "sync", "ers", ".", "FU", "DE", "clips", "e", "For", "um", "Sync", "er", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "http", "://", "www", ".", "eclipse", ".", "org", "/", "forum", "s", "/", "index", ".", "php", "/", "sf", "/", "thread", "/", "13", "/'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pname_", "=_", "'", "project", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cname_", "=_", "'", "core", "forum", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "toc", "\\u", "refresh_", "(_", "pname_", ",_", "cname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "load", "\\u", "model_", "(_", "pname_", ",_", "ST", "HRE", "AD", "\\u", "PATH_", ",_", "cname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "http", "://", "www", ".", "eclipse", ".", "org", "/", "forum", "s", "/", "index", ".", "php", "/", "sf", "/", "thread", "/", "13", "/", "1", "/", "0", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "._", "toc", "\\u", "sections_", "[_", "0_", "]_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "model_", "._", "toc", "\\u", "sections_", "[_", "0_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "model_", "._", "toc", "\\u", "sections_", ")_", ">=_", "247_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "247_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "i_", ",_", "model_", "._", "toc", "\\u", "sections_", "[_", "i_", "]_", "._", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "toc", "\\u", "download", "\\u", "section_", "(_", "pname_", ",_", "cname_", ",_", "start_", "=_", "0_", ",_", "end_", "=_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "load", "\\u", "model_", "(_", "pname_", ",_", "ST", "HRE", "AD", "\\u", "PATH_", ",_", "cname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "model_", "._", "toc", "\\u", "sections_", "[_", "0_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "model_", "._", "toc", "\\u", "sections_", "[_", "1_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "model_", "._", "toc", "\\u", "sections_", "[_", "2_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "model_", "._", "toc", "\\u", "sections_", "[_", "3_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "model_", "._", "toc", "\\u", "sections_", "[_", "4_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "160_", ",_", "len_", "(_", "model_", "._", "entries_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0_", ",_", "model_", "._", "entries_", "[_", "0_", "]_", "._", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "model_", "._", "entries_", "[_", "0_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1000_", ",_", "model_", "._", "entries_", "[_", "40_", "]_", "._", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1001_", ",_", "model_", "._", "entries_", "[_", "41_", "]_", "._", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "assert", "Tru", "e", "(", "model", ".", "entri", "es", "[", "2", "6", "].", "url", ".", "find", "('", "t", "=", "5", "9", "')", " ", ">", " ", "-1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "toc", "\\u", "download", "\\u", "entries_", "(_", "pname_", ",_", "cname_", ",_", "103", "9_", ",_", "1040", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "load", "\\u", "model_", "(_", "pname_", ",_", "ST", "HRE", "AD", "\\u", "PATH_", ",_", "cname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "model_", "._", "entries_", "[_", "79_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "model_", "._", "entries_", "[_", "80_", "]_", "._", "downloaded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "settings_", "._", "PROJECT", "\\u", "FS", "\\u", "ROOT_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "._", "entries_", "[_", "79_", "]_", "._", "local", "\\u", "paths_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Parser", "Test_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transaction_", "._", "autocommit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "apa", "che", "\\u", "parser_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "create", "\\u", "channel", "\\u", "db_", "(_", "'", "project", "1", "'_", ",_", "'", "cf", "'_", ",_", "'", "core", "forum", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "channel", ".", "sync", "er", ".", "common", "\\u", "sync", "ers", ".", "Ap", "ache", "Mail", "Sync", "er", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "channel", ".", "parser", ".", "common", "\\u", "parser", "s", ".", "Ap", "ache", "Mail", "Parser", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "http", "://", "mail", "-", "archives", ".", "apa", "che", ".", "org", "/", "mod", "\\u", "mbox", "/", "hc", "-", "httpc", "lien", "t", "-", "users", "/'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "\\u", "channel", "\\u", "local_", "(_", "'", "project", "1", "'_", ",_", "'", "core", "forum", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "channel", ".", "sync", "er", ".", "common", "\\u", "sync", "ers", ".", "Ap", "ache", "Mail", "Sync", "er", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "http", "://", "mail", "-", "archives", ".", "apa", "che", ".", "org", "/", "mod", "\\u", "mbox", "/", "hc", "-", "httpc", "lien", "t", "-", "users", "/'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pname_", "=_", "'", "project", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cname_", "=_", "'", "core", "forum", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "toc", "\\u", "refresh_", "(_", "pname_", ",_", "cname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "toc", "\\u", "download", "\\u", "section_", "(_", "pname_", ",_", "cname_", ",_", "start_", "=_", "0_", ",_", "end_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "toc", "\\u", "download", "\\u", "entries_", "(_", "pname_", ",_", "cname_", ",_", "9_", ",_", "99_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parse", "\\u", "channel_", "(_", "pname_", ",_", "cname_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "8_", ",_", "Message_", "._", "objects_", "._", "all_", "(_", ")_", "._", "count_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "messages_", "=_", "list_", "(_", "Message_", "._", "objects_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "message_", "in_", "messages_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'{", "0", "}", " ", "by", " ", "{", "1", "}", " ", "on", " ", "{", "2", "}", " ", "(", "wc", ":", " ", "{", "3", "})'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "._", "title_", ",_", "message_", "._", "author_", ",_", "message_", "._", "msg", "\\u", "date_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "._", "word", "\\u", "count_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", " ", " ", "{", "0", "}", " ", "snippet", "s", " ", "and", " ", "{", "1", "}", " ", "reference", "s", "'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "._", "code", "\\u", "snippets_", "._", "count_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "._", "code", "\\u", "references_", "._", "count_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", " ", " ", "Snippet", "s", ":'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "code", "\\u", "snippet_", "in_", "message_", "._", "code", "\\u", "snippets_", "._", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", " ", " ", " ", " ", "{", "0", "}'_", "._", "format_", "(_", "code", "\\u", "snippet_", "._", "language_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "ref_", "in_", "message_", "._", "code", "\\u", "references_", "._", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", " ", " ", " ", " ", "{", "0", "}:", " ", "{", "1", "}'_", "._", "format_", "(_", "ref_", "._", "kind", "\\u", "hint_", "._", "kind_", ",_", "ref_", "._", "content_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "Snippet", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "third", "\\u", "to", "\\u", "last_", "=_", "messages_", "[_", "-_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "l", "'_", ",_", "third", "\\u", "to", "\\u", "last_", "._", "code", "\\u", "snippets_", "._", "all_", "(_", ")_", "[_", "0_", "]_", "._", "language_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "jx", "'_", ",_", "third", "\\u", "to", "\\u", "last_", "._", "code", "\\u", "snippets_", "._", "all_", "(_", ")_", "[_", "1_", "]_", "._", "language_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "Refs", "_", "\\u\\u\\uNL\\u\\u\\u_", "fourth", "\\u", "to", "\\u", "last_", "=_", "messages_", "[_", "-_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "refs_", "=_", "[_", "ref_", "._", "content_", "._", "strip_", "(_", ")_", "for_", "ref_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "fourth", "\\u", "to", "\\u", "last_", "._", "code", "\\u", "references_", "._", "all_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "4_", ",_", "len_", "(_", "refs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "Eas", "y", "SS", "LP", "roto", "col", "Sock", "et", "Factor", "y", "'_", "in_", "refs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "SS", "L", "'_", "in_", "refs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "Post", "-", "Process", "ing", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "channel_", "=_", "post", "\\u", "process", "\\u", "channel_", "(_", "pname_", ",_", "cname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "4_", ",_", "channel_", "._", "threads_", "._", "count_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "second", "\\u", "thread_", "=_", "channel_", "._", "threads_", "._", "all_", "(_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "3_", ",_", "second", "\\u", "thread_", "._", "messages_", "._", "count_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "indexes_", "=_", "[_", "msg_", "._", "index_", "for_", "msg_", "in_", "second", "\\u", "thread_", "._", "messages_", "._", "all_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "0_", ",_", "1_", ",_", "2_", "]_", ",_", "indexes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "second", "\\u", "thread_", "._", "messages_", "._", "all_", "(_", ")_", "[_", "0_", "]_", "._", "title_", "._", "lower_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "._", "startswith_", "(_", "'", "re", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "second", "\\u", "thread_", "._", "messages_", "._", "all_", "(_", ")_", "[_", "1_", "]_", "._", "title_", "._", "lower_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "._", "startswith_", "(_", "'", "re", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Parser", "Test_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transaction_", "._", "autocommit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "php", "bb", "\\u", "parser_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "create", "\\u", "channel", "\\u", "db_", "(_", "'", "project", "1", "'_", ",_", "'", "cf", "'_", ",_", "'", "core", "forum", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "channel", ".", "sync", "er", ".", "common", "\\u", "sync", "ers", ".", "PH", "PB", "BF", "or", "um", "Sync", "er", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "channel", ".", "parser", ".", "common", "\\u", "parser", "s", ".", "PH", "PB", "BF", "or", "um", "Parser", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "https", "://", "forum", ".", "hib", "erna", "te", ".", "org", "/", "view", "forum", ".", "php", "?", "f", "=", "1", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "\\u", "channel", "\\u", "local_", "(_", "'", "project", "1", "'_", ",_", "'", "core", "forum", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "channel", ".", "sync", "er", ".", "common", "\\u", "sync", "ers", ".", "PH", "PB", "BF", "or", "um", "Sync", "er", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "https", "://", "forum", ".", "hib", "erna", "te", ".", "org", "/", "view", "forum", ".", "php", "?", "f", "=", "1", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pname_", "=_", "'", "project", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cname_", "=_", "'", "core", "forum", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "toc", "\\u", "refresh_", "(_", "pname_", ",_", "cname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "toc", "\\u", "download", "\\u", "section_", "(_", "pname_", ",_", "cname_", ",_", "start_", "=_", "0_", ",_", "end_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "toc", "\\u", "download", "\\u", "entries_", "(_", "pname_", ",_", "cname_", ",_", "1023", "_", ",_", "1025", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parse", "\\u", "channel_", "(_", "pname_", ",_", "cname_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "23_", ",_", "Message_", "._", "objects_", "._", "all_", "(_", ")_", "._", "count_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "messages_", "=_", "list_", "(_", "Message_", "._", "objects_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "message_", "in_", "messages_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "message_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'{", "0", "}", " ", "by", " ", "{", "1", "}", " ", "on", " ", "{", "2", "}", " ", "(", "wc", ":", " ", "{", "3", "})'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "._", "title_", ",_", "message_", "._", "author_", ",_", "message_", "._", "msg", "\\u", "date_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "._", "word", "\\u", "count_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", " ", " ", "{", "0", "}", " ", "snippet", "s", " ", "and", " ", "{", "1", "}", " ", "reference", "s", "'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "._", "code", "\\u", "snippets_", "._", "count_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "._", "code", "\\u", "references_", "._", "count_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", " ", " ", "Snippet", "s", ":'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "code", "\\u", "snippet_", "in_", "message_", "._", "code", "\\u", "snippets_", "._", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", " ", " ", " ", " ", "{", "0", "}'_", "._", "format_", "(_", "code", "\\u", "snippet_", "._", "language_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "ref_", "in_", "message_", "._", "code", "\\u", "references_", "._", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", " ", " ", " ", " ", "{", "0", "}:", " ", "{", "1", "}'_", "._", "format_", "(_", "ref_", "._", "kind", "\\u", "hint_", "._", "kind_", ",_", "ref_", "._", "content_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "Snippet", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "first", "\\u", "message_", "=_", "messages_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "x", "'_", ",_", "first", "\\u", "message_", "._", "code", "\\u", "snippets_", "._", "all_", "(_", ")_", "[_", "0_", "]_", "._", "language_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "Author_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "first", "\\u", "message_", "._", "author_", "._", "nickname_", ",_", "'", "mh", "ell", "kam", "p", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "Date_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "first", "\\u", "message_", "._", "msg", "\\u", "date_", ",_", "datetime_", "(_", "2003", "_", ",_", "8_", ",_", "29_", ",_", "10_", ",_", "16_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "Refs", "_", "\\u\\u\\uNL\\u\\u\\u_", "second", "\\u", "message_", "=_", "messages_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "refs_", "=_", "[_", "ref_", "._", "content_", "._", "strip_", "(_", ")_", "for_", "ref_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "second", "\\u", "message_", "._", "code", "\\u", "references_", "._", "all_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Tit", "le", " ", "is", " ", "not", " ", "counted", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "4_", ",_", "len_", "(_", "refs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "DB", "CP", "'_", "in_", "refs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "C3", "P0", "'_", "in_", "refs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Chan", "nel", "Parser", "Test_", "(_", "Transa", "ction", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transaction_", "._", "autocommit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "fu", "decl", "ipse", "\\u", "parser_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "create", "\\u", "channel", "\\u", "db_", "(_", "'", "project", "1", "'_", ",_", "'", "cf", "'_", ",_", "'", "core", "forum", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "channel", ".", "sync", "er", ".", "common", "\\u", "sync", "ers", ".", "FU", "DE", "clips", "e", "For", "um", "Sync", "er", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "channel", ".", "parser", ".", "common", "\\u", "parser", "s", ".", "FU", "DE", "clips", "e", "For", "um", "Parser", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "http", "://", "www", ".", "eclipse", ".", "org", "/", "forum", "s", "/", "index", ".", "php", "/", "sf", "/", "thread", "/", "5", "9", "/'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "\\u", "channel", "\\u", "local_", "(_", "'", "project", "1", "'_", ",_", "'", "core", "forum", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "channel", ".", "sync", "er", ".", "common", "\\u", "sync", "ers", ".", "FU", "DE", "clips", "e", "For", "um", "Sync", "er", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "http", "://", "www", ".", "eclipse", ".", "org", "/", "forum", "s", "/", "index", ".", "php", "/", "sf", "/", "thread", "/", "5", "9", "/'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pname_", "=_", "'", "project", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cname_", "=_", "'", "core", "forum", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "toc", "\\u", "refresh_", "(_", "pname_", ",_", "cname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "toc", "\\u", "download", "\\u", "section_", "(_", "pname_", ",_", "cname_", ",_", "start_", "=_", "0_", ",_", "end_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "toc", "\\u", "download", "\\u", "entries_", "(_", "pname_", ",_", "cname_", ",_", "0_", ",_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parse", "\\u", "channel_", "(_", "pname_", ",_", "cname_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "18_", ",_", "Message_", "._", "objects_", "._", "all_", "(_", ")_", "._", "count_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "messages_", "=_", "list_", "(_", "Message_", "._", "objects_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "message_", "in_", "messages_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'{", "0", "}", " ", "by", " ", "{", "1", "}", " ", "on", " ", "{", "2", "}", " ", "(", "wc", ":", " ", "{", "3", "})'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "._", "title_", ",_", "message_", "._", "author_", ",_", "message_", "._", "msg", "\\u", "date_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "._", "word", "\\u", "count_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", " ", " ", "{", "0", "}", " ", "snippet", "s", " ", "and", " ", "{", "1", "}", " ", "reference", "s", "'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "._", "code", "\\u", "snippets_", "._", "count_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "._", "code", "\\u", "references_", "._", "count_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", " ", " ", "Snippet", "s", ":'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "code", "\\u", "snippet_", "in_", "message_", "._", "code", "\\u", "snippets_", "._", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", " ", " ", " ", " ", "{", "0", "}'_", "._", "format_", "(_", "code", "\\u", "snippet_", "._", "language_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "ref_", "in_", "message_", "._", "code", "\\u", "references_", "._", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", " ", " ", " ", " ", "{", "0", "}:", " ", "{", "1", "}'_", "._", "format_", "(_", "ref_", "._", "kind", "\\u", "hint_", "._", "kind_", ",_", "ref_", "._", "content_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "first", "\\u", "message_", "=_", "messages_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "Title_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "first", "\\u", "message_", "._", "title_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "looping", " ", "back", " ", "to", " ", "a", " ", "previ", "ous", " ", "step", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "Author_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "first", "\\u", "message_", "._", "author_", "._", "nickname_", ",_", "'", "No", " ", "real", " ", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "Date_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "first", "\\u", "message_", "._", "msg", "\\u", "date_", ",_", "datetime_", "(_", "2010_", ",_", "8_", ",_", "26_", ",_", "7_", ",_", "50_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "Refs", "_", "\\u\\u\\uNL\\u\\u\\u_", "refs_", "=_", "[_", "ref_", "._", "content_", "._", "strip_", "(_", ")_", "for_", "ref_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "first", "\\u", "message_", "._", "code", "\\u", "references_", "._", "all_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "3_", ",_", "len_", "(_", "refs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "Activ", "it", "y", "Element", "s", "'_", "in_", "refs_", ")_" ]
[ 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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