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
Variable defined multiple times
abbotto/comsys/comsys.py
[ { "content": "# ---------------------------------------------------------------------------------------------\n# ComSys Tools V0.01\n# Support: Python 2.7, 3.3\n# ---------------------------------------------------------------------------------------------\n\n# Import the necessary resources\nfrom bs4 import BeautifulSoup\nimport tarfile, shutil, glob, os, re, sys, time, platform\n\n# Try for Python 3.3\ntry:\n\timport urllib.request\n\tweb = urllib.request\n# Fall back to Python 2.7\nexcept ImportError:\n\timport urllib\n\tweb = urllib\n\n# Verbose output\nvOutput = sys.stdout.write\nvFlush = sys.stdout.flush\n\n# Work/Target directories\nargs = sys.argv\nworkDir = r'' + args[1]\ntargetDir = r'' + args[2]\n\n# Make the workDir if it doesn't exist\nif not os.path.exists(workDir): os.makedirs(workDir)\n\n# Make the targetDir if it doesn't exist\nif not os.path.exists(targetDir): os.makedirs(targetDir)\n\n# Initialize the script\nvOutput('\\nInitializing....\\n\\n')\n\n# Report the download percentage\n\n# Download via BeautifulSoup\n\n\n# Most items can be added to the list without preprocesing\nurlList = {'http://download.wsusoffline.net/wsusoffline96.zip': 'wsus.zip', 'http://unetbootin.sourceforge.net/unetbootin-windows-latest.exe': 'Unetbootin.exe', 'http://mse.dlservice.microsoft.com/download/A/3/8/A38FFBF2-1122-48B4-AF60-E44F6DC28BD8/enus/x86/mseinstall.exe': 'MS_Security_x86.exe', 'http://sourceforge.net/projects/dban/files/latest/download': 'Dariks_Boot_And_Nuke.iso', 'http://www.oxid.it/downloads/ca_setup.exe': 'Cain_Network_Tool.exe', 'http://www.pkostov.com/wip/wip_inst.exe': 'Windows_IP_Config.exe', 'http://download.sysinternals.com/files/SysinternalsSuite.zip': 'Sysinternals.zip', 'http://winaudit.zymichost.com/winaudit.zip': 'WinAudit.zip', 'http://www.gunnerinc.com/files/welt.zip': 'Windows_Error_Lookup_Tool.zip', 'http://static.slysoft.com/SetupVirtualCloneDrive.exe': 'Virtual_Clone_Drive.exe', 'http://www.auslogics.com/en/downloads/disk-defrag/ausdiskdefragportable.exe': 'Auslogics_Disk_Defrag.exe', 'http://download.macromedia.com/pub/flashplayer/current/support/install_flash_player_ax.exe': 'Flash_Player_AX.exe', 'http://download.macromedia.com/pub/flashplayer/current/support/install_flash_player.exe': 'Flash_Player.exe', 'http://www.malwarebytes.org/mbam/program/mbam-setup.exe': 'Malwarebytes_AntiMalware.exe', 'http://download.mcafee.com/products/licensed/cust_support_patches/MCPR.exe': 'McAfee_Consumer_Product_Removal_Tool.exe', 'http://the.earth.li/~sgtatham/putty/latest/x86/puttytel.exe': 'PuttyTel.exe', 'http://www.revouninstaller.com/download/revouninstaller.zip': 'Revo_Uninstaller.zip', 'http://www.spybotupdates.biz/files/spybotsd162.exe': 'SpybotSD1.exe', 'http://support.kaspersky.com/downloads/utils/tdsskiller.zip': 'TDSSKiller.zip', 'http://www.infospyware.net/sUBs/ComboFix.exe': '', 'http://files.avast.com/iavs5x/avast_free_antivirus_setup.exe': 'Avast_Free.exe', 'http://files.spybot.info/SpybotSD2.exe': '', 'http://www.piriform.com/ccleaner/download/slim/downloadfile': 'CCleaner.zip', 'http://mse.dlservice.microsoft.com/download/A/3/8/A38FFBF2-1122-48B4-AF60-E44F6DC28BD8/enus/amd64/mseinstall.exe': 'MS_Security_x64.exe', 'http://sourceforge.net/projects/safecopy/files/latest/download': 'SafeCopy.tar.gz', 'http://downloadcenter.mcafee.com/products/mcafee-avert/Stinger/stinger32.exe': 'McAfee_Stinger.exe', 'ftp://ftp.symantec.com/public/english_us_canada/removal_tools/Norton_Removal_Tool.exe': ''}\n\n# These items require preprocesing with soup\nsoupList = {\"'http://www.ammyy.com/en/downloads.html','.exe','Ammyy_Admin.exe','http://www.ammyy.com/',''\", \"'http://mirror.ufs.ac.za/portableapps/BleachBit%20Portable/','.exe','BleachBit.zip','',-1\", \"'http://mirror.ufs.ac.za/portableapps/DynDNS%20Simply%20Client%20Portable/','.exe','DynDNS_Client.exe','',-1\", \"'http://mirror.ufs.ac.za/portableapps/FastCopy%20Portable/','.exe','FastCopy.exe','',-1\", \"'http://mirror.ufs.ac.za/portableapps/HijackThis%20Portable/','.exe','HijackThis.exe','',-1\", \"'http://mirror.anl.gov/pub/hirens-bootcd/','.zip','Hirens_BootCD.zip','',-1\", \"'http://devbuilds.kaspersky-labs.com/devbuilds/AVPTool/avptool11/','.exe','AVP_Tool.exe','',-1\", \"'http://launcher.nirsoft.net/download.html','.zip','NirSoft_Launcher.zip','http://download.nirsoft.net/',''\", \"'http://launcher.nirsoft.net/download.html','.zip','NirSoft_Launcher.zip','http://download.nirsoft.net/',''\", \"'http://rm.mirror.garr.it/mirrors/trk/','.iso','Trinity_Rescue_Kit.iso','',-2\", \"'http://ftp.cc.uoc.gr/mirrors/linux/ubcd/','.iso','Ultimate_BootCD.iso','',-1\", \"'http://www.wireshark.org/download.html','paf.exe','WireShark.exe','http://wiresharkdownloads.riverbed.com/wireshark/win32/',''\"}\n\n# THE FOLLOWING SECTION CONTAINS FILES THAT HAVE SPECIAL DOWNLOAD REQUIREMENTS SO THEY GET CUSTOM SOUP LOGIC\n# ---------------------------------------------------------------------------------------------\n\n# Download GParted\nsoup = BeautifulSoup(web.urlopen('http://gparted.sourceforge.net/download.php'))\n\nfor link in soup.findAll('a', href=re.compile(\".iso\")):\n\n\tgpart = link.get('href')\n\turlList[gpart] = 'GParted.iso'\n\n# Download AVG\nsoup = BeautifulSoup(web.urlopen('http://free.avg.com/us-en/download.prd-afh'))\n\nfor link in soup.findAll('a', href=re.compile(\"avg_free_stb_en\")):\n\n\tavg = link.get('href')\n\turlList[avg] = 'AVG_Free.exe'\n\n# Download AVG Remover\nfileList = []\nsoup = BeautifulSoup(web.urlopen('http://www.avg.com/ca-en/utilities'))\n\nfor link in soup.findAll('a', href=re.compile(\"remover\")):\n\n\tavgr = link.get('href')\n\tfileList.append(avgr)\n\n# Isolate the first 2 items in the list, aka the newest items\nurlList[fileList[0]] = 'AVG_Remover_x86.exe'\nurlList[fileList[1]] = 'AVG_Remover_x64.exe'\n\n# ---------------------------------------------------------------------------------------------\n\n# Loop through the soupList\nfor parameters in soupList:\n\n\tif parameters == 0:\n\t\tparameters = ''\n\n\tsoup(parameters)\n\n# Loop through the urlList\nfor url, fileName in urlList.items():\n\n\tif fileName == 0:\n\t\tfileName = ''\n\n\tgetRemoteFile(url, fileName)\n\n# The script has finished\nvOutput('Done!\\n\\n')\nvFlush()\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def soup(url1,str,rename,url2='',index=''):\n\n\t# Initialize the array for the files that will be scraped\n\tfileList = []\n\n\t# Invoke BeautifulSoup\n\tsoup = BeautifulSoup(web.urlopen(url1))\n\n\t# Search for anchor tags hrefs that contain a specific string\n\tfor link in soup.findAll('a', href=re.compile(str)):\n\t\t# Grab the link\n\t\tapp = link.get('href')\n\n\t\t# Add all the files to a list\n\t\tfileList.append(app)\n\n\t# Isolate the first item in the list, aka the newest item\n\tname = fileList[0].split('/')[-1]\n\n\t# Specify an index for fileList if required\n\tif index != '':\n\t\tname = fileList[index]\n\n\t# Set url1 to url2 when necessary\n\tif url2 != '':\n\t\turl1 = url2\n\n\t# Set the new filename\n\turlList[url1 + name] = rename", "metadata": "root.soup", "header": "['module', '___EOS___']", "index": 43 } ]
[ { "span": "soup(", "start_line": 43, "start_column": 4, "end_line": 43, "end_column": 8 } ]
[ { "span": "soup ", "start_line": 194, "start_column": 0, "end_line": 194, "end_column": 4 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "---------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Com", "Sys", " ", "Tool", "s", " ", "V0", ".01_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Supp", "ort", ":", " ", "Pyth", "on", " ", "2.7", ",", " ", "3.3", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "---------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Import", " ", "the", " ", "necessar", "y", " ", "resources_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "bs4_", "import_", "Bea", "uti", "ful", "Soup_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tarfile_", ",_", "shutil_", ",_", "glob_", ",_", "os_", ",_", "re_", ",_", "sys_", ",_", "time_", ",_", "platform_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tr", "y", " ", "for", " ", "Pyth", "on", " ", "3.3", "_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "import_", "urllib_", "._", "request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "web_", "=_", "urllib_", "._", "request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fall", " ", "back", " ", "to", " ", "Pyth", "on", " ", "2.7", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "import_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "web_", "=_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Verbos", "e", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "v", "Output_", "=_", "sys_", "._", "stdout_", "._", "write_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v", "Flu", "sh_", "=_", "sys_", "._", "stdout_", "._", "flush_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Work", "/", "Target", " ", "directories_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "sys_", "._", "argv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work", "Dir_", "=_", "r", "''_", "+_", "args_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "Dir_", "=_", "r", "''_", "+_", "args_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "the", " ", "work", "Dir", " ", "if", " ", "it", " ", "doe", "sn", "'", "t", " ", "exist_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "work", "Dir_", ")_", ":_", "os_", "._", "makedirs_", "(_", "work", "Dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "the", " ", "target", "Dir", " ", "if", " ", "it", " ", "doe", "sn", "'", "t", " ", "exist_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "target", "Dir_", ")_", ":_", "os_", "._", "makedirs_", "(_", "target", "Dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initializ", "e", " ", "the", " ", "script_", "\\u\\u\\uNL\\u\\u\\u_", "v", "Output_", "(_", "'\\\\", "n", "Initializ", "ing", "....", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Report", " ", "the", " ", "download", " ", "percentage_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Down", "load", " ", "via", " ", "Bea", "uti", "ful", "Soup_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Mos", "t", " ", "items", " ", "can", " ", "be", " ", "adde", "d", " ", "to", " ", "the", " ", "list", " ", "with", "out", " ", "preproc", "esi", "ng_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "url", "List_", "=_", "{_", "'", "http", "://", "download", ".", "ws", "uso", "ffl", "ine", ".", "net", "/", "ws", "uso", "ffl", "ine", "96", ".", "zip", "'_", ":_", "'", "ws", "us", ".", "zip", "'_", ",_", "'", "http", "://", "une", "tbo", "oti", "n", ".", "sourcef", "org", "e", ".", "net", "/", "une", "tbo", "oti", "n", "-", "windows", "-", "late", "st", ".", "exe", "'_", ":_", "'", "Une", "tbo", "oti", "n", ".", "exe", "'_", ",_", "'", "http", "://", "mse", ".", "dl", "service", ".", "micros", "oft", ".", "com", "/", "download", "/", "A", "/", "3", "/", "8", "/", "A3", "8", "FF", "BF", "2", "-1", "122", "-", "4", "8", "B4", "-", "AF", "60", "-", "E4", "4", "F6", "DC", "2", "8", "BD", "8", "/", "enu", "s", "/", "x8", "6", "/", "mse", "install", ".", "exe", "'_", ":_", "'", "MS", "\\u", "Secur", "it", "y", "\\u", "x8", "6", ".", "exe", "'_", ",_", "'", "http", "://", "sourcef", "org", "e", ".", "net", "/", "project", "s", "/", "dba", "n", "/", "files", "/", "late", "st", "/", "download", "'_", ":_", "'", "Dar", "ik", "s", "\\u", "Boot", "\\u", "And", "\\u", "Nu", "ke", ".", "iso", "'_", ",_", "'", "http", "://", "www", ".", "oxi", "d", ".", "it", "/", "download", "s", "/", "ca", "\\u", "setup", ".", "exe", "'_", ":_", "'", "Cai", "n", "\\u", "Network", "\\u", "Tool", ".", "exe", "'_", ",_", "'", "http", "://", "www", ".", "pk", "ost", "ov", ".", "com", "/", "wi", "p", "/", "wi", "p", "\\u", "inst", ".", "exe", "'_", ":_", "'", "Window", "s", "\\u", "IP", "\\u", "Config", ".", "exe", "'_", ",_", "'", "http", "://", "download", ".", "sysi", "nter", "nal", "s", ".", "com", "/", "files", "/", "Sys", "internals", "Suit", "e", ".", "zip", "'_", ":_", "'", "Sys", "internals", ".", "zip", "'_", ",_", "'", "http", "://", "win", "audit", ".", "zy", "mich", "ost", ".", "com", "/", "win", "audit", ".", "zip", "'_", ":_", "'", "Win", "Audi", "t", ".", "zip", "'_", ",_", "'", "http", "://", "www", ".", "gun", "ner", "inc", ".", "com", "/", "files", "/", "wel", "t", ".", "zip", "'_", ":_", "'", "Window", "s", "\\u", "Error", "\\u", "Look", "up", "\\u", "Tool", ".", "zip", "'_", ",_", "'", "http", "://", "static", ".", "sl", "ys", "oft", ".", "com", "/", "Set", "up", "Virt", "ual", "Clone", "Drive", ".", "exe", "'_", ":_", "'", "Virt", "ual", "\\u", "Clone", "\\u", "Drive", ".", "exe", "'_", ",_", "'", "http", "://", "www", ".", "aus", "logic", "s", ".", "com", "/", "en", "/", "download", "s", "/", "disk", "-", "def", "rag", "/", "aus", "disk", "def", "rag", "portab", "le", ".", "exe", "'_", ":_", "'", "Au", "slo", "gic", "s", "\\u", "Disk", "\\u", "Def", "rag", ".", "exe", "'_", ",_", "'", "http", "://", "download", ".", "macro", "media", ".", "com", "/", "pub", "/", "flash", "player", "/", "current", "/", "support", "/", "install", "\\u", "flash", "\\u", "player", "\\u", "ax", ".", "exe", "'_", ":_", "'", "Fla", "sh", "\\u", "Player", "\\u", "AX", ".", "exe", "'_", ",_", "'", "http", "://", "download", ".", "macro", "media", ".", "com", "/", "pub", "/", "flash", "player", "/", "current", "/", "support", "/", "install", "\\u", "flash", "\\u", "player", ".", "exe", "'_", ":_", "'", "Fla", "sh", "\\u", "Player", ".", "exe", "'_", ",_", "'", "http", "://", "www", ".", "mal", "ware", "bytes", ".", "org", "/", "mba", "m", "/", "program", "/", "mba", "m", "-", "setup", ".", "exe", "'_", ":_", "'", "Mal", "ware", "bytes", "\\u", "Anti", "Mal", "ware", ".", "exe", "'_", ",_", "'", "http", "://", "download", ".", "mca", "fe", "e", ".", "com", "/", "products", "/", "license", "d", "/", "cust", "\\u", "support", "\\u", "patche", "s", "/", "MC", "PR", ".", "exe", "'_", ":_", "'", "Mc", "Af", "ee", "\\u", "Consume", "r", "\\u", "Product", "\\u", "Remo", "val", "\\u", "Tool", ".", "exe", "'_", ",_", "'", "http", "://", "the", ".", "earth", ".", "li", "/", "~", "sg", "tat", "ham", "/", "put", "ty", "/", "late", "st", "/", "x8", "6", "/", "put", "ty", "tel", ".", "exe", "'_", ":_", "'", "Put", "ty", "Tel", ".", "exe", "'_", ",_", "'", "http", "://", "www", ".", "revo", "uninstall", "er", ".", "com", "/", "download", "/", "revo", "uninstall", "er", ".", "zip", "'_", ":_", "'", "Revo", "\\u", "Unin", "stall", "er", ".", "zip", "'_", ",_", "'", "http", "://", "www", ".", "spy", "bot", "update", "s", ".", "biz", "/", "files", "/", "spy", "bot", "sd", "162", ".", "exe", "'_", ":_", "'", "Spy", "bot", "SD", "1.e", "xe", "'_", ",_", "'", "http", "://", "support", ".", "kas", "pers", "ky", ".", "com", "/", "download", "s", "/", "util", "s", "/", "td", "ss", "kille", "r", ".", "zip", "'_", ":_", "'", "TD", "SS", "Kill", "er", ".", "zip", "'_", ",_", "'", "http", "://", "www", ".", "infos", "pyw", "are", ".", "net", "/", "s", "UB", "s", "/", "Comb", "o", "Fix", ".", "exe", "'_", ":_", "''_", ",_", "'", "http", "://", "files", ".", "ava", "st", ".", "com", "/", "ia", "vs", "5", "x", "/", "ava", "st", "\\u", "free", "\\u", "anti", "virus", "\\u", "setup", ".", "exe", "'_", ":_", "'", "Ava", "st", "\\u", "Free", ".", "exe", "'_", ",_", "'", "http", "://", "files", ".", "spy", "bot", ".", "info", "/", "Spy", "bot", "SD", "2", ".", "exe", "'_", ":_", "''_", ",_", "'", "http", "://", "www", ".", "pir", "ifo", "rm", ".", "com", "/", "ccl", "ean", "er", "/", "download", "/", "slim", "/", "download", "file", "'_", ":_", "'", "CC", "lean", "er", ".", "zip", "'_", ",_", "'", "http", "://", "mse", ".", "dl", "service", ".", "micros", "oft", ".", "com", "/", "download", "/", "A", "/", "3", "/", "8", "/", "A3", "8", "FF", "BF", "2", "-1", "122", "-", "4", "8", "B4", "-", "AF", "60", "-", "E4", "4", "F6", "DC", "2", "8", "BD", "8", "/", "enu", "s", "/", "am", "d6", "4", "/", "mse", "install", ".", "exe", "'_", ":_", "'", "MS", "\\u", "Secur", "it", "y", "\\u", "x6", "4", ".", "exe", "'_", ",_", "'", "http", "://", "sourcef", "org", "e", ".", "net", "/", "project", "s", "/", "safe", "copy", "/", "files", "/", "late", "st", "/", "download", "'_", ":_", "'", "Safe", "Copy", ".", "tar", ".", "gz", "'_", ",_", "'", "http", "://", "download", "center", ".", "mca", "fe", "e", ".", "com", "/", "products", "/", "mca", "fe", "e-", "aver", "t", "/", "Sti", "nger", "/", "stin", "ger", "32.", "exe", "'_", ":_", "'", "Mc", "Af", "ee", "\\u", "Sti", "nger", ".", "exe", "'_", ",_", "'", "ftp", "://", "ftp", ".", "sym", "ante", "c", ".", "com", "/", "public", "/", "english", "\\u", "us", "\\u", "can", "ada", "/", "removal", "\\u", "tool", "s", "/", "Nor", "ton", "\\u", "Remo", "val", "\\u", "Tool", ".", "exe", "'_", ":_", "''_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", "se", " ", "items", " ", "require", " ", "preproc", "esi", "ng", " ", "with", " ", "soup_", "\\u\\u\\uNL\\u\\u\\u_", "soup", "List_", "=_", "{_", "\"'", "http", "://", "www", ".", "am", "my", "y", ".", "com", "/", "en", "/", "download", "s", ".", "html", "','", ".", "exe", "','", "Am", "my", "y", "\\u", "Admi", "n", ".", "exe", "','", "http", "://", "www", ".", "am", "my", "y", ".", "com", "/'", ",'", "'\"_", ",_", "\"'", "http", "://", "mirror", ".", "uf", "s", ".", "ac", ".", "za", "/", "portab", "leap", "ps", "/", "Ble", "ach", "Bit", "%", "20", "Porta", "ble", "/'", ",'", ".", "exe", "','", "Ble", "ach", "Bit", ".", "zip", "','", "',", "-1", "\"_", ",_", "\"'", "http", "://", "mirror", ".", "uf", "s", ".", "ac", ".", "za", "/", "portab", "leap", "ps", "/", "Dyn", "DNS", "%", "20", "Simp", "ly", "%", "20", "Client", "%", "20", "Porta", "ble", "/'", ",'", ".", "exe", "','", "Dyn", "DNS", "\\u", "Client", ".", "exe", "','", "',", "-1", "\"_", ",_", "\"'", "http", "://", "mirror", ".", "uf", "s", ".", "ac", ".", "za", "/", "portab", "leap", "ps", "/", "Fast", "Copy", "%", "20", "Porta", "ble", "/'", ",'", ".", "exe", "','", "Fast", "Copy", ".", "exe", "','", "',", "-1", "\"_", ",_", "\"'", "http", "://", "mirror", ".", "uf", "s", ".", "ac", ".", "za", "/", "portab", "leap", "ps", "/", "Hi", "jack", "Thi", "s", "%", "20", "Porta", "ble", "/'", ",'", ".", "exe", "','", "Hi", "jack", "Thi", "s", ".", "exe", "','", "',", "-1", "\"_", ",_", "\"'", "http", "://", "mirror", ".", "an", "l", ".", "gov", "/", "pub", "/", "hire", "ns", "-", "boot", "cd", "/'", ",'", ".", "zip", "','", "Hi", "ren", "s", "\\u", "Boot", "CD", ".", "zip", "','", "',", "-1", "\"_", ",_", "\"'", "http", "://", "dev", "builds", ".", "kas", "pers", "ky", "-", "labs", ".", "com", "/", "dev", "builds", "/", "AVP", "Tool", "/", "av", "pto", "ol", "11", "/'", ",'", ".", "exe", "','", "AVP", "\\u", "Tool", ".", "exe", "','", "',", "-1", "\"_", ",_", "\"'", "http", "://", "launcher", ".", "ni", "rs", "oft", ".", "net", "/", "download", ".", "html", "','", ".", "zip", "','", "Ni", "r", "Sof", "t", "\\u", "Launch", "er", ".", "zip", "','", "http", "://", "download", ".", "ni", "rs", "oft", ".", "net", "/'", ",'", "'\"_", ",_", "\"'", "http", "://", "launcher", ".", "ni", "rs", "oft", ".", "net", "/", "download", ".", "html", "','", ".", "zip", "','", "Ni", "r", "Sof", "t", "\\u", "Launch", "er", ".", "zip", "','", "http", "://", "download", ".", "ni", "rs", "oft", ".", "net", "/'", ",'", "'\"_", ",_", "\"'", "http", "://", "rm", ".", "mirror", ".", "gar", "r", ".", "it", "/", "mirrors", "/", "tr", "k", "/'", ",'", ".", "iso", "','", "Tri", "nit", "y", "\\u", "Resc", "ue", "\\u", "Kit", ".", "iso", "','", "',", "-", "2", "\"_", ",_", "\"'", "http", "://", "ftp", ".", "cc", ".", "uo", "c", ".", "gr", "/", "mirrors", "/", "linux", "/", "ubc", "d", "/'", ",'", ".", "iso", "','", "Ult", "imat", "e\\u", "Boot", "CD", ".", "iso", "','", "',", "-1", "\"_", ",_", "\"'", "http", "://", "www", ".", "wires", "har", "k", ".", "org", "/", "download", ".", "html", "','", "pa", "f", ".", "exe", "','", "Wire", "Shar", "k", ".", "exe", "','", "http", "://", "wires", "har", "kd", "own", "load", "s", ".", "river", "bed", ".", "com", "/", "wires", "har", "k", "/", "win32", "/'", ",'", "'\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THE", " ", "FOL", "LOW", "ING", " ", "SECTION", " ", "CONT", "AINS", " ", "FILE", "S", " ", "THA", "T", " ", "HA", "VE", " ", "SPECIAL", " ", "DOWNLOAD", " ", "REQUIRE", "MENT", "S", " ", "SO", " ", "THE", "Y", " ", "GET", " ", "CUSTOM", " ", "SOU", "P", " ", "LOGI", "C_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "---------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Down", "load", " ", "GP", "arte", "d_", "\\u\\u\\uNL\\u\\u\\u_", "soup_", "=_", "Bea", "uti", "ful", "Soup_", "(_", "web_", "._", "urlopen_", "(_", "'", "http", "://", "gpa", "rted", ".", "sourcef", "org", "e", ".", "net", "/", "download", ".", "php", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "link_", "in_", "soup_", "._", "find", "All_", "(_", "'", "a", "'_", ",_", "href_", "=_", "re_", "._", "compile_", "(_", "\".", "iso", "\"_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "gpa", "rt_", "=_", "link_", "._", "get_", "(_", "'", "href", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url", "List_", "[_", "gpa", "rt_", "]_", "=_", "'", "GP", "arte", "d", ".", "iso", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Down", "load", " ", "AVG", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "soup_", "=_", "Bea", "uti", "ful", "Soup_", "(_", "web_", "._", "urlopen_", "(_", "'", "http", "://", "free", ".", "avg", ".", "com", "/", "us", "-", "en", "/", "download", ".", "prd", "-", "af", "h", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "link_", "in_", "soup_", "._", "find", "All_", "(_", "'", "a", "'_", ",_", "href_", "=_", "re_", "._", "compile_", "(_", "\"", "avg", "\\u", "free", "\\u", "stb", "\\u", "en", "\"_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "avg_", "=_", "link_", "._", "get_", "(_", "'", "href", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url", "List_", "[_", "avg_", "]_", "=_", "'", "AVG", "\\u", "Free", ".", "exe", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Down", "load", " ", "AVG", " ", "Remove", "r_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "file", "List_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "soup_", "=_", "Bea", "uti", "ful", "Soup_", "(_", "web_", "._", "urlopen_", "(_", "'", "http", "://", "www", ".", "avg", ".", "com", "/", "ca", "-", "en", "/", "util", "iti", "es", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "link_", "in_", "soup_", "._", "find", "All_", "(_", "'", "a", "'_", ",_", "href_", "=_", "re_", "._", "compile_", "(_", "\"", "remove", "r", "\"_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "avg", "r_", "=_", "link_", "._", "get_", "(_", "'", "href", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "List_", "._", "append_", "(_", "avg", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Isolat", "e", " ", "the", " ", "first", " ", "2", " ", "items", " ", "in", " ", "the", " ", "list", ",", " ", "aka", " ", "the", " ", "newest", " ", "items_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "url", "List_", "[_", "file", "List_", "[_", "0_", "]_", "]_", "=_", "'", "AVG", "\\u", "Remove", "r", "\\u", "x8", "6", ".", "exe", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url", "List_", "[_", "file", "List_", "[_", "1_", "]_", "]_", "=_", "'", "AVG", "\\u", "Remove", "r", "\\u", "x6", "4", ".", "exe", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "---------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Loop", " ", "through", " ", "the", " ", "soup", "List_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "parameters_", "in_", "soup", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "if_", "parameters_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "parameters_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "soup_", "(_", "parameters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Loop", " ", "through", " ", "the", " ", "url", "List_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "url_", ",_", "file", "Name_", "in_", "url", "List_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "if_", "file", "Name_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "file", "Name_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "get", "Remo", "te", "File_", "(_", "url_", ",_", "file", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "script", " ", "has", " ", "finished_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "v", "Output_", "(_", "'", "Don", "e", "!\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v", "Flu", "sh_", "(_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "soup_", "(_", "url", "1_", ",_", "str_", ",_", "rename_", ",_", "url2", "_", "=_", "''_", ",_", "index_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initializ", "e", " ", "the", " ", "array", " ", "for", " ", "the", " ", "files", " ", "tha", "t", " ", "will", " ", "be", " ", "scraped", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "file", "List_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Invok", "e", " ", "Bea", "uti", "ful", "Soup_", "\\u\\u\\uNL\\u\\u\\u_", "soup_", "=_", "Bea", "uti", "ful", "Soup_", "(_", "web_", "._", "urlopen_", "(_", "url", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sear", "ch", " ", "for", " ", "anchor", " ", "tags", " ", "href", "s", " ", "tha", "t", " ", "contain", " ", "a", " ", "specific", " ", "string_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "link_", "in_", "soup_", "._", "find", "All_", "(_", "'", "a", "'_", ",_", "href_", "=_", "re_", "._", "compile_", "(_", "str_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Grab", " ", "the", " ", "link_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "app_", "=_", "link_", "._", "get_", "(_", "'", "href", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "all", " ", "the", " ", "files", " ", "to", " ", "a", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "file", "List_", "._", "append_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Isolat", "e", " ", "the", " ", "first", " ", "item", " ", "in", " ", "the", " ", "list", ",", " ", "aka", " ", "the", " ", "newest", " ", "item_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "name_", "=_", "file", "List_", "[_", "0_", "]_", "._", "split_", "(_", "'/'_", ")_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Speci", "fy", " ", "an", " ", "index", " ", "for", " ", "file", "List", " ", "if", " ", "required_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "index_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "name_", "=_", "file", "List_", "[_", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "url", "1", " ", "to", " ", "url2", " ", "whe", "n", " ", "necessar", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "url2", "_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "url", "1_", "=_", "url2", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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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 ]
Imprecise assert
godaddy/Thespian/thespian/system/test/test_expirytime.py
[ { "content": " def testNonZeroRemaining(self):\n et = ExpiryTime(timedelta(milliseconds=10))\n self.assertTrue(timedelta(days=0) < et.remaining())\n self.assertTrue(timedelta(milliseconds=11) > et.remaining())\n sleep(et.remainingSeconds())\n self.assertEqual(timedelta(days=0), et.remaining())", "metadata": "root.TestExpiryTime.testNonZeroRemaining", "header": "['class', 'TestExpiryTime', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 32 }, { "content": " def testNonZeroRemainingSeconds(self):\n et = ExpiryTime(timedelta(milliseconds=10))\n self.assertTrue(0.0 < et.remainingSeconds())\n self.assertTrue(0.0101 > et.remainingSeconds())\n sleep(et.remainingSeconds())\n self.assertEqual(0.0, et.remainingSeconds())", "metadata": "root.TestExpiryTime.testNonZeroRemainingSeconds", "header": "['class', 'TestExpiryTime', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 47 }, { "content": " def testNoneInEquality(self):\n et1 = ExpiryTime(None)\n et2 = ExpiryTime(None)\n self.assertFalse(et1 != et2)\n self.assertFalse(et2 != et1)", "metadata": "root.TestExpiryTime.testNoneInEquality", "header": "['class', 'TestExpiryTime', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 125 }, { "content": " def testNoneGreaterThanNone(self):\n et1 = ExpiryTime(None)\n et2 = ExpiryTime(None)\n # None == forever, so it is greater than anything, although equal to itself\n self.assertFalse(et1 > et2)\n self.assertFalse(et2 > et1)", "metadata": "root.TestExpiryTime.testNoneGreaterThanNone", "header": "['class', 'TestExpiryTime', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 131 }, { "content": " def testNoneComparedToZero(self):\n et1 = ExpiryTime(None)\n et2 = ExpiryTime(timedelta(days=0))\n # None == forever, so it is greater than anything, although equal to itself\n self.assertGreater(et1, et2)\n self.assertLess(et2, et1)\n self.assertTrue(et1 >= et2)\n self.assertTrue(et2 <= et1)", "metadata": "root.TestExpiryTime.testNoneComparedToZero", "header": "['class', 'TestExpiryTime', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 138 }, { "content": " def testNoneComparedToNonZero(self):\n et1 = ExpiryTime(None)\n et2 = ExpiryTime(timedelta(milliseconds=10))\n # None == forever, so it is greater than anything, although equal to itself\n self.assertGreater(et1, et2)\n self.assertLess(et2, et1)\n self.assertTrue(et1 > et2)\n self.assertTrue(et2 < et1)\n sleep(et2.remainingSeconds())\n self.assertGreater(et1, et2)\n self.assertLess(et2, et1)\n self.assertTrue(et1 > et2)\n self.assertTrue(et2 < et1)", "metadata": "root.TestExpiryTime.testNoneComparedToNonZero", "header": "['class', 'TestExpiryTime', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 147 }, { "content": " def testNoneLessThanNone(self):\n et1 = ExpiryTime(None)\n et2 = ExpiryTime(None)\n self.assertFalse(et1 < et2)\n self.assertFalse(et2 < et1)", "metadata": "root.TestExpiryTime.testNoneLessThanNone", "header": "['class', 'TestExpiryTime', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 161 }, { "content": " def testNoneLessThanEqualNone(self):\n et1 = ExpiryTime(None)\n et2 = ExpiryTime(None)\n self.assertTrue(et1 >= et2)\n self.assertTrue(et2 >= et1)", "metadata": "root.TestExpiryTime.testNoneLessThanEqualNone", "header": "['class', 'TestExpiryTime', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 167 }, { "content": " def testNoneGreaterThanEqualNone(self):\n et1 = ExpiryTime(None)\n et2 = ExpiryTime(None)\n self.assertTrue(et1 <= et2)\n self.assertTrue(et2 <= et1)", "metadata": "root.TestExpiryTime.testNoneGreaterThanEqualNone", "header": "['class', 'TestExpiryTime', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 173 } ]
[ { "span": "self.assertTrue(timedelta(days=0) < et.remaining())", "start_line": 34, "start_column": 8, "end_line": 34, "end_column": 59 }, { "span": "self.assertTrue(timedelta(milliseconds=11) > et.remaining())", "start_line": 35, "start_column": 8, "end_line": 35, "end_column": 68 }, { "span": "self.assertTrue(0.0 < et.remainingSeconds())", "start_line": 49, "start_column": 8, "end_line": 49, "end_column": 52 }, { "span": "self.assertTrue(0.0101 > et.remainingSeconds())", "start_line": 50, "start_column": 8, "end_line": 50, "end_column": 55 }, { "span": "self.assertFalse(et1 != et2)", "start_line": 128, "start_column": 8, "end_line": 128, "end_column": 36 }, { "span": "self.assertFalse(et2 != et1)", "start_line": 129, "start_column": 8, "end_line": 129, "end_column": 36 }, { "span": "self.assertFalse(et1 > et2)", "start_line": 135, "start_column": 8, "end_line": 135, "end_column": 35 }, { "span": "self.assertFalse(et2 > et1)", "start_line": 136, "start_column": 8, "end_line": 136, "end_column": 35 }, { "span": "self.assertTrue(et1 >= et2)", "start_line": 144, "start_column": 8, "end_line": 144, "end_column": 35 }, { "span": "self.assertTrue(et2 <= et1)", "start_line": 145, "start_column": 8, "end_line": 145, "end_column": 35 }, { "span": "self.assertTrue(et1 > et2)", "start_line": 153, "start_column": 8, "end_line": 153, "end_column": 34 }, { "span": "self.assertTrue(et2 < et1)", "start_line": 154, "start_column": 8, "end_line": 154, "end_column": 34 }, { "span": "self.assertTrue(et1 > et2)", "start_line": 158, "start_column": 8, "end_line": 158, "end_column": 34 }, { "span": "self.assertTrue(et2 < et1)", "start_line": 159, "start_column": 8, "end_line": 159, "end_column": 34 }, { "span": "self.assertFalse(et1 < et2)", "start_line": 164, "start_column": 8, "end_line": 164, "end_column": 35 }, { "span": "self.assertFalse(et2 < et1)", "start_line": 165, "start_column": 8, "end_line": 165, "end_column": 35 }, { "span": "self.assertTrue(et1 >= et2)", "start_line": 170, "start_column": 8, "end_line": 170, "end_column": 35 }, { "span": "self.assertTrue(et2 >= et1)", "start_line": 171, "start_column": 8, "end_line": 171, "end_column": 35 }, { "span": "self.assertTrue(et1 <= et2)", "start_line": 176, "start_column": 8, "end_line": 176, "end_column": 35 }, { "span": "self.assertTrue(et2 <= et1)", "start_line": 177, "start_column": 8, "end_line": 177, "end_column": 35 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Expir", "y", "Time_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Non", "Zero", "Rema", "inin", "g_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "et_", "=_", "Expir", "y", "Time_", "(_", "timedelta_", "(_", "milliseconds", "_", "=_", "10_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "timedelta_", "(_", "days_", "=_", "0_", ")_", "<_", "et_", "._", "remaining_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "timedelta_", "(_", "milliseconds", "_", "=_", "11_", ")_", ">_", "et_", "._", "remaining_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sleep_", "(_", "et_", "._", "rema", "inin", "g", "Seconds_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "timedelta_", "(_", "days_", "=_", "0_", ")_", ",_", "et_", "._", "remaining_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Expir", "y", "Time_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Non", "Zero", "Rema", "inin", "g", "Seconds_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "et_", "=_", "Expir", "y", "Time_", "(_", "timedelta_", "(_", "milliseconds", "_", "=_", "10_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "0.0_", "<_", "et_", "._", "rema", "inin", "g", "Seconds_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "0.010", "1_", ">_", "et_", "._", "rema", "inin", "g", "Seconds_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sleep_", "(_", "et_", "._", "rema", "inin", "g", "Seconds_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0.0_", ",_", "et_", "._", "rema", "inin", "g", "Seconds_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Expir", "y", "Time_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Non", "e", "In", "Equali", "ty_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "et", "1_", "=_", "Expir", "y", "Time_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "et", "2_", "=_", "Expir", "y", "Time_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "et", "1_", "!=_", "et", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "et", "2_", "!=_", "et", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Expir", "y", "Time_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Non", "e", "Great", "er", "Than", "None_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "et", "1_", "=_", "Expir", "y", "Time_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "et", "2_", "=_", "Expir", "y", "Time_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Non", "e", " ", "==", " ", "forever", ",", " ", "so", " ", "it", " ", "is", " ", "great", "er", " ", "than", " ", "anyt", "hing", ",", " ", "alth", "ou", "gh", " ", "equal", " ", "to", " ", "its", "elf_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "et", "1_", ">_", "et", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "et", "2_", ">_", "et", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Expir", "y", "Time_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Non", "e", "Compare", "d", "To", "Zero_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "et", "1_", "=_", "Expir", "y", "Time_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "et", "2_", "=_", "Expir", "y", "Time_", "(_", "timedelta_", "(_", "days_", "=_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Non", "e", " ", "==", " ", "forever", ",", " ", "so", " ", "it", " ", "is", " ", "great", "er", " ", "than", " ", "anyt", "hing", ",", " ", "alth", "ou", "gh", " ", "equal", " ", "to", " ", "its", "elf_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Greater_", "(_", "et", "1_", ",_", "et", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Less_", "(_", "et", "2_", ",_", "et", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "et", "1_", ">=_", "et", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "et", "2_", "<=_", "et", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Expir", "y", "Time_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Non", "e", "Compare", "d", "To", "Non", "Zero_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "et", "1_", "=_", "Expir", "y", "Time_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "et", "2_", "=_", "Expir", "y", "Time_", "(_", "timedelta_", "(_", "milliseconds", "_", "=_", "10_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Non", "e", " ", "==", " ", "forever", ",", " ", "so", " ", "it", " ", "is", " ", "great", "er", " ", "than", " ", "anyt", "hing", ",", " ", "alth", "ou", "gh", " ", "equal", " ", "to", " ", "its", "elf_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Greater_", "(_", "et", "1_", ",_", "et", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Less_", "(_", "et", "2_", ",_", "et", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "et", "1_", ">_", "et", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "et", "2_", "<_", "et", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sleep_", "(_", "et", "2_", "._", "rema", "inin", "g", "Seconds_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Greater_", "(_", "et", "1_", ",_", "et", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Less_", "(_", "et", "2_", ",_", "et", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "et", "1_", ">_", "et", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "et", "2_", "<_", "et", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Expir", "y", "Time_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Non", "e", "Less", "Than", "None_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "et", "1_", "=_", "Expir", "y", "Time_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "et", "2_", "=_", "Expir", "y", "Time_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "et", "1_", "<_", "et", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "et", "2_", "<_", "et", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Expir", "y", "Time_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Non", "e", "Less", "Than", "Equal", "None_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "et", "1_", "=_", "Expir", "y", "Time_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "et", "2_", "=_", "Expir", "y", "Time_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "et", "1_", ">=_", "et", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "et", "2_", ">=_", "et", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Expir", "y", "Time_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Non", "e", "Great", "er", "Than", "Equal", "None_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "et", "1_", "=_", "Expir", "y", "Time_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "et", "2_", "=_", "Expir", "y", "Time_", "(_", "None_",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 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused local variable
agiliq/merchant/billing/tests/test_braintree_payments.py
[ { "content": " def testPaymentSuccessfulSignal(self):\n received_signals = []\n\n def receive(sender, **kwargs):\n received_signals.append(kwargs.get(\"signal\"))\n\n transaction_was_successful.connect(receive)\n\n resp = self.merchant.purchase(1, self.credit_card)\n self.assertEquals(received_signals, [transaction_was_successful])", "metadata": "root.BraintreePaymentsGatewayTestCase.testPaymentSuccessfulSignal", "header": "['class', 'BraintreePaymentsGatewayTestCase', '(', 'TestCase', ')', ':', '___EOS___']", "index": 53 }, { "content": " def testPaymentUnSuccessfulSignal(self):\n received_signals = []\n\n def receive(sender, **kwargs):\n received_signals.append(kwargs.get(\"signal\"))\n\n transaction_was_unsuccessful.connect(receive)\n\n resp = self.merchant.purchase(2000, self.credit_card)\n self.assertEquals(received_signals, [transaction_was_unsuccessful])", "metadata": "root.BraintreePaymentsGatewayTestCase.testPaymentUnSuccessfulSignal", "header": "['class', 'BraintreePaymentsGatewayTestCase', '(', 'TestCase', ')', ':', '___EOS___']", "index": 64 } ]
[ { "span": "resp ", "start_line": 61, "start_column": 8, "end_line": 61, "end_column": 12 }, { "span": "resp ", "start_line": 72, "start_column": 8, "end_line": 72, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Brain", "tree", "Payment", "s", "Gat", "ewa", "y", "Test", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Payment", "Success", "ful", "Signal_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "receive", "d\\u", "signals_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "receive_", "(_", "sender_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "receive", "d\\u", "signals_", "._", "append_", "(_", "kwargs_", "._", "get_", "(_", "\"", "signal", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "transaction", "\\u", "was", "\\u", "successful_", "._", "connect_", "(_", "receive_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "merchant", "_", "._", "purchase", "_", "(_", "1_", ",_", "self_", "._", "credit", "\\u", "card_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "receive", "d\\u", "signals_", ",_", "[_", "transaction", "\\u", "was", "\\u", "successful_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Brain", "tree", "Payment", "s", "Gat", "ewa", "y", "Test", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Payment", "Un", "Success", "ful", "Signal_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "receive", "d\\u", "signals_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "receive_", "(_", "sender_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "receive", "d\\u", "signals_", "._", "append_", "(_", "kwargs_", "._", "get_", "(_", "\"", "signal", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "transaction", "\\u", "was", "\\u", "unsuc", "cess", "ful_", "._", "connect_", "(_", "receive_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "merchant", "_", "._", "purchase", "_", "(_", "2000_", ",_", "self_", "._", "credit", "\\u", "card_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "receive", "d\\u", "signals_", ",_", "[_", "transaction", "\\u", "was", "\\u", "unsuc", "cess", "ful_", "]_", ")_", "\\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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
AppScale/appscale/AppDB/cassandra/thrift_cass/ttypes.py
[ { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('Column')\n if self.name != None:\n oprot.writeFieldBegin('name', TType.STRING, 1)\n oprot.writeString(self.name)\n oprot.writeFieldEnd()\n if self.value != None:\n oprot.writeFieldBegin('value', TType.STRING, 2)\n oprot.writeString(self.value)\n oprot.writeFieldEnd()\n if self.timestamp != None:\n oprot.writeFieldBegin('timestamp', TType.I64, 3)\n oprot.writeI64(self.timestamp)\n oprot.writeFieldEnd()\n if self.ttl != None:\n oprot.writeFieldBegin('ttl', TType.I32, 4)\n oprot.writeI32(self.ttl)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n if self.name is None:\n raise TProtocol.TProtocolException(message='Required field name is unset!')\n if self.value is None:\n raise TProtocol.TProtocolException(message='Required field value is unset!')\n if self.timestamp is None:\n raise TProtocol.TProtocolException(message='Required field timestamp is unset!')\n return", "metadata": "root.Column.write", "header": "['class', 'Column', ':', '___EOS___']", "index": 188 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('SuperColumn')\n if self.name != None:\n oprot.writeFieldBegin('name', TType.STRING, 1)\n oprot.writeString(self.name)\n oprot.writeFieldEnd()\n if self.columns != None:\n oprot.writeFieldBegin('columns', TType.LIST, 2)\n oprot.writeListBegin(TType.STRUCT, len(self.columns))\n for iter6 in self.columns:\n iter6.write(oprot)\n oprot.writeListEnd()\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n if self.name is None:\n raise TProtocol.TProtocolException(message='Required field name is unset!')\n if self.columns is None:\n raise TProtocol.TProtocolException(message='Required field columns is unset!')\n return", "metadata": "root.SuperColumn.write", "header": "['class', 'SuperColumn', ':', '___EOS___']", "index": 284 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('ColumnOrSuperColumn')\n if self.column != None:\n oprot.writeFieldBegin('column', TType.STRUCT, 1)\n self.column.write(oprot)\n oprot.writeFieldEnd()\n if self.super_column != None:\n oprot.writeFieldBegin('super_column', TType.STRUCT, 2)\n self.super_column.write(oprot)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n return", "metadata": "root.ColumnOrSuperColumn.write", "header": "['class', 'ColumnOrSuperColumn', ':', '___EOS___']", "index": 373 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('NotFoundException')\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n return", "metadata": "root.NotFoundException.write", "header": "['class', 'NotFoundException', '(', 'Exception', ')', ':', '___EOS___']", "index": 425 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('InvalidRequestException')\n if self.why != None:\n oprot.writeFieldBegin('why', TType.STRING, 1)\n oprot.writeString(self.why)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n if self.why is None:\n raise TProtocol.TProtocolException(message='Required field why is unset!')\n return", "metadata": "root.InvalidRequestException.write", "header": "['class', 'InvalidRequestException', '(', 'Exception', ')', ':', '___EOS___']", "index": 486 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('UnavailableException')\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n return", "metadata": "root.UnavailableException.write", "header": "['class', 'UnavailableException', '(', 'Exception', ')', ':', '___EOS___']", "index": 539 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('TimedOutException')\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n return", "metadata": "root.TimedOutException.write", "header": "['class', 'TimedOutException', '(', 'Exception', ')', ':', '___EOS___']", "index": 586 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('AuthenticationException')\n if self.why != None:\n oprot.writeFieldBegin('why', TType.STRING, 1)\n oprot.writeString(self.why)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n if self.why is None:\n raise TProtocol.TProtocolException(message='Required field why is unset!')\n return", "metadata": "root.AuthenticationException.write", "header": "['class', 'AuthenticationException', '(', 'Exception', ')', ':', '___EOS___']", "index": 646 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('AuthorizationException')\n if self.why != None:\n oprot.writeFieldBegin('why', TType.STRING, 1)\n oprot.writeString(self.why)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n if self.why is None:\n raise TProtocol.TProtocolException(message='Required field why is unset!')\n return", "metadata": "root.AuthorizationException.write", "header": "['class', 'AuthorizationException', '(', 'Exception', ')', ':', '___EOS___']", "index": 712 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('ColumnParent')\n if self.column_family != None:\n oprot.writeFieldBegin('column_family', TType.STRING, 3)\n oprot.writeString(self.column_family)\n oprot.writeFieldEnd()\n if self.super_column != None:\n oprot.writeFieldBegin('super_column', TType.STRING, 4)\n oprot.writeString(self.super_column)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n if self.column_family is None:\n raise TProtocol.TProtocolException(message='Required field column_family is unset!')\n return", "metadata": "root.ColumnParent.write", "header": "['class', 'ColumnParent', ':', '___EOS___']", "index": 791 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('ColumnPath')\n if self.column_family != None:\n oprot.writeFieldBegin('column_family', TType.STRING, 3)\n oprot.writeString(self.column_family)\n oprot.writeFieldEnd()\n if self.super_column != None:\n oprot.writeFieldBegin('super_column', TType.STRING, 4)\n oprot.writeString(self.super_column)\n oprot.writeFieldEnd()\n if self.column != None:\n oprot.writeFieldBegin('column', TType.STRING, 5)\n oprot.writeString(self.column)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n if self.column_family is None:\n raise TProtocol.TProtocolException(message='Required field column_family is unset!')\n return", "metadata": "root.ColumnPath.write", "header": "['class', 'ColumnPath', ':', '___EOS___']", "index": 883 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('SliceRange')\n if self.start != None:\n oprot.writeFieldBegin('start', TType.STRING, 1)\n oprot.writeString(self.start)\n oprot.writeFieldEnd()\n if self.finish != None:\n oprot.writeFieldBegin('finish', TType.STRING, 2)\n oprot.writeString(self.finish)\n oprot.writeFieldEnd()\n if self.reversed != None:\n oprot.writeFieldBegin('reversed', TType.BOOL, 3)\n oprot.writeBool(self.reversed)\n oprot.writeFieldEnd()\n if self.count != None:\n oprot.writeFieldBegin('count', TType.I32, 4)\n oprot.writeI32(self.count)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n if self.start is None:\n raise TProtocol.TProtocolException(message='Required field start is unset!')\n if self.finish is None:\n raise TProtocol.TProtocolException(message='Required field finish is unset!')\n if self.reversed is None:\n raise TProtocol.TProtocolException(message='Required field reversed is unset!')\n if self.count is None:\n raise TProtocol.TProtocolException(message='Required field count is unset!')\n return", "metadata": "root.SliceRange.write", "header": "['class', 'SliceRange', ':', '___EOS___']", "index": 991 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('SlicePredicate')\n if self.column_names != None:\n oprot.writeFieldBegin('column_names', TType.LIST, 1)\n oprot.writeListBegin(TType.STRING, len(self.column_names))\n for iter13 in self.column_names:\n oprot.writeString(iter13)\n oprot.writeListEnd()\n oprot.writeFieldEnd()\n if self.slice_range != None:\n oprot.writeFieldBegin('slice_range', TType.STRUCT, 2)\n self.slice_range.write(oprot)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n return", "metadata": "root.SlicePredicate.write", "header": "['class', 'SlicePredicate', ':', '___EOS___']", "index": 1095 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('IndexExpression')\n if self.column_name != None:\n oprot.writeFieldBegin('column_name', TType.STRING, 1)\n oprot.writeString(self.column_name)\n oprot.writeFieldEnd()\n if self.op != None:\n oprot.writeFieldBegin('op', TType.I32, 2)\n oprot.writeI32(self.op)\n oprot.writeFieldEnd()\n if self.value != None:\n oprot.writeFieldBegin('value', TType.STRING, 3)\n oprot.writeString(self.value)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n if self.column_name is None:\n raise TProtocol.TProtocolException(message='Required field column_name is unset!')\n if self.op is None:\n raise TProtocol.TProtocolException(message='Required field op is unset!')\n if self.value is None:\n raise TProtocol.TProtocolException(message='Required field value is unset!')\n return", "metadata": "root.IndexExpression.write", "header": "['class', 'IndexExpression', ':', '___EOS___']", "index": 1177 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('IndexClause')\n if self.expressions != None:\n oprot.writeFieldBegin('expressions', TType.LIST, 1)\n oprot.writeListBegin(TType.STRUCT, len(self.expressions))\n for iter20 in self.expressions:\n iter20.write(oprot)\n oprot.writeListEnd()\n oprot.writeFieldEnd()\n if self.start_key != None:\n oprot.writeFieldBegin('start_key', TType.STRING, 2)\n oprot.writeString(self.start_key)\n oprot.writeFieldEnd()\n if self.count != None:\n oprot.writeFieldBegin('count', TType.I32, 3)\n oprot.writeI32(self.count)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n if self.expressions is None:\n raise TProtocol.TProtocolException(message='Required field expressions is unset!')\n if self.start_key is None:\n raise TProtocol.TProtocolException(message='Required field start_key is unset!')\n if self.count is None:\n raise TProtocol.TProtocolException(message='Required field count is unset!')\n return", "metadata": "root.IndexClause.write", "header": "['class', 'IndexClause', ':', '___EOS___']", "index": 1272 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('KeyRange')\n if self.start_key != None:\n oprot.writeFieldBegin('start_key', TType.STRING, 1)\n oprot.writeString(self.start_key)\n oprot.writeFieldEnd()\n if self.end_key != None:\n oprot.writeFieldBegin('end_key', TType.STRING, 2)\n oprot.writeString(self.end_key)\n oprot.writeFieldEnd()\n if self.start_token != None:\n oprot.writeFieldBegin('start_token', TType.STRING, 3)\n oprot.writeString(self.start_token)\n oprot.writeFieldEnd()\n if self.end_token != None:\n oprot.writeFieldBegin('end_token', TType.STRING, 4)\n oprot.writeString(self.end_token)\n oprot.writeFieldEnd()\n if self.count != None:\n oprot.writeFieldBegin('count', TType.I32, 5)\n oprot.writeI32(self.count)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n if self.count is None:\n raise TProtocol.TProtocolException(message='Required field count is unset!')\n return", "metadata": "root.KeyRange.write", "header": "['class', 'KeyRange', ':', '___EOS___']", "index": 1387 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('KeySlice')\n if self.key != None:\n oprot.writeFieldBegin('key', TType.STRING, 1)\n oprot.writeString(self.key)\n oprot.writeFieldEnd()\n if self.columns != None:\n oprot.writeFieldBegin('columns', TType.LIST, 2)\n oprot.writeListBegin(TType.STRUCT, len(self.columns))\n for iter27 in self.columns:\n iter27.write(oprot)\n oprot.writeListEnd()\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n if self.key is None:\n raise TProtocol.TProtocolException(message='Required field key is unset!')\n if self.columns is None:\n raise TProtocol.TProtocolException(message='Required field columns is unset!')\n return", "metadata": "root.KeySlice.write", "header": "['class', 'KeySlice', ':', '___EOS___']", "index": 1484 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('KeyCount')\n if self.key != None:\n oprot.writeFieldBegin('key', TType.STRING, 1)\n oprot.writeString(self.key)\n oprot.writeFieldEnd()\n if self.count != None:\n oprot.writeFieldBegin('count', TType.I32, 2)\n oprot.writeI32(self.count)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n if self.key is None:\n raise TProtocol.TProtocolException(message='Required field key is unset!')\n if self.count is None:\n raise TProtocol.TProtocolException(message='Required field count is unset!')\n return", "metadata": "root.KeyCount.write", "header": "['class', 'KeyCount', ':', '___EOS___']", "index": 1562 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('Deletion')\n if self.timestamp != None:\n oprot.writeFieldBegin('timestamp', TType.I64, 1)\n oprot.writeI64(self.timestamp)\n oprot.writeFieldEnd()\n if self.super_column != None:\n oprot.writeFieldBegin('super_column', TType.STRING, 2)\n oprot.writeString(self.super_column)\n oprot.writeFieldEnd()\n if self.predicate != None:\n oprot.writeFieldBegin('predicate', TType.STRUCT, 3)\n self.predicate.write(oprot)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n if self.timestamp is None:\n raise TProtocol.TProtocolException(message='Required field timestamp is unset!')\n return", "metadata": "root.Deletion.write", "header": "['class', 'Deletion', ':', '___EOS___']", "index": 1646 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('Mutation')\n if self.column_or_supercolumn != None:\n oprot.writeFieldBegin('column_or_supercolumn', TType.STRUCT, 1)\n self.column_or_supercolumn.write(oprot)\n oprot.writeFieldEnd()\n if self.deletion != None:\n oprot.writeFieldBegin('deletion', TType.STRUCT, 2)\n self.deletion.write(oprot)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n return", "metadata": "root.Mutation.write", "header": "['class', 'Mutation', ':', '___EOS___']", "index": 1729 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('TokenRange')\n if self.start_token != None:\n oprot.writeFieldBegin('start_token', TType.STRING, 1)\n oprot.writeString(self.start_token)\n oprot.writeFieldEnd()\n if self.end_token != None:\n oprot.writeFieldBegin('end_token', TType.STRING, 2)\n oprot.writeString(self.end_token)\n oprot.writeFieldEnd()\n if self.endpoints != None:\n oprot.writeFieldBegin('endpoints', TType.LIST, 3)\n oprot.writeListBegin(TType.STRING, len(self.endpoints))\n for iter34 in self.endpoints:\n oprot.writeString(iter34)\n oprot.writeListEnd()\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n if self.start_token is None:\n raise TProtocol.TProtocolException(message='Required field start_token is unset!')\n if self.end_token is None:\n raise TProtocol.TProtocolException(message='Required field end_token is unset!')\n if self.endpoints is None:\n raise TProtocol.TProtocolException(message='Required field endpoints is unset!')\n return", "metadata": "root.TokenRange.write", "header": "['class', 'TokenRange', ':', '___EOS___']", "index": 1813 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('AuthenticationRequest')\n if self.credentials != None:\n oprot.writeFieldBegin('credentials', TType.MAP, 1)\n oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.credentials))\n for kiter42,viter43 in self.credentials.items():\n oprot.writeString(kiter42)\n oprot.writeString(viter43)\n oprot.writeMapEnd()\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n if self.credentials is None:\n raise TProtocol.TProtocolException(message='Required field credentials is unset!')\n return", "metadata": "root.AuthenticationRequest.write", "header": "['class', 'AuthenticationRequest', ':', '___EOS___']", "index": 1897 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('ColumnDef')\n if self.name != None:\n oprot.writeFieldBegin('name', TType.STRING, 1)\n oprot.writeString(self.name)\n oprot.writeFieldEnd()\n if self.validation_class != None:\n oprot.writeFieldBegin('validation_class', TType.STRING, 2)\n oprot.writeString(self.validation_class)\n oprot.writeFieldEnd()\n if self.index_type != None:\n oprot.writeFieldBegin('index_type', TType.I32, 3)\n oprot.writeI32(self.index_type)\n oprot.writeFieldEnd()\n if self.index_name != None:\n oprot.writeFieldBegin('index_name', TType.STRING, 4)\n oprot.writeString(self.index_name)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n if self.name is None:\n raise TProtocol.TProtocolException(message='Required field name is unset!')\n if self.validation_class is None:\n raise TProtocol.TProtocolException(message='Required field validation_class is unset!')\n return", "metadata": "root.ColumnDef.write", "header": "['class', 'ColumnDef', ':', '___EOS___']", "index": 1986 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('CfDef')\n if self.keyspace != None:\n oprot.writeFieldBegin('keyspace', TType.STRING, 1)\n oprot.writeString(self.keyspace)\n oprot.writeFieldEnd()\n if self.name != None:\n oprot.writeFieldBegin('name', TType.STRING, 2)\n oprot.writeString(self.name)\n oprot.writeFieldEnd()\n if self.column_type != None:\n oprot.writeFieldBegin('column_type', TType.STRING, 3)\n oprot.writeString(self.column_type)\n oprot.writeFieldEnd()\n if self.comparator_type != None:\n oprot.writeFieldBegin('comparator_type', TType.STRING, 5)\n oprot.writeString(self.comparator_type)\n oprot.writeFieldEnd()\n if self.subcomparator_type != None:\n oprot.writeFieldBegin('subcomparator_type', TType.STRING, 6)\n oprot.writeString(self.subcomparator_type)\n oprot.writeFieldEnd()\n if self.comment != None:\n oprot.writeFieldBegin('comment', TType.STRING, 8)\n oprot.writeString(self.comment)\n oprot.writeFieldEnd()\n if self.row_cache_size != None:\n oprot.writeFieldBegin('row_cache_size', TType.DOUBLE, 9)\n oprot.writeDouble(self.row_cache_size)\n oprot.writeFieldEnd()\n if self.key_cache_size != None:\n oprot.writeFieldBegin('key_cache_size', TType.DOUBLE, 11)\n oprot.writeDouble(self.key_cache_size)\n oprot.writeFieldEnd()\n if self.read_repair_chance != None:\n oprot.writeFieldBegin('read_repair_chance', TType.DOUBLE, 12)\n oprot.writeDouble(self.read_repair_chance)\n oprot.writeFieldEnd()\n if self.column_metadata != None:\n oprot.writeFieldBegin('column_metadata', TType.LIST, 13)\n oprot.writeListBegin(TType.STRUCT, len(self.column_metadata))\n for iter50 in self.column_metadata:\n iter50.write(oprot)\n oprot.writeListEnd()\n oprot.writeFieldEnd()\n if self.gc_grace_seconds != None:\n oprot.writeFieldBegin('gc_grace_seconds', TType.I32, 14)\n oprot.writeI32(self.gc_grace_seconds)\n oprot.writeFieldEnd()\n if self.default_validation_class != None:\n oprot.writeFieldBegin('default_validation_class', TType.STRING, 15)\n oprot.writeString(self.default_validation_class)\n oprot.writeFieldEnd()\n if self.id != None:\n oprot.writeFieldBegin('id', TType.I32, 16)\n oprot.writeI32(self.id)\n oprot.writeFieldEnd()\n if self.min_compaction_threshold != None:\n oprot.writeFieldBegin('min_compaction_threshold', TType.I32, 17)\n oprot.writeI32(self.min_compaction_threshold)\n oprot.writeFieldEnd()\n if self.max_compaction_threshold != None:\n oprot.writeFieldBegin('max_compaction_threshold', TType.I32, 18)\n oprot.writeI32(self.max_compaction_threshold)\n oprot.writeFieldEnd()\n if self.row_cache_save_period_in_seconds != None:\n oprot.writeFieldBegin('row_cache_save_period_in_seconds', TType.I32, 19)\n oprot.writeI32(self.row_cache_save_period_in_seconds)\n oprot.writeFieldEnd()\n if self.key_cache_save_period_in_seconds != None:\n oprot.writeFieldBegin('key_cache_save_period_in_seconds', TType.I32, 20)\n oprot.writeI32(self.key_cache_save_period_in_seconds)\n oprot.writeFieldEnd()\n if self.memtable_flush_after_mins != None:\n oprot.writeFieldBegin('memtable_flush_after_mins', TType.I32, 21)\n oprot.writeI32(self.memtable_flush_after_mins)\n oprot.writeFieldEnd()\n if self.memtable_throughput_in_mb != None:\n oprot.writeFieldBegin('memtable_throughput_in_mb', TType.I32, 22)\n oprot.writeI32(self.memtable_throughput_in_mb)\n oprot.writeFieldEnd()\n if self.memtable_operations_in_millions != None:\n oprot.writeFieldBegin('memtable_operations_in_millions', TType.DOUBLE, 23)\n oprot.writeDouble(self.memtable_operations_in_millions)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n if self.keyspace is None:\n raise TProtocol.TProtocolException(message='Required field keyspace is unset!')\n if self.name is None:\n raise TProtocol.TProtocolException(message='Required field name is unset!')\n return", "metadata": "root.CfDef.write", "header": "['class', 'CfDef', ':', '___EOS___']", "index": 2222 }, { "content": " def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('KsDef')\n if self.name != None:\n oprot.writeFieldBegin('name', TType.STRING, 1)\n oprot.writeString(self.name)\n oprot.writeFieldEnd()\n if self.strategy_class != None:\n oprot.writeFieldBegin('strategy_class', TType.STRING, 2)\n oprot.writeString(self.strategy_class)\n oprot.writeFieldEnd()\n if self.strategy_options != None:\n oprot.writeFieldBegin('strategy_options', TType.MAP, 3)\n oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.strategy_options))\n for kiter64,viter65 in self.strategy_options.items():\n oprot.writeString(kiter64)\n oprot.writeString(viter65)\n oprot.writeMapEnd()\n oprot.writeFieldEnd()\n if self.replication_factor != None:\n oprot.writeFieldBegin('replication_factor', TType.I32, 4)\n oprot.writeI32(self.replication_factor)\n oprot.writeFieldEnd()\n if self.cf_defs != None:\n oprot.writeFieldBegin('cf_defs', TType.LIST, 5)\n oprot.writeListBegin(TType.STRUCT, len(self.cf_defs))\n for iter66 in self.cf_defs:\n iter66.write(oprot)\n oprot.writeListEnd()\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n def validate(self):\n if self.name is None:\n raise TProtocol.TProtocolException(message='Required field name is unset!')\n if self.strategy_class is None:\n raise TProtocol.TProtocolException(message='Required field strategy_class is unset!')\n if self.replication_factor is None:\n raise TProtocol.TProtocolException(message='Required field replication_factor is unset!')\n if self.cf_defs is None:\n raise TProtocol.TProtocolException(message='Required field cf_defs is unset!')\n return", "metadata": "root.KsDef.write", "header": "['class', 'KsDef', ':', '___EOS___']", "index": 2408 } ]
[ { "span": "validate(", "start_line": 211, "start_column": 8, "end_line": 211, "end_column": 16 }, { "span": "validate(", "start_line": 302, "start_column": 8, "end_line": 302, "end_column": 16 }, { "span": "validate(", "start_line": 388, "start_column": 8, "end_line": 388, "end_column": 16 }, { "span": "validate(", "start_line": 432, "start_column": 8, "end_line": 432, "end_column": 16 }, { "span": "validate(", "start_line": 497, "start_column": 8, "end_line": 497, "end_column": 16 }, { "span": "validate(", "start_line": 546, "start_column": 8, "end_line": 546, "end_column": 16 }, { "span": "validate(", "start_line": 593, "start_column": 8, "end_line": 593, "end_column": 16 }, { "span": "validate(", "start_line": 657, "start_column": 8, "end_line": 657, "end_column": 16 }, { "span": "validate(", "start_line": 723, "start_column": 8, "end_line": 723, "end_column": 16 }, { "span": "validate(", "start_line": 806, "start_column": 8, "end_line": 806, "end_column": 16 }, { "span": "validate(", "start_line": 902, "start_column": 8, "end_line": 902, "end_column": 16 }, { "span": "validate(", "start_line": 1014, "start_column": 8, "end_line": 1014, "end_column": 16 }, { "span": "validate(", "start_line": 1113, "start_column": 8, "end_line": 1113, "end_column": 16 }, { "span": "validate(", "start_line": 1196, "start_column": 8, "end_line": 1196, "end_column": 16 }, { "span": "validate(", "start_line": 1294, "start_column": 8, "end_line": 1294, "end_column": 16 }, { "span": "validate(", "start_line": 1414, "start_column": 8, "end_line": 1414, "end_column": 16 }, { "span": "validate(", "start_line": 1502, "start_column": 8, "end_line": 1502, "end_column": 16 }, { "span": "validate(", "start_line": 1577, "start_column": 8, "end_line": 1577, "end_column": 16 }, { "span": "validate(", "start_line": 1665, "start_column": 8, "end_line": 1665, "end_column": 16 }, { "span": "validate(", "start_line": 1744, "start_column": 8, "end_line": 1744, "end_column": 16 }, { "span": "validate(", "start_line": 1835, "start_column": 8, "end_line": 1835, "end_column": 16 }, { "span": "validate(", "start_line": 1912, "start_column": 8, "end_line": 1912, "end_column": 16 }, { "span": "validate(", "start_line": 2009, "start_column": 8, "end_line": 2009, "end_column": 16 }, { "span": "validate(", "start_line": 2312, "start_column": 8, "end_line": 2312, "end_column": 16 }, { "span": "validate(", "start_line": 2442, "start_column": 8, "end_line": 2442, "end_column": 16 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Column_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Colum", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "name_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "name", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "value_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "value", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "timestamp_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "timestamp", "'_", ",_", "TT", "ype_", "._", "I64_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "I64_", "(_", "self_", "._", "timestamp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "ttl_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "ttl", "'_", ",_", "TT", "ype_", "._", "I32_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "I32_", "(_", "self_", "._", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "name", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "value_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "value", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "timestamp_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "timestamp", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Super", "Column_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Super", "Colum", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "name_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "name", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "columns_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "column", "s", "'_", ",_", "TT", "ype_", "._", "LIST_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "List", "Begin_", "(_", "TT", "ype_", "._", "STRUCT_", ",_", "len_", "(_", "self_", "._", "columns_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "iter", "6_", "in_", "self_", "._", "columns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iter", "6_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "List", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "name", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "columns_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "column", "s", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Colum", "n", "Or", "Super", "Column_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Colum", "n", "Or", "Super", "Colum", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "column_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "column", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "column_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "super", "\\u", "column_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "super", "\\u", "column", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "super", "\\u", "column_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Not", "Foun", "d", "Exception_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Not", "Foun", "d", "Except", "ion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Inva", "lid", "Request", "Exception_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Inva", "lid", "Request", "Except", "ion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "why_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "wh", "y", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "why_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "why_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "wh", "y", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Una", "vail", "able", "Exception_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Una", "vail", "able", "Except", "ion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "d", "Out", "Exception_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Time", "d", "Out", "Except", "ion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Auth", "entica", "tion", "Exception_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Auth", "entica", "tion", "Except", "ion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "why_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "wh", "y", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "why_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "why_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "wh", "y", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Authoriz", "ation", "Exception_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Authoriz", "ation", "Except", "ion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "why_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "wh", "y", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "why_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "why_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "wh", "y", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Colum", "n", "Parent_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Colum", "n", "Parent", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "column", "\\u", "family_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "column", "\\u", "famil", "y", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "column", "\\u", "family_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "super", "\\u", "column_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "super", "\\u", "column", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "super", "\\u", "column_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "column", "\\u", "family_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "column", "\\u", "famil", "y", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Colum", "n", "Path_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Colum", "n", "Path", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "column", "\\u", "family_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "column", "\\u", "famil", "y", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "column", "\\u", "family_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "super", "\\u", "column_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "super", "\\u", "column", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "super", "\\u", "column_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "column_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "column", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "column_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "column", "\\u", "family_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "column", "\\u", "famil", "y", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Slice", "Range_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Slice", "Range", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "start_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "start", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "finish_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "finish", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "finish_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "reversed_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "reverse", "d", "'_", ",_", "TT", "ype_", "._", "BOOL_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Bool_", "(_", "self_", "._", "reversed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "count_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "count", "'_", ",_", "TT", "ype_", "._", "I32_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "I32_", "(_", "self_", "._", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "start_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "start", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "finish_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "finish", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "reversed_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "reverse", "d", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "count_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "count", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Slice", "Predicate_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Slice", "Predicate", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "column", "\\u", "names_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "column", "\\u", "names", "'_", ",_", "TT", "ype_", "._", "LIST_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "List", "Begin_", "(_", "TT", "ype_", "._", "STRING_", ",_", "len_", "(_", "self_", "._", "column", "\\u", "names_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "iter", "13_", "in_", "self_", "._", "column", "\\u", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "String_", "(_", "iter", "13_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "List", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "slice", "\\u", "range_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "slice", "\\u", "range", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "slice", "\\u", "range_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Index", "Expression_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Index", "Expression", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "column", "\\u", "name_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "column", "\\u", "name", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "column", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "op_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "op", "'_", ",_", "TT", "ype_", "._", "I32_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "I32_", "(_", "self_", "._", "op_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "value_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "value", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "column", "\\u", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "column", "\\u", "name", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "op_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "op", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "value_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "value", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Index", "Clause_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Index", "Cla", "use", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "expressions_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "express", "ion", "s", "'_", ",_", "TT", "ype_", "._", "LIST_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "List", "Begin_", "(_", "TT", "ype_", "._", "STRUCT_", ",_", "len_", "(_", "self_", "._", "expressions_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "iter", "20_", "in_", "self_", "._", "expressions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iter", "20_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "List", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "start", "\\u", "key_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "start", "\\u", "key", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "start", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "count_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "count", "'_", ",_", "TT", "ype_", "._", "I32_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "I32_", "(_", "self_", "._", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "expressions_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "express", "ion", "s", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "start", "\\u", "key_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "start", "\\u", "key", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "count_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "count", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "Range_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Key", "Range", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "start", "\\u", "key_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "start", "\\u", "key", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "start", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "end", "\\u", "key_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "end", "\\u", "key", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "end", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "start", "\\u", "token_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "start", "\\u", "token", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "start", "\\u", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "end", "\\u", "token_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "end", "\\u", "token", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "end", "\\u", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "count_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "count", "'_", ",_", "TT", "ype_", "._", "I32_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "I32_", "(_", "self_", "._", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "count_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "count", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "Slice_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Key", "Slice", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "key_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "key", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "columns_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "column", "s", "'_", ",_", "TT", "ype_", "._", "LIST_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "List", "Begin_", "(_", "TT", "ype_", "._", "STRUCT_", ",_", "len_", "(_", "self_", "._", "columns_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "iter", "27_", "in_", "self_", "._", "columns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iter", "27_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "List", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "key_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "key", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "columns_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "column", "s", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "Count_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Key", "Count", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "key_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "key", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "count_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "count", "'_", ",_", "TT", "ype_", "._", "I32_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "I32_", "(_", "self_", "._", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "key_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "key", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "count_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "count", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Deletion", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Deletion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "timestamp_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "timestamp", "'_", ",_", "TT", "ype_", "._", "I64_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "I64_", "(_", "self_", "._", "timestamp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "super", "\\u", "column_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "super", "\\u", "column", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "super", "\\u", "column_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "predicate_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "predica", "te", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "predicate_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "timestamp_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "timestamp", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mutation", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Mutation", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "column", "\\u", "or", "\\u", "superc", "olu", "mn_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "column", "\\u", "or", "\\u", "superc", "olu", "mn", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "column", "\\u", "or", "\\u", "superc", "olu", "mn_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "deletion_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "deletion", "'_", ",_", "TT", "ype_", "._", "STRUCT_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "deletion_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Token", "Range_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Token", "Range", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "start", "\\u", "token_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "start", "\\u", "token", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "start", "\\u", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "end", "\\u", "token_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "end", "\\u", "token", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "end", "\\u", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "endpoints_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "endpoint", "s", "'_", ",_", "TT", "ype_", "._", "LIST_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "List", "Begin_", "(_", "TT", "ype_", "._", "STRING_", ",_", "len_", "(_", "self_", "._", "endpoints_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "iter", "34_", "in_", "self_", "._", "endpoints_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "String_", "(_", "iter", "34_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "List", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "start", "\\u", "token_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "start", "\\u", "token", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "end", "\\u", "token_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "end", "\\u", "token", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "endpoints_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "endpoint", "s", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Auth", "entica", "tion", "Request_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Auth", "entica", "tion", "Request", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "credentials_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "cred", "ential", "s", "'_", ",_", "TT", "ype_", "._", "MAP_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Map", "Begin_", "(_", "TT", "ype_", "._", "STRING_", ",_", "TT", "ype_", "._", "STRING_", ",_", "len_", "(_", "self_", "._", "credentials_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "kite", "r4", "2_", ",_", "vite", "r4", "3_", "in_", "self_", "._", "credentials_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "String_", "(_", "kite", "r4", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "vite", "r4", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Map", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "credentials_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "cred", "ential", "s", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Colum", "n", "Def_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Colum", "n", "Def", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "name_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "name", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "validation", "\\u", "class_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "validation", "\\u", "class", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "validation", "\\u", "class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "index", "\\u", "type_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "index", "\\u", "type", "'_", ",_", "TT", "ype_", "._", "I32_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "I32_", "(_", "self_", "._", "index", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "index", "\\u", "name_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "index", "\\u", "name", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "index", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "name", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "validation", "\\u", "class_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "validation", "\\u", "class", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cf", "Def_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Cf", "Def", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "keyspace_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "keyspace", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "keyspace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "name_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "name", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "column", "\\u", "type_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "column", "\\u", "type", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "column", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "comparator", "\\u", "type_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "comparator", "\\u", "type", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "comparator", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "subco", "mpa", "rator", "\\u", "type_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "subco", "mpa", "rator", "\\u", "type", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "subco", "mpa", "rator", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "comment_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "comment", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "comment_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "row", "\\u", "cache", "\\u", "size_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "row", "\\u", "cache", "\\u", "size", "'_", ",_", "TT", "ype_", "._", "DOUBLE_", ",_", "9_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Double_", "(_", "self_", "._", "row", "\\u", "cache", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "key", "\\u", "cache", "\\u", "size_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "key", "\\u", "cache", "\\u", "size", "'_", ",_", "TT", "ype_", "._", "DOUBLE_", ",_", "11_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Double_", "(_", "self_", "._", "key", "\\u", "cache", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "read", "\\u", "repair", "\\u", "chance_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "read", "\\u", "repair", "\\u", "chan", "ce", "'_", ",_", "TT", "ype_", "._", "DOUBLE_", ",_", "12_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Double_", "(_", "self_", "._", "read", "\\u", "repair", "\\u", "chance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "column", "\\u", "metadata_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "column", "\\u", "metadata", "'_", ",_", "TT", "ype_", "._", "LIST_", ",_", "13_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "List", "Begin_", "(_", "TT", "ype_", "._", "STRUCT_", ",_", "len_", "(_", "self_", "._", "column", "\\u", "metadata_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "iter", "50_", "in_", "self_", "._", "column", "\\u", "metadata_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iter", "50_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "List", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "gc", "\\u", "grace", "\\u", "seconds_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "gc", "\\u", "grace", "\\u", "second", "s", "'_", ",_", "TT", "ype_", "._", "I32_", ",_", "14_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "I32_", "(_", "self_", "._", "gc", "\\u", "grace", "\\u", "seconds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "default", "\\u", "validation", "\\u", "class_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "default", "\\u", "validation", "\\u", "class", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "15_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "default", "\\u", "validation", "\\u", "class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "id_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "id", "'_", ",_", "TT", "ype_", "._", "I32_", ",_", "16_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "I32_", "(_", "self_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "min", "\\u", "compact", "ion", "\\u", "threshold_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "min", "\\u", "compact", "ion", "\\u", "threshol", "d", "'_", ",_", "TT", "ype_", "._", "I32_", ",_", "17_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "I32_", "(_", "self_", "._", "min", "\\u", "compact", "ion", "\\u", "threshold_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "max", "\\u", "compact", "ion", "\\u", "threshold_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "max", "\\u", "compact", "ion", "\\u", "threshol", "d", "'_", ",_", "TT", "ype_", "._", "I32_", ",_", "18_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "I32_", "(_", "self_", "._", "max", "\\u", "compact", "ion", "\\u", "threshold_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "row", "\\u", "cache", "\\u", "save", "\\u", "period", "\\u", "in", "\\u", "seconds_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "row", "\\u", "cache", "\\u", "save", "\\u", "period", "\\u", "in", "\\u", "second", "s", "'_", ",_", "TT", "ype_", "._", "I32_", ",_", "19_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "I32_", "(_", "self_", "._", "row", "\\u", "cache", "\\u", "save", "\\u", "period", "\\u", "in", "\\u", "seconds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "key", "\\u", "cache", "\\u", "save", "\\u", "period", "\\u", "in", "\\u", "seconds_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "key", "\\u", "cache", "\\u", "save", "\\u", "period", "\\u", "in", "\\u", "second", "s", "'_", ",_", "TT", "ype_", "._", "I32_", ",_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "I32_", "(_", "self_", "._", "key", "\\u", "cache", "\\u", "save", "\\u", "period", "\\u", "in", "\\u", "seconds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "mem", "table", "\\u", "flush", "\\u", "after", "\\u", "mins_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "mem", "table", "\\u", "flush", "\\u", "after", "\\u", "mins", "'_", ",_", "TT", "ype_", "._", "I32_", ",_", "21_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "I32_", "(_", "self_", "._", "mem", "table", "\\u", "flush", "\\u", "after", "\\u", "mins_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "mem", "table", "\\u", "throughput", "\\u", "in", "\\u", "mb_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "mem", "table", "\\u", "throughput", "\\u", "in", "\\u", "mb", "'_", ",_", "TT", "ype_", "._", "I32_", ",_", "22_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "I32_", "(_", "self_", "._", "mem", "table", "\\u", "throughput", "\\u", "in", "\\u", "mb_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "mem", "table", "\\u", "operati", "ons", "\\u", "in", "\\u", "milli", "ons_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "mem", "table", "\\u", "operati", "ons", "\\u", "in", "\\u", "milli", "ons", "'_", ",_", "TT", "ype_", "._", "DOUBLE_", ",_", "23_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Double_", "(_", "self_", "._", "mem", "table", "\\u", "operati", "ons", "\\u", "in", "\\u", "milli", "ons_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "keyspace_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "keyspace", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "name", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ks", "Def_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "oprot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "oprot_", "._", "\\u\\u", "class\\u\\u_", "==_", "TB", "inary", "Protocol_", "._", "TB", "inary", "Proto", "col", "Accelerated_", "and_", "self_", "._", "thrift", "\\u", "spec_", "is_", "not_", "None_", "and_", "fastbinary_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "trans_", "._", "write_", "(_", "fastbinary_", "._", "encode", "\\u", "binary_", "(_", "self_", ",_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", "._", "thrift", "\\u", "spec_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "Begin_", "(_", "'", "Ks", "Def", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "name_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "name", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "strat", "eg", "y", "\\u", "class_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "strat", "eg", "y", "\\u", "class", "'_", ",_", "TT", "ype_", "._", "STRING_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "self_", "._", "strat", "eg", "y", "\\u", "class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "strat", "eg", "y", "\\u", "options_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "strat", "eg", "y", "\\u", "options", "'_", ",_", "TT", "ype_", "._", "MAP_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Map", "Begin_", "(_", "TT", "ype_", "._", "STRING_", ",_", "TT", "ype_", "._", "STRING_", ",_", "len_", "(_", "self_", "._", "strat", "eg", "y", "\\u", "options_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "kite", "r", "64_", ",_", "vite", "r", "65_", "in_", "self_", "._", "strat", "eg", "y", "\\u", "options_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "String_", "(_", "kite", "r", "64_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "String_", "(_", "vite", "r", "65_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Map", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "replication", "\\u", "factor_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "replication", "\\u", "factor", "'_", ",_", "TT", "ype_", "._", "I32_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "I32_", "(_", "self_", "._", "replication", "\\u", "factor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "cf", "\\u", "defs_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "oprot_", "._", "write", "Field", "Begin_", "(_", "'", "cf", "\\u", "def", "s", "'_", ",_", "TT", "ype_", "._", "LIST_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "List", "Begin_", "(_", "TT", "ype_", "._", "STRUCT_", ",_", "len_", "(_", "self_", "._", "cf", "\\u", "defs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "iter", "66_", "in_", "self_", "._", "cf", "\\u", "defs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iter", "66_", "._", "write_", "(_", "oprot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "List", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Field", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "oprot_", "._", "write", "Field", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oprot_", "._", "write", "Stru", "ct", "End_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "name", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "strat", "eg", "y", "\\u", "class_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "strat", "eg", "y", "\\u", "class", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "replication", "\\u", "factor_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "replication", "\\u", "factor", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "cf", "\\u", "defs_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "TP", "roto", "col_", "._", "TP", "roto", "col", "Exception_", "(_", "message_", "=_", "'", "Requ", "ired", " ", "field", " ", "cf", "\\u", "def", "s", " ", "is", " ", "unse", "t", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
PMEAL/OpenPNM/test/unit/Geometry/models/ThroatMiscTest.py
[ { "content": " def test_neighbor_min(self):\n catch = self.geo.pop('throat.seed', None)\n catch = self.geo.models.pop('throat.seed', None)\n mod = gm.throat_misc.neighbor\n self.geo['pore.seed'] = sp.rand(self.net.Np,)\n self.geo.models.add(model=mod,\n propname='throat.seed',\n pore_prop='pore.seed',\n mode='min')\n P12 = self.net['throat.conns']\n tseed = sp.amin(self.geo['pore.seed'][P12], axis=1)\n assert sp.allclose(self.geo['throat.seed'], tseed)", "metadata": "root.ThroatMiscTest.test_neighbor_min", "header": "['class', 'ThroatMiscTest', ':', '___EOS___']", "index": 41 }, { "content": " def test_neighbor_max(self):\n catch = self.geo.pop('throat.seed', None)\n catch = self.geo.models.pop('throat.seed', None)\n mod = gm.throat_misc.neighbor\n self.geo['pore.seed'] = sp.rand(self.net.Np,)\n self.geo.models.add(model=mod,\n propname='throat.seed',\n pore_prop='pore.seed',\n mode='max')\n P12 = self.net['throat.conns']\n tseed = sp.amax(self.geo['pore.seed'][P12], axis=1)\n assert sp.allclose(self.geo['throat.seed'], tseed)", "metadata": "root.ThroatMiscTest.test_neighbor_max", "header": "['class', 'ThroatMiscTest', ':', '___EOS___']", "index": 54 }, { "content": " def test_neighbor_mean(self):\n catch = self.geo.pop('throat.seed', None)\n catch = self.geo.models.pop('throat.seed', None)\n mod = gm.throat_misc.neighbor\n self.geo['pore.seed'] = sp.rand(self.net.Np,)\n self.geo.models.add(model=mod,\n propname='throat.seed',\n pore_prop='pore.seed',\n mode='mean')\n P12 = self.net['throat.conns']\n tseed = sp.mean(self.geo['pore.seed'][P12], axis=1)\n assert sp.allclose(self.geo['throat.seed'], tseed)", "metadata": "root.ThroatMiscTest.test_neighbor_mean", "header": "['class', 'ThroatMiscTest', ':', '___EOS___']", "index": 67 } ]
[ { "span": "catch ", "start_line": 43, "start_column": 8, "end_line": 43, "end_column": 13 }, { "span": "catch ", "start_line": 56, "start_column": 8, "end_line": 56, "end_column": 13 }, { "span": "catch ", "start_line": 69, "start_column": 8, "end_line": 69, "end_column": 13 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Thr", "oat", "Mis", "c", "Test_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "neighbor", "\\u", "min_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "catch", "_", "=_", "self_", "._", "geo_", "._", "pop_", "(_", "'", "thro", "at", ".", "seed", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "catch", "_", "=_", "self_", "._", "geo_", "._", "models_", "._", "pop_", "(_", "'", "thro", "at", ".", "seed", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mod_", "=_", "gm_", "._", "thro", "at", "\\u", "misc_", "._", "neighbor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "geo_", "[_", "'", "pore", ".", "seed", "'_", "]_", "=_", "sp_", "._", "rand_", "(_", "self_", "._", "net_", "._", "Np", "_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "geo_", "._", "models_", "._", "add_", "(_", "model_", "=_", "mod_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "prop", "name_", "=_", "'", "thro", "at", ".", "seed", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pore", "\\u", "prop_", "=_", "'", "pore", ".", "seed", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "min", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P1", "2_", "=_", "self_", "._", "net_", "[_", "'", "thro", "at", ".", "conn", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tse", "ed_", "=_", "sp_", "._", "amin_", "(_", "self_", "._", "geo_", "[_", "'", "pore", ".", "seed", "'_", "]_", "[_", "P1", "2_", "]_", ",_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "sp_", "._", "allclose_", "(_", "self_", "._", "geo_", "[_", "'", "thro", "at", ".", "seed", "'_", "]_", ",_", "tse", "ed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Thr", "oat", "Mis", "c", "Test_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "neighbor", "\\u", "max_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "catch", "_", "=_", "self_", "._", "geo_", "._", "pop_", "(_", "'", "thro", "at", ".", "seed", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "catch", "_", "=_", "self_", "._", "geo_", "._", "models_", "._", "pop_", "(_", "'", "thro", "at", ".", "seed", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mod_", "=_", "gm_", "._", "thro", "at", "\\u", "misc_", "._", "neighbor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "geo_", "[_", "'", "pore", ".", "seed", "'_", "]_", "=_", "sp_", "._", "rand_", "(_", "self_", "._", "net_", "._", "Np", "_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "geo_", "._", "models_", "._", "add_", "(_", "model_", "=_", "mod_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "prop", "name_", "=_", "'", "thro", "at", ".", "seed", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pore", "\\u", "prop_", "=_", "'", "pore", ".", "seed", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "max", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P1", "2_", "=_", "self_", "._", "net_", "[_", "'", "thro", "at", ".", "conn", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tse", "ed_", "=_", "sp_", "._", "amax_", "(_", "self_", "._", "geo_", "[_", "'", "pore", ".", "seed", "'_", "]_", "[_", "P1", "2_", "]_", ",_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "sp_", "._", "allclose_", "(_", "self_", "._", "geo_", "[_", "'", "thro", "at", ".", "seed", "'_", "]_", ",_", "tse", "ed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Thr", "oat", "Mis", "c", "Test_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "neighbor", "\\u", "mean_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "catch", "_", "=_", "self_", "._", "geo_", "._", "pop_", "(_", "'", "thro", "at", ".", "seed", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "catch", "_", "=_", "self_", "._", "geo_", "._", "models_", "._", "pop_", "(_", "'", "thro", "at", ".", "seed", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mod_", "=_", "gm_", "._", "thro", "at", "\\u", "misc_", "._", "neighbor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "geo_", "[_", "'", "pore", ".", "seed", "'_", "]_", "=_", "sp_", "._", "rand_", "(_", "self_", "._", "net_", "._", "Np", "_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "geo_", "._", "models_", "._", "add_", "(_", "model_", "=_", "mod_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "prop", "name_", "=_", "'", "thro", "at", ".", "seed", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pore", "\\u", "prop_", "=_", "'", "pore", ".", "seed", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "mean", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P1", "2_", "=_", "self_", "._", "net_", "[_", "'", "thro", "at", ".", "conn", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tse", "ed_", "=_", "sp_", "._", "mean_", "(_", "self_", "._", "geo_", "[_", "'", "pore", ".", "seed", "'_", "]_", "[_", "P1", "2_", "]_", ",_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "sp_", "._", "allclose_", "(_", "self_", "._", "geo_", "[_", "'", "thro", "at", ".", "seed", "'_", "]_", ",_", "tse", "ed_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
saltstack/salt/salt/cloud/clouds/nova.py
[ { "content": "def destroy(name, conn=None, call=None):\n '''\n Delete a single VM\n '''\n if call == 'function':\n raise SaltCloudSystemExit(\n 'The destroy action must be called with -d, --destroy, '\n '-a or --action.'\n )\n\n salt.utils.cloud.fire_event(\n 'event',\n 'destroying instance',\n 'salt/cloud/{0}/destroying'.format(name),\n {'name': name},\n transport=__opts__['transport']\n )\n\n if not conn:\n conn = get_conn() # pylint: disable=E0602\n\n node = conn.server_by_name(name)\n profiles = get_configured_provider()['profiles'] # pylint: disable=E0602\n if node is None:\n log.error('Unable to find the VM {0}'.format(name))\n profile = None\n if 'metadata' in node.extra and 'profile' in node.extra['metadata']:\n profile = node.extra['metadata']['profile']\n\n flush_mine_on_destroy = False\n if profile and profile in profiles and 'flush_mine_on_destroy' in profiles[profile]:\n flush_mine_on_destroy = profiles[profile]['flush_mine_on_destroy']\n\n if flush_mine_on_destroy:\n log.info('Clearing Salt Mine: {0}'.format(name))\n salt_client = salt.client.get_local_client(__opts__['conf_file'])\n minions = salt_client.cmd(name, 'mine.flush')\n\n log.info('Clearing Salt Mine: {0}, {1}'.format(\n name,\n flush_mine_on_destroy\n ))\n log.info('Destroying VM: {0}'.format(name))\n ret = conn.delete(node.id)\n if ret:\n log.info('Destroyed VM: {0}'.format(name))\n # Fire destroy action\n salt.utils.cloud.fire_event(\n 'event',\n 'destroyed instance',\n 'salt/cloud/{0}/destroyed'.format(name),\n {'name': name},\n transport=__opts__['transport']\n )\n if __opts__.get('delete_sshkeys', False) is True:\n salt.utils.cloud.remove_sshkey(getattr(node, __opts__.get('ssh_interface', 'public_ips'))[0])\n if __opts__.get('update_cachedir', False) is True:\n salt.utils.cloud.delete_minion_cachedir(name, __active_provider_name__.split(':')[0], __opts__)\n salt.utils.cloud.cachedir_index_del(name)\n return True\n\n log.error('Failed to Destroy VM: {0}'.format(name))\n return False", "metadata": "root.destroy", "header": "['module', '___EOS___']", "index": 479 }, { "content": "def create(vm_):\n '''\n Create a single VM from a data dict\n '''\n try:\n # Check for required profile parameters before sending any API calls.\n if vm_['profile'] and config.is_profile_configured(__opts__,\n __active_provider_name__ or 'nova',\n vm_['profile'],\n vm_=vm_) is False:\n return False\n except AttributeError:\n pass\n\n deploy = config.get_cloud_config_value('deploy', vm_, __opts__)\n key_filename = config.get_cloud_config_value(\n 'ssh_key_file', vm_, __opts__, search_global=False, default=None\n )\n if key_filename is not None and not os.path.isfile(key_filename):\n raise SaltCloudConfigError(\n 'The defined ssh_key_file \\'{0}\\' does not exist'.format(\n key_filename\n )\n )\n\n vm_['key_filename'] = key_filename\n\n # Since using \"provider: <provider-engine>\" is deprecated, alias provider\n # to use driver: \"driver: <provider-engine>\"\n if 'provider' in vm_:\n vm_['driver'] = vm_.pop('provider')\n\n salt.utils.cloud.fire_event(\n 'event',\n 'starting create',\n 'salt/cloud/{0}/creating'.format(vm_['name']),\n {\n 'name': vm_['name'],\n 'profile': vm_['profile'],\n 'provider': vm_['driver'],\n },\n transport=__opts__['transport']\n )\n conn = get_conn()\n\n if 'instance_id' in vm_:\n # This was probably created via another process, and doesn't have\n # things like salt keys created yet, so let's create them now.\n if 'pub_key' not in vm_ and 'priv_key' not in vm_:\n log.debug('Generating minion keys for \\'{0[name]}\\''.format(vm_))\n vm_['priv_key'], vm_['pub_key'] = salt.utils.cloud.gen_keys(\n salt.config.get_cloud_config_value(\n 'keysize',\n vm_,\n __opts__\n )\n )\n data = conn.server_show_libcloud(vm_['instance_id'])\n if vm_['key_filename'] is None and 'change_password' in __opts__ and __opts__['change_password'] is True:\n vm_['password'] = sup.secure_password()\n conn.root_password(vm_['instance_id'], vm_['password'])\n else:\n # Put together all of the information required to request the instance,\n # and then fire off the request for it\n data, vm_ = request_instance(vm_)\n\n # Pull the instance ID, valid for both spot and normal instances\n vm_['instance_id'] = data.id\n\n def __query_node_data(vm_, data):\n try:\n node = show_instance(vm_['name'], 'action')\n log.debug(\n 'Loaded node data for {0}:\\n{1}'.format(\n vm_['name'],\n pprint.pformat(node)\n )\n )\n except Exception as err:\n log.error(\n 'Failed to get nodes list: {0}'.format(\n err\n ),\n # Show the traceback if the debug logging level is enabled\n exc_info_on_loglevel=logging.DEBUG\n )\n # Trigger a failure in the wait for IP function\n return False\n\n running = node['state'] == 'ACTIVE'\n if not running:\n # Still not running, trigger another iteration\n return\n\n if rackconnect(vm_) is True:\n extra = node.get('extra', {})\n rc_status = extra.get('metadata', {}).get(\n 'rackconnect_automation_status', '')\n if rc_status != 'DEPLOYED':\n log.debug('Waiting for Rackconnect automation to complete')\n return\n\n if managedcloud(vm_) is True:\n extra = conn.server_show_libcloud(\n node['id']\n ).extra\n mc_status = extra.get('metadata', {}).get(\n 'rax_service_level_automation', '')\n\n if mc_status != 'Complete':\n log.debug('Waiting for managed cloud automation to complete')\n return\n\n access_ip = node.get('extra', {}).get('access_ip', '')\n\n rcv3 = rackconnectv3(vm_) in node['addresses']\n sshif = ssh_interface(vm_) in node['addresses']\n\n if any((rcv3, sshif)):\n networkname = rackconnectv3(vm_) if rcv3 else ssh_interface(vm_)\n for network in node['addresses'].get(networkname, []):\n if network['version'] is 4:\n access_ip = network['addr']\n break\n vm_['cloudnetwork'] = True\n\n # Conditions to pass this\n #\n # Rackconnect v2: vm_['rackconnect'] = True\n # If this is True, then the server will not be accessible from the ipv4 addres in public_ips.\n # That interface gets turned off, and an ipv4 from the dedicated firewall is routed to the\n # server. In this case we can use the private_ips for ssh_interface, or the access_ip.\n #\n # Rackconnect v3: vm['rackconnectv3'] = <cloudnetwork>\n # If this is the case, salt will need to use the cloud network to login to the server. There\n # is no ipv4 address automatically provisioned for these servers when they are booted. SaltCloud\n # also cannot use the private_ips, because that traffic is dropped at the hypervisor.\n #\n # CloudNetwork: vm['cloudnetwork'] = True\n # If this is True, then we should have an access_ip at this point set to the ip on the cloud\n # network. If that network does not exist in the 'addresses' dictionary, then SaltCloud will\n # use the initial access_ip, and not overwrite anything.\n\n if any((cloudnetwork(vm_), rackconnect(vm_))) and (ssh_interface(vm_) != 'private_ips' or rcv3):\n data.public_ips = [access_ip, ]\n return data\n\n result = []\n\n if 'private_ips' not in node and 'public_ips' not in node and \\\n 'floating_ips' not in node and 'fixed_ips' not in node and \\\n 'access_ip' in node.get('extra', {}):\n result = [node['extra']['access_ip']]\n\n if not result:\n temp_dd = node.get('addresses', {})\n for k, addr_ll in temp_dd.iteritems():\n for addr_dd in addr_ll:\n addr = addr_dd.get('addr', None)\n if addr is not None:\n result.append(addr.strip())\n\n private = node.get('private_ips', [])\n public = node.get('public_ips', [])\n fixed = node.get('fixed_ips', [])\n floating = node.get('floating_ips', [])\n\n if private and not public:\n log.warning(\n 'Private IPs returned, but not public... Checking for '\n 'misidentified IPs'\n )\n for private_ip in private:\n private_ip = preferred_ip(vm_, [private_ip])\n if salt.utils.cloud.is_public_ip(private_ip):\n log.warning('{0} is a public IP'.format(private_ip))\n data.public_ips.append(private_ip)\n log.warning(\n (\n 'Public IP address was not ready when we last'\n ' checked. Appending public IP address now.'\n )\n )\n public = data.public_ips\n else:\n log.warning('{0} is a private IP'.format(private_ip))\n ignore_ip = ignore_cidr(vm_, private_ip)\n if private_ip not in data.private_ips and not ignore_ip:\n result.append(private_ip)\n\n # populate return data with private_ips\n # when ssh_interface is set to private_ips and public_ips exist\n if not result and ssh_interface(vm_) == 'private_ips':\n for private_ip in private:\n ignore_ip = ignore_cidr(vm_, private_ip)\n if private_ip not in data.private_ips and not ignore_ip:\n result.append(private_ip)\n\n non_private_ips = []\n\n if public:\n data.public_ips = public\n if ssh_interface(vm_) == 'public_ips':\n non_private_ips.append(public)\n\n if floating:\n data.floating_ips = floating\n if ssh_interface(vm_) == 'floating_ips':\n non_private_ips.append(floating)\n\n if fixed:\n data.fixed_ips = fixed\n if ssh_interface(vm_) == 'fixed_ips':\n non_private_ips.append(fixed)\n\n if non_private_ips:\n log.debug('result = {0}'.format(non_private_ips))\n data.private_ips = result\n if ssh_interface(vm_) != 'private_ips':\n return data\n\n if result:\n log.debug('result = {0}'.format(result))\n data.private_ips = result\n if ssh_interface(vm_) == 'private_ips':\n return data\n\n try:\n data = salt.utils.cloud.wait_for_ip(\n __query_node_data,\n update_args=(vm_, data),\n timeout=config.get_cloud_config_value(\n 'wait_for_ip_timeout', vm_, __opts__, default=10 * 60),\n interval=config.get_cloud_config_value(\n 'wait_for_ip_interval', vm_, __opts__, default=10),\n )\n except (SaltCloudExecutionTimeout, SaltCloudExecutionFailure) as exc:\n try:\n # It might be already up, let's destroy it!\n destroy(vm_['name'])\n except SaltCloudSystemExit:\n pass\n finally:\n raise SaltCloudSystemExit(str(exc))\n\n log.debug('VM is now running')\n\n if ssh_interface(vm_) == 'private_ips':\n ip_address = preferred_ip(vm_, data.private_ips)\n elif ssh_interface(vm_) == 'fixed_ips':\n ip_address = preferred_ip(vm_, data.fixed_ips)\n elif ssh_interface(vm_) == 'floating_ips':\n ip_address = preferred_ip(vm_, data.floating_ips)\n else:\n ip_address = preferred_ip(vm_, data.public_ips)\n log.debug('Using IP address {0}'.format(ip_address))\n\n if salt.utils.cloud.get_salt_interface(vm_, __opts__) == 'private_ips':\n salt_ip_address = preferred_ip(vm_, data.private_ips)\n log.info('Salt interface set to: {0}'.format(salt_ip_address))\n elif salt.utils.cloud.get_salt_interface(vm_, __opts__) == 'fixed_ips':\n salt_ip_address = preferred_ip(vm_, data.fixed_ips)\n log.info('Salt interface set to: {0}'.format(salt_ip_address))\n elif salt.utils.cloud.get_salt_interface(vm_, __opts__) == 'floating_ips':\n salt_ip_address = preferred_ip(vm_, data.floating_ips)\n log.info('Salt interface set to: {0}'.format(salt_ip_address))\n else:\n salt_ip_address = preferred_ip(vm_, data.public_ips)\n log.debug('Salt interface set to: {0}'.format(salt_ip_address))\n\n if not ip_address:\n raise SaltCloudSystemExit('A valid IP address was not found')\n\n vm_['ssh_host'] = ip_address\n vm_['salt_host'] = salt_ip_address\n\n ret = salt.utils.cloud.bootstrap(vm_, __opts__)\n\n ret.update(data.__dict__)\n\n if 'password' in ret['extra']:\n del ret['extra']['password']\n\n log.info('Created Cloud VM \\'{0[name]}\\''.format(vm_))\n log.debug(\n '\\'{0[name]}\\' VM creation details:\\n{1}'.format(\n vm_, pprint.pformat(data.__dict__)\n )\n )\n\n event_data = {\n 'name': vm_['name'],\n 'profile': vm_['profile'],\n 'provider': vm_['driver'],\n 'instance_id': vm_['instance_id'],\n 'floating_ips': data.floating_ips,\n 'fixed_ips': data.fixed_ips,\n 'private_ips': data.private_ips,\n 'public_ips': data.public_ips\n }\n\n salt.utils.cloud.fire_event(\n 'event',\n 'created instance',\n 'salt/cloud/{0}/created'.format(vm_['name']),\n event_data,\n transport=__opts__['transport']\n )\n salt.utils.cloud.cachedir_index_add(\n vm_['name'], vm_['profile'], 'nova', vm_['driver']\n )\n return ret", "metadata": "root.create", "header": "['module', '___EOS___']", "index": 694 } ]
[ { "span": "minions ", "start_line": 515, "start_column": 8, "end_line": 515, "end_column": 15 }, { "span": "deploy ", "start_line": 708, "start_column": 4, "end_line": 708, "end_column": 10 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "destroy_", "(_", "name_", ",_", "conn_", "=_", "None_", ",_", "call_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Delete", " ", "a", " ", "single", " ", "VM", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "call_", "==_", "'", "function", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Sal", "t", "Cloud", "System", "Exit_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "The", " ", "destroy", " ", "action", " ", "must", " ", "be", " ", "call", "ed", " ", "with", " ", "-", "d", ",", " ", "--", "destroy", ",", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'-", "a", " ", "or", " ", "--", "action", ".'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "salt_", "._", "utils_", "._", "cloud_", "._", "fire", "\\u", "event_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "event", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "destroy", "ing", " ", "instance", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "salt", "/", "cloud", "/{", "0", "}/", "destroy", "ing", "'_", "._", "format_", "(_", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "name", "'_", ":_", "name_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "transport_", "=_", "\\u\\u", "opts", "\\u\\u_", "[_", "'", "transport", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "conn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn_", "=_", "get", "\\u", "conn_", "(_", ")_", "#", " ", "pylint", ":", " ", "disable", "=", "E0", "602", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "node_", "=_", "conn_", "._", "server", "\\u", "by", "\\u", "name_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "profiles_", "=_", "get", "\\u", "configur", "ed", "\\u", "provider_", "(_", ")_", "[_", "'", "profile", "s", "'_", "]_", "#", " ", "pylint", ":", " ", "disable", "=", "E0", "602", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "node_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "error_", "(_", "'", "Una", "ble", " ", "to", " ", "find", " ", "the", " ", "VM", " ", "{", "0", "}'_", "._", "format_", "(_", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "profile_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "metadata", "'_", "in_", "node_", "._", "extra_", "and_", "'", "profile", "'_", "in_", "node_", "._", "extra_", "[_", "'", "metadata", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "profile_", "=_", "node_", "._", "extra_", "[_", "'", "metadata", "'_", "]_", "[_", "'", "profile", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "flush", "\\u", "mine", "\\u", "on", "\\u", "destroy_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "profile_", "and_", "profile_", "in_", "profiles_", "and_", "'", "flush", "\\u", "mine", "\\u", "on", "\\u", "destroy", "'_", "in_", "profiles_", "[_", "profile_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flush", "\\u", "mine", "\\u", "on", "\\u", "destroy_", "=_", "profiles_", "[_", "profile_", "]_", "[_", "'", "flush", "\\u", "mine", "\\u", "on", "\\u", "destroy", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "flush", "\\u", "mine", "\\u", "on", "\\u", "destroy_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "'", "Clear", "ing", " ", "Sal", "t", " ", "Mine", ":", " ", "{", "0", "}'_", "._", "format_", "(_", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "salt", "\\u", "client_", "=_", "salt_", "._", "client_", "._", "get", "\\u", "local", "\\u", "client_", "(_", "\\u\\u", "opts", "\\u\\u_", "[_", "'", "conf", "\\u", "file", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "minions_", "=_", "salt", "\\u", "client_", "._", "cmd_", "(_", "name_", ",_", "'", "mine", ".", "flush", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "info_", "(_", "'", "Clear", "ing", " ", "Sal", "t", " ", "Mine", ":", " ", "{", "0", "},", " ", "{", "1", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "flush", "\\u", "mine", "\\u", "on", "\\u", "destroy_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "'", "Destr", "oy", "ing", " ", "VM", ":", " ", "{", "0", "}'_", "._", "format_", "(_", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "conn_", "._", "delete_", "(_", "node_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ret_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "'", "Destr", "oy", "ed", " ", "VM", ":", " ", "{", "0", "}'_", "._", "format_", "(_", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fire", " ", "destroy", " ", "action_", "\\u\\u\\uNL\\u\\u\\u_", "salt_", "._", "utils_", "._", "cloud_", "._", "fire", "\\u", "event_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "event", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "destroy", "ed", " ", "instance", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "salt", "/", "cloud", "/{", "0", "}/", "destroy", "ed", "'_", "._", "format_", "(_", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "name", "'_", ":_", "name_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "transport_", "=_", "\\u\\u", "opts", "\\u\\u_", "[_", "'", "transport", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\\u\\u", "opts", "\\u\\u_", "._", "get_", "(_", "'", "delete", "\\u", "ssh", "keys", "'_", ",_", "False_", ")_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "salt_", "._", "utils_", "._", "cloud_", "._", "remove", "\\u", "ssh", "key_", "(_", "getattr_", "(_", "node_", ",_", "\\u\\u", "opts", "\\u\\u_", "._", "get_", "(_", "'", "ssh", "\\u", "interface", "'_", ",_", "'", "public", "\\u", "ips", "'_", ")_", ")_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "opts", "\\u\\u_", "._", "get_", "(_", "'", "update", "\\u", "cachedir", "'_", ",_", "False_", ")_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "salt_", "._", "utils_", "._", "cloud_", "._", "delete", "\\u", "minion", "\\u", "cachedir", "_", "(_", "name_", ",_", "\\u\\u", "active", "\\u", "provide", "r", "\\u", "name\\u\\u_", "._", "split_", "(_", "':'_", ")_", "[_", "0_", "]_", ",_", "\\u\\u", "opts", "\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "salt_", "._", "utils_", "._", "cloud_", "._", "cachedir", "\\u", "index", "\\u", "del_", "(_", "name_", ")_", "\\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_", "log_", "._", "error_", "(_", "'", "Fail", "ed", " ", "to", " ", "Destr", "oy", " ", "VM", ":", " ", "{", "0", "}'_", "._", "format_", "(_", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create_", "(_", "vm", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Creat", "e", " ", "a", " ", "single", " ", "VM", " ", "from", " ", "a", " ", "data", " ", "dict", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "require", "d", " ", "profile", " ", "parameter", "s", " ", "bef", "ore", " ", "sendin", "g", " ", "any", " ", "API", " ", "calls", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "vm", "\\u_", "[_", "'", "profile", "'_", "]_", "and_", "config_", "._", "is", "\\u", "profile", "\\u", "configured_", "(_", "\\u\\u", "opts", "\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "active", "\\u", "provide", "r", "\\u", "name\\u\\u_", "or_", "'", "nova", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "vm", "\\u_", "[_", "'", "profile", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "vm", "\\u_", "=_", "vm", "\\u_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\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_", "deploy_", "=_", "config_", "._", "get", "\\u", "cloud", "\\u", "config", "\\u", "value_", "(_", "'", "deploy", "'_", ",_", "vm", "\\u_", ",_", "\\u\\u", "opts", "\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key", "\\u", "filename_", "=_", "config_", "._", "get", "\\u", "cloud", "\\u", "config", "\\u", "value_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ssh", "\\u", "key", "\\u", "file", "'_", ",_", "vm", "\\u_", ",_", "\\u\\u", "opts", "\\u\\u_", ",_", "search", "\\u", "global_", "=_", "False_", ",_", "default_", "=_", "None_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "key", "\\u", "filename_", "is_", "not_", "None_", "and_", "not_", "os_", "._", "path_", "._", "isfile_", "(_", "key", "\\u", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Sal", "t", "Cloud", "Config", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "The", " ", "defin", "ed", " ", "ssh", "\\u", "key", "\\u", "file", " ", "\\\\'{", "0", "}\\\\'", " ", "doe", "s", " ", "not", " ", "exist", "'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "key", "\\u", "filename_", "\\u\\u\\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_", "vm", "\\u_", "[_", "'", "key", "\\u", "filename", "'_", "]_", "=_", "key", "\\u", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sin", "ce", " ", "usi", "ng", " ", "\"", "provide", "r", ":", " ", "<", "provide", "r", "-", "eng", "ine", ">\"", " ", "is", " ", "depre", "cated", ",", " ", "alias", " ", "provider_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "use", " ", "driver", ":", " ", "\"", "driver", ":", " ", "<", "provide", "r", "-", "eng", "ine", ">\"_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "provide", "r", "'_", "in_", "vm", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vm", "\\u_", "[_", "'", "driver", "'_", "]_", "=_", "vm", "\\u_", "._", "pop_", "(_", "'", "provide", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "salt_", "._", "utils_", "._", "cloud_", "._", "fire", "\\u", "event_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "event", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "startin", "g", " ", "create", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "salt", "/", "cloud", "/{", "0", "}/", "creati", "ng", "'_", "._", "format_", "(_", "vm", "\\u_", "[_", "'", "name", "'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "vm", "\\u_", "[_", "'", "name", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "profile", "'_", ":_", "vm", "\\u_", "[_", "'", "profile", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "provide", "r", "'_", ":_", "vm", "\\u_", "[_", "'", "driver", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "transport_", "=_", "\\u\\u", "opts", "\\u\\u_", "[_", "'", "transport", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "=_", "get", "\\u", "conn_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "instance", "\\u", "id", "'_", "in_", "vm", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "was", " ", "probab", "ly", " ", "created", " ", "via", " ", "anot", "her", " ", "process", ",", " ", "and", " ", "doe", "sn", "'", "t", " ", "have_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "thing", "s", " ", "like", " ", "salt", " ", "keys", " ", "created", " ", "ye", "t", ",", " ", "so", " ", "let", "'", "s", " ", "create", " ", "them", " ", "now", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "pub", "\\u", "key", "'_", "not_", "in_", "vm", "\\u_", "and_", "'", "priv", "\\u", "key", "'_", "not_", "in_", "vm", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "debug_", "(_", "'", "Generat", "ing", " ", "minion", " ", "keys", " ", "for", " ", "\\\\'{", "0", "[", "name", "]}", "\\\\''_", "._", "format_", "(_", "vm", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vm", "\\u_", "[_", "'", "priv", "\\u", "key", "'_", "]_", ",_", "vm", "\\u_", "[_", "'", "pub", "\\u", "key", "'_", "]_", "=_", "salt_", "._", "utils_", "._", "cloud_", "._", "gen", "\\u", "keys_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "salt_", "._", "config_", "._", "get", "\\u", "cloud", "\\u", "config", "\\u", "value_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "keys", "ize", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "vm", "\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "opts", "\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "=_", "conn_", "._", "server", "\\u", "show", "\\u", "libc", "loud", "_", "(_", "vm", "\\u_", "[_", "'", "instance", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "vm", "\\u_", "[_", "'", "key", "\\u", "filename", "'_", "]_", "is_", "None_", "and_", "'", "change", "\\u", "password", "'_", "in_", "\\u\\u", "opts", "\\u\\u_", "and_", "\\u\\u", "opts", "\\u\\u_", "[_", "'", "change", "\\u", "password", "'_", "]_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vm", "\\u_", "[_", "'", "password", "'_", "]_", "=_", "sup_", "._", "secure", "\\u", "password_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "._", "root", "\\u", "password_", "(_", "vm", "\\u_", "[_", "'", "instance", "\\u", "id", "'_", "]_", ",_", "vm", "\\u_", "[_", "'", "password", "'_", "]_", ")_", "\\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_", "#", " ", "Put", " ", "tog", "ether", " ", "all", " ", "of", " ", "the", " ", "informati", "on", " ", "require", "d", " ", "to", " ", "request", " ", "the", " ", "instance", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "then", " ", "fire", " ", "off", " ", "the", " ", "request", " ", "for", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", ",_", "vm", "\\u_", "=_", "request", "\\u", "instance_", "(_", "vm", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pul", "l", " ", "the", " ", "instance", " ", "ID", ",", " ", "valid", " ", "for", " ", "bot", "h", " ", "spot", " ", "and", " ", "normal", " ", "instances_", "\\u\\u\\uNL\\u\\u\\u_", "vm", "\\u_", "[_", "'", "instance", "\\u", "id", "'_", "]_", "=_", "data_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "query", "\\u", "node", "\\u", "data_", "(_", "vm", "\\u_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node_", "=_", "show", "\\u", "instance_", "(_", "vm", "\\u_", "[_", "'", "name", "'_", "]_", ",_", "'", "action", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "debug_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Load", "ed", " ", "node", " ", "data", " ", "for", " ", "{", "0", "}:", "\\\\", "n", "{", "1", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "vm", "\\u_", "[_", "'", "name", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pprint_", "._", "pformat_", "(_", "node_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Fail", "ed", " ", "to", " ", "get", " ", "nodes", " ", "list", ":", " ", "{", "0", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "err_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Show", " ", "the", " ", "traceback", " ", "if", " ", "the", " ", "debug", " ", "logg", "ing", " ", "level", " ", "is", " ", "enabled_", "\\u\\u\\uNL\\u\\u\\u_", "exc", "\\u", "info", "\\u", "on", "\\u", "loglevel_", "=_", "logging_", "._", "DEBUG_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Trigger", " ", "a", " ", "fail", "ure", " ", "in", " ", "the", " ", "wait", " ", "for", " ", "IP", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "running_", "=_", "node_", "[_", "'", "state", "'_", "]_", "==_", "'", "ACTI", "VE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "running_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Stil", "l", " ", "not", " ", "runn", "ing", ",", " ", "trigger", " ", "anot", "her", " ", "iteration_", "\\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_", "rack", "connect_", "(_", "vm", "\\u_", ")_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "extra_", "=_", "node_", "._", "get_", "(_", "'", "extra", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rc", "\\u", "status_", "=_", "extra_", "._", "get_", "(_", "'", "metadata", "'_", ",_", "{_", "}_", ")_", "._", "get_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rack", "connect", "\\u", "automati", "on", "\\u", "status", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "rc", "\\u", "status_", "!=_", "'", "DEPLOY", "ED", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "debug_", "(_", "'", "Wait", "ing", " ", "for", " ", "Rack", "connect", " ", "automati", "on", " ", "to", " ", "complete", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "manage", "dcl", "oud", "_", "(_", "vm", "\\u_", ")_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "extra_", "=_", "conn_", "._", "server", "\\u", "show", "\\u", "libc", "loud", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "node_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "extra_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mc", "\\u", "status_", "=_", "extra_", "._", "get_", "(_", "'", "metadata", "'_", ",_", "{_", "}_", ")_", "._", "get_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rax", "\\u", "service", "\\u", "level", "\\u", "automati", "on", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "mc", "\\u", "status_", "!=_", "'", "Complete", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "debug_", "(_", "'", "Wait", "ing", " ", "for", " ", "manage", "d", " ", "cloud", " ", "automati", "on", " ", "to", " ", "complete", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "access", "\\u", "ip_", "=_", "node_", "._", "get_", "(_", "'", "extra", "'_", ",_", "{_", "}_", ")_", "._", "get_", "(_", "'", "access", "\\u", "ip", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rcv", "3_", "=_", "rack", "connect", "v3_", "(_", "vm", "\\u_", ")_", "in_", "node_", "[_", "'", "addresse", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ssh", "if_", "=_", "ssh", "\\u", "interface_", "(_", "vm", "\\u_", ")_", "in_", "node_", "[_", "'", "addresse", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "any_", "(_", "(_", "rcv", "3_", ",_", "ssh", "if_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "network", "name_", "=_", "rack", "connect", "v3_", "(_", "vm", "\\u_", ")_", "if_", "rcv", "3_", "else_", "ssh", "\\u", "interface_", "(_", "vm", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "network_", "in_", "node_", "[_", "'", "addresse", "s", "'_", "]_", "._", "get_", "(_", "network", "name_", ",_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "network_", "[_", "'", "version", "'_", "]_", "is_", "4_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "access", "\\u", "ip_", "=_", "network_", "[_", "'", "addr", "'_", "]_", "\\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_", "vm", "\\u_", "[_", "'", "cloud", "network", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Conditions", " ", "to", " ", "pass", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Rack", "connect", " ", "v2", ":", " ", "vm", "\\u", "['", "rack", "connect", "']", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "If", " ", "this", " ", "is", " ", "Tru", "e", ",", " ", "then", " ", "the", " ", "server", " ", "will", " ", "not", " ", "be", " ", "accessible", " ", "from", " ", "the", " ", "ipv", "4", " ", "addre", "s", " ", "in", " ", "public", "\\u", "ips", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "Tha", "t", " ", "interface", " ", "gets", " ", "turn", "ed", " ", "off", ",", " ", "and", " ", "an", " ", "ipv", "4", " ", "from", " ", "the", " ", "dedicated", " ", "firew", "all", " ", "is", " ", "route", "d", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "server", ".", " ", " ", "In", " ", "this", " ", "case", " ", "we", " ", "can", " ", "use", " ", "the", " ", "private", "\\u", "ips", " ", "for", " ", "ssh", "\\u", "interface", ",", " ", "or", " ", "the", " ", "access", "\\u", "ip", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Rack", "connect", " ", "v", "3", ":", " ", "vm", "['", "rack", "connect", "v", "3", "']", " ", "=", " ", "<", "cloud", "network", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "If", " ", "this", " ", "is", " ", "the", " ", "case", ",", " ", "salt", " ", "will", " ", "need", " ", "to", " ", "use", " ", "the", " ", "cloud", " ", "network", " ", "to", " ", "login", " ", "to", " ", "the", " ", "server", ".", " ", " ", "There", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "is", " ", "no", " ", "ipv", "4", " ", "address", " ", "automati", "call", "y", " ", "provisioned", " ", "for", " ", "these", " ", "server", "s", " ", "whe", "n", " ", "the", "y", " ", "are", " ", "boot", "ed", ".", " ", " ", "Sal", "t", "Cloud_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "als", "o", " ", "cann", "ot", " ", "use", " ", "the", " ", "private", "\\u", "ips", ",", " ", "bec", "aus", "e", " ", "tha", "t", " ", "traffic", " ", "is", " ", "dropped", " ", "at", " ", "the", " ", "hypervisor", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Cloud", "Network", ":", " ", "vm", "['", "cloud", "network", "']", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "If", " ", "this", " ", "is", " ", "Tru", "e", ",", " ", "then", " ", "we", " ", "shou", "ld", " ", "have", " ", "an", " ", "access", "\\u", "ip", " ", "at", " ", "this", " ", "point", " ", "set", " ", "to", " ", "the", " ", "ip", " ", "on", " ", "the", " ", "cloud_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "network", ".", " ", " ", "If", " ", "tha", "t", " ", "network", " ", "doe", "s", " ", "not", " ", "exist", " ", "in", " ", "the", " ", "'", "addresse", "s", "'", " ", "dictionar", "y", ",", " ", "then", " ", "Sal", "t", "Cloud", " ", "will", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "use", " ", "the", " ", "initial", " ", "access", "\\u", "ip", ",", " ", "and", " ", "not", " ", "overwrit", "e", " ", "anyt", "hing", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "any_", "(_", "(_", "cloud", "network_", "(_", "vm", "\\u_", ")_", ",_", "rack", "connect_", "(_", "vm", "\\u_", ")_", ")_", ")_", "and_", "(_", "ssh", "\\u", "interface_", "(_", "vm", "\\u_", ")_", "!=_", "'", "private", "\\u", "ips", "'_", "or_", "rcv", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "._", "public", "\\u", "ips_", "=_", "[_", "access", "\\u", "ip_", ",_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "private", "\\u", "ips", "'_", "not_", "in_", "node_", "and_", "'", "public", "\\u", "ips", "'_", "not_", "in_", "node_", "and_", "'", "float", "ing", "\\u", "ips", "'_", "not_", "in_", "node_", "and_", "'", "fixed", "\\u", "ips", "'_", "not_", "in_", "node_", "and_", "'", "access", "\\u", "ip", "'_", "in_", "node_", "._", "get_", "(_", "'", "extra", "'_", ",_", "{_", "}_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "[_", "node_", "[_", "'", "extra", "'_", "]_", "[_", "'", "access", "\\u", "ip", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp", "\\u", "dd_", "=_", "node_", "._", "get_", "(_", "'", "addresse", "s", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "addr", "\\u", "ll_", "in_", "temp", "\\u", "dd_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "addr", "\\u", "dd_", "in_", "addr", "\\u", "ll_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "addr_", "=_", "addr", "\\u", "dd_", "._", "get_", "(_", "'", "addr", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "addr_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "result_", "._", "append_", "(_", "addr_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "private_", "=_", "node_", "._", "get_", "(_", "'", "private", "\\u", "ips", "'_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "public_", "=_", "node_", "._", "get_", "(_", "'", "public", "\\u", "ips", "'_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed_", "=_", "node_", "._", "get_", "(_", "'", "fixed", "\\u", "ips", "'_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "float", "ing_", "=_", "node_", "._", "get_", "(_", "'", "float", "ing", "\\u", "ips", "'_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "private_", "and_", "not_", "public_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "warning_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Priva", "te", " ", "IP", "s", " ", "return", "ed", ",", " ", "but", " ", "not", " ", "public", "...", " ", "Check", "ing", " ", "for", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mis", "identifi", "ed", " ", "IP", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "private", "\\u", "ip_", "in_", "private_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "private", "\\u", "ip_", "=_", "prefer", "red", "\\u", "ip_", "(_", "vm", "\\u_", ",_", "[_", "private", "\\u", "ip_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "salt_", "._", "utils_", "._", "cloud_", "._", "is", "\\u", "public", "\\u", "ip_", "(_", "private", "\\u", "ip_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "log_", "._", "warning_", "(_", "'{", "0", "}", " ", "is", " ", "a", " ", "public", " ", "IP", "'_", "._", "format_", "(_", "private", "\\u", "ip_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "._", "public", "\\u", "ips_", "._", "append_", "(_", "private", "\\u", "ip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "warning_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Public", " ", "IP", " ", "address", " ", "was", " ", "not", " ", "read", "y", " ", "whe", "n", " ", "we", " ", "last", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", " ", "checke", "d", ".", " ", " ", "Append", "ing", " ", "public", " ", "IP", " ", "address", " ", "now", ".'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "public_", "=_", "data_", "._", "public", "\\u", "ips_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "log_", "._", "warning_", "(_", "'{", "0", "}", " ", "is", " ", "a", " ", "private", " ", "IP", "'_", "._", "format_", "(_", "private", "\\u", "ip_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ignore", "\\u", "ip_", "=_", "ignore", "\\u", "cidr_", "(_", "vm", "\\u_", ",_", "private", "\\u", "ip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "private", "\\u", "ip_", "not_", "in_", "data_", "._", "private", "\\u", "ips_", "and_", "not_", "ignore", "\\u", "ip_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "result_", "._", "append_", "(_", "private", "\\u", "ip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "populate", " ", "return", " ", "data", " ", "with", " ", "private", "\\u", "ips_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whe", "n", " ", "ssh", "\\u", "interface", " ", "is", " ", "set", " ", "to", " ", "private", "\\u", "ips", " ", "and", " ", "public", "\\u", "ips", " ", "exist_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "result_", "and_", "ssh", "\\u", "interface_", "(_", "vm", "\\u_", ")_", "==_", "'", "private", "\\u", "ips", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "private", "\\u", "ip_", "in_", "private_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ignore", "\\u", "ip_", "=_", "ignore", "\\u", "cidr_", "(_", "vm", "\\u_", ",_", "private", "\\u", "ip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "private", "\\u", "ip_", "not_", "in_", "data_", "._", "private", "\\u", "ips_", "and_", "not_", "ignore", "\\u", "ip_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "result_", "._", "append_", "(_", "private", "\\u", "ip_", ")_", "\\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_", "non", "\\u", "private", "\\u", "ips_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "public_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "._", "public", "\\u", "ips_", "=_", "public_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ssh", "\\u", "interface_", "(_", "vm", "\\u_", ")_", "==_", "'", "public", "\\u", "ips", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "non", "\\u", "private", "\\u", "ips_", "._", "append_", "(_", "public_", ")_", "\\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_", "float", "ing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "._", "float", "ing", "\\u", "ips_", "=_", "float", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ssh", "\\u", "interface_", "(_", "vm", "\\u_", ")_", "==_", "'", "float", "ing", "\\u", "ips", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "non", "\\u", "private", "\\u", "ips_", "._", "append_", "(_", "float", "ing_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "fixed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "._", "fixed", "\\u", "ips_", "=_", "fixed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ssh", "\\u", "interface_", "(_", "vm", "\\u_", ")_", "==_", "'", "fixed", "\\u", "ips", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "non", "\\u", "private", "\\u", "ips_", "._", "append_", "(_", "fixed_", ")_", "\\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_", "non", "\\u", "private", "\\u", "ips_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "debug_", "(_", "'", "result", " ", "=", " ", "{", "0", "}'_", "._", "format_", "(_", "non", "\\u", "private", "\\u", "ips_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "._", "private", "\\u", "ips_", "=_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ssh", "\\u", "interface_", "(_", "vm", "\\u_", ")_", "!=_", "'", "private", "\\u", "ips", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "data_", "\\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_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "debug_", "(_", "'", "result", " ", "=", " ", "{", "0", "}'_", "._", "format_", "(_", "result_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "._", "private", "\\u", "ips_", "=_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ssh", "\\u", "interface_", "(_", "vm", "\\u_", ")_", "==_", "'", "private", "\\u", "ips", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "data_", "\\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_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "salt_", "._", "utils_", "._", "cloud_", "._", "wait", "\\u", "for", "\\u", "ip_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "query", "\\u", "node", "\\u", "data_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "update", "\\u", "args_", "=_", "(_", "vm", "\\u_", ",_", "data_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "timeout_", "=_", "config_", "._", "get", "\\u", "cloud", "\\u", "config", "\\u", "value_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "wait", "\\u", "for", "\\u", "ip", "\\u", "timeo", "ut", "'_", ",_", "vm", "\\u_", ",_", "\\u\\u", "opts", "\\u\\u_", ",_", "default_", "=_", "10_", "*_", "60_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "interval_", "=_", "config_", "._", "get", "\\u", "cloud", "\\u", "config", "\\u", "value_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "wait", "\\u", "for", "\\u", "ip", "\\u", "interval", "'_", ",_", "vm", "\\u_", ",_", "\\u\\u", "opts", "\\u\\u_", ",_", "default_", "=_", "10_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Sal", "t", "Cloud", "Execut", "ion", "Timeout_", ",_", "Sal", "t", "Cloud", "Execut", "ion", "Failure_", ")_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "It", " ", "mig", "ht", " ", "be", " ", "alr", "ead", "y", " ", "up", ",", " ", "let", "'", "s", " ", "destroy", " ", "it", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "destroy_", "(_", "vm", "\\u_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Sal", "t", "Cloud", "System", "Exit_", ":_", "\\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_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Sal", "t", "Cloud", "System", "Exit_", "(_", "str_", "(_", "exc_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "debug_", "(_", "'", "VM", " ", "is", " ", "now", " ", "runn", "ing", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "ssh", "\\u", "interface_", "(_", "vm", "\\u_", ")_", "==_", "'", "private", "\\u", "ips", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ip", "\\u", "address_", "=_", "prefer", "red", "\\u", "ip_", "(_", "vm", "\\u_", ",_", "data_", "._", "private", "\\u", "ips_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "ssh", "\\u", "interface_", "(_", "vm", "\\u_", ")_", "==_", "'", "fixed", "\\u", "ips", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ip", "\\u", "address_", "=_", "prefer", "red", "\\u", "ip_", "(_", "vm", "\\u_", ",_", "data_", "._", "fixed", "\\u", "ips_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "ssh", "\\u", "interface_", "(_", "vm", "\\u_", ")_", "==_", "'", "float", "ing", "\\u", "ips", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ip", "\\u", "address_", "=_", "prefer", "red", "\\u", "ip_", "(_", "vm", "\\u_", ",_", "data_", "._", "float", "ing", "\\u", "ips_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ip", "\\u", "address_", "=_", "prefer", "red", "\\u", "ip_", "(_", "vm", "\\u_", ",_", "data_", "._", "public", "\\u", "ips_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "debug_", "(_", "'", "Us", "ing", " ", "IP", " ", "address", " ", "{", "0", "}'_", "._", "format_", "(_", "ip", "\\u", "address_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "salt_", "._", "utils_", "._", "cloud_", "._", "get", "\\u", "salt", "\\u", "interface_", "(_", "vm", "\\u_", ",_", "\\u\\u", "opts", "\\u\\u_", ")_", "==_", "'", "private", "\\u", "ips", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "salt", "\\u", "ip", "\\u", "address_", "=_", "prefer", "red", "\\u", "ip_", "(_", "vm", "\\u_", ",_", "data_", "._", "private", "\\u", "ips_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "'", "Sal", "t", " ", "interface", " ", "set", " ", "to", ":", " ", "{", "0", "}'_", "._", "format_", "(_", "salt", "\\u", "ip", "\\u", "address_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "salt_", "._", "utils_", "._", "cloud_", "._", "get", "\\u", "salt", "\\u", "interface_", "(_", "vm", "\\u_", ",_", "\\u\\u", "opts", "\\u\\u_", ")_", "==_", "'", "fixed", "\\u", "ips", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "salt", "\\u", "ip", "\\u", "address_", "=_", "prefer", "red", "\\u", "ip_", "(_", "vm", "\\u_", ",_", "data_", "._", "fixed", "\\u", "ips_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "'", "Sal", "t", " ", "interface", " ", "set", " ", "to", ":", " ", "{", "0", "}'_", "._", "format_", "(_", "salt", "\\u", "ip", "\\u", "address_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "salt_", "._", "utils_", "._", "cloud_", "._", "get", "\\u", "salt", "\\u", "interface_", "(_", "vm", "\\u_", ",_", "\\u\\u", "opts", "\\u\\u_", ")_", "==_", "'", "float", "ing", "\\u", "ips", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "salt", "\\u", "ip", "\\u", "address_", "=_", "prefer", "red", "\\u", "ip_", "(_", "vm", "\\u_", ",_", "data_", "._", "float", "ing", "\\u", "ips_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "'", "Sal", "t", " ", "interface", " ", "set", " ", "to", ":", " ", "{", "0", "}'_", "._", "format_", "(_", "salt", "\\u", "ip", "\\u", "address_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "salt", "\\u", "ip", "\\u", "address_", "=_", "prefer", "red", "\\u", "ip_", "(_", "vm", "\\u_", ",_", "data_", "._", "public", "\\u", "ips_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "debug_", "(_", "'", "Sal", "t", " ", "interface", " ", "set", " ", "to", ":", " ", "{", "0", "}'_", "._", "format_", "(_", "salt", "\\u", "ip", "\\u", "address_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "ip", "\\u", "address_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Sal", "t", "Cloud", "System", "Exit_", "(_", "'", "A", " ", "valid", " ", "IP", " ", "address", " ", "was", " ", "not", " ", "found", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "vm", "\\u_", "[_", "'", "ssh", "\\u", "host", "'_", "]_", "=_", "ip", "\\u", "address_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vm", "\\u_", "[_", "'", "salt", "\\u", "host", "'_", "]_", "=_", "salt", "\\u", "ip", "\\u", "address_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ret_", "=_", "salt_", "._", "utils_", "._", "cloud_", "._", "bootstrap_", "(_", "vm", "\\u_", ",_", "\\u\\u", "opts", "\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ret_", "._", "update_", "(_", "data_", "._", "\\u\\u", "dict\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "password", "'_", "in_", "ret_", "[_", "'", "extra", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "ret_", "[_", "'", "extra", "'_", "]_", "[_", "'", "password", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "info_", "(_", "'", "Creat", "ed", " ", "Cloud", " ", "VM", " ", "\\\\'{", "0", "[", "name", "]}", "\\\\''_", "._", "format_", "(_", "vm", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "debug_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'\\\\'", "{", "0", "[", "name", "]}", "\\\\'", " ", "VM", " ", "creati", "on", " ", "deta", "il", "s", ":\\\\", "n", "{", "1", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "vm", "\\u_", ",_", "pprint_", "._", "pformat_", "(_", "data_", "._", "\\u\\u", "dict\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "event", "\\u", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "vm", "\\u_", "[_", "'", "name", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "profile", "'_", ":_", "vm", "\\u_", "[_", "'", "profile", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "provide", "r", "'_", ":_", "vm", "\\u_", "[_", "'", "driver", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "instance", "\\u", "id", "'_", ":_", "vm", "\\u_", "[_", "'", "instance", "\\u", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "float", "ing", "\\u", "ips", "'_", ":_", "data_", "._", "float", "ing", "\\u", "ips_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fixed", "\\u", "ips", "'_", ":_", "data_", "._", "fixed", "\\u", "ips_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "private", "\\u", "ips", "'_", ":_", "data_", "._", "private", "\\u", "ips_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "public", "\\u", "ips", "'_", ":_", "data_", "._", "public", "\\u", "ips_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "salt_", "._", "utils_", "._", "cloud_", "._", "fire", "\\u", "event_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "event", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", " ", "instance", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "salt", "/", "cloud", "/{", "0", "}/", "created", "'_", "._", "format_", "(_", "vm", "\\u_", "[_", "'", "name", "'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "event", "\\u", "data_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "transport_", "=_", "\\u\\u", "opts", "\\u\\u_", "[_", "'", "transport", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "salt_", "._", "utils_", "._", "cloud_", "._", "cachedir", "\\u", "index", "\\u", "add_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "vm", "\\u_", "[_", "'", "name", "'_", "]_", ",_", "vm", "\\u_", "[_", "'", "profile", "'_", "]_", ",_", "'", "nova", "'_", ",_", "vm", "\\u_", "[_", "'", "driver", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ret_", "\\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,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s):\n \"\"\"\n Contour an array. If the array is three-dimensional, then the method\n will contour the layer tied to this class (self.layer).\n\n Parameters\n ----------\n a : numpy.ndarray\n Array to plot.\n masked_values : iterable of floats, ints\n Values to mask.\n **kwargs : dictionary\n keyword arguments passed to matplotlib.pyplot.pcolormesh\n\n Returns\n -------\n contour_set : matplotlib.pyplot.contour\n\n \"\"\"\n if a.ndim == 3:\n plotarray = a[self.layer, :, :]\n elif a.ndim == 2:\n plotarray = a\n else:\n raise Exception('Array must be of dimension 2 or 3')\n if masked_values is not None:\n for mval in masked_values:\n plotarray = np.ma.masked_equal(plotarray, mval)\n if 'ax' in kwargs:\n ax = kwargs.pop('ax')\n else:\n ax = self.ax\n if 'colors' in kwargs.keys():\n if 'cmap' in kwargs.keys():\n cmap = kwargs.pop('cmap')\n cmap = None\n contour_set = ax.contour(self.sr.xcentergrid, self.sr.ycentergrid,\n plotarray, **kwargs)\n ax.set_xlim(self.extent[0], self.extent[1])\n ax.set_ylim(self.extent[2], self.extent[3])\n\n return contour_set", "metadata": "root.ModelMap.contour_array", "header": "['class', 'ModelMap', '(', 'object', ')', ':', '___EOS___']", "index": 133 }, { "content": " def plot_inactive(self, ibound=None, color_noflow='black', **kwargs):\n \"\"\"\n Make a plot of inactive cells. If not specified, then pull ibound from the\n self.ml\n\n Parameters\n ----------\n ibound : numpy.ndarray\n ibound array to plot. (Default is ibound in 'BAS6' package.)\n color_noflow : string\n (Default is 'black')\n\n Returns\n -------\n quadmesh : matplotlib.collections.QuadMesh\n\n \"\"\"\n if 'ax' in kwargs:\n ax = kwargs.pop('ax')\n else:\n ax = self.ax\n\n if ibound is None:\n bas = self.model.get_package('BAS6')\n ibound = bas.ibound.array\n\n plotarray = np.zeros(ibound.shape, dtype=np.int)\n idx1 = (ibound == 0)\n plotarray[idx1] = 1\n plotarray = np.ma.masked_equal(plotarray, 0)\n cmap = matplotlib.colors.ListedColormap(['0', color_noflow])\n bounds = [0, 1, 2]\n norm = matplotlib.colors.BoundaryNorm(bounds, cmap.N)\n quadmesh = self.plot_array(plotarray, cmap=cmap, norm=norm, **kwargs)\n return quadmesh", "metadata": "root.ModelMap.plot_inactive", "header": "['class', 'ModelMap', '(', 'object', ')', ':', '___EOS___']", "index": 176 }, { "content": " def plot_ibound(self, ibound=None, color_noflow='black', color_ch='blue',\n **kwargs):\n \"\"\"\n Make a plot of ibound. If not specified, then pull ibound from the\n self.ml\n\n Parameters\n ----------\n ibound : numpy.ndarray\n ibound array to plot. (Default is ibound in 'BAS6' package.)\n color_noflow : string\n (Default is 'black')\n color_ch : string\n Color for constant heads (Default is 'blue'.)\n\n Returns\n -------\n quadmesh : matplotlib.collections.QuadMesh\n\n \"\"\"\n if 'ax' in kwargs:\n ax = kwargs.pop('ax')\n else:\n ax = self.ax\n\n if ibound is None:\n bas = self.model.get_package('BAS6')\n ibound = bas.ibound.array\n plotarray = np.zeros(ibound.shape, dtype=np.int)\n idx1 = (ibound == 0)\n idx2 = (ibound < 0)\n plotarray[idx1] = 1\n plotarray[idx2] = 2\n plotarray = np.ma.masked_equal(plotarray, 0)\n cmap = matplotlib.colors.ListedColormap(['0', color_noflow, color_ch])\n bounds = [0, 1, 2, 3]\n norm = matplotlib.colors.BoundaryNorm(bounds, cmap.N)\n quadmesh = self.plot_array(plotarray, cmap=cmap, norm=norm, **kwargs)\n return quadmesh", "metadata": "root.ModelMap.plot_ibound", "header": "['class', 'ModelMap', '(', 'object', ')', ':', '___EOS___']", "index": 212 }, { "content": " def plot_bc(self, ftype=None, package=None, kper=0, color=None, plotAll=False,\n **kwargs):\n \"\"\"\n Plot boundary conditions locations for a specific boundary\n type from a flopy model\n\n Parameters\n ----------\n ftype : string\n Package name string ('WEL', 'GHB', etc.). (Default is None)\n package : flopy.modflow.Modflow package class instance\n flopy package class instance. (Default is None)\n kper : int\n Stress period to plot\n color : string\n matplotlib color string. (Default is None)\n plotAll : bool\n Boolean used to specify that boundary condition locations for all\n layers will be plotted on the current ModelMap layer.\n (Default is False)\n **kwargs : dictionary\n keyword arguments passed to matplotlib.collections.PatchCollection\n\n Returns\n -------\n quadmesh : matplotlib.collections.QuadMesh\n\n \"\"\"\n if 'ax' in kwargs:\n ax = kwargs.pop('ax')\n else:\n ax = self.ax\n\n # Find package to plot\n if package is not None:\n p = package\n elif self.model is not None:\n if ftype is None:\n raise Exception('ftype not specified')\n p = self.model.get_package(ftype)\n else:\n raise Exception('Cannot find package to plot')\n\n # Get the list data\n try:\n mflist = p.stress_period_data[kper]\n except Exception as e:\n raise Exception('Not a list-style boundary package:'+str(e))\n\n # Return if MfList is None\n if mflist is None:\n return None\n nlay = self.model.nlay\n # Plot the list locations\n plotarray = np.zeros((nlay, self.sr.nrow, self.sr.ncol), dtype=np.int)\n if plotAll:\n idx = [mflist['i'], mflist['j']]\n #plotarray[:, idx] = 1\n pa = np.zeros((self.sr.nrow, self.sr.ncol), dtype=np.int)\n pa[idx] = 1\n for k in range(nlay):\n plotarray[k, :, :] = pa.copy()\n else:\n idx = [mflist['k'], mflist['i'], mflist['j']]\n\n plotarray[idx] = 1\n plotarray = np.ma.masked_equal(plotarray, 0)\n if color is None:\n if ftype in bc_color_dict:\n c = bc_color_dict[ftype]\n else:\n c = bc_color_dict['default']\n else:\n c = color\n cmap = matplotlib.colors.ListedColormap(['0', c])\n bounds = [0, 1, 2]\n norm = matplotlib.colors.BoundaryNorm(bounds, cmap.N)\n quadmesh = self.plot_array(plotarray, cmap=cmap, norm=norm, **kwargs)\n return quadmesh", "metadata": "root.ModelMap.plot_bc", "header": "['class', 'ModelMap', '(', 'object', ')', ':', '___EOS___']", "index": 281 }, { "content": " def plot_pathline(self, pl, **kwargs):\n \"\"\"\n Plot the MODPATH pathlines.\n\n Parameters\n ----------\n pl : list of rec arrays or a single rec array\n rec array or list of rec arrays is data returned from\n modpathfile PathlineFile get_data() or get_alldata()\n methods. Data in rec array is 'x', 'y', 'z', 'time',\n 'k', and 'particleid'.\n\n kwargs : layer, ax, colors. The remaining kwargs are passed\n into the LineCollection constructor. If layer='all',\n pathlines are output for all layers\n\n Returns\n -------\n lc : matplotlib.collections.LineCollection\n\n \"\"\"\n from matplotlib.collections import LineCollection\n #make sure pathlines is a list\n if isinstance(pl, np.ndarray):\n pl = [pl]\n \n if 'layer' in kwargs:\n kon = kwargs.pop('layer')\n if isinstance(kon, str):\n if kon.lower() == 'all':\n kon = -1\n else:\n kon = self.layer\n else:\n kon = self.layer\n\n if 'ax' in kwargs:\n ax = kwargs.pop('ax')\n else:\n ax = self.ax\n\n if 'colors' not in kwargs:\n kwargs['colors'] = '0.5'\n\n linecol = []\n for p in pl:\n vlc = []\n #rotate data\n x0r, y0r = self.sr.rotate(p['x'], p['y'], self.sr.rotation, 0., self.sr.yedge[0])\n x0r += self.sr.xul\n y0r += self.sr.yul - self.sr.yedge[0]\n #build polyline array\n arr = np.vstack((x0r, y0r)).T\n #select based on layer\n if kon >= 0:\n arr = np.ma.masked_where((p['k'] != kon), arr)\n #append line to linecol if there is some unmasked segment\n if not arr.mask.all():\n linecol.append(arr)\n #create line collection\n lc = None\n if len(linecol) > 0:\n lc = LineCollection(linecol, **kwargs)\n ax.add_collection(lc)\n return lc", "metadata": "root.ModelMap.plot_pathline", "header": "['class', 'ModelMap', '(', 'object', ')', ':', '___EOS___']", "index": 491 }, { "content": " def plot_endpoint(self, ep, **kwargs):\n \"\"\"\n Plot the MODPATH endpoints.\n\n Parameters\n ----------\n ep : rec array\n rec array is data returned from modpathfile EndpointFile\n get_data() or get_alldata() methods. Data in rec array\n is 'x', 'y', 'z', 'time', 'k', and 'particleid'.\n\n kwargs : layer, ax, c, s, colorbar, colorbar_label, shrink. The\n remaining kwargs are passed into the matplotlib scatter\n method. If layer='all', endpoints are output for all layers.\n If colorbar is True a colorbar will be added to the plot.\n If colorbar_label is passed in and colorbar is True then\n colorbar_label will be passed to the colorbar set_label()\n method. If shrink is passed in and colorbar is True then\n the colorbar size will be set using shrink.\n\n Returns\n -------\n sp : matplotlib.pyplot.scatter\n\n \"\"\"\n\n if 'layer' in kwargs:\n kon = kwargs.pop('layer')\n if isinstance(kon, str):\n if kon.lower() == 'all':\n kon = -1\n else:\n kon = self.layer\n else:\n kon = self.layer\n\n if 'ax' in kwargs:\n ax = kwargs.pop('ax')\n else:\n ax = self.ax\n\n #scatter kwargs that users may redefine\n if 'c' not in kwargs:\n c = ep['time']\n else:\n c = np.empty((ep.shape[0]), dtype=\"S30\")\n c.fill(kwargs.pop('c'))\n\n if 's' not in kwargs:\n s = 50.\n else:\n s = float(kwargs.pop('s'))**2.\n\n #colorbar kwargs\n createcb = False\n if 'colorbar' in kwargs:\n createcb = kwargs.pop('colorbar')\n\n colorbar_label = 'Endpoint Time'\n if 'colorbar_label' in kwargs:\n colorbar_label = kwargs.pop('colorbar_label')\n\n shrink = 1.\n if 'shrink' in kwargs:\n shrink = float(kwargs.pop('shrink'))\n\n #rotate data\n x0r, y0r = self.sr.rotate(ep['x'], ep['y'], self.sr.rotation, 0., self.sr.yedge[0])\n x0r += self.sr.xul\n y0r += self.sr.yul - self.sr.yedge[0]\n #build array to plot\n arr = np.vstack((x0r, y0r)).T\n #select based on layer\n if kon >= 0:\n c = np.ma.masked_where((ep['k'] != kon), c)\n #plot the end point data\n sp = plt.scatter(arr[:, 0], arr[:, 1], c=c, s=s, **kwargs)\n #add a colorbar for endpoint times\n if createcb:\n cb = plt.colorbar(sp, shrink=shrink)\n cb.set_label(colorbar_label)\n return sp", "metadata": "root.ModelMap.plot_endpoint", "header": "['class', 'ModelMap', '(', 'object', ')', ':', '___EOS___']", "index": 558 } ]
[ { "span": "cmap ", "start_line": 168, "start_column": 12, "end_line": 168, "end_column": 16 }, { "span": "ax ", "start_line": 194, "start_column": 12, "end_line": 194, "end_column": 14 }, { "span": "ax ", "start_line": 196, "start_column": 12, "end_line": 196, "end_column": 14 }, { "span": "ax ", "start_line": 233, "start_column": 12, "end_line": 233, "end_column": 14 }, { "span": "ax ", "start_line": 235, "start_column": 12, "end_line": 235, "end_column": 14 }, { "span": "ax ", "start_line": 310, "start_column": 12, "end_line": 310, "end_column": 14 }, { "span": "ax ", "start_line": 312, "start_column": 12, "end_line": 312, "end_column": 14 }, { "span": "vlc ", "start_line": 537, "start_column": 12, "end_line": 537, "end_column": 15 }, { "span": "ax ", "start_line": 595, "start_column": 12, "end_line": 595, "end_column": 14 }, { "span": "ax ", "start_line": 597, "start_column": 12, "end_line": 597, "end_column": 14 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Model", "Map_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "conto", "ur\\u", "array_", "(_", "self_", ",_", "a_", ",_", "mask", "ed", "\\u", "values_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Contour", " ", "an", " ", "array", ".", " ", " ", "If", " ", "the", " ", "array", " ", "is", " ", "three", "-", "dimension", "al", ",", " ", "then", " ", "the", " ", "method", "\\", "10", ";", " ", " ", " ", " ", "will", " ", "conto", "ur", " ", "the", " ", "layer", " ", "tied", " ", "to", " ", "this", " ", "class", " ", "(", "self", ".", "layer", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "a", " ", ":", " ", "nump", "y", ".", "ndar", "ray", "\\", "10", ";", " ", " ", " ", " ", "Array", " ", "to", " ", "plot", ".", "\\", "10", ";", " ", " ", " ", " ", "mask", "ed", "\\u", "values", " ", ":", " ", "iterable", " ", "of", " ", "float", "s", ",", " ", "ints", "\\", "10", ";", " ", " ", " ", " ", "Value", "s", " ", "to", " ", "mask", ".", "\\", "10", ";", " ", " ", " ", " ", "**", "kwarg", "s", " ", ":", " ", "dictionar", "y", "\\", "10", ";", " ", " ", " ", " ", "keyw", "ord", " ", "argu", "ment", "s", " ", "pass", "ed", " ", "to", " ", "mat", "plotlib", ".", "pypl", "ot", ".", "pcolor", "mesh", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", " ", "conto", "ur\\u", "set", " ", ":", " ", "mat", "plotlib", ".", "pypl", "ot", ".", "conto", "ur", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "a_", "._", "ndim_", "==_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plot", "array_", "=_", "a_", "[_", "self_", "._", "layer_", ",_", ":_", ",_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "a_", "._", "ndim_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plot", "array_", "=_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "Array", " ", "must", " ", "be", " ", "of", " ", "dimension", " ", "2", " ", "or", " ", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mask", "ed", "\\u", "values_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "mv", "al_", "in_", "mask", "ed", "\\u", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plot", "array_", "=_", "np_", "._", "ma_", "._", "mask", "ed", "\\u", "equal_", "(_", "plot", "array_", ",_", "mv", "al_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "ax", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax_", "=_", "kwargs_", "._", "pop_", "(_", "'", "ax", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax_", "=_", "self_", "._", "ax_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "colors", "'_", "in_", "kwargs_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "cmap", "'_", "in_", "kwargs_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmap_", "=_", "kwargs_", "._", "pop_", "(_", "'", "cmap", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmap_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "conto", "ur\\u", "set_", "=_", "ax_", "._", "contour_", "(_", "self_", "._", "sr_", "._", "xce", "nter", "grid_", ",_", "self_", "._", "sr_", "._", "ycen", "ter", "grid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "plot", "array_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "._", "set\\u", "xlim_", "(_", "self_", "._", "extent_", "[_", "0_", "]_", ",_", "self_", "._", "extent_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "._", "set\\u", "ylim_", "(_", "self_", "._", "extent_", "[_", "2_", "]_", ",_", "self_", "._", "extent_", "[_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "conto", "ur\\u", "set_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Model", "Map_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "plot", "\\u", "inactive_", "(_", "self_", ",_", "ibo", "und_", "=_", "None_", ",_", "color", "\\u", "nof", "low_", "=_", "'", "black", "'_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Make", " ", "a", " ", "plot", " ", "of", " ", "inact", "ive", " ", "cells", ".", " ", " ", "If", " ", "not", " ", "specified", ",", " ", "then", " ", "pull", " ", "ibo", "und", " ", "from", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "self", ".", "ml", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "ibo", "und", " ", ":", " ", "nump", "y", ".", "ndar", "ray", "\\", "10", ";", " ", " ", " ", " ", "ibo", "und", " ", "array", " ", "to", " ", "plot", ".", " ", " ", "(", "Default", " ", "is", " ", "ibo", "und", " ", "in", " ", "'", "BAS", "6", "'", " ", "package", ".)", "\\", "10", ";", " ", " ", " ", " ", "color", "\\u", "nof", "low", " ", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "(", "Default", " ", "is", " ", "'", "black", "')", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", " ", "quad", "mesh", " ", ":", " ", "mat", "plotlib", ".", "collection", "s", ".", "Quad", "Mesh", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "ax", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax_", "=_", "kwargs_", "._", "pop_", "(_", "'", "ax", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax_", "=_", "self_", "._", "ax_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ibo", "und_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bas", "_", "=_", "self_", "._", "model_", "._", "get", "\\u", "package_", "(_", "'", "BAS", "6", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ibo", "und_", "=_", "bas", "_", "._", "ibo", "und_", "._", "array_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plot", "array_", "=_", "np_", "._", "zeros_", "(_", "ibo", "und_", "._", "shape_", ",_", "dtype_", "=_", "np_", "._", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx1_", "=_", "(_", "ibo", "und_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plot", "array_", "[_", "idx1_", "]_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plot", "array_", "=_", "np_", "._", "ma_", "._", "mask", "ed", "\\u", "equal_", "(_", "plot", "array_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmap_", "=_", "matplotlib_", "._", "colors_", "._", "Liste", "d", "Color", "map_", "(_", "[_", "'", "0", "'_", ",_", "color", "\\u", "nof", "low_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bounds_", "=_", "[_", "0_", ",_", "1_", ",_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "norm_", "=_", "matplotlib_", "._", "colors_", "._", "Boundar", "y", "Norm_", "(_", "bounds_", ",_", "cmap_", "._", "N_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "quad", "mesh_", "=_", "self_", "._", "plot", "\\u", "array_", "(_", "plot", "array_", ",_", "cmap_", "=_", "cmap_", ",_", "norm_", "=_", "norm_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "quad", "mesh_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Model", "Map_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "plot", "\\u", "ibo", "und_", "(_", "self_", ",_", "ibo", "und_", "=_", "None_", ",_", "color", "\\u", "nof", "low_", "=_", "'", "black", "'_", ",_", "color", "\\u", "ch_", "=_", "'", "blue", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Make", " ", "a", " ", "plot", " ", "of", " ", "ibo", "und", ".", " ", " ", "If", " ", "not", " ", "specified", ",", " ", "then", " ", "pull", " ", "ibo", "und", " ", "from", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "self", ".", "ml", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "ibo", "und", " ", ":", " ", "nump", "y", ".", "ndar", "ray", "\\", "10", ";", " ", " ", " ", " ", "ibo", "und", " ", "array", " ", "to", " ", "plot", ".", " ", " ", "(", "Default", " ", "is", " ", "ibo", "und", " ", "in", " ", "'", "BAS", "6", "'", " ", "package", ".)", "\\", "10", ";", " ", " ", " ", " ", "color", "\\u", "nof", "low", " ", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "(", "Default", " ", "is", " ", "'", "black", "')", "\\", "10", ";", " ", " ", " ", " ", "color", "\\u", "ch", " ", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "Color", " ", "for", " ", "constant", " ", "head", "s", " ", "(", "Default", " ", "is", " ", "'", "blue", "'.", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", " ", "quad", "mesh", " ", ":", " ", "mat", "plotlib", ".", "collection", "s", ".", "Quad", "Mesh", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "ax", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax_", "=_", "kwargs_", "._", "pop_", "(_", "'", "ax", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax_", "=_", "self_", "._", "ax_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ibo", "und_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bas", "_", "=_", "self_", "._", "model_", "._", "get", "\\u", "package_", "(_", "'", "BAS", "6", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ibo", "und_", "=_", "bas", "_", "._", "ibo", "und_", "._", "array_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plot", "array_", "=_", "np_", "._", "zeros_", "(_", "ibo", "und_", "._", "shape_", ",_", "dtype_", "=_", "np_", "._", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx1_", "=_", "(_", "ibo", "und_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx2_", "=_", "(_", "ibo", "und_", "<_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plot", "array_", "[_", "idx1_", "]_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plot", "array_", "[_", "idx2_", "]_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plot", "array_", "=_", "np_", "._", "ma_", "._", "mask", "ed", "\\u", "equal_", "(_", "plot", "array_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmap_", "=_", "matplotlib_", "._", "colors_", "._", "Liste", "d", "Color", "map_", "(_", "[_", "'", "0", "'_", ",_", "color", "\\u", "nof", "low_", ",_", "color", "\\u", "ch_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bounds_", "=_", "[_", "0_", ",_", "1_", ",_", "2_", ",_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "norm_", "=_", "matplotlib_", "._", "colors_", "._", "Boundar", "y", "Norm_", "(_", "bounds_", ",_", "cmap_", "._", "N_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "quad", "mesh_", "=_", "self_", "._", "plot", "\\u", "array_", "(_", "plot", "array_", ",_", "cmap_", "=_", "cmap_", ",_", "norm_", "=_", "norm_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "quad", "mesh_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Model", "Map_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "plot", "\\u", "bc_", "(_", "self_", ",_", "ftype_", "=_", "None_", ",_", "package_", "=_", "None_", ",_", "kp", "er_", "=_", "0_", ",_", "color_", "=_", "None_", ",_", "plot", "All_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Plot", " ", "bound", "ary", " ", "condition", "s", " ", "location", "s", " ", "for", " ", "a", " ", "specific", " ", "bound", "ary", "\\", "10", ";", " ", " ", " ", " ", "type", " ", "from", " ", "a", " ", "flop", "y", " ", "model", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "ft", "ype", " ", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "Packa", "ge", " ", "name", " ", "string", " ", "('", "WEL", "',", " ", "'", "GH", "B", "',", " ", "etc", ".)", ".", " ", "(", "Default", " ", "is", " ", "Non", "e", ")", "\\", "10", ";", " ", " ", " ", " ", "package", " ", ":", " ", "flop", "y", ".", "mod", "flow", ".", "Mod", "flow", " ", "package", " ", "class", " ", "instance", "\\", "10", ";", " ", " ", " ", " ", "flop", "y", " ", "package", " ", "class", " ", "instance", ".", " ", "(", "Default", " ", "is", " ", "Non", "e", ")", "\\", "10", ";", " ", " ", " ", " ", "kp", "er", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "Stre", "ss", " ", "period", " ", "to", " ", "plot", "\\", "10", ";", " ", " ", " ", " ", "color", " ", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "mat", "plotlib", " ", "color", " ", "string", ".", " ", "(", "Default", " ", "is", " ", "Non", "e", ")", "\\", "10", ";", " ", " ", " ", " ", "plot", "All", " ", ":", " ", "bool", "\\", "10", ";", " ", " ", " ", " ", "Boo", "lean", " ", "used", " ", "to", " ", "speci", "fy", " ", "tha", "t", " ", "bound", "ary", " ", "condition", " ", "location", "s", " ", "for", " ", "all", "\\", "10", ";", " ", " ", " ", " ", "layer", "s", " ", "will", " ", "be", " ", "plott", "ed", " ", "on", " ", "the", " ", "current", " ", "Model", "Map", " ", "layer", ".", "\\", "10", ";", " ", " ", " ", " ", "(", "Default", " ", "is", " ", "Fal", "se", ")", "\\", "10", ";", " ", " ", " ", " ", "**", "kwarg", "s", " ", ":", " ", "dictionar", "y", "\\", "10", ";", " ", " ", " ", " ", "keyw", "ord", " ", "argu", "ment", "s", " ", "pass", "ed", " ", "to", " ", "mat", "plotlib", ".", "collection", "s", ".", "Pat", "ch", "Collecti", "on", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", " ", "quad", "mesh", " ", ":", " ", "mat", "plotlib", ".", "collection", "s", ".", "Quad", "Mesh", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "ax", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax_", "=_", "kwargs_", "._", "pop_", "(_", "'", "ax", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax_", "=_", "self_", "._", "ax_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fin", "d", " ", "package", " ", "to", " ", "plot_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "package_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "package_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "model_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "ft", "ype", " ", "not", " ", "specified", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p_", "=_", "self_", "._", "model_", "._", "get", "\\u", "package_", "(_", "ftype_", ")_", "\\u\\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_", "Exception_", "(_", "'", "Cann", "ot", " ", "find", " ", "package", " ", "to", " ", "plot", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "list", " ", "data_", "\\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 ", " _", "mf", "list_", "=_", "p_", "._", "stress", "\\u", "period", "\\u", "data_", "[_", "kp", "er_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "Not", " ", "a", " ", "list", "-", "style", " ", "bound", "ary", " ", "package", ":'_", "+_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Return", " ", "if", " ", "Mf", "List", " ", "is", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mf", "list_", "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_", "nla", "y_", "=_", "self_", "._", "model_", "._", "nla", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Plot", " ", "the", " ", "list", " ", "locations_", "\\u\\u\\uNL\\u\\u\\u_", "plot", "array_", "=_", "np_", "._", "zeros_", "(_", "(_", "nla", "y_", ",_", "self_", "._", "sr_", "._", "nrow_", ",_", "self_", "._", "sr_", "._", "ncol_", ")_", ",_", "dtype_", "=_", "np_", "._", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "plot", "All_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "idx_", "=_", "[_", "mf", "list_", "[_", "'", "i", "'_", "]_", ",_", "mf", "list_", "[_", "'", "j", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "plot", "array", "[:,", " ", "idx", "]", " ", "=", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", "pa_", "=_", "np_", "._", "zeros_", "(_", "(_", "self_", "._", "sr_", "._", "nrow_", ",_", "self_", "._", "sr_", "._", "ncol_", ")_", ",_", "dtype_", "=_", "np_", "._", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa_", "[_", "idx_", "]_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "range_", "(_", "nla", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plot", "array_", "[_", "k_", ",_", ":_", ",_", ":_", "]_", "=_", "pa_", "._", "copy_", "(_", ")_", "\\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 ", " _", "idx_", "=_", "[_", "mf", "list_", "[_", "'", "k", "'_", "]_", ",_", "mf", "list_", "[_", "'", "i", "'_", "]_", ",_", "mf", "list_", "[_", "'", "j", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plot", "array_", "[_", "idx_", "]_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plot", "array_", "=_", "np_", "._", "ma_", "._", "mask", "ed", "\\u", "equal_", "(_", "plot", "array_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "color_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ftype_", "in_", "bc", "\\u", "color", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "bc", "\\u", "color", "\\u", "dict_", "[_", "ftype_", "]_", "\\u\\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_", "=_", "bc", "\\u", "color", "\\u", "dict_", "[_", "'", "default", "'_", "]_", "\\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 ", " _", "c_", "=_", "color_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmap_", "=_", "matplotlib_", "._", "colors_", "._", "Liste", "d", "Color", "map_", "(_", "[_", "'", "0", "'_", ",_", "c_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bounds_", "=_", "[_", "0_", ",_", "1_", ",_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "norm_", "=_", "matplotlib_", "._", "colors_", "._", "Boundar", "y", "Norm_", "(_", "bounds_", ",_", "cmap_", "._", "N_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "quad", "mesh_", "=_", "self_", "._", "plot", "\\u", "array_", "(_", "plot", "array_", ",_", "cmap_", "=_", "cmap_", ",_", "norm_", "=_", "norm_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "quad", "mesh_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Model", "Map_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "plot", "\\u", "pathli", "ne_", "(_", "self_", ",_", "pl_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Plot", " ", "the", " ", "MOD", "PATH", " ", "pathli", "nes", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "pl", " ", ":", " ", "list", " ", "of", " ", "rec", " ", "arrays", " ", "or", " ", "a", " ", "single", " ", "rec", " ", "array", "\\", "10", ";", " ", " ", " ", " ", "rec", " ", "array", " ", "or", " ", "list", " ", "of", " ", "rec", " ", "arrays", " ", "is", " ", "data", " ", "return", "ed", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "modp", "ath", "file", " ", "Path", "line", "File", " ", "get", "\\u", "data", "()", " ", "or", " ", "get", "\\u", "alld", "ata", "()", "\\", "10", ";", " ", " ", " ", " ", "method", "s", ".", " ", "Data", " ", "in", " ", "rec", " ", "array", " ", "is", " ", "'", "x", "',", " ", "'", "y", "',", " ", "'", "z", "',", " ", "'", "time", "',", "\\", "10", ";", " ", " ", " ", " ", "'", "k", "',", " ", "and", " ", "'", "partic", "lei", "d", "'.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "kwarg", "s", " ", ":", " ", "layer", ",", " ", "ax", ",", " ", "colors", ".", " ", " ", "The", " ", "rema", "inin", "g", " ", "kwarg", "s", " ", "are", " ", "pass", "ed", "\\", "10", ";", " ", " ", " ", " ", "int", "o", " ", "the", " ", "Line", "Collecti", "on", " ", "construct", "or", ".", " ", "If", " ", "layer", "='", "all", "',", "\\", "10", ";", " ", " ", " ", " ", "pathli", "nes", " ", "are", " ", "output", " ", "for", " ", "all", " ", "layer", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", " ", "lc", " ", ":", " ", "mat", "plotlib", ".", "collection", "s", ".", "Line", "Collecti", "on", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "matplotlib_", "._", "collections_", "import_", "Line", "Collection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "make", " ", "sure", " ", "pathli", "nes", " ", "is", " ", "a", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "pl_", ",_", "np_", "._", "ndarray_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pl_", "=_", "[_", "pl_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "layer", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kon", "_", "=_", "kwargs_", "._", "pop_", "(_", "'", "layer", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "kon", "_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "kon", "_", "._", "lower_", "(_", ")_", "==_", "'", "all", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "kon", "_", "=_", "-_", "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 ", " ", "_", "kon", "_", "=_", "self_", "._", "layer_", "\\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 ", " _", "kon", "_", "=_", "self_", "._", "layer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "ax", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax_", "=_", "kwargs_", "._", "pop_", "(_", "'", "ax", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax_", "=_", "self_", "._", "ax_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "colors", "'_", "not_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'", "colors", "'_", "]_", "=_", "'", "0.", "5", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lineco", "l_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "pl_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vlc", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "rota", "te", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "x0", "r_", ",_", "y", "0", "r_", "=_", "self_", "._", "sr_", "._", "rotate_", "(_", "p_", "[_", "'", "x", "'_", "]_", ",_", "p_", "[_", "'", "y", "'_", "]_", ",_", "self_", "._", "sr_", "._", "rotation_", ",_", "0._", ",_", "self_", "._", "sr_", "._", "yed", "ge_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x0", "r_", "+=_", "self_", "._", "sr_", "._", "xu", "l_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "0", "r_", "+=_", "self_", "._", "sr_", "._", "yu", "l_", "-_", "self_", "._", "sr_", "._", "yed", "ge_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "build", " ", "polyline", " ", "array_", "\\u\\u\\uNL\\u\\u\\u_", "arr_", "=_", "np_", "._", "vstack_", "(_", "(_", "x0", "r_", ",_", "y", "0", "r_", ")_", ")_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "select", " ", "based", " ", "on", " ", "layer_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "kon", "_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arr_", "=_", "np_", "._", "ma_", "._", "mask", "ed", "\\u", "where_", "(_", "(_", "p_", "[_", "'", "k", "'_", "]_", "!=_", "kon", "_", ")_", ",_", "arr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "append", " ", "line", " ", "to", " ", "lineco", "l", " ", "if", " ", "there", " ", "is", " ", "some", " ", "unma", "ske", "d", " ", "segment_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "arr_", "._", "mask_", "._", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lineco", "l_", "._", "append_", "(_", "arr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "create", " ", "line", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lc_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "lineco", "l_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lc_", "=_", "Line", "Collection_", "(_", "lineco", "l_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "._", "add", "\\u", "collection_", "(_", "lc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "lc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Model", "Map_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "plot", "\\u", "endpoint_", "(_", "self_", ",_", "ep_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Plot", " ", "the", " ", "MOD", "PATH", " ", "endpoint", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "ep", " ", ":", " ", "rec", " ", "array", "\\", "10", ";", " ", " ", " ", " ", "rec", " ", "array", " ", "is", " ", "data", " ", "return", "ed", " ", "from", " ", "modp", "ath", "file", " ", "End", "point", "File", "\\", "10", ";", " ", " ", " ", " ", "get", "\\u", "data", "()", " ", "or", " ", "get", "\\u", "alld", "ata", "()", " ", "method", "s", ".", " ", "Data", " ", "in", " ", "rec", " ", "array", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "'", "x", "',", " ", "'", "y", "',", " ", "'", "z", "',", " ", "'", "time", "',", " ", "'", "k", "',", " ", "and", " ", "'", "partic", "lei", "d", "'.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "kwarg", "s", " ", ":", " ", "layer", ",", " ", "ax", ",", " ", "c", ",", " ", "s", ",", " ", "colorbar", ",", " ", "colorbar", "\\u", "label", ",", " ", "shrink", ".", " ", "The", "\\", "10", ";", " ", " ", " ", " ", "rema", "inin", "g", " ", "kwarg", "s", " ", "are", " ", "pass", "ed", " ", "int", "o", " ", "the", " ", "mat", "plotlib", " ", "scatter", "\\", "10", ";", " ", " ", " ", " ", "method", ".", " ", "If", " ", "layer", "='", "all", "',", " ", "endpoint", "s", " ", "are", " ", "output", " ", "for", " ", "all", " ", "layer", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "colorbar", " ", "is", " ", "Tru", "e", " ", "a", " ", "colorbar", " ", "will", " ", "be", " ", "adde", "d", " ", "to", " ", "the", " ", "plot", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "colorbar", "\\u", "label", " ", "is", " ", "pass", "ed", " ", "in", " ", "and", " ", "colorbar", " ", "is", " ", "Tru", "e", " ", "then", "\\", "10", ";", " ", " ", " ", " ", "colorbar", "\\u", "label", " ", "will", " ", "be", " ", "pass", "ed", " ", "to", " ", "the", " ", "colorbar", " ", "set\\u", "label", "()", "\\", "10", ";", " ", " ", " ", " ", "method", ".", " ", "If", " ", "shrink", " ", "is", " ", "pass", "ed", " ", "in", " ", "and", " ", "colorbar", " ", "is", " ", "Tru", "e", " ", "then", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "colorbar", " ", "size", " ", "will", " ", "be", " ", "set", " ", "usi", "ng", " ", "shrink", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", " ", "sp", " ", ":", " ", "mat", "plotlib", ".", "pypl", "ot", ".", "scatter", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "layer", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kon", "_", "=_", "kwargs_", "._", "pop_", "(_", "'", "layer", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "kon", "_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "kon", "_", "._", "lower_", "(_", ")_", "==_", "'", "all", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "kon", "_", "=_", "-_", "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 ", " ", "_", "kon", "_", "=_", "self_", "._", "layer_", "\\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 ", " _", "kon", "_", "=_", "self_", "._", "layer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "ax", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax_", "=_", "kwargs_", "._", "pop_", "(_", "'", "ax", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax_", "=_", "self_", "._", "ax_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "scatter", " ", "kwarg", "s", " ", "tha", "t", " ", "users", " ", "may", " ", "rede", "fine", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "c", "'_", "not_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "ep_", "[_", "'", "time", "'_", "]_", "\\u\\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_", "=_", "np_", "._", "empty_", "(_", "(_", "ep_", "._", "shape_", "[_", "0_", "]_", ")_", ",_", "dtype_", "=_", "\"", "S", "30", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "fill_", "(_", "kwargs_", "._", "pop_", "(_", "'", "c", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "s", "'_", "not_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "50.", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "float_", "(_", "kwargs_", "._", "pop_", "(_", "'", "s", "'_", ")_", ")_", "**_", "2._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "colorbar", " ", "kwargs_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "create", "cb_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "colorbar", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "create", "cb_", "=_", "kwargs_", "._", "pop_", "(_", "'", "colorbar", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "colorbar", "\\u", "label_", "=_", "'", "End", "point", " ", "Time", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "colorbar", "\\u", "label", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "colorbar", "\\u", "label_", "=_", "kwargs_", "._", "pop_", "(_", "'", "colorbar", "\\u", "label", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "shrink", "_", "=_", "1._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "shrink", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "shrink", "_", "=_", "float_", "(_", "kwargs_", "._", "pop_", "(_", "'", "shrink", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "rota", "te", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "x0", "r_", ",_", "y", "0", "r_", "=_", "self_", "._", "sr_", "._", "rotate_", "(_", "ep_", "[_", "'", "x", "'_", "]_", ",_", "ep_", "[_", "'", "y", "'_", "]_", ",_", "self_", "._", "sr_", "._", "rotation_", ",_", "0._", ",_", "self_", "._", "sr_", "._", "yed", "ge_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x0", "r_", "+=_", "self_", "._", "sr_", "._", "xu", "l_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "0", "r_", "+=_", "self_", "._", "sr_", "._", "yu", "l_", "-_", "self_", "._", "sr_", "._", "yed", "ge_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "build", " ", "array", " ", "to", " ", "plot_", "\\u\\u\\uNL\\u\\u\\u_", "arr_", "=_", "np_", "._", "vstack_", "(_", "(_", "x0", "r_", ",_", "y", "0", "r_", ")_", ")_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "select", " ", "based", " ", "on", " ", "layer_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "kon", "_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "np_", "._", "ma_", "._", "mask", "ed", "\\u", "where_", "(_", "(_", "ep_", "[_", "'", "k", "'_", "]_", "!=_", "kon", "_", ")_", ",_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "plot", " ", "the", " ", "end", " ", "point", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sp_", "=_", "plt_", "._", "scatter_", "(_", "arr_", "[_", ":_", ",_", "0_", "]_", ",_", "arr_", "[_", ":_", ",_", "1_", "]_", ",_", "c_", "=_", "c_", ",_", "s_", "=_", "s_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "add", " ", "a", " ", "colorbar", " ", "for", " ", "endpoint", " ", "times_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "create", "cb_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cb_", "=_", "plt_", "._", "colorbar_", "(_", "sp_", ",_", "shrink", "_", "=_", "shrink", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cb_", "._", "set\\u", "label_", "(_", "colorbar", "\\u", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "sp_", "\\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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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 ]
Except block handles 'BaseException'
SteveAbb/Vestigo/Vestigo/settings.py
[ { "content": "\tdef __init__(self):\n\t\t#Set defaults\n\t\tself.scanMode_LE=False\n\t\tself.scanMode_Disc=False\n\t\tself.scanMode_NonDisc=False\n\t\t\n\t\tself.readTimeout_Disc=0\n\t\tself.readTimeout_NonDisc=0\n\t\t\n\t\tself.baseServer_URL=None\n\t\tself.baseServer_Timeout=8\n\t\tself.baseServer_Recache=60\n\t\tself.baseServer_Reader=\"Unknown\"\n\t\t\n\t\tself.logging_File=\"vestigo.log\"\n\t\tself.logging_MaxSize=1024*1024 # 1MB\n\t\tself.logging_FileCount=5\n\t\tself.logging_UseLog=False\n\t\tself.logging_STDOUT=True\n\t\t\n\t\t\n\t\tif not os.path.isfile(\"vestigo.ini\"):\n\t\t\traise \"Error reading configuration file\"\n\t\t\n\t\tConfig = ConfigParser.ConfigParser()\n\t\tConfig.read(\"vestigo.ini\")\n\t\n\t\ttry: self.scanMode_LE=Config.getboolean(\"Scan Modes\",\"le\") \n\t\texcept: pass\n\t\ttry: self.scanMode_Disc=Config.getboolean(\"Scan Modes\",\"discoverable\") \n\t\texcept: pass\n\t\ttry: self.scanMode_NonDisc=Config.getboolean(\"Scan Modes\",\"nondiscoverable\") \n\t\texcept: pass\n\t\n\t\ttry: self.readTimeout_Disc=Config.get(\"Read Timeout\",\"discoverable\") \n\t\texcept: pass\n\t\ttry: self.readTimeout_NonDisc=Config.get(\"Read Timeout\",\"nondiscoverable\") \n\t\texcept: pass\n\t\n\t\ttry: self.baseServer_URL=Config.get(\"Base Server\",\"url\") \n\t\texcept: pass\n\t\ttry: self.baseServer_Timeout=Config.get(\"Base Server\",\"timeout\") \n\t\texcept: pass\n\t\ttry: self.baseServer_Recache=Config.get(\"Base Server\",\"recache\") \n\t\texcept: pass\n\t\ttry: self.baseServer_Reader=Config.get(\"Base Server\",\"reader\") \n\t\texcept: pass\n\t\n\t\ttry: self.logging_File=Config.get(\"Logging\",\"file\") \n\t\texcept: pass\n\t\ttry: self.logging_MaxSize=Config.get(\"Logging\",\"maxsize\") \n\t\texcept: pass\n\t\ttry: self.logging_FileCount=Config.get(\"Logging\",\"filecount\") \n\t\texcept: pass\n\t\ttry: self.logging_UseLog=Config.getboolean(\"Logging\",\"uselog\") \n\t\texcept: pass\n\t\ttry: self.logging_STDOUT=Config.getboolean(\"Logging\",\"stdout\") \n\t\texcept: pass", "metadata": "root.Settings.__init__", "header": "['class', 'Settings', '(', ')', ':', '___EOS___']", "index": 6 } ]
[ { "span": "except: ", "start_line": 34, "start_column": 2, "end_line": 34, "end_column": 9 }, { "span": "except: ", "start_line": 36, "start_column": 2, "end_line": 36, "end_column": 9 }, { "span": "except: ", "start_line": 38, "start_column": 2, "end_line": 38, "end_column": 9 }, { "span": "except: ", "start_line": 41, "start_column": 2, "end_line": 41, "end_column": 9 }, { "span": "except: ", "start_line": 43, "start_column": 2, "end_line": 43, "end_column": 9 }, { "span": "except: ", "start_line": 46, "start_column": 2, "end_line": 46, "end_column": 9 }, { "span": "except: ", "start_line": 48, "start_column": 2, "end_line": 48, "end_column": 9 }, { "span": "except: ", "start_line": 50, "start_column": 2, "end_line": 50, "end_column": 9 }, { "span": "except: ", "start_line": 52, "start_column": 2, "end_line": 52, "end_column": 9 }, { "span": "except: ", "start_line": 55, "start_column": 2, "end_line": 55, "end_column": 9 }, { "span": "except: ", "start_line": 57, "start_column": 2, "end_line": 57, "end_column": 9 }, { "span": "except: ", "start_line": 59, "start_column": 2, "end_line": 59, "end_column": 9 }, { "span": "except: ", "start_line": 61, "start_column": 2, "end_line": 61, "end_column": 9 }, { "span": "except: ", "start_line": 63, "start_column": 2, "end_line": 63, "end_column": 9 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Settings_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Set", " ", "defaults_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "self_", "._", "scan", "Mode", "\\u", "LE_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "scan", "Mode", "\\u", "Disc", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "scan", "Mode", "\\u", "Non", "Disc", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "read", "Time", "out", "\\u", "Disc", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "read", "Time", "out", "\\u", "Non", "Disc", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "base", "Server", "\\u", "URL_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "base", "Server", "\\u", "Timeout_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "base", "Server", "\\u", "Rec", "ache_", "=_", "60_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "base", "Server", "\\u", "Reader_", "=_", "\"", "Un", "know", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "logg", "ing", "\\u", "File_", "=_", "\"", "ves", "tig", "o", ".", "log", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logg", "ing", "\\u", "Max", "Size_", "=_", "1024_", "*_", "1024_", "#", " ", "1", "MB_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logg", "ing", "\\u", "File", "Count_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logg", "ing", "\\u", "Us", "e", "Log_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logg", "ing", "\\u", "STDOUT_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "isfile_", "(_", "\"", "ves", "tig", "o", ".", "ini", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "\"", "Error", " ", "readi", "ng", " ", "configura", "tion", " ", "file", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Config_", "=_", "Config", "Parser_", "._", "Config", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Config_", "._", "read_", "(_", "\"", "ves", "tig", "o", ".", "ini", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "self_", "._", "scan", "Mode", "\\u", "LE_", "=_", "Config_", "._", "getboolean_", "(_", "\"", "Sca", "n", " ", "Mode", "s", "\"_", ",_", "\"", "le", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "self_", "._", "scan", "Mode", "\\u", "Disc", "_", "=_", "Config_", "._", "getboolean_", "(_", "\"", "Sca", "n", " ", "Mode", "s", "\"_", ",_", "\"", "discove", "rab", "le", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "self_", "._", "scan", "Mode", "\\u", "Non", "Disc", "_", "=_", "Config_", "._", "getboolean_", "(_", "\"", "Sca", "n", " ", "Mode", "s", "\"_", ",_", "\"", "nond", "isco", "vera", "ble", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "self_", "._", "read", "Time", "out", "\\u", "Disc", "_", "=_", "Config_", "._", "get_", "(_", "\"", "Read", " ", "Time", "out", "\"_", ",_", "\"", "discove", "rab", "le", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "self_", "._", "read", "Time", "out", "\\u", "Non", "Disc", "_", "=_", "Config_", "._", "get_", "(_", "\"", "Read", " ", "Time", "out", "\"_", ",_", "\"", "nond", "isco", "vera", "ble", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "self_", "._", "base", "Server", "\\u", "URL_", "=_", "Config_", "._", "get_", "(_", "\"", "Base", " ", "Server", "\"_", ",_", "\"", "url", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "self_", "._", "base", "Server", "\\u", "Timeout_", "=_", "Config_", "._", "get_", "(_", "\"", "Base", " ", "Server", "\"_", ",_", "\"", "timeo", "ut", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "self_", "._", "base", "Server", "\\u", "Rec", "ache_", "=_", "Config_", "._", "get_", "(_", "\"", "Base", " ", "Server", "\"_", ",_", "\"", "reca", "che", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "self_", "._", "base", "Server", "\\u", "Reader_", "=_", "Config_", "._", "get_", "(_", "\"", "Base", " ", "Server", "\"_", ",_", "\"", "reader", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "self_", "._", "logg", "ing", "\\u", "File_", "=_", "Config_", "._", "get_", "(_", "\"", "Log", "ging", "\"_", ",_", "\"", "file", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "self_", "._", "logg", "ing", "\\u", "Max", "Size_", "=_", "Config_", "._", "get_", "(_", "\"", "Log", "ging", "\"_", ",_", "\"", "maxs", "ize", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "self_", "._", "logg", "ing", "\\u", "File", "Count_", "=_", "Config_", "._", "get_", "(_", "\"", "Log", "ging", "\"_", ",_", "\"", "fileco", "unt", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "self_", "._", "logg", "ing", "\\u", "Us", "e", "Log_", "=_", "Config_", "._", "getboolean_", "(_", "\"", "Log", "ging", "\"_", ",_", "\"", "usel", "og", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "self_", "._", "logg", "ing", "\\u", "STDOUT_", "=_", "Config_", "._", "getboolean_", "(_", "\"", "Log", "ging", "\"_", ",_", "\"", "stdout", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2 ]
Unused import
fp7-ofelia/ocf/vt_manager/src/python/vt_manager/controller/drivers/VTDriver.py
[ { "content": "from vt_manager.communication.utils.XmlHelper import XmlHelper\nimport os\nimport sys\nfrom vt_manager.models import *\nfrom vt_manager.controller import *\nfrom vt_manager.communication.utils import *\nfrom vt_manager.utils.ServiceThread import *\nimport xmlrpclib, threading, logging, copy\nfrom django.conf import settings\nfrom django import forms\n#from vt_manager.settings.settingsLoader import settings.ROOT_USERNAME, settings.ROOT_PASSWORD, settings.VTAM_IP,settings.VTAM_PORT\nfrom vt_manager.utils.HttpUtils import HttpUtils\nfrom django.db.models.query import QuerySet\nfrom vt_manager.models.VirtualMachine import VirtualMachine\nfrom vt_manager.controller.actions.ActionController import ActionController\nfrom vt_manager.utils.ServiceThread import *\nfrom django.core.exceptions import ValidationError\nfrom vt_manager.utils.HttpUtils import HttpUtils\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class VTDriver():\n\n\n\tCONTROLLER_TYPE_XEN = \"xen\"\n\t__possibleVirtTechs = [CONTROLLER_TYPE_XEN]\n\n#\tServerClass = None\n#\tVMclass = None\n\n\n\n\n\n\t\n\n\n\n\n\n\t\t\n\n\n\t\n\n\n\n\t\n\n\n\n#\t@staticmethod\n#\tdef propagateAction(vmId, serverUUID, action):\n#\t\ttry:\n#\t\t\tfrom vt_manager.controller.dispatchers.ProvisioningDispatcher import ProvisioningDispatcher\n#\t\t\trspec = XmlHelper.getSimpleActionSpecificQuery(action, serverUUID)\n#\t\t\t#MARC XXX\n#\t\t\t#Translator.PopulateNewAction(rspec.query.provisioning.action[0], VTDriver.getVMbyId(vmId))\n#\t\t\tProvisioningDispatcher.processProvisioning(rspec.query.provisioning)\n#\t\texcept Exception as e:\n#\t\t\tlogging.error(e)\n\t\t\t\n\n", "metadata": "root.VTDriver", "header": "['module', '___EOS___']", "index": 19 }, { "content": "\t@staticmethod\n\tdef getDriver(virtType):\n\t\tfrom vt_manager.controller.drivers.XenDriver import XenDriver\n\t\tif virtType == VTDriver.CONTROLLER_TYPE_XEN:\n\t\t\treturn XenDriver.getInstance()", "metadata": "root.VTDriver.getDriver", "header": "['class', 'VTDriver', '(', ')', ':', '___EOS___']", "index": 29 }, { "content": "\t@staticmethod\n\tdef getAllDrivers():\n\t\tfrom vt_manager.controller.drivers.XenDriver import XenDriver\n\n\t\tdrivers = []\t\n\t\tfor vt in Driver.__possibleVirtTechs:\n\t\t\tdrivers.append(Driver.getDriver(vt))\n\t\treturn drivers", "metadata": "root.VTDriver.getAllDrivers", "header": "['class', 'VTDriver', '(', ')', ':', '___EOS___']", "index": 35 }, { "content": "\t@staticmethod\n\tdef getAllServers():\n\t\tfrom vt_manager.models.VTServer import VTServer\n\t\tservers = VTServer.objects.all()\n\t\tserversChild = []\n\t\tfor server in servers:\n\t\t\tserver = server.getChildObject()\n\t\t\tserversChild.append(server)\n\t\treturn serversChild", "metadata": "root.VTDriver.getAllServers", "header": "['class', 'VTDriver', '(', ')', ':', '___EOS___']", "index": 44 }, { "content": "\t@staticmethod\n\tdef createServerFromPOST(request, instance):\n\t\tfrom vt_manager.models.VTServer import VTServer\n\t\tcontroller = VTDriver.getDriver(HttpUtils.getFieldInPost(request,VTServer,\"virtTech\"))\n\t\treturn controller.createOrUpdateServerFromPOST(request, instance)\t\t", "metadata": "root.VTDriver.createServerFromPOST", "header": "['class', 'VTDriver', '(', ')', ':', '___EOS___']", "index": 55 }, { "content": "\t@staticmethod\n\tdef crudServerFromInstance(instance):\n # Password check. Ping is directly checked in the VTServer model\n s = xmlrpclib.Server(instance.agentURL)\n try:\n s.pingAuth(\"ping\",instance.agentPassword)\n except:\n raise forms.ValidationError(\"Could not connect to server: password mismatch\")\n\t\tcontroller = VTDriver.getDriver(instance.getVirtTech())\n\t\treturn controller.crudServerFromInstance(instance)", "metadata": "root.VTDriver.crudServerFromInstance", "header": "['class', 'VTDriver', '(', ')', ':', '___EOS___']", "index": 62 }, { "content": "\t@staticmethod\n\tdef setMgmtBridge(request, server):\n\t\tname = HttpUtils.getFieldInPost(request, \"mgmtBridge-name\")\n\t\tmac = HttpUtils.getFieldInPost(request, \"mgmtBridge-mac\")\n\t\tserver.setMgmtBridge(name, mac)", "metadata": "root.VTDriver.setMgmtBridge", "header": "['class', 'VTDriver', '(', ')', ':', '___EOS___']", "index": 73 }, { "content": "\t@staticmethod\n\tdef crudDataBridgeFromInstance(server,ifaces, ifacesToDelete):\n\t\tserverIfaces = server.getNetworkInterfaces().filter(isMgmt = False)\n\t\tfor newIface in ifaces:\n\t\t\tif newIface.id == None:# or not serverIfaces.filter(id = newIface.id):\n\t\t\t\tserver.addDataBridge(newIface.getName(),\"\",newIface.getSwitchID(),newIface.getPort())\n\t\t\telse:\n\t\t\t\tserver.updateDataBridge(newIface)\n\t\tfor id in ifacesToDelete:\n\t\t\tif id != '':\n\t\t\t\ttry:\n\t\t\t\t\tserver.deleteDataBridge(serverIfaces.get(id=id))\n\t\t\t\texcept Exception as e:\n\t\t\t\t\traise ValidationError(str(e))", "metadata": "root.VTDriver.crudDataBridgeFromInstance", "header": "['class', 'VTDriver', '(', ')', ':', '___EOS___']", "index": 79 }, { "content": "\t@staticmethod\n\tdef getServerById(id):\n\t\tfrom vt_manager.models.VTServer import VTServer\n\t\ttry:\n\t\t\treturn VTServer.objects.get(id=id).getChildObject()\n\t\texcept:\n\t\t\traise Exception(\"Server does not exist or id not unique\")", "metadata": "root.VTDriver.getServerById", "header": "['class', 'VTDriver', '(', ')', ':', '___EOS___']", "index": 94 }, { "content": "\t@staticmethod\n\tdef getServerByUUID(uuid):\n\t\ttry:\n\t\t\tfrom vt_manager.models.VTServer import VTServer\n\t\t\treturn VTServer.objects.get(uuid=uuid).getChildObject()\n\t\texcept:\n\t\t\traise Exception(\"Server does not exist or id not unique\")", "metadata": "root.VTDriver.getServerByUUID", "header": "['class', 'VTDriver', '(', ')', ':', '___EOS___']", "index": 102 }, { "content": "\t@staticmethod\n\tdef getVMsInServer(server):\n\t\ttry:\n\t\t\treturn server.vms.all()\n\t\texcept:\n\t\t\traise Exception(\"Could not recover server VMs\")", "metadata": "root.VTDriver.getVMsInServer", "header": "['class', 'VTDriver', '(', ')', ':', '___EOS___']", "index": 110 }, { "content": "\t@staticmethod\n\tdef getInstance():\n\t\traise Exception(\"Driver Class cannot be instantiated\")", "metadata": "root.VTDriver.getInstance", "header": "['class', 'VTDriver', '(', ')', ':', '___EOS___']", "index": 117 }, { "content": "\t@staticmethod\t\n\tdef getVMbyUUID(uuid):\n\t\ttry:\n\t\t\treturn VirtualMachine.objects.get(uuid = uuid).getChildObject()\n\t\texcept:\n\t\t\traise", "metadata": "root.VTDriver.getVMbyUUID", "header": "['class', 'VTDriver', '(', ')', ':', '___EOS___']", "index": 121 }, { "content": "\t@staticmethod\n\tdef getVMbyId(id):\n\t\ttry:\n\t\t\treturn VirtualMachine.objects.get(id = id).getChildObject()\n\t\texcept:\n\t\t\traise", "metadata": "root.VTDriver.getVMbyId", "header": "['class', 'VTDriver', '(', ')', ':', '___EOS___']", "index": 128 }, { "content": "\tdef deleteVM():\n\t\traise Exception(\"Method not callable for Driver Class\")", "metadata": "root.VTDriver.deleteVM", "header": "['class', 'VTDriver', '(', ')', ':', '___EOS___']", "index": 135 }, { "content": "\tdef getServerAndCreateVM(): \n\t\traise Exception(\"Method not callable for Driver Class\")", "metadata": "root.VTDriver.getServerAndCreateVM", "header": "['class', 'VTDriver', '(', ')', ':', '___EOS___']", "index": 138 }, { "content": "\tdef getServers(self):\n\t\treturn self.ServerClass.objects.all()", "metadata": "root.VTDriver.getServers", "header": "['class', 'VTDriver', '(', ')', ':', '___EOS___']", "index": 142 }, { "content": "\t@staticmethod\n\tdef deleteServer(server):\t\n\t\tserver.destroy()", "metadata": "root.VTDriver.deleteServer", "header": "['class', 'VTDriver', '(', ')', ':', '___EOS___']", "index": 145 }, { "content": "\t@staticmethod\n\tdef manageEthernetRanges(request, server, totalMacRanges):\n\n\t\tjustUnsubscribed = []\n\t\tfor macRange in server.getSubscribedMacRangesNoGlobal():\n\t\t\ttry:\n\t\t\t\trequest.POST['subscribe_'+str(macRange.id)]\n\t\t\texcept:\n\t\t\t\tserver.unsubscribeToMacRange(macRange)\n\t\t\t\tjustUnsubscribed.append(macRange)\n\n\t\tfor macRange in totalMacRanges:\n\t\t\tif macRange not in (server.getSubscribedMacRangesNoGlobal() or justUnsubscribed):\n\t\t\t\ttry:\n\t\t\t\t\trequest.POST['subscribe_'+str(macRange.id)]\n\t\t\t\t\tserver.subscribeToMacRange(macRange)\n\t\t\t\texcept:\n\t\t\t\t\tpass", "metadata": "root.VTDriver.manageEthernetRanges", "header": "['class', 'VTDriver', '(', ')', ':', '___EOS___']", "index": 160 }, { "content": "\t@staticmethod\n\tdef manageIp4Ranges(request, server, totalIpRanges):\n\n\t\tjustUnsubscribed = []\n\t\tfor ipRange in server.getSubscribedIp4RangesNoGlobal():\n\t\t\t#if not ipRange.getIsGlobal():\n\t\t\ttry:\n\t\t\t\trequest.POST['subscribe_'+str(ipRange.id)]\n\t\t\texcept:\n\t\t\t\tserver.unsubscribeToIp4Range(ipRange)\n\t\t\t\tjustUnsubscribed.append(ipRange)\n\n\t\tfor ipRange in totalIpRanges:\n\t\t\tif ipRange not in (server.getSubscribedIp4RangesNoGlobal() or justUnsubscribed):\n\t\t\t\ttry:\n\t\t\t\t\trequest.POST['subscribe_'+str(ipRange.id)]\n\t\t\t\t\tserver.subscribeToIp4Range(ipRange)\n\t\t\t\texcept Exception as e:\n\t\t\t\t\tpass", "metadata": "root.VTDriver.manageIp4Ranges", "header": "['class', 'VTDriver', '(', ')', ':', '___EOS___']", "index": 179 }, { "content": "\t@staticmethod\n\tdef PropagateActionToProvisioningDispatcher(vm_id, serverUUID, action):\n\t\tfrom vt_manager.communication.utils.XmlHelper import XmlHelper\n\t\tfrom vt_manager.controller.dispatchers.xmlrpc.DispatcherLauncher import DispatcherLauncher\n\t\tvm = VirtualMachine.objects.get(id=vm_id).getChildObject()\n\t\trspec = XmlHelper.getSimpleActionSpecificQuery(action, serverUUID)\n\t\tActionController.PopulateNewActionWithVM(rspec.query.provisioning.action[0], vm)\n\t\tServiceThread.startMethodInNewThread(DispatcherLauncher.processXmlQuery, rspec)", "metadata": "root.VTDriver.PropagateActionToProvisioningDispatcher", "header": "['class', 'VTDriver', '(', ')', ':', '___EOS___']", "index": 199 } ]
[ { "span": "from vt_manager.communication.utils.XmlHelper import XmlHelper", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 62 }, { "span": "import os", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 9 }, { "span": "import sys", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 10 }, { "span": "import xmlrpclib, threading, logging, copy", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 42 }, { "span": "from django.conf import settings", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 32 }, { "span": "from django.db.models.query import QuerySet", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 43 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "utils_", "._", "Xm", "l", "Helper_", "import_", "Xm", "l", "Helper_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "models_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "controller_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "utils_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "utils_", "._", "Service", "Thread_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "xmlrpclib_", ",_", "threading_", ",_", "logging_", ",_", "copy_", "\\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", " ", "vt", "\\u", "manage", "r", ".", "settings", ".", "settings", "Load", "er", " ", "import", " ", "settings", ".", "ROO", "T", "\\u", "USER", "NAME", ",", " ", "settings", ".", "ROO", "T", "\\u", "PASS", "WORD", ",", " ", "settings", ".", "VT", "AM", "\\u", "IP", ",", "settings", ".", "VT", "AM", "\\u", "PORT_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "utils_", "._", "Http", "Utils_", "import_", "Http", "Utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "query_", "import_", "Query", "Set_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "models_", "._", "Virt", "ual", "Machine_", "import_", "Virt", "ual", "Machine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "controller_", "._", "actions_", "._", "Action", "Controller_", "import_", "Action", "Controller_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "utils_", "._", "Service", "Thread_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "exceptions_", "import_", "Validat", "ion", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "utils_", "._", "Http", "Utils_", "import_", "Http", "Utils_", "\\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_", "VT", "Driver_", "(_", ")_", ":_", "\\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", "_", "CONTROLLER", "\\u", "TYPE", "\\u", "XE", "N_", "=_", "\"", "xen", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "possib", "le", "Virt", "Te", "chs", "_", "=_", "[_", "CONTROLLER", "\\u", "TYPE", "\\u", "XE", "N_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "Server", "Class", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "VM", "class", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "@", "staticmethod_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "def", " ", "propagate", "Action", "(", "vm", "Id", ",", " ", "server", "UU", "ID", ",", " ", "action", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t\t\t", "from", " ", "vt", "\\u", "manage", "r", ".", "controlle", "r", ".", "dispatcher", "s", ".", "Provision", "ing", "Dispatcher", " ", "import", " ", "Provision", "ing", "Dispatcher_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t\t\t", "rsp", "ec", " ", "=", " ", "Xm", "l", "Help", "er", ".", "get", "Simple", "Action", "Specifi", "c", "Query", "(", "action", ",", " ", "server", "UU", "ID", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t\t\t", "#", "MARC", " ", "XX", "X_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t\t\t", "#", "Translat", "or", ".", "Populate", "New", "Action", "(", "rsp", "ec", ".", "query", ".", "provision", "ing", ".", "action", "[", "0", "],", " ", "VT", "Drive", "r", ".", "get", "VM", "by", "Id", "(", "vm", "Id", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t\t\t", "Provision", "ing", "Dispatcher", ".", "process", "Provision", "ing", "(", "rsp", "ec", ".", "query", ".", "provision", "ing", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "except", " ", "Except", "ion", " ", "as", " ", "e", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t\t\t", "logg", "ing", ".", "error", "(", "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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "VT", "Driver_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "Driver_", "(_", "virt", "Type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "from_", "vt", "\\u", "manager_", "._", "controller_", "._", "drivers_", "._", "Xen", "Driver_", "import_", "Xen", "Driver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "virt", "Type_", "==_", "VT", "Driver_", "._", "CONTROLLER", "\\u", "TYPE", "\\u", "XE", "N_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "Xen", "Driver_", "._", "get", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VT", "Driver_", "(_", ")_", ":_", "\\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_", "get", "All", "Drive", "rs_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "from_", "vt", "\\u", "manager_", "._", "controller_", "._", "drivers_", "._", "Xen", "Driver_", "import_", "Xen", "Driver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "drivers_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "vt_", "in_", "Driver_", "._", "\\u\\u", "possib", "le", "Virt", "Te", "chs", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "drivers_", "._", "append_", "(_", "Driver_", "._", "get", "Driver_", "(_", "vt_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "drivers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VT", "Driver_", "(_", ")_", ":_", "\\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", "All", "Server", "s_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "from_", "vt", "\\u", "manager_", "._", "models_", "._", "VT", "Server_", "import_", "VT", "Server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "servers_", "=_", "VT", "Server_", "._", "objects_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "server", "s", "Child_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "server_", "in_", "servers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "server_", "=_", "server_", "._", "get", "Chil", "d", "Object_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "server", "s", "Child_", "._", "append_", "(_", "server_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "server", "s", "Child_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VT", "Driver_", "(_", ")_", ":_", "\\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_", "create", "Server", "Fro", "m", "POST_", "(_", "request_", ",_", "instance_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "from_", "vt", "\\u", "manager_", "._", "models_", "._", "VT", "Server_", "import_", "VT", "Server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "controller_", "=_", "VT", "Driver_", "._", "get", "Driver_", "(_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "VT", "Server_", ",_", "\"", "virt", "Te", "ch", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "controller_", "._", "create", "Or", "Update", "Server", "Fro", "m", "POST_", "(_", "request_", ",_", "instance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VT", "Driver_", "(_", ")_", ":_", "\\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_", "crud", "Server", "Fro", "m", "Instance_", "(_", "instance_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Passw", "ord", " ", "check", ".", " ", "Ping", " ", "is", " ", "direct", "ly", " ", "checke", "d", " ", "in", " ", "the", " ", "VT", "Server", " ", "model_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "xmlrpclib_", "._", "Server_", "(_", "instance_", "._", "agent", "URL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "s_", "._", "ping", "Auth_", "(_", "\"", "ping", "\"_", ",_", "instance_", "._", "agent", "Password_", ")_", "\\u\\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_", "forms_", "._", "Validat", "ion", "Error_", "(_", "\"", "Cou", "ld", " ", "not", " ", "connect", " ", "to", " ", "server", ":", " ", "password", " ", "mism", "atch", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "controller_", "=_", "VT", "Driver_", "._", "get", "Driver_", "(_", "instance_", "._", "get", "Virt", "Te", "ch_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "controller_", "._", "crud", "Server", "Fro", "m", "Instance_", "(_", "instance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VT", "Driver_", "(_", ")_", ":_", "\\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_", "set", "Mgmt", "Bridge", "_", "(_", "request_", ",_", "server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "name_", "=_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "\"", "mg", "mt", "Bridge", "-", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mac_", "=_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "\"", "mg", "mt", "Bridge", "-", "mac", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "server_", "._", "set", "Mgmt", "Bridge", "_", "(_", "name_", ",_", "mac_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VT", "Driver_", "(_", ")_", ":_", "\\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_", "crud", "Data", "Bridge", "Fro", "m", "Instance_", "(_", "server_", ",_", "ifaces", "_", ",_", "ifaces", "To", "Delete_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "server", "Iface", "s_", "=_", "server_", "._", "get", "Network", "Interface", "s_", "(_", ")_", "._", "filter_", "(_", "is", "Mgmt", "_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "new", "Iface", "_", "in_", "ifaces", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "new", "Iface", "_", "._", "id_", "==_", "None_", ":_", "#", " ", "or", " ", "not", " ", "server", "Iface", "s", ".", "filter", "(", "id", " ", "=", " ", "new", "Iface", ".", "id", "):", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "server_", "._", "add", "Data", "Bridge", "_", "(_", "new", "Iface", "_", "._", "get", "Name_", "(_", ")_", ",_", "\"\"_", ",_", "new", "Iface", "_", "._", "get", "Switch", "ID_", "(_", ")_", ",_", "new", "Iface", "_", "._", "get", "Port_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "server_", "._", "update", "Data", "Bridge", "_", "(_", "new", "Iface", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "id_", "in_", "ifaces", "To", "Delete_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "id_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "server_", "._", "delete", "Data", "Bridge", "_", "(_", "server", "Iface", "s_", "._", "get_", "(_", "id_", "=_", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "raise_", "Validat", "ion", "Error_", "(_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VT", "Driver_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "Server", "By", "Id_", "(_", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "from_", "vt", "\\u", "manager_", "._", "models_", "._", "VT", "Server_", "import_", "VT", "Server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "VT", "Server_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "id_", ")_", "._", "get", "Chil", "d", "Object_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "Exception_", "(_", "\"", "Server", " ", "doe", "s", " ", "not", " ", "exist", " ", "or", " ", "id", " ", "not", " ", "unique", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VT", "Driver_", "(_", ")_", ":_", "\\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_", "get", "Server", "By", "UUID_", "(_", "uuid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "from_", "vt", "\\u", "manager_", "._", "models_", "._", "VT", "Server_", "import_", "VT", "Server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "VT", "Server_", "._", "objects_", "._", "get_", "(_", "uuid_", "=_", "uuid_", ")_", "._", "get", "Chil", "d", "Object_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "Exception_", "(_", "\"", "Server", " ", "doe", "s", " ", "not", " ", "exist", " ", "or", " ", "id", " ", "not", " ", "unique", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VT", "Driver_", "(_", ")_", ":_", "\\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_", "get", "VM", "s", "In", "Server_", "(_", "server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "server_", "._", "vms_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "Exception_", "(_", "\"", "Cou", "ld", " ", "not", " ", "recover", " ", "server", " ", "VM", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VT", "Driver_", "(_", ")_", ":_", "\\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_", "get", "Instance_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "Exception_", "(_", "\"", "Drive", "r", " ", "Class", " ", "cann", "ot", " ", "be", " ", "instantiate", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VT", "Driver_", "(_", ")_", ":_", "\\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", "VM", "by", "UUID_", "(_", "uuid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "Virt", "ual", "Machine_", "._", "objects_", "._", "get_", "(_", "uuid_", "=_", "uuid_", ")_", "._", "get", "Chil", "d", "Object_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VT", "Driver_", "(_", ")_", ":_", "\\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_", "get", "VM", "by", "Id_", "(_", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "Virt", "ual", "Machine_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "id_", ")_", "._", "get", "Chil", "d", "Object_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VT", "Driver_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "VM_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "Exception_", "(_", "\"", "Meth", "od", " ", "not", " ", "calla", "ble", " ", "for", " ", "Drive", "r", " ", "Class", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VT", "Driver_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Server", "And", "Creat", "e", "VM_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "Exception_", "(_", "\"", "Meth", "od", " ", "not", " ", "calla", "ble", " ", "for", " ", "Drive", "r", " ", "Class", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VT", "Driver_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Server", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "return_", "self_", "._", "Server", "Class_", "._", "objects_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VT", "Driver_", "(_", ")_", ":_", "\\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_", "delete", "Server_", "(_", "server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "server_", "._", "destroy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VT", "Driver_", "(_", ")_", ":_", "\\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_", "manage", "Ether", "net", "Ranges_", "(_", "request_", ",_", "server_", ",_", "total", "Mac", "Ranges_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "just", "Unsu", "bsc", "ribe", "d_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "mac", "Range_", "in_", "server_", "._", "get", "Subscrib", "ed", "Mac", "Range", "s", "No", "Global_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "request_", "._", "POST_", "[_", "'", "subscribe", "\\u'_", "+_", "str_", "(_", "mac", "Range_", "._", "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\t", "\t\t\t_", "server_", "._", "unsubscribe", "To", "Mac", "Range_", "(_", "mac", "Range_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "just", "Unsu", "bsc", "ribe", "d_", "._", "append_", "(_", "mac", "Range_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "mac", "Range_", "in_", "total", "Mac", "Ranges_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "mac", "Range_", "not_", "in_", "(_", "server_", "._", "get", "Subscrib", "ed", "Mac", "Range", "s", "No", "Global_", "(_", ")_", "or_", "just", "Unsu", "bsc", "ribe", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "request_", "._", "POST_", "[_", "'", "subscribe", "\\u'_", "+_", "str_", "(_", "mac", "Range_", "._", "id_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "server_", "._", "subscribe", "To", "Mac", "Range_", "(_", "mac", "Range_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VT", "Driver_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "manage", "Ip", "4", "Ranges_", "(_", "request_", ",_", "server_", ",_", "total", "Ip", "Ranges_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "just", "Unsu", "bsc", "ribe", "d_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ip", "Range_", "in_", "server_", "._", "get", "Subscrib", "ed", "Ip", "4", "Range", "s", "No", "Global_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "not", " ", "ip", "Range", ".", "get", "Is", "Global", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "request_", "._", "POST_", "[_", "'", "subscribe", "\\u'_", "+_", "str_", "(_", "ip", "Range_", "._", "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\t", "\t\t\t_", "server_", "._", "unsubscribe", "To", "Ip", "4", "Range_", "(_", "ip", "Range_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "just", "Unsu", "bsc", "ribe", "d_", "._", "append_", "(_", "ip", "Range_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "ip", "Range_", "in_", "total", "Ip", "Ranges_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "ip", "Range_", "not_", "in_", "(_", "server_", "._", "get", "Subscrib", "ed", "Ip", "4", "Range", "s", "No", "Global_", "(_", ")_", "or_", "just", "Unsu", "bsc", "ribe", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "request_", "._", "POST_", "[_", "'", "subscribe", "\\u'_", "+_", "str_", "(_", "ip", "Range_", "._", "id_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "server_", "._", "subscribe", "To", "Ip", "4", "Range_", "(_", "ip", "Range_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VT", "Driver_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "Propag", "ate", "Action", "To", "Provision", "ing", "Dispatcher_", "(_", "vm", "\\u", "id_", ",_", "server", "UUID_", ",_", "action_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "utils_", "._", "Xm", "l", "Helper_", "import_", "Xm", "l", "Helper_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "controller_", "._", "dispatcher", "s_", "._", "xmlrpc", "_", "._", "Dispatcher", "Launch", "er_", "import_", "Dispatcher", "Launch", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vm_", "=_", "Virt", "ual", "Machine_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "vm", "\\u", "id_", ")_", "._", "get", "Chil", "d", "Object_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rsp", "ec_", "=_", "Xm", "l", "Helper_", "._", "get", "Simple", "Action", "Specifi", "c", "Query_", "(_", "action_", ",_", "server", "UUID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Action", "Controller_", "._", "Populate", "New", "Action", "With", "VM_", "(_", "rsp", "ec_", "._", "query_", "._", "provision", "ing_", "._", "action_", "[_", "0_", "]_", ",_", "vm_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Service", "Thread_", "._", "start", "Meth", "od", "In", "New", "Thread_", "(_", "Dispatcher", "Launch", "er_", "._", "process", "Xm", "l", "Query_", ",_", "rsp", "ec_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 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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
[ { "content": "'''\nCreated on Jul 21, 2015\n\n@author: kashefy\n'''\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom PIL import Image\nimport caffe\nfrom nideep.iow.read_img import read_img_cv2, read_img_PIL\n\nif __name__ == '__main__':\n \n caffe.set_mode_cpu()\n \n # load image, switch to BGR, subtract mean, and make dims C x H x W for Caffe\n path_img = '/home/kashefy/data/VOCdevkit/VOC2012/JPEGImagesX/2008_000015.jpg'\n \n bgr_mean = np.array((104.00698793,116.66876762,122.67891434))\n im = Image.open(path_img)\n in_ = np.array(im, dtype=np.float32)\n in_ = in_[:,:,::-1]\n print in_.shape\n print in_\n in_ -= bgr_mean\n print in_\n in_ = in_.transpose((2,0,1))\n \n in_ = read_img_PIL(path_img, mean=bgr_mean)\n \n print 'in_'\n print in_[0, 0, 0:6]\n print in_[1, 0, 0:6]\n print in_[2, 0, 0:6]\n \n in2 = read_img_cv2(path_img, mean=bgr_mean)\n print in2.shape\n #in2[0, :, :] -= 104.00698793\n #in2[1, :, :] -= 116.66876762\n #in2[2, :, :] -= 122.67891434\n \n print in2[0, 0, 0:6]\n print in2[1, 0, 0:6]\n print in2[2, 0, 0:6]\n \n print np.all(in_ == in2)\n print in_[in_ != in2]\n print in2[in_ != in2]\n return 0\n \n # load net\n path_model = '/home/kashefy/data/models/fcn_segm/fcn-32s-Pascal-context/deploy.prototxt'\n path_weights = '/home/kashefy/data/models/fcn_segm/fcn-32s-Pascal-context/fcn-32s-pascalcontext.caffemodel'\n net = caffe.Net(path_model, path_weights, caffe.TEST)\n # shape for input (data blob is N x C x H x W), set data\n net.blobs['data'].reshape(1, *in_.shape)\n net.blobs['data'].data[...] = in_ \n \n\n \n \n # run net and take argmax for prediction\n# net.forward()\n# out = net.blobs['score'].data[0].argmax(axis=0)\n# \n# \n# print 'data after fwd'\n# print net.blobs['data'].data[net.blobs['data'].data.shape[0]/2-3:net.blobs['data'].data.shape[0]/2+3,\n# net.blobs['data'].data.shape[1]/2-3:net.blobs['data'].data.shape[1]/2+3]\n# \n# print 'out'\n# print out[out.shape[0]/2-3:out.shape[0]/2+3,\n# out.shape[1]/2-3:out.shape[1]/2+3]\n# plt.imshow(out)\n# plt.show()\n \n pass", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "pass", "start_line": 76, "start_column": 4, "end_line": 76, "end_column": 8 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "'''", "\\", "10", ";", "Creat", "ed", " ", "on", " ", "Ju", "l", " ", "21", ",", " ", "201", "5", "\\", "10", ";", "\\", "10", ";", "@", "author", ":", " ", "kas", "hef", "y", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "matplotlib_", "._", "pyplot_", "as_", "plt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "PIL_", "import_", "Image_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "caffe", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nid", "eep", "_", "._", "io", "w_", "._", "read", "\\u", "img_", "import_", "read", "\\u", "img", "\\u", "cv2_", ",_", "read", "\\u", "img", "\\u", "PIL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "caffe", "_", "._", "set\\u", "mode", "\\u", "cpu_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "load", " ", "image", ",", " ", "switch", " ", "to", " ", "BG", "R", ",", " ", "subtract", " ", "mean", ",", " ", "and", " ", "make", " ", "dims", " ", "C", " ", "x", " ", "H", " ", "x", " ", "W", " ", "for", " ", "Ca", "ffe", "_", "\\u\\u\\uNL\\u\\u\\u_", "path", "\\u", "img_", "=_", "'/", "home", "/", "kas", "hef", "y", "/", "data", "/", "VOC", "dev", "kit", "/", "VOC", "2012", "/", "JP", "EG", "Image", "s", "X", "/", "2008", "\\u", "00001", "5", ".", "jp", "g", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bgr", "\\u", "mean_", "=_", "np_", "._", "array_", "(_", "(_", "104", ".00", "698", "793", "_", ",_", "116", ".6", "687", "676", "2_", ",_", "122.", "678", "914", "34_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "im_", "=_", "Image_", "._", "open_", "(_", "path", "\\u", "img_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "in\\u_", "=_", "np_", "._", "array_", "(_", "im_", ",_", "dtype_", "=_", "np_", "._", "float32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "in\\u_", "=_", "in\\u_", "[_", ":_", ",_", ":_", ",_", ":_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "in\\u_", "._", "shape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "in\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "in\\u_", "-=_", "bgr", "\\u", "mean_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "in\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "in\\u_", "=_", "in\\u_", "._", "transpose_", "(_", "(_", "2_", ",_", "0_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "in\\u_", "=_", "read", "\\u", "img", "\\u", "PIL_", "(_", "path", "\\u", "img_", ",_", "mean_", "=_", "bgr", "\\u", "mean_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "in", "\\u'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "in\\u_", "[_", "0_", ",_", "0_", ",_", "0_", ":_", "6_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "in\\u_", "[_", "1_", ",_", "0_", ",_", "0_", ":_", "6_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "in\\u_", "[_", "2_", ",_", "0_", ",_", "0_", ":_", "6_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "in", "2_", "=_", "read", "\\u", "img", "\\u", "cv2_", "(_", "path", "\\u", "img_", ",_", "mean_", "=_", "bgr", "\\u", "mean_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "in", "2_", "._", "shape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "in", "2", "[", "0", ",", " ", ":,", " ", ":]", " ", "-=", " ", "104", ".00", "698", "793", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "in", "2", "[", "1", ",", " ", ":,", " ", ":]", " ", "-=", " ", "116", ".6", "687", "676", "2_", "\\u\\u\\uNL\\u\\u\\u_", "#", "in", "2", "[", "2", ",", " ", ":,", " ", ":]", " ", "-=", " ", "122.", "678", "914", "34_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "in", "2_", "[_", "0_", ",_", "0_", ",_", "0_", ":_", "6_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "in", "2_", "[_", "1_", ",_", "0_", ",_", "0_", ":_", "6_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "in", "2_", "[_", "2_", ",_", "0_", ",_", "0_", ":_", "6_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "np_", "._", "all_", "(_", "in\\u_", "==_", "in", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "in\\u_", "[_", "in\\u_", "!=_", "in", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "in", "2_", "[_", "in\\u_", "!=_", "in", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "load", " ", "net_", "\\u\\u\\uNL\\u\\u\\u_", "path", "\\u", "model_", "=_", "'/", "home", "/", "kas", "hef", "y", "/", "data", "/", "model", "s", "/", "fcn", "\\u", "segm", "/", "fcn", "-", "32", "s", "-", "Pas", "cal", "-", "context", "/", "deploy", ".", "protot", "xt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path", "\\u", "weights_", "=_", "'/", "home", "/", "kas", "hef", "y", "/", "data", "/", "model", "s", "/", "fcn", "\\u", "segm", "/", "fcn", "-", "32", "s", "-", "Pas", "cal", "-", "context", "/", "fcn", "-", "32", "s", "-", "pasc", "alc", "onte", "xt", ".", "caffe", "model", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net_", "=_", "caffe", "_", "._", "Net_", "(_", "path", "\\u", "model_", ",_", "path", "\\u", "weights_", ",_", "caffe", "_", "._", "TEST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "shape", " ", "for", " ", "input", " ", "(", "data", " ", "blob", " ", "is", " ", "N", " ", "x", " ", "C", " ", "x", " ", "H", " ", "x", " ", "W", "),", " ", "set", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "net_", "._", "blobs_", "[_", "'", "data", "'_", "]_", "._", "reshape_", "(_", "1_", ",_", "*_", "in\\u_", "._", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net_", "._", "blobs_", "[_", "'", "data", "'_", "]_", "._", "data_", "[_", "..._", "]_", "=_", "in\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "run", " ", "net", " ", "and", " ", "take", " ", "argm", "ax", " ", "for", " ", "prediction_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "net", ".", "forward", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "out", " ", "=", " ", "net", ".", "blobs", "['", "score", "']", ".", "data", "[", "0", "].", "argm", "ax", "(", "axis", "=", "0", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "data", " ", "after", " ", "fw", "d", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "net", ".", "blobs", "['", "data", "']", ".", "data", "[", "net", ".", "blobs", "['", "data", "']", ".", "data", ".", "shape", "[", "0", "]/", "2", "-", "3", ":", "net", ".", "blobs", "['", "data", "']", ".", "data", ".", "shape", "[", "0", "]/", "2", "+", "3", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "net", ".", "blobs", "['", "data", "']", ".", "data", ".", "shape", "[", "1", "]/", "2", "-", "3", ":", "net", ".", "blobs", "['", "data", "']", ".", "data", ".", "shape", "[", "1", "]/", "2", "+", "3", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "out", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "out", "[", "out", ".", "shape", "[", "0", "]/", "2", "-", "3", ":", "out", ".", "shape", "[", "0", "]/", "2", "+", "3", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "out", ".", "shape", "[", "1", "]/", "2", "-", "3", ":", "out", ".", "shape", "[", "1", "]/", "2", "+", "3", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ",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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0 ]
Imprecise assert
MongoEngine/mongoengine/tests/queryset/transform.py
[ { "content": " def test_query_field_name(self):\n \"\"\"Ensure that the correct field name is used when querying.\n \"\"\"\n class Comment(EmbeddedDocument):\n content = StringField(db_field='commentContent')\n\n class BlogPost(Document):\n title = StringField(db_field='postTitle')\n comments = ListField(EmbeddedDocumentField(Comment),\n db_field='postComments')\n\n BlogPost.drop_collection()\n\n data = {'title': 'Post 1', 'comments': [Comment(content='test')]}\n post = BlogPost(**data)\n post.save()\n\n self.assertTrue('postTitle' in\n BlogPost.objects(title=data['title'])._query)\n self.assertFalse('title' in\n BlogPost.objects(title=data['title'])._query)\n self.assertEqual(BlogPost.objects(title=data['title']).count(), 1)\n\n self.assertTrue('_id' in BlogPost.objects(pk=post.id)._query)\n self.assertEqual(BlogPost.objects(pk=post.id).count(), 1)\n\n self.assertTrue('postComments.commentContent' in\n BlogPost.objects(comments__content='test')._query)\n self.assertEqual(BlogPost.objects(comments__content='test').count(), 1)\n\n BlogPost.drop_collection()", "metadata": "root.TransformTest.test_query_field_name", "header": "['class', 'TransformTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 58 }, { "content": " def test_query_pk_field_name(self):\n \"\"\"Ensure that the correct \"primary key\" field name is used when\n querying\n \"\"\"\n class BlogPost(Document):\n title = StringField(primary_key=True, db_field='postTitle')\n\n BlogPost.drop_collection()\n\n data = {'title': 'Post 1'}\n post = BlogPost(**data)\n post.save()\n\n self.assertTrue('_id' in BlogPost.objects(pk=data['title'])._query)\n self.assertTrue('_id' in BlogPost.objects(title=data['title'])._query)\n self.assertEqual(BlogPost.objects(pk=data['title']).count(), 1)\n\n BlogPost.drop_collection()", "metadata": "root.TransformTest.test_query_pk_field_name", "header": "['class', 'TransformTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 90 } ]
[ { "span": "self.assertTrue('postTitle' in\n BlogPost.objects(title=data['title'])._query)", "start_line": 75, "start_column": 8, "end_line": 76, "end_column": 69 }, { "span": "self.assertFalse('title' in\n BlogPost.objects(title=data['title'])._query)", "start_line": 77, "start_column": 8, "end_line": 78, "end_column": 70 }, { "span": "self.assertTrue('_id' in BlogPost.objects(pk=post.id)._query)", "start_line": 81, "start_column": 8, "end_line": 81, "end_column": 69 }, { "span": "self.assertTrue('postComments.commentContent' in\n BlogPost.objects(comments__content='test')._query)", "start_line": 84, "start_column": 8, "end_line": 85, "end_column": 74 }, { "span": "self.assertTrue('_id' in BlogPost.objects(pk=data['title'])._query)", "start_line": 103, "start_column": 8, "end_line": 103, "end_column": 75 }, { "span": "self.assertTrue('_id' in BlogPost.objects(title=data['title'])._query)", "start_line": 104, "start_column": 8, "end_line": 104, "end_column": 78 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Transform", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "query", "\\u", "field", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Ensur", "e", " ", "tha", "t", " ", "the", " ", "correct", " ", "field", " ", "name", " ", "is", " ", "used", " ", "whe", "n", " ", "query", "ing", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Comment_", "(_", "Emb", "edd", "ed", "Document_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", "=_", "String", "Field_", "(_", "db", "\\u", "field_", "=_", "'", "comment", "Conten", "t", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Blog", "Post_", "(_", "Document_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "title_", "=_", "String", "Field_", "(_", "db", "\\u", "field_", "=_", "'", "post", "Tit", "le", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "comments_", "=_", "List", "Field_", "(_", "Emb", "edd", "ed", "Document", "Field_", "(_", "Comment_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "field_", "=_", "'", "post", "Comme", "nts", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Blog", "Post_", "._", "drop", "\\u", "collection_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "title", "'_", ":_", "'", "Post", " ", "1", "'_", ",_", "'", "comment", "s", "'_", ":_", "[_", "Comment_", "(_", "content_", "=_", "'", "test", "'_", ")_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "=_", "Blog", "Post_", "(_", "**_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "post", "Tit", "le", "'_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "Blog", "Post_", "._", "objects_", "(_", "title_", "=_", "data_", "[_", "'", "title", "'_", "]_", ")_", "._", "\\u", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "title", "'_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "Blog", "Post_", "._", "objects_", "(_", "title_", "=_", "data_", "[_", "'", "title", "'_", "]_", ")_", "._", "\\u", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "Blog", "Post_", "._", "objects_", "(_", "title_", "=_", "data_", "[_", "'", "title", "'_", "]_", ")_", "._", "count_", "(_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'\\u", "id", "'_", "in_", "Blog", "Post_", "._", "objects_", "(_", "pk_", "=_", "post_", "._", "id_", ")_", "._", "\\u", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "Blog", "Post_", "._", "objects_", "(_", "pk_", "=_", "post_", "._", "id_", ")_", "._", "count_", "(_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "post", "Comme", "nts", ".", "comment", "Conten", "t", "'_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "Blog", "Post_", "._", "objects_", "(_", "comment", "s", "\\u\\u", "content_", "=_", "'", "test", "'_", ")_", "._", "\\u", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "Blog", "Post_", "._", "objects_", "(_", "comment", "s", "\\u\\u", "content_", "=_", "'", "test", "'_", ")_", "._", "count_", "(_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Blog", "Post_", "._", "drop", "\\u", "collection_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Transform", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "query", "\\u", "pk", "\\u", "field", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Ensur", "e", " ", "tha", "t", " ", "the", " ", "correct", " ", "\"", "primary", " ", "key", "\"", " ", "field", " ", "name", " ", "is", " ", "used", " ", "whe", "n", "\\", "10", ";", " ", " ", " ", " ", "query", "ing", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Blog", "Post_", "(_", "Document_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "title_", "=_", "String", "Field_", "(_", "primary", "\\u", "key_", "=_", "True_", ",_", "db", "\\u", "field_", "=_", "'", "post", "Tit", "le", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Blog", "Post_", "._", "drop", "\\u", "collection_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "title", "'_", ":_", "'", "Post", " ", "1", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "=_", "Blog", "Post_", "(_", "**_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'\\u", "id", "'_", "in_", "Blog", "Post_", "._", "objects_", "(_", "pk_", "=_", "data_", "[_", "'", "title", "'_", "]_", ")_", "._", "\\u", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'\\u", "id", "'_", "in_", "Blog", "Post_", "._", "objects_", "(_", "title_", "=_", "data_", "[_", "'", "title", "'_", "]_", ")_", "._", "\\u", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "Blog", "Post_", "._", "objects_", "(_", "pk_", "=_", "data_", "[_", "'", "title", "'_", "]_", ")_", "._", "count_", "(_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Blog", "Post_", "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-test-utils/test_utils/crawler/plugins/__init__.py
[ { "content": "from base import Plugin\n\nfrom time_plugin import Time\nfrom pdb import Pdb\nfrom urlconf import URLConf\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from base import Plugin", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 23 }, { "span": "from time_plugin import Time", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 28 }, { "span": "from urlconf import URLConf", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 27 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "base_", "import_", "Plugin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "time", "\\u", "plugin_", "import_", "Time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pdb_", "import_", "Pd", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "url", "conf_", "import_", "URL", "Conf_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1 ]
Unused local variable
VisTrails/VisTrails/vistrails/gui/configuration.py
[ { "content": " def __init__(self, key, field, callback_f, parent=None):\n QtGui.QComboBox.__init__(self, parent)\n QConfigurationWidgetItem.__init__(self, key, field, callback_f)\n\n inv_remap = None\n options = self.get_widget_options()\n if \"allowed_values\" in options:\n values = options[\"allowed_values\"]\n if \"remap\" in options:\n remap = options[\"remap\"]\n inv_remap = dict((v, k) for (k, v) in remap.iteritems())\n entries = [remap[v] for v in values]\n else:\n entries = values\n for entry in entries:\n self.addItem(entry)\n\n self.currentIndexChanged[int].connect(self.value_changed)", "metadata": "root.QConfigurationComboBox.__init__", "header": "['class', 'QConfigurationComboBox', '(', 'QtGui', '.', 'QComboBox', ',', 'QConfigurationWidgetItem', ')', ':', '___EOS___']", "index": 430 }, { "content": " def add_field(self, base_layout, field, category=\"\", startup_only=False,\n prefix=\"\", indent=0):\n label_widget = QtGui.QWidget()\n label_layout = QtGui.QHBoxLayout()\n label_layout.setMargin(0)\n label_layout.setSpacing(5)\n label_widget.setLayout(label_layout)\n\n config_key = \"%s%s\" % (prefix, field.name)\n if self._temp_configuration.is_unset(config_key):\n config_val = None\n else:\n config_val = self._temp_configuration.get_deep_value(config_key)\n if self._configuration.is_unset(config_key):\n perm_config_val = None\n else:\n perm_config_val = self._configuration.get_deep_value(config_key)\n\n icon = self.style().standardIcon(QtGui.QStyle.SP_MessageBoxWarning)\n label = QtGui.QLabel()\n label.setPixmap(icon.pixmap(14,14))\n label.setToolTip(\"This option has been changed for this session\")\n label_layout.addWidget(label, 0, QtCore.Qt.AlignCenter)\n \n space = 0\n if not startup_only and config_val == perm_config_val:\n space = (label.sizeHint().width() +\n label_layout.spacing() * (indent + 1))\n label.hide()\n elif indent > 0:\n space = label_layout.spacing() * indent\n\n if space > 0:\n spacer = QtGui.QSpacerItem(space, label.sizeHint().height())\n label_layout.insertSpacerItem(0, spacer)\n\n config_desc = find_simpledoc(config_key)\n widget_type = field.widget_type\n if widget_type is None:\n if field.val_type == bool:\n widget_type = \"checkbox\"\n elif field.val_type == ConfigPath:\n widget_type = \"pathedit\"\n else:\n widget_type = \"lineedit\"\n\n if widget_type == \"combo\":\n widget = QConfigurationComboBox(config_key, field,\n self.field_changed)\n elif widget_type == \"lineedit\":\n widget = QConfigurationLineEdit(config_key, field,\n self.field_changed)\n elif widget_type == \"pathedit\":\n widget = QConfigurationPathEdit(config_key, field,\n self.field_changed)\n elif widget_type == \"thumbnailcache\":\n widget = QConfigurationThumbnailCache(config_key, field,\n self.field_changed)\n elif widget_type == \"linuxext\":\n widget = QConfigurationLinuxHandler(config_key, field,\n self.field_changed)\n else:\n config_val = bool(config_val)\n widget = QConfigurationCheckBox(config_key, field,\n self.field_changed)\n widget.set_value(config_val, False)\n\n label_text = widget.get_label_text()\n if not label_text and category:\n label_text = category\n if label_text:\n label = QtGui.QLabel(label_text + \":\")\n label_layout.addWidget(label)\n\n base_layout.addRow(label_widget, widget)\n self._field_layouts[config_key] = (base_layout, base_layout.rowCount())", "metadata": "root.QConfigurationPane.add_field", "header": "['class', 'QConfigurationPane', '(', 'QtGui', '.', 'QWidget', ')', ':', '___EOS___']", "index": 513 } ]
[ { "span": "inv_remap ", "start_line": 440, "start_column": 16, "end_line": 440, "end_column": 25 }, { "span": "config_desc ", "start_line": 549, "start_column": 8, "end_line": 549, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "QC", "onfi", "gur", "ation", "Comb", "o", "Box_", "(_", "Qt", "Gui_", "._", "QC", "omb", "o", "Box_", ",_", "QC", "onfi", "gur", "ation", "Wid", "get", "Item_", ")_", ":_", "\\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_", ",_", "key_", ",_", "field_", ",_", "callback", "\\u", "f_", ",_", "parent_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Qt", "Gui_", "._", "QC", "omb", "o", "Box_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "parent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "QC", "onfi", "gur", "ation", "Wid", "get", "Item_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "key_", ",_", "field_", ",_", "callback", "\\u", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "inv", "\\u", "remap", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options_", "=_", "self_", "._", "get", "\\u", "widget", "\\u", "options_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\"", "allow", "ed", "\\u", "values", "\"_", "in_", "options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "=_", "options_", "[_", "\"", "allow", "ed", "\\u", "values", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\"", "remap", "\"_", "in_", "options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "remap", "_", "=_", "options_", "[_", "\"", "remap", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inv", "\\u", "remap", "_", "=_", "dict_", "(_", "(_", "v_", ",_", "k_", ")_", "for_", "(_", "k_", ",_", "v_", ")_", "in_", "remap", "_", "._", "iteritems_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entries_", "=_", "[_", "remap", "_", "[_", "v_", "]_", "for_", "v_", "in_", "values_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entries_", "=_", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "entry_", "in_", "entries_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "Item_", "(_", "entry_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "current", "Index", "Changed_", "[_", "int_", "]_", "._", "connect_", "(_", "self_", "._", "value", "\\u", "changed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "QC", "onfi", "gur", "ation", "Pane_", "(_", "Qt", "Gui_", "._", "QW", "idge", "t_", ")_", ":_", "\\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_", "add", "\\u", "field_", "(_", "self_", ",_", "base", "\\u", "layout_", ",_", "field_", ",_", "category_", "=_", "\"\"_", ",_", "start", "up", "\\u", "only_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "prefix_", "=_", "\"\"_", ",_", "indent_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "label", "\\u", "widget_", "=_", "Qt", "Gui_", "._", "QW", "idge", "t_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "layout_", "=_", "Qt", "Gui_", "._", "Q", "HB", "ox", "Layout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "layout_", "._", "set", "Margin_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "layout_", "._", "set", "Spacing_", "(_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "widget_", "._", "set", "Layout_", "(_", "label", "\\u", "layout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "config", "\\u", "key_", "=_", "\"%", "s", "%", "s", "\"_", "%_", "(_", "prefix_", ",_", "field_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "temp", "\\u", "configuration_", "._", "is", "\\u", "unset_", "(_", "config", "\\u", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "config", "\\u", "val_", "=_", "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 ", " _", "config", "\\u", "val_", "=_", "self_", "._", "\\u", "temp", "\\u", "configuration_", "._", "get", "\\u", "deep", "\\u", "value_", "(_", "config", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "configuration_", "._", "is", "\\u", "unset_", "(_", "config", "\\u", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "perm", "\\u", "config", "\\u", "val_", "=_", "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 ", " _", "perm", "\\u", "config", "\\u", "val_", "=_", "self_", "._", "\\u", "configuration_", "._", "get", "\\u", "deep", "\\u", "value_", "(_", "config", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "icon_", "=_", "self_", "._", "style_", "(_", ")_", "._", "standard", "Icon_", "(_", "Qt", "Gui_", "._", "QS", "tyle_", "._", "SP", "\\u", "Messag", "e", "Box", "Warning_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label_", "=_", "Qt", "Gui_", "._", "QL", "abel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label_", "._", "set", "Pixmap_", "(_", "icon_", "._", "pixmap_", "(_", "14_", ",_", "14_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label_", "._", "set", "Tool", "Tip_", "(_", "\"", "Thi", "s", " ", "option", " ", "has", " ", "bee", "n", " ", "change", "d", " ", "for", " ", "this", " ", "session", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "layout_", "._", "add", "Widget_", "(_", "label_", ",_", "0_", ",_", "Qt", "Core_", "._", "Qt_", "._", "Align", "Center_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "space_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "start", "up", "\\u", "only_", "and_", "config", "\\u", "val_", "==_", "perm", "\\u", "config", "\\u", "val_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "space_", "=_", "(_", "label_", "._", "size", "Hint_", "(_", ")_", "._", "width_", "(_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "label", "\\u", "layout_", "._", "spacing_", "(_", ")_", "*_", "(_", "indent_", "+_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label_", "._", "hide_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "indent_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "space_", "=_", "label", "\\u", "layout_", "._", "spacing_", "(_", ")_", "*_", "indent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "space_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "spacer", "_", "=_", "Qt", "Gui_", "._", "QS", "pace", "r", "Item_", "(_", "space_", ",_", "label_", "._", "size", "Hint_", "(_", ")_", "._", "height_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "layout_", "._", "insert", "Spac", "er", "Item_", "(_", "0_", ",_", "spacer", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "config", "\\u", "desc_", "=_", "find", "\\u", "simple", "doc_", "(_", "config", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "widget", "\\u", "type_", "=_", "field_", "._", "widget", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "widget", "\\u", "type_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "field_", "._", "val", "\\u", "type_", "==_", "bool_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "widget", "\\u", "type_", "=_", "\"", "checkb", "ox", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "field_", "._", "val", "\\u", "type_", "==_", "Config", "Path_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "widget", "\\u", "type_", "=_", "\"", "path", "edit", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "widget", "\\u", "type_", "=_", "\"", "line", "edit", "\"_", "\\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_", "widget", "\\u", "type_", "==_", "\"", "combo", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "widget_", "=_", "QC", "onfi", "gur", "ation", "Comb", "o", "Box_", "(_", "config", "\\u", "key_", ",_", "field_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "field", "\\u", "changed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "widget", "\\u", "type_", "==_", "\"", "line", "edit", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "widget_", "=_", "QC", "onfi", "gur", "ation", "Line", "Edit_", "(_", "config", "\\u", "key_", ",_", "field_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "field", "\\u", "changed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "widget", "\\u", "type_", "==_", "\"", "path", "edit", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "widget_", "=_", "QC", "onfi", "gur", "ation", "Path", "Edit_", "(_", "config", "\\u", "key_", ",_", "field_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "field", "\\u", "changed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "widget", "\\u", "type_", "==_", "\"", "thumbnail", "cache", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "widget_", "=_", "QC", "onfi", "gur", "ation", "Thumb", "nail", "Cache_", "(_", "config", "\\u", "key_", ",_", "field_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "field", "\\u", "changed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "widget", "\\u", "type_", "==_", "\"", "linux", "ext", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "widget_", "=_", "QC", "onfi", "gur", "ation", "Lin", "ux", "Handler_", "(_", "config", "\\u", "key_", ",_", "field_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "field", "\\u", "changed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "config", "\\u", "val_", "=_", "bool_", "(_", "config", "\\u", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "widget_", "=_", "QC", "onfi", "gur", "ation", "Check", "Box_", "(_", "config", "\\u", "key_", ",_", "field_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "field", "\\u", "changed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "widget_", "._", "set\\u", "value_", "(_", "config", "\\u", "val_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "label", "\\u", "text_", "=_", "widget_", "._", "get", "\\u", "label", "\\u", "text_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "label", "\\u", "text_", "and_", "category_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "label", "\\u", "text_", "=_", "category_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "label", "\\u", "text_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "label_", "=_", "Qt", "Gui_", "._", "QL", "abel_", "(_", "label", "\\u", "text_", "+_", "\":\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "layout_", "._", "add", "Widget_", "(_", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "base", "\\u", "layout_", "._", "add", "Row_", "(_", "label", "\\u", "widget_", ",_", "widget_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "field", "\\u", "layouts", "_", "[_", "config", "\\u", "key_", "]_", "=_", "(_", "base", "\\u", "layout_", ",_", "base", "\\u", "layout_", "._", "row", "Count_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
cpfair/tapiriik/tapiriik/testing/sync.py
[ { "content": " def test_accumulate_exclusions(self):\n svcA, svcB = TestTools.create_mock_services()\n recA = TestTools.create_mock_svc_record(svcA)\n\n # regular\n s = SynchronizationTask(None)\n s._syncExclusions = {recA._id: {}}\n exc = APIExcludeActivity(\"Messag!e\", activity_id=3.14)\n s._accumulateExclusions(recA, exc)\n exclusionstore = s._syncExclusions\n self.assertTrue(\"3_14\" in exclusionstore[recA._id])\n self.assertEqual(exclusionstore[recA._id][\"3_14\"][\"Message\"], \"Messag!e\")\n self.assertEqual(exclusionstore[recA._id][\"3_14\"][\"Activity\"], None)\n self.assertEqual(exclusionstore[recA._id][\"3_14\"][\"ExternalActivityID\"], 3.14)\n self.assertEqual(exclusionstore[recA._id][\"3_14\"][\"Permanent\"], True)\n\n # updating\n act = TestTools.create_blank_activity(svcA)\n act.UID = \"3_14\" # meh\n exc = APIExcludeActivity(\"Messag!e2\", activity_id=42, permanent=False, activity=act)\n s = SynchronizationTask(None)\n s._syncExclusions = {recA._id: {}}\n s._accumulateExclusions(recA, exc)\n exclusionstore = s._syncExclusions\n self.assertTrue(\"3_14\" in exclusionstore[recA._id])\n self.assertEqual(exclusionstore[recA._id][\"3_14\"][\"Message\"], \"Messag!e2\")\n self.assertNotEqual(exclusionstore[recA._id][\"3_14\"][\"Activity\"], None) # Who knows what the string format will be down the road?\n self.assertEqual(exclusionstore[recA._id][\"3_14\"][\"ExternalActivityID\"], 42)\n self.assertEqual(exclusionstore[recA._id][\"3_14\"][\"Permanent\"], False)\n\n # multiple, retaining existing\n exc2 = APIExcludeActivity(\"INM\", activity_id=13)\n exc3 = APIExcludeActivity(\"FNIM\", activity_id=37)\n s._accumulateExclusions(recA, [exc2, exc3])\n exclusionstore = s._syncExclusions\n self.assertTrue(\"3_14\" in exclusionstore[recA._id])\n self.assertTrue(\"37\" in exclusionstore[recA._id])\n self.assertTrue(\"13\" in exclusionstore[recA._id])\n\n # don't allow with no identifiers\n exc4 = APIExcludeActivity(\"nooooo\")\n s = SynchronizationTask(None)\n s._syncExclusions = {}\n self.assertRaises(ValueError, s._accumulateExclusions, recA, [exc4])", "metadata": "root.SyncTests.test_accumulate_exclusions", "header": "['class', 'SyncTests', '(', 'TapiriikTestCase', ')', ':', '___EOS___']", "index": 213 }, { "content": " def test_activity_coalesce(self):\n ''' ensure that activity data is getting coalesced by _accumulateActivities '''\n svcA, svcB = TestTools.create_mock_services()\n recA = TestTools.create_mock_svc_record(svcA)\n recB = TestTools.create_mock_svc_record(svcB)\n actA = TestTools.create_random_activity(svcA, tz=pytz.timezone(\"America/Iqaluit\"))\n actB = Activity()\n actB.StartTime = actA.StartTime.replace(tzinfo=None)\n actB.ServiceDataCollection = TestTools.create_mock_servicedatacollection(svcB)\n actA.Name = \"Not this\"\n actA.Private = True\n actB.Name = \"Heya\"\n actB.Type = ActivityType.Walking\n actA.CalculateUID()\n actB.CalculateUID()\n\n s = SynchronizationTask(None)\n s._activities = []\n s._accumulateActivities(recB, [copy.deepcopy(actB)])\n s._accumulateActivities(recA, [copy.deepcopy(actA)])\n\n self.assertEqual(len(s._activities), 1)\n act = s._activities[0]\n\n self.assertEqual(act.StartTime, actA.StartTime)\n self.assertEqual(act.EndTime, actA.EndTime)\n self.assertEqual(act.EndTime.tzinfo, actA.StartTime.tzinfo)\n self.assertEqual(act.StartTime.tzinfo, actA.StartTime.tzinfo)\n self.assertLapsListsEqual(act.Laps, actA.Laps)\n self.assertTrue(act.Private) # Most restrictive setting\n self.assertEqual(act.Name, actB.Name) # The first activity takes priority.\n self.assertEqual(act.Type, actB.Type) # Same here.\n self.assertTrue(list(actB.ServiceDataCollection.keys())[0] in act.ServiceDataCollection)\n self.assertTrue(list(actA.ServiceDataCollection.keys())[0] in act.ServiceDataCollection)\n\n s._activities = []\n s._accumulateActivities(recA, [copy.deepcopy(actA)])\n s._accumulateActivities(recB, [copy.deepcopy(actB)])\n\n self.assertEqual(len(s._activities), 1)\n act = s._activities[0]\n\n self.assertEqual(act.StartTime, actA.StartTime)\n self.assertEqual(act.EndTime, actA.EndTime)\n self.assertEqual(act.EndTime.tzinfo, actA.StartTime.tzinfo)\n self.assertEqual(act.StartTime.tzinfo, actA.StartTime.tzinfo)\n self.assertLapsListsEqual(act.Laps, actA.Laps)\n self.assertEqual(act.Name, actA.Name) # The first activity takes priority.\n self.assertEqual(act.Type, actB.Type) # Exception: ActivityType.Other does not take priority\n self.assertTrue(list(actB.ServiceDataCollection.keys())[0] in act.ServiceDataCollection)\n self.assertTrue(list(actA.ServiceDataCollection.keys())[0] in act.ServiceDataCollection)\n\n # Similar activities should be coalesced (Hiking, Walking..)..\n actA.Type = ActivityType.Hiking\n s._activities = []\n s._accumulateActivities(recA, [copy.deepcopy(actA)])\n s._accumulateActivities(recB, [copy.deepcopy(actB)])\n\n self.assertEqual(len(s._activities), 1)\n act = s._activities[0]\n self.assertEqual(act.Type, actA.Type) # Here, it will take priority.\n\n # Dissimilar should not..\n actA.Type = ActivityType.CrossCountrySkiing\n s._activities = []\n s._accumulateActivities(recA, [copy.deepcopy(actA)])\n s._accumulateActivities(recB, [copy.deepcopy(actB)])\n\n self.assertEqual(len(s._activities), 2)\n self.assertEqual(s._activities[0].Type, actB.Type)\n self.assertEqual(s._activities[1].Type, actA.Type)", "metadata": "root.SyncTests.test_activity_coalesce", "header": "['class', 'SyncTests', '(', 'TapiriikTestCase', ')', ':', '___EOS___']", "index": 326 }, { "content": " def test_eligibility_excluded(self):\n user = TestTools.create_mock_user()\n svcA, svcB = TestTools.create_mock_services()\n recA = TestTools.create_mock_svc_record(svcA)\n recB = TestTools.create_mock_svc_record(svcB)\n act = TestTools.create_blank_activity(svcA, record=recB)\n recipientServices = [recA, recB]\n s = SynchronizationTask(None)\n s._excludedServices = {recA._id: UserException(UserExceptionType.Private)}\n s.user = user\n s._serviceConnections = recipientServices\n act.UIDs = set([act.UID])\n act.Record = ActivityRecord.FromActivity(act)\n eligible = s._determineEligibleRecipientServices(act, recipientServices)\n self.assertTrue(recB in eligible)\n self.assertTrue(recA not in eligible)", "metadata": "root.SyncTests.test_eligibility_excluded", "header": "['class', 'SyncTests', '(', 'TapiriikTestCase', ')', ':', '___EOS___']", "index": 398 }, { "content": " def test_eligibility_config(self):\n user = TestTools.create_mock_user()\n svcA, svcB = TestTools.create_mock_services()\n svcA.Configurable = True\n svcA.RequiresConfiguration = lambda x: True\n recA = TestTools.create_mock_svc_record(svcA)\n recB = TestTools.create_mock_svc_record(svcB)\n act = TestTools.create_blank_activity(svcA, record=recB)\n recipientServices = [recA, recB]\n s = SynchronizationTask(None)\n s._excludedServices = {}\n s.user = user\n s._serviceConnections = recipientServices\n act.UIDs = set([act.UID])\n act.Record = ActivityRecord.FromActivity(act)\n eligible = s._determineEligibleRecipientServices(act, recipientServices)\n self.assertTrue(recB in eligible)\n self.assertTrue(recA not in eligible)", "metadata": "root.SyncTests.test_eligibility_config", "header": "['class', 'SyncTests', '(', 'TapiriikTestCase', ')', ':', '___EOS___']", "index": 415 }, { "content": " def test_eligibility_flowexception(self):\n user = TestTools.create_mock_user()\n svcA, svcB = TestTools.create_mock_services()\n recA = TestTools.create_mock_svc_record(svcA)\n recB = TestTools.create_mock_svc_record(svcB)\n act = TestTools.create_blank_activity(svcA, record=recA)\n act.Origin = recA\n act.UIDs = set([act.UID])\n act.Record = ActivityRecord.FromActivity(act)\n User.SetFlowException(user, recA, recB, flowToTarget=False)\n recipientServices = [recA, recB]\n s = SynchronizationTask(None)\n s._excludedServices = {}\n s.user = user\n s._serviceConnections = recipientServices\n eligible = s._determineEligibleRecipientServices(act, recipientServices)\n self.assertTrue(recA in eligible)\n self.assertFalse(recB in eligible)", "metadata": "root.SyncTests.test_eligibility_flowexception", "header": "['class', 'SyncTests', '(', 'TapiriikTestCase', ')', ':', '___EOS___']", "index": 434 }, { "content": " def test_eligibility_flowexception_shortcircuit(self):\n user = TestTools.create_mock_user()\n svcA, svcB = TestTools.create_mock_services()\n svcC = TestTools.create_mock_service(\"mockC\")\n recA = TestTools.create_mock_svc_record(svcA)\n recB = TestTools.create_mock_svc_record(svcB)\n recC = TestTools.create_mock_svc_record(svcC)\n act = TestTools.create_blank_activity(svcA, record=recA)\n User.SetFlowException(user, recA, recC, flowToTarget=False)\n\n # Behaviour with known origin and no override set\n act.Origin = recA\n act.UIDs = set([act.UID])\n act.Record = ActivityRecord.FromActivity(act)\n recipientServices = [recC, recB]\n s = SynchronizationTask(None)\n s._excludedServices = {}\n s.user = user\n s._serviceConnections = [recA, recB, recC]\n eligible = s._determineEligibleRecipientServices(act, recipientServices)\n self.assertTrue(recA not in eligible)\n self.assertTrue(recB in eligible)\n self.assertTrue(recC not in eligible)\n\n # Enable alternate routing\n # FIXME: This setting doesn't seem to be used anywhere any more?? Test disabled at the end..\n recB.SetConfiguration({\"allow_activity_flow_exception_bypass_via_self\": True}, no_save=True)\n self.assertTrue(recB.GetConfiguration()[\"allow_activity_flow_exception_bypass_via_self\"])\n # We should now be able to arrive at recC via recB\n act.Origin = recA\n act.UIDs = set([act.UID])\n act.Record = ActivityRecord.FromActivity(act)\n recipientServices = [recC, recB]\n s._excludedServices = {}\n s._serviceConnections = [recA, recB, recC]\n eligible = s._determineEligibleRecipientServices(act, recipientServices)\n self.assertTrue(recA not in eligible)\n self.assertTrue(recB in eligible)\n # self.assertTrue(recC in eligible)", "metadata": "root.SyncTests.test_eligibility_flowexception_shortcircuit", "header": "['class', 'SyncTests', '(', 'TapiriikTestCase', ')', ':', '___EOS___']", "index": 453 }, { "content": " def test_eligibility_flowexception_reverse(self):\n user = TestTools.create_mock_user()\n svcA, svcB = TestTools.create_mock_services()\n recA = TestTools.create_mock_svc_record(svcA)\n recB = TestTools.create_mock_svc_record(svcB)\n act = TestTools.create_blank_activity(svcA, record=recB)\n act.Origin = recB\n act.UIDs = set([act.UID])\n act.Record = ActivityRecord.FromActivity(act)\n User.SetFlowException(user, recA, recB, flowToSource=False)\n recipientServices = [recA, recB]\n s = SynchronizationTask(None)\n s._excludedServices = {}\n s.user = user\n s._serviceConnections = recipientServices\n eligible = s._determineEligibleRecipientServices(act, recipientServices)\n self.assertFalse(recA in eligible)\n self.assertTrue(recB in eligible)", "metadata": "root.SyncTests.test_eligibility_flowexception_reverse", "header": "['class', 'SyncTests', '(', 'TapiriikTestCase', ')', ':', '___EOS___']", "index": 493 }, { "content": " def test_eligibility_flowexception_both(self):\n user = TestTools.create_mock_user()\n svcA, svcB = TestTools.create_mock_services()\n recA = TestTools.create_mock_svc_record(svcA)\n recB = TestTools.create_mock_svc_record(svcB)\n act = TestTools.create_blank_activity(svcA, record=recB)\n act.Origin = recB\n act.UIDs = set([act.UID])\n act.Record = ActivityRecord.FromActivity(act)\n User.SetFlowException(user, recA, recB, flowToSource=False, flowToTarget=False)\n recipientServices = [recA, recB]\n s = SynchronizationTask(None)\n s._excludedServices = {}\n s.user = user\n s._serviceConnections = recipientServices\n eligible = s._determineEligibleRecipientServices(act, recipientServices)\n self.assertFalse(recA in eligible)\n self.assertTrue(recB in eligible)\n\n act.Origin = recA\n act.ServiceDataCollection = TestTools.create_mock_servicedatacollection(svcA, record=recA)\n eligible = s._determineEligibleRecipientServices(act, recipientServices)\n self.assertTrue(recA in eligible)\n self.assertFalse(recB in eligible)", "metadata": "root.SyncTests.test_eligibility_flowexception_both", "header": "['class', 'SyncTests', '(', 'TapiriikTestCase', ')', ':', '___EOS___']", "index": 512 }, { "content": " def test_eligibility_flowexception_none(self):\n user = TestTools.create_mock_user()\n svcA, svcB = TestTools.create_mock_services()\n recA = TestTools.create_mock_svc_record(svcA)\n recB = TestTools.create_mock_svc_record(svcB)\n act = TestTools.create_blank_activity(svcA, record=recB)\n act.Origin = recB\n act.UIDs = set([act.UID])\n act.Record = ActivityRecord.FromActivity(act)\n User.SetFlowException(user, recA, recB, flowToSource=False, flowToTarget=False)\n recipientServices = [recA]\n s = SynchronizationTask(None)\n s._excludedServices = {}\n s.user = user\n s._serviceConnections = [recA, recB]\n eligible = s._determineEligibleRecipientServices(act, recipientServices)\n self.assertTrue(recA not in eligible)\n self.assertTrue(recB not in eligible)\n\n recipientServices = [recB]\n act.Origin = recA\n act.ServiceDataCollection = TestTools.create_mock_servicedatacollection(svcA, record=recA)\n eligible = s._determineEligibleRecipientServices(act, recipientServices)\n self.assertTrue(recA not in eligible)\n self.assertTrue(recB not in eligible)", "metadata": "root.SyncTests.test_eligibility_flowexception_none", "header": "['class', 'SyncTests', '(', 'TapiriikTestCase', ')', ':', '___EOS___']", "index": 537 }, { "content": " def test_eligibility_flowexception_change(self):\n user = TestTools.create_mock_user()\n svcA, svcB = TestTools.create_mock_services()\n recA = TestTools.create_mock_svc_record(svcA)\n recB = TestTools.create_mock_svc_record(svcB)\n act = TestTools.create_blank_activity(svcA, record=recB)\n act.Origin = recB\n act.UIDs = set([act.UID])\n act.Record = ActivityRecord.FromActivity(act)\n\n recipientServices = [recA]\n s = SynchronizationTask(None)\n s._excludedServices = {}\n s.user = user\n s._serviceConnections = [recA, recB]\n\n User.SetFlowException(user, recA, recB, flowToSource=False, flowToTarget=True)\n eligible = s._determineEligibleRecipientServices(act, recipientServices)\n self.assertTrue(recA not in eligible)\n self.assertTrue(recB not in eligible)\n\n recipientServices = [recB]\n act.Origin = recA\n act.ServiceDataCollection = TestTools.create_mock_servicedatacollection(svcA, record=recA)\n User.SetFlowException(user, recA, recB, flowToSource=True, flowToTarget=False)\n eligible = s._determineEligibleRecipientServices(act, recipientServices)\n self.assertTrue(recA not in eligible)\n self.assertTrue(recB not in eligible)\n\n User.SetFlowException(user, recA, recB, flowToSource=False, flowToTarget=False)\n eligible = s._determineEligibleRecipientServices(act, recipientServices)\n self.assertTrue(recA not in eligible)\n self.assertTrue(recB not in eligible)\n\n recipientServices = [recA, recB]\n User.SetFlowException(user, recA, recB, flowToSource=True, flowToTarget=True)\n eligible = s._determineEligibleRecipientServices(act, recipientServices)\n self.assertTrue(recA in eligible)\n self.assertTrue(recB in eligible)\n\n eligible = s._determineEligibleRecipientServices(act, recipientServices)\n self.assertTrue(recA in eligible)\n self.assertTrue(recB in eligible)", "metadata": "root.SyncTests.test_eligibility_flowexception_change", "header": "['class', 'SyncTests', '(', 'TapiriikTestCase', ')', ':', '___EOS___']", "index": 563 } ]
[ { "span": "self.assertTrue(\"3_14\" in exclusionstore[recA._id])", "start_line": 223, "start_column": 8, "end_line": 223, "end_column": 59 }, { "span": "self.assertTrue(\"3_14\" in exclusionstore[recA._id])", "start_line": 237, "start_column": 8, "end_line": 237, "end_column": 59 }, { "span": "self.assertTrue(\"3_14\" in exclusionstore[recA._id])", "start_line": 248, "start_column": 8, "end_line": 248, "end_column": 59 }, { "span": "self.assertTrue(\"37\" in exclusionstore[recA._id])", "start_line": 249, "start_column": 8, "end_line": 249, "end_column": 57 }, { "span": "self.assertTrue(\"13\" in exclusionstore[recA._id])", "start_line": 250, "start_column": 8, "end_line": 250, "end_column": 57 }, { "span": "self.assertTrue(list(actB.ServiceDataCollection.keys())[0] in act.ServiceDataCollection)", "start_line": 358, "start_column": 8, "end_line": 358, "end_column": 96 }, { "span": "self.assertTrue(list(actA.ServiceDataCollection.keys())[0] in act.ServiceDataCollection)", "start_line": 359, "start_column": 8, "end_line": 359, "end_column": 96 }, { "span": "self.assertTrue(list(actB.ServiceDataCollection.keys())[0] in act.ServiceDataCollection)", "start_line": 375, "start_column": 8, "end_line": 375, "end_column": 96 }, { "span": "self.assertTrue(list(actA.ServiceDataCollection.keys())[0] in act.ServiceDataCollection)", "start_line": 376, "start_column": 8, "end_line": 376, "end_column": 96 }, { "span": "self.assertTrue(recB in eligible)", "start_line": 412, "start_column": 8, "end_line": 412, "end_column": 41 }, { "span": "self.assertTrue(recA not in eligible)", "start_line": 413, "start_column": 8, "end_line": 413, "end_column": 45 }, { "span": "self.assertTrue(recB in eligible)", "start_line": 431, "start_column": 8, "end_line": 431, "end_column": 41 }, { "span": "self.assertTrue(recA not in eligible)", "start_line": 432, "start_column": 8, "end_line": 432, "end_column": 45 }, { "span": "self.assertTrue(recA in eligible)", "start_line": 450, "start_column": 8, "end_line": 450, "end_column": 41 }, { "span": "self.assertFalse(recB in eligible)", "start_line": 451, "start_column": 8, "end_line": 451, "end_column": 42 }, { "span": "self.assertTrue(recA not in eligible)", "start_line": 473, "start_column": 8, "end_line": 473, "end_column": 45 }, { "span": "self.assertTrue(recB in eligible)", "start_line": 474, "start_column": 8, "end_line": 474, "end_column": 41 }, { "span": "self.assertTrue(recC not in eligible)", "start_line": 475, "start_column": 8, "end_line": 475, "end_column": 45 }, { "span": "self.assertTrue(recA not in eligible)", "start_line": 489, "start_column": 8, "end_line": 489, "end_column": 45 }, { "span": "self.assertTrue(recB in eligible)", "start_line": 490, "start_column": 8, "end_line": 490, "end_column": 41 }, { "span": "self.assertFalse(recA in eligible)", "start_line": 509, "start_column": 8, "end_line": 509, "end_column": 42 }, { "span": "self.assertTrue(recB in eligible)", "start_line": 510, "start_column": 8, "end_line": 510, "end_column": 41 }, { "span": "self.assertFalse(recA in eligible)", "start_line": 528, "start_column": 8, "end_line": 528, "end_column": 42 }, { "span": "self.assertTrue(recB in eligible)", "start_line": 529, "start_column": 8, "end_line": 529, "end_column": 41 }, { "span": "self.assertTrue(recA in eligible)", "start_line": 534, "start_column": 8, "end_line": 534, "end_column": 41 }, { "span": "self.assertFalse(recB in eligible)", "start_line": 535, "start_column": 8, "end_line": 535, "end_column": 42 }, { "span": "self.assertTrue(recA not in eligible)", "start_line": 553, "start_column": 8, "end_line": 553, "end_column": 45 }, { "span": "self.assertTrue(recB not in eligible)", "start_line": 554, "start_column": 8, "end_line": 554, "end_column": 45 }, { "span": "self.assertTrue(recA not in eligible)", "start_line": 560, "start_column": 8, "end_line": 560, "end_column": 45 }, { "span": "self.assertTrue(recB not in eligible)", "start_line": 561, "start_column": 8, "end_line": 561, "end_column": 45 }, { "span": "self.assertTrue(recA not in eligible)", "start_line": 581, "start_column": 8, "end_line": 581, "end_column": 45 }, { "span": "self.assertTrue(recB not in eligible)", "start_line": 582, "start_column": 8, "end_line": 582, "end_column": 45 }, { "span": "self.assertTrue(recA not in eligible)", "start_line": 589, "start_column": 8, "end_line": 589, "end_column": 45 }, { "span": "self.assertTrue(recB not in eligible)", "start_line": 590, "start_column": 8, "end_line": 590, "end_column": 45 }, { "span": "self.assertTrue(recA not in eligible)", "start_line": 594, "start_column": 8, "end_line": 594, "end_column": 45 }, { "span": "self.assertTrue(recB not in eligible)", "start_line": 595, "start_column": 8, "end_line": 595, "end_column": 45 }, { "span": "self.assertTrue(recA in eligible)", "start_line": 600, "start_column": 8, "end_line": 600, "end_column": 41 }, { "span": "self.assertTrue(recB in eligible)", "start_line": 601, "start_column": 8, "end_line": 601, "end_column": 41 }, { "span": "self.assertTrue(recA in eligible)", "start_line": 604, "start_column": 8, "end_line": 604, "end_column": 41 }, { "span": "self.assertTrue(recB in eligible)", "start_line": 605, "start_column": 8, "end_line": 605, "end_column": 41 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Sync", "Tests_", "(_", "Tap", "iri", "ik", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "accumulate", "\\u", "exclusions", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "svc", "A_", ",_", "svc", "B_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "services_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "A_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "svc", "\\u", "record_", "(_", "svc", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "regular", "_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "Synchronization", "Task_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "sync", "Exclu", "sions_", "=_", "{_", "rec", "A_", "._", "\\u", "id_", ":_", "{_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exc_", "=_", "API", "Exclude", "Activity_", "(_", "\"", "Messag", "!", "e", "\"_", ",_", "activit", "y", "\\u", "id_", "=_", "3.14", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "accumulate", "Exclu", "sions_", "(_", "rec", "A_", ",_", "exc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exclusions", "tore_", "=_", "s_", "._", "\\u", "sync", "Exclu", "sions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "3", "\\u", "14", "\"_", "in_", "exclusions", "tore_", "[_", "rec", "A_", "._", "\\u", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "exclusions", "tore_", "[_", "rec", "A_", "._", "\\u", "id_", "]_", "[_", "\"", "3", "\\u", "14", "\"_", "]_", "[_", "\"", "Messag", "e", "\"_", "]_", ",_", "\"", "Messag", "!", "e", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "exclusions", "tore_", "[_", "rec", "A_", "._", "\\u", "id_", "]_", "[_", "\"", "3", "\\u", "14", "\"_", "]_", "[_", "\"", "Activ", "it", "y", "\"_", "]_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "exclusions", "tore_", "[_", "rec", "A_", "._", "\\u", "id_", "]_", "[_", "\"", "3", "\\u", "14", "\"_", "]_", "[_", "\"", "Exter", "nal", "Activ", "it", "y", "ID", "\"_", "]_", ",_", "3.14", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "exclusions", "tore_", "[_", "rec", "A_", "._", "\\u", "id_", "]_", "[_", "\"", "3", "\\u", "14", "\"_", "]_", "[_", "\"", "Permanent", "\"_", "]_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "updat", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "act_", "=_", "Test", "Tools_", "._", "create", "\\u", "blank", "\\u", "activity_", "(_", "svc", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "UID_", "=_", "\"", "3", "\\u", "14", "\"_", "#", " ", "me", "h_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exc_", "=_", "API", "Exclude", "Activity_", "(_", "\"", "Messag", "!", "e2", "\"_", ",_", "activit", "y", "\\u", "id_", "=_", "42_", ",_", "permanent", "_", "=_", "False_", ",_", "activity_", "=_", "act_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "Synchronization", "Task_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "sync", "Exclu", "sions_", "=_", "{_", "rec", "A_", "._", "\\u", "id_", ":_", "{_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "accumulate", "Exclu", "sions_", "(_", "rec", "A_", ",_", "exc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exclusions", "tore_", "=_", "s_", "._", "\\u", "sync", "Exclu", "sions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "3", "\\u", "14", "\"_", "in_", "exclusions", "tore_", "[_", "rec", "A_", "._", "\\u", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "exclusions", "tore_", "[_", "rec", "A_", "._", "\\u", "id_", "]_", "[_", "\"", "3", "\\u", "14", "\"_", "]_", "[_", "\"", "Messag", "e", "\"_", "]_", ",_", "\"", "Messag", "!", "e2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "exclusions", "tore_", "[_", "rec", "A_", "._", "\\u", "id_", "]_", "[_", "\"", "3", "\\u", "14", "\"_", "]_", "[_", "\"", "Activ", "it", "y", "\"_", "]_", ",_", "None_", ")_", "#", " ", "Who", " ", "knows", " ", "what", " ", "the", " ", "string", " ", "format", " ", "will", " ", "be", " ", "down", " ", "the", " ", "road", "?", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "exclusions", "tore_", "[_", "rec", "A_", "._", "\\u", "id_", "]_", "[_", "\"", "3", "\\u", "14", "\"_", "]_", "[_", "\"", "Exter", "nal", "Activ", "it", "y", "ID", "\"_", "]_", ",_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "exclusions", "tore_", "[_", "rec", "A_", "._", "\\u", "id_", "]_", "[_", "\"", "3", "\\u", "14", "\"_", "]_", "[_", "\"", "Permanent", "\"_", "]_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "multiple", ",", " ", "retain", "ing", " ", "existing_", "\\u\\u\\uNL\\u\\u\\u_", "exc", "2_", "=_", "API", "Exclude", "Activity_", "(_", "\"", "IN", "M", "\"_", ",_", "activit", "y", "\\u", "id_", "=_", "13_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exc", "3_", "=_", "API", "Exclude", "Activity_", "(_", "\"", "FN", "IM", "\"_", ",_", "activit", "y", "\\u", "id_", "=_", "37_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "accumulate", "Exclu", "sions_", "(_", "rec", "A_", ",_", "[_", "exc", "2_", ",_", "exc", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exclusions", "tore_", "=_", "s_", "._", "\\u", "sync", "Exclu", "sions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "3", "\\u", "14", "\"_", "in_", "exclusions", "tore_", "[_", "rec", "A_", "._", "\\u", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "3", "7", "\"_", "in_", "exclusions", "tore_", "[_", "rec", "A_", "._", "\\u", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "13", "\"_", "in_", "exclusions", "tore_", "[_", "rec", "A_", "._", "\\u", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "don", "'", "t", " ", "allow", " ", "with", " ", "no", " ", "identifiers_", "\\u\\u\\uNL\\u\\u\\u_", "exc", "4_", "=_", "API", "Exclude", "Activity_", "(_", "\"", "noo", "ooo", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "Synchronization", "Task_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "sync", "Exclu", "sions_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "s_", "._", "\\u", "accumulate", "Exclu", "sions_", ",_", "rec", "A_", ",_", "[_", "exc", "4_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sync", "Tests_", "(_", "Tap", "iri", "ik", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "activit", "y", "\\u", "coalesce", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "ensure", " ", "tha", "t", " ", "activit", "y", " ", "data", " ", "is", " ", "getti", "ng", " ", "coalesce", "d", " ", "by", " ", "\\u", "accumulate", "Activ", "iti", "es", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "svc", "A_", ",_", "svc", "B_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "services_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "A_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "svc", "\\u", "record_", "(_", "svc", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "B_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "svc", "\\u", "record_", "(_", "svc", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act", "A_", "=_", "Test", "Tools_", "._", "create", "\\u", "random", "\\u", "activity_", "(_", "svc", "A_", ",_", "tz_", "=_", "pytz_", "._", "timezone_", "(_", "\"", "Ame", "rica", "/", "I", "qa", "lui", "t", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act", "B_", "=_", "Activity_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act", "B_", "._", "Start", "Time_", "=_", "act", "A_", "._", "Start", "Time_", "._", "replace_", "(_", "tzinfo_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act", "B_", "._", "Service", "Data", "Collection_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "service", "datac", "olle", "ction_", "(_", "svc", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act", "A_", "._", "Name_", "=_", "\"", "Not", " ", "this", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act", "A_", "._", "Priva", "te_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act", "B_", "._", "Name_", "=_", "\"", "He", "ya", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act", "B_", "._", "Type_", "=_", "Activ", "it", "y", "Type_", "._", "Walk", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act", "A_", "._", "Calculat", "e", "UID_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act", "B_", "._", "Calculat", "e", "UID_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "Synchronization", "Task_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "activities_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "accumulate", "Activ", "ities_", "(_", "rec", "B_", ",_", "[_", "copy_", "._", "deepcopy_", "(_", "act", "B_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "accumulate", "Activ", "ities_", "(_", "rec", "A_", ",_", "[_", "copy_", "._", "deepcopy_", "(_", "act", "A_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "s_", "._", "\\u", "activities_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "=_", "s_", "._", "\\u", "activities_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "act_", "._", "Start", "Time_", ",_", "act", "A_", "._", "Start", "Time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "act_", "._", "End", "Time_", ",_", "act", "A_", "._", "End", "Time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "act_", "._", "End", "Time_", "._", "tzinfo_", ",_", "act", "A_", "._", "Start", "Time_", "._", "tzinfo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "act_", "._", "Start", "Time_", "._", "tzinfo_", ",_", "act", "A_", "._", "Start", "Time_", "._", "tzinfo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Lap", "s", "List", "s", "Equal_", "(_", "act_", "._", "Lap", "s_", ",_", "act", "A_", "._", "Lap", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "act_", "._", "Priva", "te_", ")_", "#", " ", "Mos", "t", " ", "restrict", "ive", " ", "setting_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "act_", "._", "Name_", ",_", "act", "B_", "._", "Name_", ")_", "#", " ", "The", " ", "first", " ", "activit", "y", " ", "take", "s", " ", "priorit", "y", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "act_", "._", "Type_", ",_", "act", "B_", "._", "Type_", ")_", "#", " ", "Sam", "e", " ", "here", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "list_", "(_", "act", "B_", "._", "Service", "Data", "Collection_", "._", "keys_", "(_", ")_", ")_", "[_", "0_", "]_", "in_", "act_", "._", "Service", "Data", "Collection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "list_", "(_", "act", "A_", "._", "Service", "Data", "Collection_", "._", "keys_", "(_", ")_", ")_", "[_", "0_", "]_", "in_", "act_", "._", "Service", "Data", "Collection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "\\u", "activities_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "accumulate", "Activ", "ities_", "(_", "rec", "A_", ",_", "[_", "copy_", "._", "deepcopy_", "(_", "act", "A_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "accumulate", "Activ", "ities_", "(_", "rec", "B_", ",_", "[_", "copy_", "._", "deepcopy_", "(_", "act", "B_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "s_", "._", "\\u", "activities_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "=_", "s_", "._", "\\u", "activities_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "act_", "._", "Start", "Time_", ",_", "act", "A_", "._", "Start", "Time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "act_", "._", "End", "Time_", ",_", "act", "A_", "._", "End", "Time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "act_", "._", "End", "Time_", "._", "tzinfo_", ",_", "act", "A_", "._", "Start", "Time_", "._", "tzinfo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "act_", "._", "Start", "Time_", "._", "tzinfo_", ",_", "act", "A_", "._", "Start", "Time_", "._", "tzinfo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Lap", "s", "List", "s", "Equal_", "(_", "act_", "._", "Lap", "s_", ",_", "act", "A_", "._", "Lap", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "act_", "._", "Name_", ",_", "act", "A_", "._", "Name_", ")_", "#", " ", "The", " ", "first", " ", "activit", "y", " ", "take", "s", " ", "priorit", "y", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "act_", "._", "Type_", ",_", "act", "B_", "._", "Type_", ")_", "#", " ", "Except", "ion", ":", " ", "Activ", "it", "y", "Type", ".", "Ot", "her", " ", "doe", "s", " ", "not", " ", "take", " ", "priority_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "list_", "(_", "act", "B_", "._", "Service", "Data", "Collection_", "._", "keys_", "(_", ")_", ")_", "[_", "0_", "]_", "in_", "act_", "._", "Service", "Data", "Collection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "list_", "(_", "act", "A_", "._", "Service", "Data", "Collection_", "._", "keys_", "(_", ")_", ")_", "[_", "0_", "]_", "in_", "act_", "._", "Service", "Data", "Collection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Simil", "ar", " ", "activit", "ies", " ", "shou", "ld", " ", "be", " ", "coalesce", "d", " ", "(", "Hi", "king", ",", " ", "Walk", "ing", "..", ").", "._", "\\u\\u\\uNL\\u\\u\\u_", "act", "A_", "._", "Type_", "=_", "Activ", "it", "y", "Type_", "._", "Hi", "king", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "activities_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "accumulate", "Activ", "ities_", "(_", "rec", "A_", ",_", "[_", "copy_", "._", "deepcopy_", "(_", "act", "A_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "accumulate", "Activ", "ities_", "(_", "rec", "B_", ",_", "[_", "copy_", "._", "deepcopy_", "(_", "act", "B_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "s_", "._", "\\u", "activities_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "=_", "s_", "._", "\\u", "activities_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "act_", "._", "Type_", ",_", "act", "A_", "._", "Type_", ")_", "#", " ", "Her", "e", ",", " ", "it", " ", "will", " ", "take", " ", "priorit", "y", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Dis", "similar", " ", "shou", "ld", " ", "not", "..", "_", "\\u\\u\\uNL\\u\\u\\u_", "act", "A_", "._", "Type_", "=_", "Activ", "it", "y", "Type_", "._", "Cross", "Count", "ry", "Ski", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "activities_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "accumulate", "Activ", "ities_", "(_", "rec", "A_", ",_", "[_", "copy_", "._", "deepcopy_", "(_", "act", "A_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "accumulate", "Activ", "ities_", "(_", "rec", "B_", ",_", "[_", "copy_", "._", "deepcopy_", "(_", "act", "B_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "s_", "._", "\\u", "activities_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "._", "\\u", "activities_", "[_", "0_", "]_", "._", "Type_", ",_", "act", "B_", "._", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "._", "\\u", "activities_", "[_", "1_", "]_", "._", "Type_", ",_", "act", "A_", "._", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sync", "Tests_", "(_", "Tap", "iri", "ik", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "eli", "gib", "ilit", "y", "\\u", "excluded_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "svc", "A_", ",_", "svc", "B_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "services_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "A_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "svc", "\\u", "record_", "(_", "svc", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "B_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "svc", "\\u", "record_", "(_", "svc", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "=_", "Test", "Tools_", "._", "create", "\\u", "blank", "\\u", "activity_", "(_", "svc", "A_", ",_", "record_", "=_", "rec", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "recip", "ient", "Services_", "=_", "[_", "rec", "A_", ",_", "rec", "B_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "Synchronization", "Task_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "exclu", "ded", "Services_", "=_", "{_", "rec", "A_", "._", "\\u", "id_", ":_", "User", "Exception_", "(_", "User", "Except", "ion", "Type_", "._", "Priva", "te_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "user_", "=_", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "service", "Connections_", "=_", "recip", "ient", "Services_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "UI", "Ds_", "=_", "set_", "(_", "[_", "act_", "._", "UID_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "Record_", "=_", "Activ", "it", "y", "Record_", "._", "Fro", "m", "Activity_", "(_", "act_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eligible", "_", "=_", "s_", "._", "\\u", "dete", "rmin", "e", "Eli", "gib", "le", "Recipient", "Services_", "(_", "act_", ",_", "recip", "ient", "Services_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "B_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "A_", "not_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sync", "Tests_", "(_", "Tap", "iri", "ik", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "eli", "gib", "ilit", "y", "\\u", "config_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "svc", "A_", ",_", "svc", "B_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "services_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "svc", "A_", "._", "Configura", "ble_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "svc", "A_", "._", "Requ", "ires", "Configuration_", "=_", "lambda_", "x_", ":_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "A_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "svc", "\\u", "record_", "(_", "svc", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "B_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "svc", "\\u", "record_", "(_", "svc", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "=_", "Test", "Tools_", "._", "create", "\\u", "blank", "\\u", "activity_", "(_", "svc", "A_", ",_", "record_", "=_", "rec", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "recip", "ient", "Services_", "=_", "[_", "rec", "A_", ",_", "rec", "B_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "Synchronization", "Task_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "exclu", "ded", "Services_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "user_", "=_", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "service", "Connections_", "=_", "recip", "ient", "Services_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "UI", "Ds_", "=_", "set_", "(_", "[_", "act_", "._", "UID_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "Record_", "=_", "Activ", "it", "y", "Record_", "._", "Fro", "m", "Activity_", "(_", "act_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eligible", "_", "=_", "s_", "._", "\\u", "dete", "rmin", "e", "Eli", "gib", "le", "Recipient", "Services_", "(_", "act_", ",_", "recip", "ient", "Services_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "B_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "A_", "not_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sync", "Tests_", "(_", "Tap", "iri", "ik", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "eli", "gib", "ilit", "y", "\\u", "flow", "exception_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "svc", "A_", ",_", "svc", "B_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "services_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "A_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "svc", "\\u", "record_", "(_", "svc", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "B_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "svc", "\\u", "record_", "(_", "svc", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "=_", "Test", "Tools_", "._", "create", "\\u", "blank", "\\u", "activity_", "(_", "svc", "A_", ",_", "record_", "=_", "rec", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "Origin_", "=_", "rec", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "UI", "Ds_", "=_", "set_", "(_", "[_", "act_", "._", "UID_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "Record_", "=_", "Activ", "it", "y", "Record_", "._", "Fro", "m", "Activity_", "(_", "act_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "User_", "._", "Set", "Flow", "Exception_", "(_", "user_", ",_", "rec", "A_", ",_", "rec", "B_", ",_", "flow", "To", "Target_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "recip", "ient", "Services_", "=_", "[_", "rec", "A_", ",_", "rec", "B_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "Synchronization", "Task_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "exclu", "ded", "Services_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "user_", "=_", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "service", "Connections_", "=_", "recip", "ient", "Services_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eligible", "_", "=_", "s_", "._", "\\u", "dete", "rmin", "e", "Eli", "gib", "le", "Recipient", "Services_", "(_", "act_", ",_", "recip", "ient", "Services_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "A_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "rec", "B_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sync", "Tests_", "(_", "Tap", "iri", "ik", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "eli", "gib", "ilit", "y", "\\u", "flow", "exception", "\\u", "short", "circuit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "svc", "A_", ",_", "svc", "B_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "services_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "svc", "C_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "service_", "(_", "\"", "mock", "C", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "A_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "svc", "\\u", "record_", "(_", "svc", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "B_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "svc", "\\u", "record_", "(_", "svc", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "C_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "svc", "\\u", "record_", "(_", "svc", "C_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "=_", "Test", "Tools_", "._", "create", "\\u", "blank", "\\u", "activity_", "(_", "svc", "A_", ",_", "record_", "=_", "rec", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "User_", "._", "Set", "Flow", "Exception_", "(_", "user_", ",_", "rec", "A_", ",_", "rec", "C_", ",_", "flow", "To", "Target_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Behavio", "ur", " ", "with", " ", "know", "n", " ", "orig", "in", " ", "and", " ", "no", " ", "override", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "act_", "._", "Origin_", "=_", "rec", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "UI", "Ds_", "=_", "set_", "(_", "[_", "act_", "._", "UID_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "Record_", "=_", "Activ", "it", "y", "Record_", "._", "Fro", "m", "Activity_", "(_", "act_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "recip", "ient", "Services_", "=_", "[_", "rec", "C_", ",_", "rec", "B_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "Synchronization", "Task_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "exclu", "ded", "Services_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "user_", "=_", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "service", "Connections_", "=_", "[_", "rec", "A_", ",_", "rec", "B_", ",_", "rec", "C_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eligible", "_", "=_", "s_", "._", "\\u", "dete", "rmin", "e", "Eli", "gib", "le", "Recipient", "Services_", "(_", "act_", ",_", "recip", "ient", "Services_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "A_", "not_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "B_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "C_", "not_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Enable", " ", "alternat", "e", " ", "routing_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIX", "ME", ":", " ", "Thi", "s", " ", "setti", "ng", " ", "doe", "sn", "'", "t", " ", "see", "m", " ", "to", " ", "be", " ", "used", " ", "any", "where", " ", "any", " ", "more", "??", " ", " ", "Test", " ", "disable", "d", " ", "at", " ", "the", " ", "end", "..", "_", "\\u\\u\\uNL\\u\\u\\u_", "rec", "B_", "._", "Set", "Configuration_", "(_", "{_", "\"", "allow", "\\u", "activit", "y", "\\u", "flow", "\\u", "exception", "\\u", "bypass", "\\u", "via", "\\u", "self", "\"_", ":_", "True_", "}_", ",_", "no", "\\u", "save_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "B_", "._", "Get", "Configuration_", "(_", ")_", "[_", "\"", "allow", "\\u", "activit", "y", "\\u", "flow", "\\u", "exception", "\\u", "bypass", "\\u", "via", "\\u", "self", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "shou", "ld", " ", "now", " ", "be", " ", "able", " ", "to", " ", "arrive", " ", "at", " ", "rec", "C", " ", "via", " ", "rec", "B_", "\\u\\u\\uNL\\u\\u\\u_", "act_", "._", "Origin_", "=_", "rec", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "UI", "Ds_", "=_", "set_", "(_", "[_", "act_", "._", "UID_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "Record_", "=_", "Activ", "it", "y", "Record_", "._", "Fro", "m", "Activity_", "(_", "act_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "recip", "ient", "Services_", "=_", "[_", "rec", "C_", ",_", "rec", "B_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "exclu", "ded", "Services_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "service", "Connections_", "=_", "[_", "rec", "A_", ",_", "rec", "B_", ",_", "rec", "C_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eligible", "_", "=_", "s_", "._", "\\u", "dete", "rmin", "e", "Eli", "gib", "le", "Recipient", "Services_", "(_", "act_", ",_", "recip", "ient", "Services_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "A_", "not_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "B_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "assert", "Tru", "e", "(", "rec", "C", " ", "in", " ", "eligible", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Sync", "Tests_", "(_", "Tap", "iri", "ik", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "eli", "gib", "ilit", "y", "\\u", "flow", "exception", "\\u", "reverse_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "svc", "A_", ",_", "svc", "B_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "services_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "A_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "svc", "\\u", "record_", "(_", "svc", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "B_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "svc", "\\u", "record_", "(_", "svc", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "=_", "Test", "Tools_", "._", "create", "\\u", "blank", "\\u", "activity_", "(_", "svc", "A_", ",_", "record_", "=_", "rec", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "Origin_", "=_", "rec", "B_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "UI", "Ds_", "=_", "set_", "(_", "[_", "act_", "._", "UID_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "Record_", "=_", "Activ", "it", "y", "Record_", "._", "Fro", "m", "Activity_", "(_", "act_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "User_", "._", "Set", "Flow", "Exception_", "(_", "user_", ",_", "rec", "A_", ",_", "rec", "B_", ",_", "flow", "To", "Source_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "recip", "ient", "Services_", "=_", "[_", "rec", "A_", ",_", "rec", "B_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "Synchronization", "Task_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "exclu", "ded", "Services_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "user_", "=_", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "service", "Connections_", "=_", "recip", "ient", "Services_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eligible", "_", "=_", "s_", "._", "\\u", "dete", "rmin", "e", "Eli", "gib", "le", "Recipient", "Services_", "(_", "act_", ",_", "recip", "ient", "Services_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "rec", "A_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "B_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sync", "Tests_", "(_", "Tap", "iri", "ik", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "eli", "gib", "ilit", "y", "\\u", "flow", "exception", "\\u", "both_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "svc", "A_", ",_", "svc", "B_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "services_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "A_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "svc", "\\u", "record_", "(_", "svc", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "B_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "svc", "\\u", "record_", "(_", "svc", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "=_", "Test", "Tools_", "._", "create", "\\u", "blank", "\\u", "activity_", "(_", "svc", "A_", ",_", "record_", "=_", "rec", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "Origin_", "=_", "rec", "B_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "UI", "Ds_", "=_", "set_", "(_", "[_", "act_", "._", "UID_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "Record_", "=_", "Activ", "it", "y", "Record_", "._", "Fro", "m", "Activity_", "(_", "act_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "User_", "._", "Set", "Flow", "Exception_", "(_", "user_", ",_", "rec", "A_", ",_", "rec", "B_", ",_", "flow", "To", "Source_", "=_", "False_", ",_", "flow", "To", "Target_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "recip", "ient", "Services_", "=_", "[_", "rec", "A_", ",_", "rec", "B_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "Synchronization", "Task_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "exclu", "ded", "Services_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "user_", "=_", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "service", "Connections_", "=_", "recip", "ient", "Services_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eligible", "_", "=_", "s_", "._", "\\u", "dete", "rmin", "e", "Eli", "gib", "le", "Recipient", "Services_", "(_", "act_", ",_", "recip", "ient", "Services_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "rec", "A_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "B_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "act_", "._", "Origin_", "=_", "rec", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "Service", "Data", "Collection_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "service", "datac", "olle", "ction_", "(_", "svc", "A_", ",_", "record_", "=_", "rec", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eligible", "_", "=_", "s_", "._", "\\u", "dete", "rmin", "e", "Eli", "gib", "le", "Recipient", "Services_", "(_", "act_", ",_", "recip", "ient", "Services_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "A_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "rec", "B_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sync", "Tests_", "(_", "Tap", "iri", "ik", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "eli", "gib", "ilit", "y", "\\u", "flow", "exception", "\\u", "none_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "svc", "A_", ",_", "svc", "B_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "services_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "A_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "svc", "\\u", "record_", "(_", "svc", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "B_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "svc", "\\u", "record_", "(_", "svc", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "=_", "Test", "Tools_", "._", "create", "\\u", "blank", "\\u", "activity_", "(_", "svc", "A_", ",_", "record_", "=_", "rec", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "Origin_", "=_", "rec", "B_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "UI", "Ds_", "=_", "set_", "(_", "[_", "act_", "._", "UID_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "Record_", "=_", "Activ", "it", "y", "Record_", "._", "Fro", "m", "Activity_", "(_", "act_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "User_", "._", "Set", "Flow", "Exception_", "(_", "user_", ",_", "rec", "A_", ",_", "rec", "B_", ",_", "flow", "To", "Source_", "=_", "False_", ",_", "flow", "To", "Target_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "recip", "ient", "Services_", "=_", "[_", "rec", "A_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "Synchronization", "Task_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "exclu", "ded", "Services_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "user_", "=_", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "service", "Connections_", "=_", "[_", "rec", "A_", ",_", "rec", "B_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eligible", "_", "=_", "s_", "._", "\\u", "dete", "rmin", "e", "Eli", "gib", "le", "Recipient", "Services_", "(_", "act_", ",_", "recip", "ient", "Services_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "A_", "not_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "B_", "not_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "recip", "ient", "Services_", "=_", "[_", "rec", "B_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "Origin_", "=_", "rec", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "Service", "Data", "Collection_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "service", "datac", "olle", "ction_", "(_", "svc", "A_", ",_", "record_", "=_", "rec", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eligible", "_", "=_", "s_", "._", "\\u", "dete", "rmin", "e", "Eli", "gib", "le", "Recipient", "Services_", "(_", "act_", ",_", "recip", "ient", "Services_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "A_", "not_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "B_", "not_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sync", "Tests_", "(_", "Tap", "iri", "ik", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "eli", "gib", "ilit", "y", "\\u", "flow", "exception", "\\u", "change_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "svc", "A_", ",_", "svc", "B_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "services_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "A_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "svc", "\\u", "record_", "(_", "svc", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "B_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "svc", "\\u", "record_", "(_", "svc", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "=_", "Test", "Tools_", "._", "create", "\\u", "blank", "\\u", "activity_", "(_", "svc", "A_", ",_", "record_", "=_", "rec", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "Origin_", "=_", "rec", "B_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "UI", "Ds_", "=_", "set_", "(_", "[_", "act_", "._", "UID_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "Record_", "=_", "Activ", "it", "y", "Record_", "._", "Fro", "m", "Activity_", "(_", "act_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "recip", "ient", "Services_", "=_", "[_", "rec", "A_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "Synchronization", "Task_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "exclu", "ded", "Services_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "user_", "=_", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "\\u", "service", "Connections_", "=_", "[_", "rec", "A_", ",_", "rec", "B_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "User_", "._", "Set", "Flow", "Exception_", "(_", "user_", ",_", "rec", "A_", ",_", "rec", "B_", ",_", "flow", "To", "Source_", "=_", "False_", ",_", "flow", "To", "Target_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eligible", "_", "=_", "s_", "._", "\\u", "dete", "rmin", "e", "Eli", "gib", "le", "Recipient", "Services_", "(_", "act_", ",_", "recip", "ient", "Services_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "A_", "not_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "B_", "not_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "recip", "ient", "Services_", "=_", "[_", "rec", "B_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "Origin_", "=_", "rec", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "act_", "._", "Service", "Data", "Collection_", "=_", "Test", "Tools_", "._", "create", "\\u", "mock", "\\u", "service", "datac", "olle", "ction_", "(_", "svc", "A_", ",_", "record_", "=_", "rec", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "User_", "._", "Set", "Flow", "Exception_", "(_", "user_", ",_", "rec", "A_", ",_", "rec", "B_", ",_", "flow", "To", "Source_", "=_", "True_", ",_", "flow", "To", "Target_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eligible", "_", "=_", "s_", "._", "\\u", "dete", "rmin", "e", "Eli", "gib", "le", "Recipient", "Services_", "(_", "act_", ",_", "recip", "ient", "Services_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "A_", "not_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "B_", "not_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "User_", "._", "Set", "Flow", "Exception_", "(_", "user_", ",_", "rec", "A_", ",_", "rec", "B_", ",_", "flow", "To", "Source_", "=_", "False_", ",_", "flow", "To", "Target_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eligible", "_", "=_", "s_", "._", "\\u", "dete", "rmin", "e", "Eli", "gib", "le", "Recipient", "Services_", "(_", "act_", ",_", "recip", "ient", "Services_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "A_", "not_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "B_", "not_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "recip", "ient", "Services_", "=_", "[_", "rec", "A_", ",_", "rec", "B_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "User_", "._", "Set", "Flow", "Exception_", "(_", "user_", ",_", "rec", "A_", ",_", "rec", "B_", ",_", "flow", "To", "Source_", "=_", "True_", ",_", "flow", "To", "Target_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eligible", "_", "=_", "s_", "._", "\\u", "dete", "rmin", "e", "Eli", "gib", "le", "Recipient", "Services_", "(_", "act_", ",_", "recip", "ient", "Services_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "A_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "B_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "eligible", "_", "=_", "s_", "._", "\\u", "dete", "rmin", "e", "Eli", "gib", "le", "Recipient", "Services_", "(_", "act_", ",_", "recip", "ient", "Services_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "A_", "in_", "eligible", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rec", "B_", "in_", "eligible", "_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 1, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
Imprecise assert
whiskey/Machine-Learning/de/staticline/tests/dummytests.py
[ { "content": " def testDummyModel(self):\n cwd = os.path.dirname(os.path.abspath(sys.argv[0]))\n \n dummy = Always1Predictor()\n dummy.buildClassifier(os.path.join(cwd,'data/classification/a1a'))\n dummy.validateModel(os.path.join(cwd,'data/classification/a1a.t'))\n self.assertTrue(dummy.get_pctCorrect() > 24) # for data set a1a !!!", "metadata": "root.DummyClassificatorTestCase.testDummyModel", "header": "['class', 'DummyClassificatorTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 14 } ]
[ { "span": "self.assertTrue(dummy.get_pctCorrect() > 24) ", "start_line": 20, "start_column": 8, "end_line": 20, "end_column": 52 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Du", "mm", "y", "Classificat", "or", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test", "Du", "mm", "y", "Model_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cwd_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "abspath_", "(_", "sys_", "._", "argv_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dummy_", "=_", "Al", "way", "s1", "Predictor", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dummy_", "._", "build", "Classifier_", "(_", "os_", "._", "path_", "._", "join_", "(_", "cwd_", ",_", "'", "data", "/", "classificati", "on", "/", "a1", "a", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dummy_", "._", "validat", "e", "Model_", "(_", "os_", "._", "path_", "._", "join_", "(_", "cwd_", ",_", "'", "data", "/", "classificati", "on", "/", "a1", "a", ".", "t", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "dummy_", "._", "get", "\\u", "pct", "Correct", "_", "(_", ")_", ">_", "24_", ")_", "#", " ", "for", " ", "data", " ", "set", " ", "a1", "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, 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 ]
Unused import
AmmsA/theresumator/scripts/create_baseuser.py
[ { "content": "from django.db.utils import OperationalError\nfrom solo.admin import SingletonModelAdmin\n\nfrom resumator.models import BasicInformation\nfrom resumator.models import Settings\n\n# make BasicInformation singleton if it does not already exist\ntry:\n basic_information = BasicInformation.get_solo()\nexcept OperationalError:\n pass\n\n# make setting singleton if it does not already exist\ntry:\n settings = Settings.get_solo()\nexcept OperationalError:\n pass\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from solo.admin import SingletonModelAdmin", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 42 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "utils_", "import_", "Opera", "tion", "al", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "solo", "_", "._", "admin_", "import_", "Singleton", "Model", "Admin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "resum", "ator_", "._", "models_", "import_", "Basic", "Information_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "resum", "ator_", "._", "models_", "import_", "Settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "Basic", "Information", " ", "singleton", " ", "if", " ", "it", " ", "doe", "s", " ", "not", " ", "alr", "ead", "y", " ", "exist_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "basic", "\\u", "information_", "=_", "Basic", "Information_", "._", "get", "\\u", "solo", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Opera", "tion", "al", "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_", "#", " ", "make", " ", "setti", "ng", " ", "singleton", " ", "if", " ", "it", " ", "doe", "s", " ", "not", " ", "alr", "ead", "y", " ", "exist_", "\\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 ", " _", "settings_", "=_", "Settings_", "._", "get", "\\u", "solo", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Opera", "tion", "al", "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, 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 ]
Unused import
androguard/androguard/demos/benchmark.py
[ { "content": "#!/usr/bin/env python\n\nimport sys, os\nimport cProfile\n\n# http://code.activestate.com/recipes/286222-memory-usage/\n_proc_status = '/proc/%d/status' % os.getpid()\n\n_scale = {\n 'kB': 1024.0,\n 'mB': 1024.0 * 1024.0,\n 'KB': 1024.0,\n 'MB': 1024.0 * 1024.0\n}\n\n\n\n\n\n\n\n\n\n\nPATH_INSTALL = \"./\"\nsys.path.append(PATH_INSTALL + \"./\")\n\nimport androguard, analysis\n\n# a directory with apks files\"\n\nTEST = \"./apks/\"\n\nl = []\nfor i in os.walk(TEST):\n for j in i[2]:\n l.append(i[0] + j)\n\nprint len(l), l\n\n_a = androguard.Androguard(l)\n\nprint \"MEMORY : \", memory() / _scale[\"MB\"], \"RESIDENT \", resident(\n) / _scale[\"MB\"], \"STACKSIZE \", stacksize() / _scale[\"MB\"]\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def _VmB(VmKey):\n global _proc_status, _scale\n # get pseudo file /proc/<pid>/status\n try:\n with open(_proc_status) as t:\n v = t.read()\n except:\n return 0.0 # non-Linux?\n # get VmKey line e.g. 'VmRSS: 9999 kB\\n ...'\n i = v.index(VmKey)\n v = v[i:].split(None, 3) # whitespace\n if len(v) < 3:\n return 0.0 # invalid format?\n # convert Vm value to bytes\n return float(v[1]) * _scale[v[2]]", "metadata": "root._VmB", "header": "['module', '___EOS___']", "index": 16 }, { "content": "def memory(since=0.0):\n '''Return memory usage in bytes.\n '''\n return _VmB('VmSize:') - since", "metadata": "root.memory", "header": "['module', '___EOS___']", "index": 33 }, { "content": "def resident(since=0.0):\n '''Return resident memory usage in bytes.\n '''\n return _VmB('VmRSS:') - since", "metadata": "root.resident", "header": "['module', '___EOS___']", "index": 39 }, { "content": "def stacksize(since=0.0):\n '''Return stack size in bytes.\n '''\n return _VmB('VmStk:') - since", "metadata": "root.stacksize", "header": "['module', '___EOS___']", "index": 45 } ]
[ { "span": "import cProfile", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 15 }, { "span": "import androguard, analysis", "start_line": 54, "start_column": 0, "end_line": 54, "end_column": 27 } ]
[]
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_", "sys_", ",_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "c", "Profile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "code", ".", "active", "state", ".", "com", "/", "recip", "es", "/", "286", "222", "-", "memory", "-", "usage", "/_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "proc", "\\u", "status_", "=_", "'/", "proc", "/", "%", "d", "/", "status", "'_", "%_", "os_", "._", "getpid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "scale_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "k", "B", "'_", ":_", "1024.", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "m", "B", "'_", ":_", "1024.", "0_", "*_", "1024.", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "KB", "'_", ":_", "1024.", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "MB", "'_", ":_", "1024.", "0_", "*_", "1024.", "0_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "PATH", "\\u", "INSTA", "LL_", "=_", "\"./", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "PATH", "\\u", "INSTA", "LL_", "+_", "\"./", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "andr", "og", "uar", "d_", ",_", "analysis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "director", "y", " ", "with", " ", "apk", "s", " ", "files", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "TEST_", "=_", "\"./", "apk", "s", "/\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "l_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "os_", "._", "walk_", "(_", "TEST_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "j_", "in_", "i_", "[_", "2_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l_", "._", "append_", "(_", "i_", "[_", "0_", "]_", "+_", "j_", ")_", "\\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_", "len_", "(_", "l_", ")_", ",_", "l_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "a_", "=_", "andr", "og", "uar", "d_", "._", "And", "rog", "uar", "d_", "(_", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"", "MEM", "ORY", " ", ":", " ", "\"_", ",_", "memory_", "(_", ")_", "/_", "\\u", "scale_", "[_", "\"", "MB", "\"_", "]_", ",_", "\"", "RES", "IDENT", " ", "\"_", ",_", "resident", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "/_", "\\u", "scale_", "[_", "\"", "MB", "\"_", "]_", ",_", "\"", "STACK", "SIZE", " ", "\"_", ",_", "stack", "size_", "(_", ")_", "/_", "\\u", "scale_", "[_", "\"", "MB", "\"_", "]_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "Vm", "B_", "(_", "Vm", "Key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "\\u", "proc", "\\u", "status_", ",_", "\\u", "scale_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "pseudo", " ", "file", " ", " ", "/", "proc", "/", "<", "pid", ">/", "status_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "\\u", "proc", "\\u", "status_", ")_", "as_", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "t_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0.0_", "#", " ", "non", "-", "Lin", "ux", "?", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "Vm", "Key", " ", "line", " ", "e", ".", "g", ".", " ", "'", "Vm", "RSS", ":", " ", " ", "9999", " ", " ", "k", "B", "\\\\", "n", " ", "...'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i_", "=_", "v_", "._", "index_", "(_", "Vm", "Key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "v_", "[_", "i_", ":_", "]_", "._", "split_", "(_", "None_", ",_", "3_", ")_", "#", " ", "whitespace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "v_", ")_", "<_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0.0_", "#", " ", "invalid", " ", "format", "?", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "convert", " ", "Vm", " ", "value", " ", "to", " ", "bytes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "float_", "(_", "v_", "[_", "1_", "]_", ")_", "*_", "\\u", "scale_", "[_", "v_", "[_", "2_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "memory_", "(_", "since_", "=_", "0.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Return", " ", "memory", " ", "usage", " ", "in", " ", "bytes", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u", "Vm", "B_", "(_", "'", "Vm", "Size", ":'_", ")_", "-_", "since_", "\\u\\u\\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_", "resident", "_", "(_", "since_", "=_", "0.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Return", " ", "resident", " ", "memory", " ", "usage", " ", "in", " ", "bytes", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u", "Vm", "B_", "(_", "'", "Vm", "RSS", ":'_", ")_", "-_", "since_", "\\u\\u\\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_", "stack", "size_", "(_", "since_", "=_", "0.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Return", " ", "stack", " ", "size", " ", "in", " ", "bytes", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u", "Vm", "B_", "(_", "'", "Vm", "St", "k", ":'_", ")_", "-_", "since_", "\\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, 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,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
First parameter of a method is not named 'self'
fredrik-johansson/mpmath/mpmath/ctx_mp.py
[ { "content": " def __init__(ctx):\n BaseMPContext.__init__(ctx)\n ctx.trap_complex = False\n ctx.pretty = False\n ctx.types = [ctx.mpf, ctx.mpc, ctx.constant]\n ctx._mpq = rational.mpq\n ctx.default()\n StandardBaseContext.__init__(ctx)\n\n ctx.mpq = rational.mpq\n ctx.init_builtins()\n\n ctx.hyp_summators = {}\n\n ctx._init_aliases()\n\n # XXX: automate\n try:\n ctx.bernoulli.im_func.func_doc = function_docs.bernoulli\n ctx.primepi.im_func.func_doc = function_docs.primepi\n ctx.psi.im_func.func_doc = function_docs.psi\n ctx.atan2.im_func.func_doc = function_docs.atan2\n except AttributeError:\n # python 3\n ctx.bernoulli.__func__.func_doc = function_docs.bernoulli\n ctx.primepi.__func__.func_doc = function_docs.primepi\n ctx.psi.__func__.func_doc = function_docs.psi\n ctx.atan2.__func__.func_doc = function_docs.atan2\n\n ctx.digamma.func_doc = function_docs.digamma\n ctx.cospi.func_doc = function_docs.cospi\n ctx.sinpi.func_doc = function_docs.sinpi", "metadata": "root.MPContext.__init__", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 60 }, { "content": " def init_builtins(ctx):\n\n mpf = ctx.mpf\n mpc = ctx.mpc\n\n # Exact constants\n ctx.one = ctx.make_mpf(fone)\n ctx.zero = ctx.make_mpf(fzero)\n ctx.j = ctx.make_mpc((fzero,fone))\n ctx.inf = ctx.make_mpf(finf)\n ctx.ninf = ctx.make_mpf(fninf)\n ctx.nan = ctx.make_mpf(fnan)\n\n eps = ctx.constant(lambda prec, rnd: (0, MPZ_ONE, 1-prec, 1),\n \"epsilon of working precision\", \"eps\")\n ctx.eps = eps\n\n # Approximate constants\n ctx.pi = ctx.constant(mpf_pi, \"pi\", \"pi\")\n ctx.ln2 = ctx.constant(mpf_ln2, \"ln(2)\", \"ln2\")\n ctx.ln10 = ctx.constant(mpf_ln10, \"ln(10)\", \"ln10\")\n ctx.phi = ctx.constant(mpf_phi, \"Golden ratio phi\", \"phi\")\n ctx.e = ctx.constant(mpf_e, \"e = exp(1)\", \"e\")\n ctx.euler = ctx.constant(mpf_euler, \"Euler's constant\", \"euler\")\n ctx.catalan = ctx.constant(mpf_catalan, \"Catalan's constant\", \"catalan\")\n ctx.khinchin = ctx.constant(mpf_khinchin, \"Khinchin's constant\", \"khinchin\")\n ctx.glaisher = ctx.constant(mpf_glaisher, \"Glaisher's constant\", \"glaisher\")\n ctx.apery = ctx.constant(mpf_apery, \"Apery's constant\", \"apery\")\n ctx.degree = ctx.constant(mpf_degree, \"1 deg = pi / 180\", \"degree\")\n ctx.twinprime = ctx.constant(mpf_twinprime, \"Twin prime constant\", \"twinprime\")\n ctx.mertens = ctx.constant(mpf_mertens, \"Mertens' constant\", \"mertens\")\n\n # Standard functions\n ctx.sqrt = ctx._wrap_libmp_function(libmp.mpf_sqrt, libmp.mpc_sqrt)\n ctx.cbrt = ctx._wrap_libmp_function(libmp.mpf_cbrt, libmp.mpc_cbrt)\n ctx.ln = ctx._wrap_libmp_function(libmp.mpf_log, libmp.mpc_log)\n ctx.atan = ctx._wrap_libmp_function(libmp.mpf_atan, libmp.mpc_atan)\n ctx.exp = ctx._wrap_libmp_function(libmp.mpf_exp, libmp.mpc_exp)\n ctx.expj = ctx._wrap_libmp_function(libmp.mpf_expj, libmp.mpc_expj)\n ctx.expjpi = ctx._wrap_libmp_function(libmp.mpf_expjpi, libmp.mpc_expjpi)\n ctx.sin = ctx._wrap_libmp_function(libmp.mpf_sin, libmp.mpc_sin)\n ctx.cos = ctx._wrap_libmp_function(libmp.mpf_cos, libmp.mpc_cos)\n ctx.tan = ctx._wrap_libmp_function(libmp.mpf_tan, libmp.mpc_tan)\n ctx.sinh = ctx._wrap_libmp_function(libmp.mpf_sinh, libmp.mpc_sinh)\n ctx.cosh = ctx._wrap_libmp_function(libmp.mpf_cosh, libmp.mpc_cosh)\n ctx.tanh = ctx._wrap_libmp_function(libmp.mpf_tanh, libmp.mpc_tanh)\n ctx.asin = ctx._wrap_libmp_function(libmp.mpf_asin, libmp.mpc_asin)\n ctx.acos = ctx._wrap_libmp_function(libmp.mpf_acos, libmp.mpc_acos)\n ctx.atan = ctx._wrap_libmp_function(libmp.mpf_atan, libmp.mpc_atan)\n ctx.asinh = ctx._wrap_libmp_function(libmp.mpf_asinh, libmp.mpc_asinh)\n ctx.acosh = ctx._wrap_libmp_function(libmp.mpf_acosh, libmp.mpc_acosh)\n ctx.atanh = ctx._wrap_libmp_function(libmp.mpf_atanh, libmp.mpc_atanh)\n ctx.sinpi = ctx._wrap_libmp_function(libmp.mpf_sin_pi, libmp.mpc_sin_pi)\n ctx.cospi = ctx._wrap_libmp_function(libmp.mpf_cos_pi, libmp.mpc_cos_pi)\n ctx.floor = ctx._wrap_libmp_function(libmp.mpf_floor, libmp.mpc_floor)\n ctx.ceil = ctx._wrap_libmp_function(libmp.mpf_ceil, libmp.mpc_ceil)\n ctx.nint = ctx._wrap_libmp_function(libmp.mpf_nint, libmp.mpc_nint)\n ctx.frac = ctx._wrap_libmp_function(libmp.mpf_frac, libmp.mpc_frac)\n ctx.fib = ctx.fibonacci = ctx._wrap_libmp_function(libmp.mpf_fibonacci, libmp.mpc_fibonacci)\n\n ctx.gamma = ctx._wrap_libmp_function(libmp.mpf_gamma, libmp.mpc_gamma)\n ctx.rgamma = ctx._wrap_libmp_function(libmp.mpf_rgamma, libmp.mpc_rgamma)\n ctx.loggamma = ctx._wrap_libmp_function(libmp.mpf_loggamma, libmp.mpc_loggamma)\n ctx.fac = ctx.factorial = ctx._wrap_libmp_function(libmp.mpf_factorial, libmp.mpc_factorial)\n ctx.gamma_old = ctx._wrap_libmp_function(libmp.mpf_gamma_old, libmp.mpc_gamma_old)\n ctx.fac_old = ctx.factorial_old = ctx._wrap_libmp_function(libmp.mpf_factorial_old, libmp.mpc_factorial_old)\n\n ctx.digamma = ctx._wrap_libmp_function(libmp.mpf_psi0, libmp.mpc_psi0)\n ctx.harmonic = ctx._wrap_libmp_function(libmp.mpf_harmonic, libmp.mpc_harmonic)\n ctx.ei = ctx._wrap_libmp_function(libmp.mpf_ei, libmp.mpc_ei)\n ctx.e1 = ctx._wrap_libmp_function(libmp.mpf_e1, libmp.mpc_e1)\n ctx._ci = ctx._wrap_libmp_function(libmp.mpf_ci, libmp.mpc_ci)\n ctx._si = ctx._wrap_libmp_function(libmp.mpf_si, libmp.mpc_si)\n ctx.ellipk = ctx._wrap_libmp_function(libmp.mpf_ellipk, libmp.mpc_ellipk)\n ctx._ellipe = ctx._wrap_libmp_function(libmp.mpf_ellipe, libmp.mpc_ellipe)\n ctx.agm1 = ctx._wrap_libmp_function(libmp.mpf_agm1, libmp.mpc_agm1)\n ctx._erf = ctx._wrap_libmp_function(libmp.mpf_erf, None)\n ctx._erfc = ctx._wrap_libmp_function(libmp.mpf_erfc, None)\n ctx._zeta = ctx._wrap_libmp_function(libmp.mpf_zeta, libmp.mpc_zeta)\n ctx._altzeta = ctx._wrap_libmp_function(libmp.mpf_altzeta, libmp.mpc_altzeta)\n\n # Faster versions\n ctx.sqrt = getattr(ctx, \"_sage_sqrt\", ctx.sqrt)\n ctx.exp = getattr(ctx, \"_sage_exp\", ctx.exp)\n ctx.ln = getattr(ctx, \"_sage_ln\", ctx.ln)\n ctx.cos = getattr(ctx, \"_sage_cos\", ctx.cos)\n ctx.sin = getattr(ctx, \"_sage_sin\", ctx.sin)", "metadata": "root.MPContext.init_builtins", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 93 }, { "content": " def to_fixed(ctx, x, prec):\n return x.to_fixed(prec)", "metadata": "root.MPContext.to_fixed", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 181 }, { "content": " def hypot(ctx, x, y):\n r\"\"\"\n Computes the Euclidean norm of the vector `(x, y)`, equal\n to `\\sqrt{x^2 + y^2}`. Both `x` and `y` must be real.\"\"\"\n x = ctx.convert(x)\n y = ctx.convert(y)\n return ctx.make_mpf(libmp.mpf_hypot(x._mpf_, y._mpf_, *ctx._prec_rounding))", "metadata": "root.MPContext.hypot", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 184 }, { "content": " def _gamma_upper_int(ctx, n, z):\n n = int(ctx._re(n))\n if n == 0:\n return ctx.e1(z)\n if not hasattr(z, '_mpf_'):\n raise NotImplementedError\n prec, rounding = ctx._prec_rounding\n real, imag = libmp.mpf_expint(n, z._mpf_, prec, rounding, gamma=True)\n if imag is None:\n return ctx.make_mpf(real)\n else:\n return ctx.make_mpc((real, imag))", "metadata": "root.MPContext._gamma_upper_int", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 192 }, { "content": " def _expint_int(ctx, n, z):\n n = int(n)\n if n == 1:\n return ctx.e1(z)\n if not hasattr(z, '_mpf_'):\n raise NotImplementedError\n prec, rounding = ctx._prec_rounding\n real, imag = libmp.mpf_expint(n, z._mpf_, prec, rounding)\n if imag is None:\n return ctx.make_mpf(real)\n else:\n return ctx.make_mpc((real, imag))", "metadata": "root.MPContext._expint_int", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 205 }, { "content": " def _nthroot(ctx, x, n):\n if hasattr(x, '_mpf_'):\n try:\n return ctx.make_mpf(libmp.mpf_nthroot(x._mpf_, n, *ctx._prec_rounding))\n except ComplexResult:\n if ctx.trap_complex:\n raise\n x = (x._mpf_, libmp.fzero)\n else:\n x = x._mpc_\n return ctx.make_mpc(libmp.mpc_nthroot(x, n, *ctx._prec_rounding))", "metadata": "root.MPContext._nthroot", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 218 }, { "content": " def _besselj(ctx, n, z):\n prec, rounding = ctx._prec_rounding\n if hasattr(z, '_mpf_'):\n return ctx.make_mpf(libmp.mpf_besseljn(n, z._mpf_, prec, rounding))\n elif hasattr(z, '_mpc_'):\n return ctx.make_mpc(libmp.mpc_besseljn(n, z._mpc_, prec, rounding))", "metadata": "root.MPContext._besselj", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 230 }, { "content": " def _agm(ctx, a, b=1):\n prec, rounding = ctx._prec_rounding\n if hasattr(a, '_mpf_') and hasattr(b, '_mpf_'):\n try:\n v = libmp.mpf_agm(a._mpf_, b._mpf_, prec, rounding)\n return ctx.make_mpf(v)\n except ComplexResult:\n pass\n if hasattr(a, '_mpf_'): a = (a._mpf_, libmp.fzero)\n else: a = a._mpc_\n if hasattr(b, '_mpf_'): b = (b._mpf_, libmp.fzero)\n else: b = b._mpc_\n return ctx.make_mpc(libmp.mpc_agm(a, b, prec, rounding))", "metadata": "root.MPContext._agm", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 237 }, { "content": " def bernoulli(ctx, n):\n return ctx.make_mpf(libmp.mpf_bernoulli(int(n), *ctx._prec_rounding))", "metadata": "root.MPContext.bernoulli", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 251 }, { "content": " def _zeta_int(ctx, n):\n return ctx.make_mpf(libmp.mpf_zeta_int(int(n), *ctx._prec_rounding))", "metadata": "root.MPContext._zeta_int", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 254 }, { "content": " def atan2(ctx, y, x):\n x = ctx.convert(x)\n y = ctx.convert(y)\n return ctx.make_mpf(libmp.mpf_atan2(y._mpf_, x._mpf_, *ctx._prec_rounding))", "metadata": "root.MPContext.atan2", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 257 }, { "content": " def psi(ctx, m, z):\n z = ctx.convert(z)\n m = int(m)\n if ctx._is_real_type(z):\n return ctx.make_mpf(libmp.mpf_psi(m, z._mpf_, *ctx._prec_rounding))\n else:\n return ctx.make_mpc(libmp.mpc_psi(m, z._mpc_, *ctx._prec_rounding))", "metadata": "root.MPContext.psi", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 262 }, { "content": " def cos_sin(ctx, x, **kwargs):\n if type(x) not in ctx.types:\n x = ctx.convert(x)\n prec, rounding = ctx._parse_prec(kwargs)\n if hasattr(x, '_mpf_'):\n c, s = libmp.mpf_cos_sin(x._mpf_, prec, rounding)\n return ctx.make_mpf(c), ctx.make_mpf(s)\n elif hasattr(x, '_mpc_'):\n c, s = libmp.mpc_cos_sin(x._mpc_, prec, rounding)\n return ctx.make_mpc(c), ctx.make_mpc(s)\n else:\n return ctx.cos(x, **kwargs), ctx.sin(x, **kwargs)", "metadata": "root.MPContext.cos_sin", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 270 }, { "content": " def cospi_sinpi(ctx, x, **kwargs):\n if type(x) not in ctx.types:\n x = ctx.convert(x)\n prec, rounding = ctx._parse_prec(kwargs)\n if hasattr(x, '_mpf_'):\n c, s = libmp.mpf_cos_sin_pi(x._mpf_, prec, rounding)\n return ctx.make_mpf(c), ctx.make_mpf(s)\n elif hasattr(x, '_mpc_'):\n c, s = libmp.mpc_cos_sin_pi(x._mpc_, prec, rounding)\n return ctx.make_mpc(c), ctx.make_mpc(s)\n else:\n return ctx.cos(x, **kwargs), ctx.sin(x, **kwargs)", "metadata": "root.MPContext.cospi_sinpi", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 283 }, { "content": " def clone(ctx):\n \"\"\"\n Create a copy of the context, with the same working precision.\n \"\"\"\n a = ctx.__class__()\n a.prec = ctx.prec\n return a", "metadata": "root.MPContext.clone", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 296 }, { "content": " def _is_real_type(ctx, x):\n if hasattr(x, '_mpc_') or type(x) is complex:\n return False\n return True", "metadata": "root.MPContext._is_real_type", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 307 }, { "content": " def _is_complex_type(ctx, x):\n if hasattr(x, '_mpc_') or type(x) is complex:\n return True\n return False", "metadata": "root.MPContext._is_complex_type", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 312 }, { "content": " def isnan(ctx, x):\n \"\"\"\n Return *True* if *x* is a NaN (not-a-number), or for a complex\n number, whether either the real or complex part is NaN;\n otherwise return *False*::\n\n >>> from mpmath import *\n >>> isnan(3.14)\n False\n >>> isnan(nan)\n True\n >>> isnan(mpc(3.14,2.72))\n False\n >>> isnan(mpc(3.14,nan))\n True\n\n \"\"\"\n if hasattr(x, \"_mpf_\"):\n return x._mpf_ == fnan\n if hasattr(x, \"_mpc_\"):\n return fnan in x._mpc_\n if isinstance(x, int_types) or isinstance(x, rational.mpq):\n return False\n x = ctx.convert(x)\n if hasattr(x, '_mpf_') or hasattr(x, '_mpc_'):\n return ctx.isnan(x)\n raise TypeError(\"isnan() needs a number as input\")", "metadata": "root.MPContext.isnan", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 317 }, { "content": " def isfinite(ctx, x):\n \"\"\"\n Return *True* if *x* is a finite number, i.e. neither\n an infinity or a NaN.\n\n >>> from mpmath import *\n >>> isfinite(inf)\n False\n >>> isfinite(-inf)\n False\n >>> isfinite(3)\n True\n >>> isfinite(nan)\n False\n >>> isfinite(3+4j)\n True\n >>> isfinite(mpc(3,inf))\n False\n >>> isfinite(mpc(nan,3))\n False\n\n \"\"\"\n if ctx.isinf(x) or ctx.isnan(x):\n return False\n return True", "metadata": "root.MPContext.isfinite", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 345 }, { "content": " def isnpint(ctx, x):\n \"\"\"\n Determine if *x* is a nonpositive integer.\n \"\"\"\n if not x:\n return True\n if hasattr(x, '_mpf_'):\n sign, man, exp, bc = x._mpf_\n return sign and exp >= 0\n if hasattr(x, '_mpc_'):\n return not x.imag and ctx.isnpint(x.real)\n if type(x) in int_types:\n return x <= 0\n if isinstance(x, ctx.mpq):\n p, q = x._mpq_\n if not p:\n return True\n return q == 1 and p <= 0\n return ctx.isnpint(ctx.convert(x))", "metadata": "root.MPContext.isnpint", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 371 }, { "content": " def __str__(ctx):\n lines = [\"Mpmath settings:\",\n (\" mp.prec = %s\" % ctx.prec).ljust(30) + \"[default: 53]\",\n (\" mp.dps = %s\" % ctx.dps).ljust(30) + \"[default: 15]\",\n (\" mp.trap_complex = %s\" % ctx.trap_complex).ljust(30) + \"[default: False]\",\n ]\n return \"\\n\".join(lines)", "metadata": "root.MPContext.__str__", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 391 }, { "content": " def extraprec(ctx, n, normalize_output=False):\n \"\"\"\n The block\n\n with extraprec(n):\n <code>\n\n increases the precision n bits, executes <code>, and then\n restores the precision.\n\n extraprec(n)(f) returns a decorated version of the function f\n that increases the working precision by n bits before execution,\n and restores the parent precision afterwards. With\n normalize_output=True, it rounds the return value to the parent\n precision.\n \"\"\"\n return PrecisionManager(ctx, lambda p: p + n, None, normalize_output)", "metadata": "root.MPContext.extraprec", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 407 }, { "content": " def extradps(ctx, n, normalize_output=False):\n \"\"\"\n This function is analogous to extraprec (see documentation)\n but changes the decimal precision instead of the number of bits.\n \"\"\"\n return PrecisionManager(ctx, None, lambda d: d + n, normalize_output)", "metadata": "root.MPContext.extradps", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 425 }, { "content": " def workprec(ctx, n, normalize_output=False):\n \"\"\"\n The block\n\n with workprec(n):\n <code>\n\n sets the precision to n bits, executes <code>, and then restores\n the precision.\n\n workprec(n)(f) returns a decorated version of the function f\n that sets the precision to n bits before execution,\n and restores the precision afterwards. With normalize_output=True,\n it rounds the return value to the parent precision.\n \"\"\"\n return PrecisionManager(ctx, lambda p: n, None, normalize_output)", "metadata": "root.MPContext.workprec", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 432 }, { "content": " def workdps(ctx, n, normalize_output=False):\n \"\"\"\n This function is analogous to workprec (see documentation)\n but changes the decimal precision instead of the number of bits.\n \"\"\"\n return PrecisionManager(ctx, None, lambda d: n, normalize_output)", "metadata": "root.MPContext.workdps", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 449 }, { "content": " def autoprec(ctx, f, maxprec=None, catch=(), verbose=False):\n \"\"\"\n Return a wrapped copy of *f* that repeatedly evaluates *f*\n with increasing precision until the result converges to the\n full precision used at the point of the call.\n\n This heuristically protects against rounding errors, at the cost of\n roughly a 2x slowdown compared to manually setting the optimal\n precision. This method can, however, easily be fooled if the results\n from *f* depend \"discontinuously\" on the precision, for instance\n if catastrophic cancellation can occur. Therefore, :func:`~mpmath.autoprec`\n should be used judiciously.\n\n **Examples**\n\n Many functions are sensitive to perturbations of the input arguments.\n If the arguments are decimal numbers, they may have to be converted\n to binary at a much higher precision. If the amount of required\n extra precision is unknown, :func:`~mpmath.autoprec` is convenient::\n\n >>> from mpmath import *\n >>> mp.dps = 15\n >>> mp.pretty = True\n >>> besselj(5, 125 * 10**28) # Exact input\n -8.03284785591801e-17\n >>> besselj(5, '1.25e30') # Bad\n 7.12954868316652e-16\n >>> autoprec(besselj)(5, '1.25e30') # Good\n -8.03284785591801e-17\n\n The following fails to converge because `\\sin(\\pi) = 0` whereas all\n finite-precision approximations of `\\pi` give nonzero values::\n\n >>> autoprec(sin)(pi) # doctest: +IGNORE_EXCEPTION_DETAIL\n Traceback (most recent call last):\n ...\n NoConvergence: autoprec: prec increased to 2910 without convergence\n\n As the following example shows, :func:`~mpmath.autoprec` can protect against\n cancellation, but is fooled by too severe cancellation::\n\n >>> x = 1e-10\n >>> exp(x)-1; expm1(x); autoprec(lambda t: exp(t)-1)(x)\n 1.00000008274037e-10\n 1.00000000005e-10\n 1.00000000005e-10\n >>> x = 1e-50\n >>> exp(x)-1; expm1(x); autoprec(lambda t: exp(t)-1)(x)\n 0.0\n 1.0e-50\n 0.0\n\n With *catch*, an exception or list of exceptions to intercept\n may be specified. The raised exception is interpreted\n as signaling insufficient precision. This permits, for example,\n evaluating a function where a too low precision results in a\n division by zero::\n\n >>> f = lambda x: 1/(exp(x)-1)\n >>> f(1e-30)\n Traceback (most recent call last):\n ...\n ZeroDivisionError\n >>> autoprec(f, catch=ZeroDivisionError)(1e-30)\n 1.0e+30\n\n\n \"\"\"\n def f_autoprec_wrapped(*args, **kwargs):\n prec = ctx.prec\n if maxprec is None:\n maxprec2 = ctx._default_hyper_maxprec(prec)\n else:\n maxprec2 = maxprec\n try:\n ctx.prec = prec + 10\n try:\n v1 = f(*args, **kwargs)\n except catch:\n v1 = ctx.nan\n prec2 = prec + 20\n while 1:\n ctx.prec = prec2\n try:\n v2 = f(*args, **kwargs)\n except catch:\n v2 = ctx.nan\n if v1 == v2:\n break\n err = ctx.mag(v2-v1) - ctx.mag(v2)\n if err < (-prec):\n break\n if verbose:\n print(\"autoprec: target=%s, prec=%s, accuracy=%s\" \\\n % (prec, prec2, -err))\n v1 = v2\n if prec2 >= maxprec2:\n raise ctx.NoConvergence(\\\n \"autoprec: prec increased to %i without convergence\"\\\n % prec2)\n prec2 += int(prec2*2)\n prec2 = min(prec2, maxprec2)\n finally:\n ctx.prec = prec\n return +v2\n return f_autoprec_wrapped", "metadata": "root.MPContext.autoprec", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 456 }, { "content": " def nstr(ctx, x, n=6, **kwargs):\n \"\"\"\n Convert an ``mpf`` or ``mpc`` to a decimal string literal with *n*\n significant digits. The small default value for *n* is chosen to\n make this function useful for printing collections of numbers\n (lists, matrices, etc).\n\n If *x* is a list or tuple, :func:`~mpmath.nstr` is applied recursively\n to each element. For unrecognized classes, :func:`~mpmath.nstr`\n simply returns ``str(x)``.\n\n The companion function :func:`~mpmath.nprint` prints the result\n instead of returning it.\n\n The keyword arguments *strip_zeros*, *min_fixed*, *max_fixed*\n and *show_zero_exponent* are forwarded to :func:`~mpmath.libmp.to_str`.\n\n The number will be printed in fixed-point format if the position\n of the leading digit is strictly between min_fixed\n (default = min(-dps/3,-5)) and max_fixed (default = dps).\n\n To force fixed-point format always, set min_fixed = -inf,\n max_fixed = +inf. To force floating-point format, set\n min_fixed >= max_fixed.\n\n >>> from mpmath import *\n >>> nstr([+pi, ldexp(1,-500)])\n '[3.14159, 3.05494e-151]'\n >>> nprint([+pi, ldexp(1,-500)])\n [3.14159, 3.05494e-151]\n >>> nstr(mpf(\"5e-10\"), 5)\n '5.0e-10'\n >>> nstr(mpf(\"5e-10\"), 5, strip_zeros=False)\n '5.0000e-10'\n >>> nstr(mpf(\"5e-10\"), 5, strip_zeros=False, min_fixed=-11)\n '0.00000000050000'\n >>> nstr(mpf(0), 5, show_zero_exponent=True)\n '0.0e+0'\n\n \"\"\"\n if isinstance(x, list):\n return \"[%s]\" % (\", \".join(ctx.nstr(c, n, **kwargs) for c in x))\n if isinstance(x, tuple):\n return \"(%s)\" % (\", \".join(ctx.nstr(c, n, **kwargs) for c in x))\n if hasattr(x, '_mpf_'):\n return to_str(x._mpf_, n, **kwargs)\n if hasattr(x, '_mpc_'):\n return \"(\" + mpc_to_str(x._mpc_, n, **kwargs) + \")\"\n if isinstance(x, basestring):\n return repr(x)\n if isinstance(x, ctx.matrix):\n return x.__nstr__(n, **kwargs)\n return str(x)", "metadata": "root.MPContext.nstr", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 563 }, { "content": " def _convert_fallback(ctx, x, strings):\n if strings and isinstance(x, basestring):\n if 'j' in x.lower():\n x = x.lower().replace(' ', '')\n match = get_complex.match(x)\n re = match.group('re')\n if not re:\n re = 0\n im = match.group('im').rstrip('j')\n return ctx.mpc(ctx.convert(re), ctx.convert(im))\n if hasattr(x, \"_mpi_\"):\n a, b = x._mpi_\n if a == b:\n return ctx.make_mpf(a)\n else:\n raise ValueError(\"can only create mpf from zero-width interval\")\n raise TypeError(\"cannot create mpf from \" + repr(x))", "metadata": "root.MPContext._convert_fallback", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 617 }, { "content": " def _parse_prec(ctx, kwargs):\n if kwargs:\n if kwargs.get('exact'):\n return 0, 'f'\n prec, rounding = ctx._prec_rounding\n if 'rounding' in kwargs:\n rounding = kwargs['rounding']\n if 'prec' in kwargs:\n prec = kwargs['prec']\n if prec == ctx.inf:\n return 0, 'f'\n else:\n prec = int(prec)\n elif 'dps' in kwargs:\n dps = kwargs['dps']\n if dps == ctx.inf:\n return 0, 'f'\n prec = dps_to_prec(dps)\n return prec, rounding\n return ctx._prec_rounding", "metadata": "root.MPContext._parse_prec", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 638 }, { "content": " def hypsum(ctx, p, q, flags, coeffs, z, accurate_small=True, **kwargs):\n if hasattr(z, \"_mpf_\"):\n key = p, q, flags, 'R'\n v = z._mpf_\n elif hasattr(z, \"_mpc_\"):\n key = p, q, flags, 'C'\n v = z._mpc_\n if key not in ctx.hyp_summators:\n ctx.hyp_summators[key] = libmp.make_hyp_summator(key)[1]\n summator = ctx.hyp_summators[key]\n prec = ctx.prec\n maxprec = kwargs.get('maxprec', ctx._default_hyper_maxprec(prec))\n extraprec = 50\n epsshift = 25\n # Jumps in magnitude occur when parameters are close to negative\n # integers. We must ensure that these terms are included in\n # the sum and added accurately\n magnitude_check = {}\n max_total_jump = 0\n for i, c in enumerate(coeffs):\n if flags[i] == 'Z':\n if i >= p and c <= 0:\n ok = False\n for ii, cc in enumerate(coeffs[:p]):\n # Note: c <= cc or c < cc, depending on convention\n if flags[ii] == 'Z' and cc <= 0 and c <= cc:\n ok = True\n if not ok:\n raise ZeroDivisionError(\"pole in hypergeometric series\")\n continue\n n, d = ctx.nint_distance(c)\n n = -int(n)\n d = -d\n if i >= p and n >= 0 and d > 4:\n if n in magnitude_check:\n magnitude_check[n] += d\n else:\n magnitude_check[n] = d\n extraprec = max(extraprec, d - prec + 60)\n max_total_jump += abs(d)\n while 1:\n if extraprec > maxprec:\n raise ValueError(ctx._hypsum_msg % (prec, prec+extraprec))\n wp = prec + extraprec\n if magnitude_check:\n mag_dict = dict((n,None) for n in magnitude_check)\n else:\n mag_dict = {}\n zv, have_complex, magnitude = summator(coeffs, v, prec, wp, \\\n epsshift, mag_dict, **kwargs)\n cancel = -magnitude\n jumps_resolved = True\n if extraprec < max_total_jump:\n for n in mag_dict.values():\n if (n is None) or (n < prec):\n jumps_resolved = False\n break\n accurate = (cancel < extraprec-25-5 or not accurate_small)\n if jumps_resolved:\n if accurate:\n break\n # zero?\n zeroprec = kwargs.get('zeroprec')\n if zeroprec is not None:\n if cancel > zeroprec:\n if have_complex:\n return ctx.mpc(0)\n else:\n return ctx.zero\n\n # Some near-singularities were not included, so increase\n # precision and repeat until they are\n extraprec *= 2\n # Possible workaround for bad roundoff in fixed-point arithmetic\n epsshift += 5\n extraprec += 5\n\n if type(zv) is tuple:\n if have_complex:\n return ctx.make_mpc(zv)\n else:\n return ctx.make_mpf(zv)\n else:\n return zv", "metadata": "root.MPContext.hypsum", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 665 }, { "content": " def ldexp(ctx, x, n):\n r\"\"\"\n Computes `x 2^n` efficiently. No rounding is performed.\n The argument `x` must be a real floating-point number (or\n possible to convert into one) and `n` must be a Python ``int``.\n\n >>> from mpmath import *\n >>> mp.dps = 15; mp.pretty = False\n >>> ldexp(1, 10)\n mpf('1024.0')\n >>> ldexp(1, -3)\n mpf('0.125')\n\n \"\"\"\n x = ctx.convert(x)\n return ctx.make_mpf(libmp.mpf_shift(x._mpf_, n))", "metadata": "root.MPContext.ldexp", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 750 }, { "content": " def frexp(ctx, x):\n r\"\"\"\n Given a real number `x`, returns `(y, n)` with `y \\in [0.5, 1)`,\n `n` a Python integer, and such that `x = y 2^n`. No rounding is\n performed.\n\n >>> from mpmath import *\n >>> mp.dps = 15; mp.pretty = False\n >>> frexp(7.5)\n (mpf('0.9375'), 3)\n\n \"\"\"\n x = ctx.convert(x)\n y, n = libmp.mpf_frexp(x._mpf_)\n return ctx.make_mpf(y), n", "metadata": "root.MPContext.frexp", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 767 }, { "content": " def fneg(ctx, x, **kwargs):\n \"\"\"\n Negates the number *x*, giving a floating-point result, optionally\n using a custom precision and rounding mode.\n\n See the documentation of :func:`~mpmath.fadd` for a detailed description\n of how to specify precision and rounding.\n\n **Examples**\n\n An mpmath number is returned::\n\n >>> from mpmath import *\n >>> mp.dps = 15; mp.pretty = False\n >>> fneg(2.5)\n mpf('-2.5')\n >>> fneg(-5+2j)\n mpc(real='5.0', imag='-2.0')\n\n Precise control over rounding is possible::\n\n >>> x = fadd(2, 1e-100, exact=True)\n >>> fneg(x)\n mpf('-2.0')\n >>> fneg(x, rounding='f')\n mpf('-2.0000000000000004')\n\n Negating with and without roundoff::\n\n >>> n = 200000000000000000000001\n >>> print(int(-mpf(n)))\n -200000000000000016777216\n >>> print(int(fneg(n)))\n -200000000000000016777216\n >>> print(int(fneg(n, prec=log(n,2)+1)))\n -200000000000000000000001\n >>> print(int(fneg(n, dps=log(n,10)+1)))\n -200000000000000000000001\n >>> print(int(fneg(n, prec=inf)))\n -200000000000000000000001\n >>> print(int(fneg(n, dps=inf)))\n -200000000000000000000001\n >>> print(int(fneg(n, exact=True)))\n -200000000000000000000001\n\n \"\"\"\n prec, rounding = ctx._parse_prec(kwargs)\n x = ctx.convert(x)\n if hasattr(x, '_mpf_'):\n return ctx.make_mpf(mpf_neg(x._mpf_, prec, rounding))\n if hasattr(x, '_mpc_'):\n return ctx.make_mpc(mpc_neg(x._mpc_, prec, rounding))\n raise ValueError(\"Arguments need to be mpf or mpc compatible numbers\")", "metadata": "root.MPContext.fneg", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 783 }, { "content": " def fadd(ctx, x, y, **kwargs):\n \"\"\"\n Adds the numbers *x* and *y*, giving a floating-point result,\n optionally using a custom precision and rounding mode.\n\n The default precision is the working precision of the context.\n You can specify a custom precision in bits by passing the *prec* keyword\n argument, or by providing an equivalent decimal precision with the *dps*\n keyword argument. If the precision is set to ``+inf``, or if the flag\n *exact=True* is passed, an exact addition with no rounding is performed.\n\n When the precision is finite, the optional *rounding* keyword argument\n specifies the direction of rounding. Valid options are ``'n'`` for\n nearest (default), ``'f'`` for floor, ``'c'`` for ceiling, ``'d'``\n for down, ``'u'`` for up.\n\n **Examples**\n\n Using :func:`~mpmath.fadd` with precision and rounding control::\n\n >>> from mpmath import *\n >>> mp.dps = 15; mp.pretty = False\n >>> fadd(2, 1e-20)\n mpf('2.0')\n >>> fadd(2, 1e-20, rounding='u')\n mpf('2.0000000000000004')\n >>> nprint(fadd(2, 1e-20, prec=100), 25)\n 2.00000000000000000001\n >>> nprint(fadd(2, 1e-20, dps=15), 25)\n 2.0\n >>> nprint(fadd(2, 1e-20, dps=25), 25)\n 2.00000000000000000001\n >>> nprint(fadd(2, 1e-20, exact=True), 25)\n 2.00000000000000000001\n\n Exact addition avoids cancellation errors, enforcing familiar laws\n of numbers such as `x+y-x = y`, which don't hold in floating-point\n arithmetic with finite precision::\n\n >>> x, y = mpf(2), mpf('1e-1000')\n >>> print(x + y - x)\n 0.0\n >>> print(fadd(x, y, prec=inf) - x)\n 1.0e-1000\n >>> print(fadd(x, y, exact=True) - x)\n 1.0e-1000\n\n Exact addition can be inefficient and may be impossible to perform\n with large magnitude differences::\n\n >>> fadd(1, '1e-100000000000000000000', prec=inf)\n Traceback (most recent call last):\n ...\n OverflowError: the exact result does not fit in memory\n\n \"\"\"\n prec, rounding = ctx._parse_prec(kwargs)\n x = ctx.convert(x)\n y = ctx.convert(y)\n try:\n if hasattr(x, '_mpf_'):\n if hasattr(y, '_mpf_'):\n return ctx.make_mpf(mpf_add(x._mpf_, y._mpf_, prec, rounding))\n if hasattr(y, '_mpc_'):\n return ctx.make_mpc(mpc_add_mpf(y._mpc_, x._mpf_, prec, rounding))\n if hasattr(x, '_mpc_'):\n if hasattr(y, '_mpf_'):\n return ctx.make_mpc(mpc_add_mpf(x._mpc_, y._mpf_, prec, rounding))\n if hasattr(y, '_mpc_'):\n return ctx.make_mpc(mpc_add(x._mpc_, y._mpc_, prec, rounding))\n except (ValueError, OverflowError):\n raise OverflowError(ctx._exact_overflow_msg)\n raise ValueError(\"Arguments need to be mpf or mpc compatible numbers\")", "metadata": "root.MPContext.fadd", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 837 }, { "content": " def fsub(ctx, x, y, **kwargs):\n \"\"\"\n Subtracts the numbers *x* and *y*, giving a floating-point result,\n optionally using a custom precision and rounding mode.\n\n See the documentation of :func:`~mpmath.fadd` for a detailed description\n of how to specify precision and rounding.\n\n **Examples**\n\n Using :func:`~mpmath.fsub` with precision and rounding control::\n\n >>> from mpmath import *\n >>> mp.dps = 15; mp.pretty = False\n >>> fsub(2, 1e-20)\n mpf('2.0')\n >>> fsub(2, 1e-20, rounding='d')\n mpf('1.9999999999999998')\n >>> nprint(fsub(2, 1e-20, prec=100), 25)\n 1.99999999999999999999\n >>> nprint(fsub(2, 1e-20, dps=15), 25)\n 2.0\n >>> nprint(fsub(2, 1e-20, dps=25), 25)\n 1.99999999999999999999\n >>> nprint(fsub(2, 1e-20, exact=True), 25)\n 1.99999999999999999999\n\n Exact subtraction avoids cancellation errors, enforcing familiar laws\n of numbers such as `x-y+y = x`, which don't hold in floating-point\n arithmetic with finite precision::\n\n >>> x, y = mpf(2), mpf('1e1000')\n >>> print(x - y + y)\n 0.0\n >>> print(fsub(x, y, prec=inf) + y)\n 2.0\n >>> print(fsub(x, y, exact=True) + y)\n 2.0\n\n Exact addition can be inefficient and may be impossible to perform\n with large magnitude differences::\n\n >>> fsub(1, '1e-100000000000000000000', prec=inf)\n Traceback (most recent call last):\n ...\n OverflowError: the exact result does not fit in memory\n\n \"\"\"\n prec, rounding = ctx._parse_prec(kwargs)\n x = ctx.convert(x)\n y = ctx.convert(y)\n try:\n if hasattr(x, '_mpf_'):\n if hasattr(y, '_mpf_'):\n return ctx.make_mpf(mpf_sub(x._mpf_, y._mpf_, prec, rounding))\n if hasattr(y, '_mpc_'):\n return ctx.make_mpc(mpc_sub((x._mpf_, fzero), y._mpc_, prec, rounding))\n if hasattr(x, '_mpc_'):\n if hasattr(y, '_mpf_'):\n return ctx.make_mpc(mpc_sub_mpf(x._mpc_, y._mpf_, prec, rounding))\n if hasattr(y, '_mpc_'):\n return ctx.make_mpc(mpc_sub(x._mpc_, y._mpc_, prec, rounding))\n except (ValueError, OverflowError):\n raise OverflowError(ctx._exact_overflow_msg)\n raise ValueError(\"Arguments need to be mpf or mpc compatible numbers\")", "metadata": "root.MPContext.fsub", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 911 }, { "content": " def fmul(ctx, x, y, **kwargs):\n \"\"\"\n Multiplies the numbers *x* and *y*, giving a floating-point result,\n optionally using a custom precision and rounding mode.\n\n See the documentation of :func:`~mpmath.fadd` for a detailed description\n of how to specify precision and rounding.\n\n **Examples**\n\n The result is an mpmath number::\n\n >>> from mpmath import *\n >>> mp.dps = 15; mp.pretty = False\n >>> fmul(2, 5.0)\n mpf('10.0')\n >>> fmul(0.5j, 0.5)\n mpc(real='0.0', imag='0.25')\n\n Avoiding roundoff::\n\n >>> x, y = 10**10+1, 10**15+1\n >>> print(x*y)\n 10000000001000010000000001\n >>> print(mpf(x) * mpf(y))\n 1.0000000001e+25\n >>> print(int(mpf(x) * mpf(y)))\n 10000000001000011026399232\n >>> print(int(fmul(x, y)))\n 10000000001000011026399232\n >>> print(int(fmul(x, y, dps=25)))\n 10000000001000010000000001\n >>> print(int(fmul(x, y, exact=True)))\n 10000000001000010000000001\n\n Exact multiplication with complex numbers can be inefficient and may\n be impossible to perform with large magnitude differences between\n real and imaginary parts::\n\n >>> x = 1+2j\n >>> y = mpc(2, '1e-100000000000000000000')\n >>> fmul(x, y)\n mpc(real='2.0', imag='4.0')\n >>> fmul(x, y, rounding='u')\n mpc(real='2.0', imag='4.0000000000000009')\n >>> fmul(x, y, exact=True)\n Traceback (most recent call last):\n ...\n OverflowError: the exact result does not fit in memory\n\n \"\"\"\n prec, rounding = ctx._parse_prec(kwargs)\n x = ctx.convert(x)\n y = ctx.convert(y)\n try:\n if hasattr(x, '_mpf_'):\n if hasattr(y, '_mpf_'):\n return ctx.make_mpf(mpf_mul(x._mpf_, y._mpf_, prec, rounding))\n if hasattr(y, '_mpc_'):\n return ctx.make_mpc(mpc_mul_mpf(y._mpc_, x._mpf_, prec, rounding))\n if hasattr(x, '_mpc_'):\n if hasattr(y, '_mpf_'):\n return ctx.make_mpc(mpc_mul_mpf(x._mpc_, y._mpf_, prec, rounding))\n if hasattr(y, '_mpc_'):\n return ctx.make_mpc(mpc_mul(x._mpc_, y._mpc_, prec, rounding))\n except (ValueError, OverflowError):\n raise OverflowError(ctx._exact_overflow_msg)\n raise ValueError(\"Arguments need to be mpf or mpc compatible numbers\")", "metadata": "root.MPContext.fmul", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 977 }, { "content": " def fdiv(ctx, x, y, **kwargs):\n \"\"\"\n Divides the numbers *x* and *y*, giving a floating-point result,\n optionally using a custom precision and rounding mode.\n\n See the documentation of :func:`~mpmath.fadd` for a detailed description\n of how to specify precision and rounding.\n\n **Examples**\n\n The result is an mpmath number::\n\n >>> from mpmath import *\n >>> mp.dps = 15; mp.pretty = False\n >>> fdiv(3, 2)\n mpf('1.5')\n >>> fdiv(2, 3)\n mpf('0.66666666666666663')\n >>> fdiv(2+4j, 0.5)\n mpc(real='4.0', imag='8.0')\n\n The rounding direction and precision can be controlled::\n\n >>> fdiv(2, 3, dps=3) # Should be accurate to at least 3 digits\n mpf('0.6666259765625')\n >>> fdiv(2, 3, rounding='d')\n mpf('0.66666666666666663')\n >>> fdiv(2, 3, prec=60)\n mpf('0.66666666666666667')\n >>> fdiv(2, 3, rounding='u')\n mpf('0.66666666666666674')\n\n Checking the error of a division by performing it at higher precision::\n\n >>> fdiv(2, 3) - fdiv(2, 3, prec=100)\n mpf('-3.7007434154172148e-17')\n\n Unlike :func:`~mpmath.fadd`, :func:`~mpmath.fmul`, etc., exact division is not\n allowed since the quotient of two floating-point numbers generally\n does not have an exact floating-point representation. (In the\n future this might be changed to allow the case where the division\n is actually exact.)\n\n >>> fdiv(2, 3, exact=True)\n Traceback (most recent call last):\n ...\n ValueError: division is not an exact operation\n\n \"\"\"\n prec, rounding = ctx._parse_prec(kwargs)\n if not prec:\n raise ValueError(\"division is not an exact operation\")\n x = ctx.convert(x)\n y = ctx.convert(y)\n if hasattr(x, '_mpf_'):\n if hasattr(y, '_mpf_'):\n return ctx.make_mpf(mpf_div(x._mpf_, y._mpf_, prec, rounding))\n if hasattr(y, '_mpc_'):\n return ctx.make_mpc(mpc_div((x._mpf_, fzero), y._mpc_, prec, rounding))\n if hasattr(x, '_mpc_'):\n if hasattr(y, '_mpf_'):\n return ctx.make_mpc(mpc_div_mpf(x._mpc_, y._mpf_, prec, rounding))\n if hasattr(y, '_mpc_'):\n return ctx.make_mpc(mpc_div(x._mpc_, y._mpc_, prec, rounding))\n raise ValueError(\"Arguments need to be mpf or mpc compatible numbers\")", "metadata": "root.MPContext.fdiv", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 1046 }, { "content": " def nint_distance(ctx, x):\n r\"\"\"\n Return `(n,d)` where `n` is the nearest integer to `x` and `d` is\n an estimate of `\\log_2(|x-n|)`. If `d < 0`, `-d` gives the precision\n (measured in bits) lost to cancellation when computing `x-n`.\n\n >>> from mpmath import *\n >>> n, d = nint_distance(5)\n >>> print(n); print(d)\n 5\n -inf\n >>> n, d = nint_distance(mpf(5))\n >>> print(n); print(d)\n 5\n -inf\n >>> n, d = nint_distance(mpf(5.00000001))\n >>> print(n); print(d)\n 5\n -26\n >>> n, d = nint_distance(mpf(4.99999999))\n >>> print(n); print(d)\n 5\n -26\n >>> n, d = nint_distance(mpc(5,10))\n >>> print(n); print(d)\n 5\n 4\n >>> n, d = nint_distance(mpc(5,0.000001))\n >>> print(n); print(d)\n 5\n -19\n\n \"\"\"\n typx = type(x)\n if typx in int_types:\n return int(x), ctx.ninf\n elif typx is rational.mpq:\n p, q = x._mpq_\n n, r = divmod(p, q)\n if 2*r >= q:\n n += 1\n elif not r:\n return n, ctx.ninf\n # log(p/q-n) = log((p-nq)/q) = log(p-nq) - log(q)\n d = bitcount(abs(p-n*q)) - bitcount(q)\n return n, d\n if hasattr(x, \"_mpf_\"):\n re = x._mpf_\n im_dist = ctx.ninf\n elif hasattr(x, \"_mpc_\"):\n re, im = x._mpc_\n isign, iman, iexp, ibc = im\n if iman:\n im_dist = iexp + ibc\n elif im == fzero:\n im_dist = ctx.ninf\n else:\n raise ValueError(\"requires a finite number\")\n else:\n x = ctx.convert(x)\n if hasattr(x, \"_mpf_\") or hasattr(x, \"_mpc_\"):\n return ctx.nint_distance(x)\n else:\n raise TypeError(\"requires an mpf/mpc\")\n sign, man, exp, bc = re\n mag = exp+bc\n # |x| < 0.5\n if mag < 0:\n n = 0\n re_dist = mag\n elif man:\n # exact integer\n if exp >= 0:\n n = man << exp\n re_dist = ctx.ninf\n # exact half-integer\n elif exp == -1:\n n = (man>>1)+1\n re_dist = 0\n else:\n d = (-exp-1)\n t = man >> d\n if t & 1:\n t += 1\n man = (t<<d) - man\n else:\n man -= (t<<d)\n n = t>>1 # int(t)>>1\n re_dist = exp+bitcount(man)\n if sign:\n n = -n\n elif re == fzero:\n re_dist = ctx.ninf\n n = 0\n else:\n raise ValueError(\"requires a finite number\")\n return n, max(re_dist, im_dist)", "metadata": "root.MPContext.nint_distance", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 1112 }, { "content": " def fprod(ctx, factors):\n r\"\"\"\n Calculates a product containing a finite number of factors (for\n infinite products, see :func:`~mpmath.nprod`). The factors will be\n converted to mpmath numbers.\n\n >>> from mpmath import *\n >>> mp.dps = 15; mp.pretty = False\n >>> fprod([1, 2, 0.5, 7])\n mpf('7.0')\n\n \"\"\"\n orig = ctx.prec\n try:\n v = ctx.one\n for p in factors:\n v *= p\n finally:\n ctx.prec = orig\n return +v", "metadata": "root.MPContext.fprod", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 1210 }, { "content": " def rand(ctx):\n \"\"\"\n Returns an ``mpf`` with value chosen randomly from `[0, 1)`.\n The number of randomly generated bits in the mantissa is equal\n to the working precision.\n \"\"\"\n return ctx.make_mpf(mpf_rand(ctx._prec))", "metadata": "root.MPContext.rand", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 1231 }, { "content": " def fraction(ctx, p, q):\n \"\"\"\n Given Python integers `(p, q)`, returns a lazy ``mpf`` representing\n the fraction `p/q`. The value is updated with the precision.\n\n >>> from mpmath import *\n >>> mp.dps = 15\n >>> a = fraction(1,100)\n >>> b = mpf(1)/100\n >>> print(a); print(b)\n 0.01\n 0.01\n >>> mp.dps = 30\n >>> print(a); print(b) # a will be accurate\n 0.01\n 0.0100000000000000002081668171172\n >>> mp.dps = 15\n \"\"\"\n return ctx.constant(lambda prec, rnd: from_rational(p, q, prec, rnd),\n '%s/%s' % (p, q))", "metadata": "root.MPContext.fraction", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 1239 }, { "content": " def absmin(ctx, x):\n return abs(ctx.convert(x))", "metadata": "root.MPContext.absmin", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 1260 }, { "content": " def absmax(ctx, x):\n return abs(ctx.convert(x))", "metadata": "root.MPContext.absmax", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 1263 }, { "content": " def _as_points(ctx, x):\n # XXX: remove this?\n if hasattr(x, '_mpi_'):\n a, b = x._mpi_\n return [ctx.make_mpf(a), ctx.make_mpf(b)]\n return x", "metadata": "root.MPContext._as_points", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 1266 }, { "content": " def _zetasum_fast(ctx, s, a, n, derivatives=[0], reflect=False):\n if not (ctx.isint(a) and hasattr(s, \"_mpc_\")):\n raise NotImplementedError\n a = int(a)\n prec = ctx._prec\n xs, ys = libmp.mpc_zetasum(s._mpc_, a, n, derivatives, reflect, prec)\n xs = [ctx.make_mpc(x) for x in xs]\n ys = [ctx.make_mpc(y) for y in ys]\n return xs, ys", "metadata": "root.MPContext._zetasum_fast", "header": "['class', 'MPContext', '(', 'BaseMPContext', ',', 'StandardBaseContext', ')', ':', '___EOS___']", "index": 1290 } ]
[ { "span": "def __init__(ctx):", "start_line": 60, "start_column": 4, "end_line": 60, "end_column": 22 }, { "span": "def init_builtins(ctx):", "start_line": 93, "start_column": 4, "end_line": 93, "end_column": 27 }, { "span": "def to_fixed(ctx, x, prec):", "start_line": 181, "start_column": 4, "end_line": 181, "end_column": 31 }, { "span": "def hypot(ctx, x, y):", "start_line": 184, "start_column": 4, "end_line": 184, "end_column": 25 }, { "span": "def _gamma_upper_int(ctx, n, z):", "start_line": 192, "start_column": 4, "end_line": 192, "end_column": 36 }, { "span": "def _expint_int(ctx, n, z):", "start_line": 205, "start_column": 4, "end_line": 205, "end_column": 31 }, { "span": "def _nthroot(ctx, x, n):", "start_line": 218, "start_column": 4, "end_line": 218, "end_column": 28 }, { "span": "def _besselj(ctx, n, z):", "start_line": 230, "start_column": 4, "end_line": 230, "end_column": 28 }, { "span": "def _agm(ctx, a, b=1):", "start_line": 237, "start_column": 4, "end_line": 237, "end_column": 26 }, { "span": "def bernoulli(ctx, n):", "start_line": 251, "start_column": 4, "end_line": 251, "end_column": 26 }, { "span": "def _zeta_int(ctx, n):", "start_line": 254, "start_column": 4, "end_line": 254, "end_column": 26 }, { "span": "def atan2(ctx, y, x):", "start_line": 257, "start_column": 4, "end_line": 257, "end_column": 25 }, { "span": "def psi(ctx, m, z):", "start_line": 262, "start_column": 4, "end_line": 262, "end_column": 23 }, { "span": "def cos_sin(ctx, x, **kwargs):", "start_line": 270, "start_column": 4, "end_line": 270, "end_column": 34 }, { "span": "def cospi_sinpi(ctx, x, **kwargs):", "start_line": 283, "start_column": 4, "end_line": 283, "end_column": 38 }, { "span": "def clone(ctx):", "start_line": 296, "start_column": 4, "end_line": 296, "end_column": 19 }, { "span": "def _is_real_type(ctx, x):", "start_line": 307, "start_column": 4, "end_line": 307, "end_column": 30 }, { "span": "def _is_complex_type(ctx, x):", "start_line": 312, "start_column": 4, "end_line": 312, "end_column": 33 }, { "span": "def isnan(ctx, x):", "start_line": 317, "start_column": 4, "end_line": 317, "end_column": 22 }, { "span": "def isfinite(ctx, x):", "start_line": 345, "start_column": 4, "end_line": 345, "end_column": 25 }, { "span": "def isnpint(ctx, x):", "start_line": 371, "start_column": 4, "end_line": 371, "end_column": 24 }, { "span": "def __str__(ctx):", "start_line": 391, "start_column": 4, "end_line": 391, "end_column": 21 }, { "span": "def extraprec(ctx, n, normalize_output=False):", "start_line": 407, "start_column": 4, "end_line": 407, "end_column": 50 }, { "span": "def extradps(ctx, n, normalize_output=False):", "start_line": 425, "start_column": 4, "end_line": 425, "end_column": 49 }, { "span": "def workprec(ctx, n, normalize_output=False):", "start_line": 432, "start_column": 4, "end_line": 432, "end_column": 49 }, { "span": "def workdps(ctx, n, normalize_output=False):", "start_line": 449, "start_column": 4, "end_line": 449, "end_column": 48 }, { "span": "def autoprec(ctx, f, maxprec=None, catch=(), verbose=False):", "start_line": 456, "start_column": 4, "end_line": 456, "end_column": 64 }, { "span": "def nstr(ctx, x, n=6, **kwargs):", "start_line": 563, "start_column": 4, "end_line": 563, "end_column": 36 }, { "span": "def _convert_fallback(ctx, x, strings):", "start_line": 617, "start_column": 4, "end_line": 617, "end_column": 43 }, { "span": "def _parse_prec(ctx, kwargs):", "start_line": 638, "start_column": 4, "end_line": 638, "end_column": 33 }, { "span": "def hypsum(ctx, p, q, flags, coeffs, z, accurate_small=True, **kwargs):", "start_line": 665, "start_column": 4, "end_line": 665, "end_column": 75 }, { "span": "def ldexp(ctx, x, n):", "start_line": 750, "start_column": 4, "end_line": 750, "end_column": 25 }, { "span": "def frexp(ctx, x):", "start_line": 767, "start_column": 4, "end_line": 767, "end_column": 22 }, { "span": "def fneg(ctx, x, **kwargs):", "start_line": 783, "start_column": 4, "end_line": 783, "end_column": 31 }, { "span": "def fadd(ctx, x, y, **kwargs):", "start_line": 837, "start_column": 4, "end_line": 837, "end_column": 34 }, { "span": "def fsub(ctx, x, y, **kwargs):", "start_line": 911, "start_column": 4, "end_line": 911, "end_column": 34 }, { "span": "def fmul(ctx, x, y, **kwargs):", "start_line": 977, "start_column": 4, "end_line": 977, "end_column": 34 }, { "span": "def fdiv(ctx, x, y, **kwargs):", "start_line": 1046, "start_column": 4, "end_line": 1046, "end_column": 34 }, { "span": "def nint_distance(ctx, x):", "start_line": 1112, "start_column": 4, "end_line": 1112, "end_column": 30 }, { "span": "def fprod(ctx, factors):", "start_line": 1210, "start_column": 4, "end_line": 1210, "end_column": 28 }, { "span": "def rand(ctx):", "start_line": 1231, "start_column": 4, "end_line": 1231, "end_column": 18 }, { "span": "def fraction(ctx, p, q):", "start_line": 1239, "start_column": 4, "end_line": 1239, "end_column": 28 }, { "span": "def absmin(ctx, x):", "start_line": 1260, "start_column": 4, "end_line": 1260, "end_column": 23 }, { "span": "def absmax(ctx, x):", "start_line": 1263, "start_column": 4, "end_line": 1263, "end_column": 23 }, { "span": "def _as_points(ctx, x):", "start_line": 1266, "start_column": 4, "end_line": 1266, "end_column": 27 }, { "span": "def _zetasum_fast(ctx, s, a, n, derivatives=[0], reflect=False):", "start_line": 1290, "start_column": 4, "end_line": 1290, "end_column": 68 } ]
[]
1
true
[ "[CLS]_", "First_", "parameter_", "of_", "a_", "method_", "is_", "not_", "named_", "'", "self", "'_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "ctx_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Base", "MP", "Context_", "._", "\\u\\u", "init\\u\\u_", "(_", "ctx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "trap", "\\u", "complex_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "pretty_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "types_", "=_", "[_", "ctx_", "._", "mpf", "_", ",_", "ctx_", "._", "mpc", "_", ",_", "ctx_", "._", "constant_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "\\u", "mp", "q_", "=_", "rational", "_", "._", "mp", "q_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "default_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Standard", "Base", "Context_", "._", "\\u\\u", "init\\u\\u_", "(_", "ctx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "mp", "q_", "=_", "rational", "_", "._", "mp", "q_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "init", "\\u", "builtins_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "hyp", "\\u", "summa", "tors_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "\\u", "init", "\\u", "aliases_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", ":", " ", "automat", "e_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "bern", "oulli", "_", "._", "im", "\\u", "func_", "._", "func", "\\u", "doc_", "=_", "function", "\\u", "docs_", "._", "bern", "oulli", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "prim", "epi", "_", "._", "im", "\\u", "func_", "._", "func", "\\u", "doc_", "=_", "function", "\\u", "docs_", "._", "prim", "epi", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "psi_", "._", "im", "\\u", "func_", "._", "func", "\\u", "doc_", "=_", "function", "\\u", "docs_", "._", "psi_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "atan2_", "._", "im", "\\u", "func_", "._", "func", "\\u", "doc_", "=_", "function", "\\u", "docs_", "._", "atan2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "python", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "bern", "oulli", "_", "._", "\\u\\u", "func", "\\u\\u_", "._", "func", "\\u", "doc_", "=_", "function", "\\u", "docs_", "._", "bern", "oulli", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "prim", "epi", "_", "._", "\\u\\u", "func", "\\u\\u_", "._", "func", "\\u", "doc_", "=_", "function", "\\u", "docs_", "._", "prim", "epi", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "psi_", "._", "\\u\\u", "func", "\\u\\u_", "._", "func", "\\u", "doc_", "=_", "function", "\\u", "docs_", "._", "psi_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "atan2_", "._", "\\u\\u", "func", "\\u\\u_", "._", "func", "\\u", "doc_", "=_", "function", "\\u", "docs_", "._", "atan2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ctx_", "._", "dig", "amma", "_", "._", "func", "\\u", "doc_", "=_", "function", "\\u", "docs_", "._", "dig", "amma", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "cos", "pi_", "._", "func", "\\u", "doc_", "=_", "function", "\\u", "docs_", "._", "cos", "pi_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "sin", "pi_", "._", "func", "\\u", "doc_", "=_", "function", "\\u", "docs_", "._", "sin", "pi_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "init", "\\u", "builtins_", "(_", "ctx_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mpf", "_", "=_", "ctx_", "._", "mpf", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mpc", "_", "=_", "ctx_", "._", "mpc", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Exa", "ct", " ", "constants_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "one_", "=_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "fon", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "zero_", "=_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "fz", "ero", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "j_", "=_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "(_", "fz", "ero", "_", ",_", "fon", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "inf_", "=_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "fin", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "nin", "f_", "=_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "fn", "inf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "nan_", "=_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "fna", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "eps_", "=_", "ctx_", "._", "constant_", "(_", "lambda_", "prec_", ",_", "rnd_", ":_", "(_", "0_", ",_", "MP", "Z", "\\u", "ONE_", ",_", "1_", "-_", "prec_", ",_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "eps", "ilon", " ", "of", " ", "working", " ", "preci", "sion", "\"_", ",_", "\"", "eps", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "eps_", "=_", "eps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Approx", "imat", "e", " ", "constants_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "pi_", "=_", "ctx_", "._", "constant_", "(_", "mpf", "\\u", "pi_", ",_", "\"", "pi", "\"_", ",_", "\"", "pi", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "ln", "2_", "=_", "ctx_", "._", "constant_", "(_", "mpf", "\\u", "ln", "2_", ",_", "\"", "ln", "(", "2", ")\"_", ",_", "\"", "ln", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "ln", "10_", "=_", "ctx_", "._", "constant_", "(_", "mpf", "\\u", "ln", "10_", ",_", "\"", "ln", "(", "10", ")\"_", ",_", "\"", "ln", "10", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "phi_", "=_", "ctx_", "._", "constant_", "(_", "mpf", "\\u", "phi_", ",_", "\"", "Gold", "en", " ", "ratio", " ", "phi", "\"_", ",_", "\"", "phi", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "e_", "=_", "ctx_", "._", "constant_", "(_", "mpf", "\\u", "e_", ",_", "\"", "e", " ", "=", " ", "exp", "(", "1", ")\"_", ",_", "\"", "e", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "euler_", "=_", "ctx_", "._", "constant_", "(_", "mpf", "\\u", "euler_", ",_", "\"", "Euler", "'", "s", " ", "constant", "\"_", ",_", "\"", "euler", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "catal", "an_", "=_", "ctx_", "._", "constant_", "(_", "mpf", "\\u", "catal", "an_", ",_", "\"", "Cata", "lan", "'", "s", " ", "constant", "\"_", ",_", "\"", "catal", "an", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "kh", "inch", "in_", "=_", "ctx_", "._", "constant_", "(_", "mpf", "\\u", "kh", "inch", "in_", ",_", "\"", "Kh", "inch", "in", "'", "s", " ", "constant", "\"_", ",_", "\"", "kh", "inch", "in", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "gla", "ish", "er_", "=_", "ctx_", "._", "constant_", "(_", "mpf", "\\u", "gla", "ish", "er_", ",_", "\"", "Gla", "ish", "er", "'", "s", " ", "constant", "\"_", ",_", "\"", "gla", "ish", "er", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "aper", "y_", "=_", "ctx_", "._", "constant_", "(_", "mpf", "\\u", "aper", "y_", ",_", "\"", "Ape", "ry", "'", "s", " ", "constant", "\"_", ",_", "\"", "aper", "y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "degree_", "=_", "ctx_", "._", "constant_", "(_", "mpf", "\\u", "degree_", ",_", "\"", "1", " ", "deg", " ", "=", " ", "pi", " ", "/", " ", "180", "\"_", ",_", "\"", "degr", "ee", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "twin", "prime_", "=_", "ctx_", "._", "constant_", "(_", "mpf", "\\u", "twin", "prime_", ",_", "\"", "Twi", "n", " ", "prim", "e", " ", "constant", "\"_", ",_", "\"", "twin", "prim", "e", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "mer", "tens", "_", "=_", "ctx_", "._", "constant_", "(_", "mpf", "\\u", "mer", "tens", "_", ",_", "\"", "Mer", "tens", "'", " ", "constant", "\"_", ",_", "\"", "mer", "tens", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Standard", " ", "functions_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "sqrt_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "sqrt_", ",_", "libm", "p_", "._", "mpc", "\\u", "sqrt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "cb", "rt_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "cb", "rt_", ",_", "libm", "p_", "._", "mpc", "\\u", "cb", "rt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "ln_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "log_", ",_", "libm", "p_", "._", "mpc", "\\u", "log_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "atan", "_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "atan", "_", ",_", "libm", "p_", "._", "mpc", "\\u", "atan", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "exp_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "exp_", ",_", "libm", "p_", "._", "mpc", "\\u", "exp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "exp", "j_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "exp", "j_", ",_", "libm", "p_", "._", "mpc", "\\u", "exp", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "exp", "jp", "i_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "exp", "jp", "i_", ",_", "libm", "p_", "._", "mpc", "\\u", "exp", "jp", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "sin_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "sin_", ",_", "libm", "p_", "._", "mpc", "\\u", "sin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "cos_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "cos_", ",_", "libm", "p_", "._", "mpc", "\\u", "cos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "tan_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "tan_", ",_", "libm", "p_", "._", "mpc", "\\u", "tan_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "sinh", "_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "sinh", "_", ",_", "libm", "p_", "._", "mpc", "\\u", "sinh", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "cos", "h_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "cos", "h_", ",_", "libm", "p_", "._", "mpc", "\\u", "cos", "h_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "tanh_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "tanh_", ",_", "libm", "p_", "._", "mpc", "\\u", "tanh_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "asin", "_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "asin", "_", ",_", "libm", "p_", "._", "mpc", "\\u", "asin", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "acos", "_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "acos", "_", ",_", "libm", "p_", "._", "mpc", "\\u", "acos", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "atan", "_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "atan", "_", ",_", "libm", "p_", "._", "mpc", "\\u", "atan", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "asin", "h_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "asin", "h_", ",_", "libm", "p_", "._", "mpc", "\\u", "asin", "h_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "acos", "h_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "acos", "h_", ",_", "libm", "p_", "._", "mpc", "\\u", "acos", "h_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "atan", "h_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "atan", "h_", ",_", "libm", "p_", "._", "mpc", "\\u", "atan", "h_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "sin", "pi_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "sin", "\\u", "pi_", ",_", "libm", "p_", "._", "mpc", "\\u", "sin", "\\u", "pi_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "cos", "pi_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "cos", "\\u", "pi_", ",_", "libm", "p_", "._", "mpc", "\\u", "cos", "\\u", "pi_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "floor_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "floor_", ",_", "libm", "p_", "._", "mpc", "\\u", "floor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "ceil_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "ceil_", ",_", "libm", "p_", "._", "mpc", "\\u", "ceil_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "nin", "t_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "nin", "t_", ",_", "libm", "p_", "._", "mpc", "\\u", "nin", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "frac_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "frac_", ",_", "libm", "p_", "._", "mpc", "\\u", "frac_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "fib_", "=_", "ctx_", "._", "fibo", "nacc", "i_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "fibo", "nacc", "i_", ",_", "libm", "p_", "._", "mpc", "\\u", "fibo", "nacc", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "gamma_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "gamma_", ",_", "libm", "p_", "._", "mpc", "\\u", "gamma_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "rga", "mma", "_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "rga", "mma", "_", ",_", "libm", "p_", "._", "mpc", "\\u", "rga", "mma", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "logg", "amma", "_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "logg", "amma", "_", ",_", "libm", "p_", "._", "mpc", "\\u", "logg", "amma", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "fac_", "=_", "ctx_", "._", "factorial_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "factorial_", ",_", "libm", "p_", "._", "mpc", "\\u", "factorial_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "gamma", "\\u", "old_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "gamma", "\\u", "old_", ",_", "libm", "p_", "._", "mpc", "\\u", "gamma", "\\u", "old_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "fac", "\\u", "old_", "=_", "ctx_", "._", "factori", "al", "\\u", "old_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "factori", "al", "\\u", "old_", ",_", "libm", "p_", "._", "mpc", "\\u", "factori", "al", "\\u", "old_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "dig", "amma", "_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "psi", "0_", ",_", "libm", "p_", "._", "mpc", "\\u", "psi", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "harmonic", "_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "harmonic", "_", ",_", "libm", "p_", "._", "mpc", "\\u", "harmonic", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "ei_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "ei_", ",_", "libm", "p_", "._", "mpc", "\\u", "ei_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "e1_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "e1_", ",_", "libm", "p_", "._", "mpc", "\\u", "e1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "\\u", "ci_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "ci_", ",_", "libm", "p_", "._", "mpc", "\\u", "ci_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "\\u", "si_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "si_", ",_", "libm", "p_", "._", "mpc", "\\u", "si_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "ellip", "k_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "ellip", "k_", ",_", "libm", "p_", "._", "mpc", "\\u", "ellip", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "\\u", "ellip", "e_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "ellip", "e_", ",_", "libm", "p_", "._", "mpc", "\\u", "ellip", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "ag", "m1_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "ag", "m1_", ",_", "libm", "p_", "._", "mpc", "\\u", "ag", "m1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "\\u", "erf", "_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "erf", "_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "\\u", "erf", "c_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "erf", "c_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "\\u", "zeta", "_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "zeta", "_", ",_", "libm", "p_", "._", "mpc", "\\u", "zeta", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "\\u", "alt", "zeta", "_", "=_", "ctx_", "._", "\\u", "wrap", "\\u", "libm", "p", "\\u", "function_", "(_", "libm", "p_", "._", "mpf", "\\u", "alt", "zeta", "_", ",_", "libm", "p_", "._", "mpc", "\\u", "alt", "zeta", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fast", "er", " ", "versions_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "sqrt_", "=_", "getattr_", "(_", "ctx_", ",_", "\"\\u", "sage", "\\u", "sqrt", "\"_", ",_", "ctx_", "._", "sqrt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "exp_", "=_", "getattr_", "(_", "ctx_", ",_", "\"\\u", "sage", "\\u", "exp", "\"_", ",_", "ctx_", "._", "exp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "ln_", "=_", "getattr_", "(_", "ctx_", ",_", "\"\\u", "sage", "\\u", "ln", "\"_", ",_", "ctx_", "._", "ln_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "cos_", "=_", "getattr_", "(_", "ctx_", ",_", "\"\\u", "sage", "\\u", "cos", "\"_", ",_", "ctx_", "._", "cos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "sin_", "=_", "getattr_", "(_", "ctx_", ",_", "\"\\u", "sage", "\\u", "sin", "\"_", ",_", "ctx_", "._", "sin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "fixed_", "(_", "ctx_", ",_", "x_", ",_", "prec_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "x_", "._", "to", "\\u", "fixed_", "(_", "prec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "hypot", "_", "(_", "ctx_", ",_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Compute", "s", " ", "the", " ", "Euc", "lide", "an", " ", "norm", " ", "of", " ", "the", " ", "vector", " ", "`", "(", "x", ",", " ", "y", ")`", ",", " ", "equal", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "`", "\\\\", "sqrt", "{", "x", "^", "2", " ", "+", " ", "y", "^", "2", "}`", ".", " ", "Bot", "h", " ", "`", "x", "`", " ", "and", " ", "`", "y", "`", " ", "must", " ", "be", " ", "real", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "ctx_", "._", "convert_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "ctx_", "._", "convert_", "(_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "libm", "p_", "._", "mpf", "\\u", "hypot", "_", "(_", "x_", "._", "\\u", "mpf", "\\u_", ",_", "y_", "._", "\\u", "mpf", "\\u_", ",_", "*_", "ctx_", "._", "\\u", "prec", "\\u", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "gamma", "\\u", "upper", "\\u", "int_", "(_", "ctx_", ",_", "n_", ",_", "z_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "int_", "(_", "ctx_", "._", "\\u", "re_", "(_", "n_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "n_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "e1_", "(_", "z_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "hasattr_", "(_", "z_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\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_", "prec_", ",_", "rounding", "_", "=_", "ctx_", "._", "\\u", "prec", "\\u", "rounding", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "real_", ",_", "imag_", "=_", "libm", "p_", "._", "mpf", "\\u", "exp", "int_", "(_", "n_", ",_", "z_", "._", "\\u", "mpf", "\\u_", ",_", "prec_", ",_", "rounding", "_", ",_", "gamma_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "imag_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "real_", ")_", "\\u\\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_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "(_", "real_", ",_", "imag_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\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", "exp", "int\\u", "int_", "(_", "ctx_", ",_", "n_", ",_", "z_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "int_", "(_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "n_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "e1_", "(_", "z_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "hasattr_", "(_", "z_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\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_", "prec_", ",_", "rounding", "_", "=_", "ctx_", "._", "\\u", "prec", "\\u", "rounding", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "real_", ",_", "imag_", "=_", "libm", "p_", "._", "mpf", "\\u", "exp", "int_", "(_", "n_", ",_", "z_", "._", "\\u", "mpf", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "imag_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "real_", ")_", "\\u\\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_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "(_", "real_", ",_", "imag_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\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", "nthr", "oot_", "(_", "ctx_", ",_", "x_", ",_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "libm", "p_", "._", "mpf", "\\u", "nthr", "oot_", "(_", "x_", "._", "\\u", "mpf", "\\u_", ",_", "n_", ",_", "*_", "ctx_", "._", "\\u", "prec", "\\u", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Comple", "x", "Result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ctx_", "._", "trap", "\\u", "complex_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "x_", "=_", "(_", "x_", "._", "\\u", "mpf", "\\u_", ",_", "libm", "p_", "._", "fz", "ero", "_", ")_", "\\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 ", " _", "x_", "=_", "x_", "._", "\\u", "mpc", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "libm", "p_", "._", "mpc", "\\u", "nthr", "oot_", "(_", "x_", ",_", "n_", ",_", "*_", "ctx_", "._", "\\u", "prec", "\\u", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "bes", "sel", "j_", "(_", "ctx_", ",_", "n_", ",_", "z_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prec_", ",_", "rounding", "_", "=_", "ctx_", "._", "\\u", "prec", "\\u", "rounding", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "z_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "libm", "p_", "._", "mpf", "\\u", "bes", "sel", "jn", "_", "(_", "n_", ",_", "z_", "._", "\\u", "mpf", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "hasattr_", "(_", "z_", ",_", "'\\u", "mpc", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "libm", "p_", "._", "mpc", "\\u", "bes", "sel", "jn", "_", "(_", "n_", ",_", "z_", "._", "\\u", "mpc", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\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", "ag", "m_", "(_", "ctx_", ",_", "a_", ",_", "b_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prec_", ",_", "rounding", "_", "=_", "ctx_", "._", "\\u", "prec", "\\u", "rounding", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "a_", ",_", "'\\u", "mpf", "\\u'_", ")_", "and_", "hasattr_", "(_", "b_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "libm", "p_", "._", "mpf", "\\u", "ag", "m_", "(_", "a_", "._", "\\u", "mpf", "\\u_", ",_", "b_", "._", "\\u", "mpf", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Comple", "x", "Result_", ":_", "\\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_", "hasattr_", "(_", "a_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "a_", "=_", "(_", "a_", "._", "\\u", "mpf", "\\u_", ",_", "libm", "p_", "._", "fz", "ero", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "a_", "=_", "a_", "._", "\\u", "mpc", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "b_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "b_", "=_", "(_", "b_", "._", "\\u", "mpf", "\\u_", ",_", "libm", "p_", "._", "fz", "ero", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "b_", "=_", "b_", "._", "\\u", "mpc", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "libm", "p_", "._", "mpc", "\\u", "ag", "m_", "(_", "a_", ",_", "b_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "bern", "oulli", "_", "(_", "ctx_", ",_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "libm", "p_", "._", "mpf", "\\u", "bern", "oulli", "_", "(_", "int_", "(_", "n_", ")_", ",_", "*_", "ctx_", "._", "\\u", "prec", "\\u", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "zeta", "\\u", "int_", "(_", "ctx_", ",_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "libm", "p_", "._", "mpf", "\\u", "zeta", "\\u", "int_", "(_", "int_", "(_", "n_", ")_", ",_", "*_", "ctx_", "._", "\\u", "prec", "\\u", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "atan2_", "(_", "ctx_", ",_", "y_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "ctx_", "._", "convert_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "ctx_", "._", "convert_", "(_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "libm", "p_", "._", "mpf", "\\u", "atan2_", "(_", "y_", "._", "\\u", "mpf", "\\u_", ",_", "x_", "._", "\\u", "mpf", "\\u_", ",_", "*_", "ctx_", "._", "\\u", "prec", "\\u", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "psi_", "(_", "ctx_", ",_", "m_", ",_", "z_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "z_", "=_", "ctx_", "._", "convert_", "(_", "z_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "int_", "(_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ctx_", "._", "\\u", "is", "\\u", "real", "\\u", "type_", "(_", "z_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "libm", "p_", "._", "mpf", "\\u", "psi_", "(_", "m_", ",_", "z_", "._", "\\u", "mpf", "\\u_", ",_", "*_", "ctx_", "._", "\\u", "prec", "\\u", "rounding", "_", ")_", ")_", "\\u\\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_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "libm", "p_", "._", "mpc", "\\u", "psi_", "(_", "m_", ",_", "z_", "._", "\\u", "mpc", "\\u_", ",_", "*_", "ctx_", "._", "\\u", "prec", "\\u", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cos", "\\u", "sin_", "(_", "ctx_", ",_", "x_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "x_", ")_", "not_", "in_", "ctx_", "._", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "ctx_", "._", "convert_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prec_", ",_", "rounding", "_", "=_", "ctx_", "._", "\\u", "parse", "\\u", "prec_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", ",_", "s_", "=_", "libm", "p_", "._", "mpf", "\\u", "cos", "\\u", "sin_", "(_", "x_", "._", "\\u", "mpf", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "c_", ")_", ",_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpc", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", ",_", "s_", "=_", "libm", "p_", "._", "mpc", "\\u", "cos", "\\u", "sin_", "(_", "x_", "._", "\\u", "mpc", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "c_", ")_", ",_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "cos_", "(_", "x_", ",_", "**_", "kwargs_", ")_", ",_", "ctx_", "._", "sin_", "(_", "x_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cos", "pi", "\\u", "sin", "pi_", "(_", "ctx_", ",_", "x_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "x_", ")_", "not_", "in_", "ctx_", "._", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "ctx_", "._", "convert_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prec_", ",_", "rounding", "_", "=_", "ctx_", "._", "\\u", "parse", "\\u", "prec_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", ",_", "s_", "=_", "libm", "p_", "._", "mpf", "\\u", "cos", "\\u", "sin", "\\u", "pi_", "(_", "x_", "._", "\\u", "mpf", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "c_", ")_", ",_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpc", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", ",_", "s_", "=_", "libm", "p_", "._", "mpc", "\\u", "cos", "\\u", "sin", "\\u", "pi_", "(_", "x_", "._", "\\u", "mpc", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "c_", ")_", ",_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "cos_", "(_", "x_", ",_", "**_", "kwargs_", ")_", ",_", "ctx_", "._", "sin_", "(_", "x_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clone_", "(_", "ctx_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Creat", "e", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "context", ",", " ", "with", " ", "the", " ", "same", " ", "working", " ", "preci", "sion", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "ctx_", "._", "\\u\\u", "class\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "._", "prec_", "=_", "ctx_", "._", "prec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "is", "\\u", "real", "\\u", "type_", "(_", "ctx_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpc", "\\u'_", ")_", "or_", "type_", "(_", "x_", ")_", "is_", "complex_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "is", "\\u", "complex", "\\u", "type_", "(_", "ctx_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpc", "\\u'_", ")_", "or_", "type_", "(_", "x_", ")_", "is_", "complex_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "isnan_", "(_", "ctx_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "*", "Tru", "e", "*", " ", "if", " ", "*", "x", "*", " ", "is", " ", "a", " ", "Na", "N", " ", "(", "not", "-", "a", "-", "number", "),", " ", "or", " ", "for", " ", "a", " ", "complex", "\\", "10", ";", " ", " ", " ", " ", "number", ",", " ", "whe", "ther", " ", "eit", "her", " ", "the", " ", "real", " ", "or", " ", "complex", " ", "part", " ", "is", " ", "Na", "N", ";", "\\", "10", ";", " ", " ", " ", " ", "other", "wis", "e", " ", "return", " ", "*", "Fal", "se", "*:", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "mpm", "ath", " ", "import", " ", "*", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "isn", "an", "(", "3.14", ")", "\\", "10", ";", " ", " ", " ", " ", "Fal", "se", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "isn", "an", "(", "nan", ")", "\\", "10", ";", " ", " ", " ", " ", "Tru", "e", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "isn", "an", "(", "mpc", "(", "3.14", ",", "2.7", "2", "))\\", "10", ";", " ", " ", " ", " ", "Fal", "se", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "isn", "an", "(", "mpc", "(", "3.14", ",", "nan", "))\\", "10", ";", " ", " ", " ", " ", "Tru", "e", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "\"\\u", "mpf", "\\u\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "x_", "._", "\\u", "mpf", "\\u_", "==_", "fna", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "\"\\u", "mpc", "\\u\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "fna", "n_", "in_", "x_", "._", "\\u", "mpc", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "x_", ",_", "int\\u", "types_", ")_", "or_", "isinstance_", "(_", "x_", ",_", "rational", "_", "._", "mp", "q_", ")_", ":_", "\\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_", "x_", "=_", "ctx_", "._", "convert_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpf", "\\u'_", ")_", "or_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpc", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "isnan_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Type", "Error_", "(_", "\"", "isn", "an", "()", " ", "need", "s", " ", "a", " ", "number", " ", "as", " ", "input", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "isfinite_", "(_", "ctx_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "*", "Tru", "e", "*", " ", "if", " ", "*", "x", "*", " ", "is", " ", "a", " ", "finite", " ", "number", ",", " ", "i", ".", "e", ".", " ", "nei", "ther", "\\", "10", ";", " ", " ", " ", " ", "an", " ", "infinity", " ", "or", " ", "a", " ", "Na", "N", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "mpm", "ath", " ", "import", " ", "*", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "isfi", "nite", "(", "inf", ")", "\\", "10", ";", " ", " ", " ", " ", "Fal", "se", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "isfi", "nite", "(-", "inf", ")", "\\", "10", ";", " ", " ", " ", " ", "Fal", "se", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "isfi", "nite", "(", "3", ")", "\\", "10", ";", " ", " ", " ", " ", "Tru", "e", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "isfi", "nite", "(", "nan", ")", "\\", "10", ";", " ", " ", " ", " ", "Fal", "se", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "isfi", "nite", "(", "3", "+", "4j", ")", "\\", "10", ";", " ", " ", " ", " ", "Tru", "e", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "isfi", "nite", "(", "mpc", "(", "3", ",", "inf", "))\\", "10", ";", " ", " ", " ", " ", "Fal", "se", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "isfi", "nite", "(", "mpc", "(", "nan", ",", "3", "))\\", "10", ";", " ", " ", " ", " ", "Fal", "se", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ctx_", "._", "isinf", "_", "(_", "x_", ")_", "or_", "ctx_", "._", "isnan_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "isn", "pint", "_", "(_", "ctx_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Det", "erm", "ine", " ", "if", " ", "*", "x", "*", " ", "is", " ", "a", " ", "nonp", "osi", "tiv", "e", " ", "integ", "er", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "x_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sign_", ",_", "man_", ",_", "exp_", ",_", "bc_", "=_", "x_", "._", "\\u", "mpf", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "sign_", "and_", "exp_", ">=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpc", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "x_", "._", "imag_", "and_", "ctx_", "._", "isn", "pint", "_", "(_", "x_", "._", "real_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "x_", ")_", "in_", "int\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "x_", "<=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "x_", ",_", "ctx_", "._", "mp", "q_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", ",_", "q_", "=_", "x_", "._", "\\u", "mp", "q", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "p_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "q_", "==_", "1_", "and_", "p_", "<=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ctx_", "._", "isn", "pint", "_", "(_", "ctx_", "._", "convert_", "(_", "x_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "ctx_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lines_", "=_", "[_", "\"", "Mp", "math", " ", "settings", ":\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", " ", " ", "mp", ".", "prec", " ", "=", " ", "%", "s", "\"_", "%_", "ctx_", "._", "prec_", ")_", "._", "ljust_", "(_", "30_", ")_", "+_", "\"[", "default", ":", " ", "5", "3", "]\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", " ", " ", "mp", ".", "dps", " ", "=", " ", "%", "s", "\"_", "%_", "ctx_", "._", "dps", "_", ")_", "._", "ljust_", "(_", "30_", ")_", "+_", "\"[", "default", ":", " ", "15", "]\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", " ", " ", "mp", ".", "trap", "\\u", "complex", " ", "=", " ", "%", "s", "\"_", "%_", "ctx_", "._", "trap", "\\u", "complex_", ")_", "._", "ljust_", "(_", "30_", ")_", "+_", "\"[", "default", ":", " ", "Fal", "se", "]\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\"\\\\", "n", "\"_", "._", "join_", "(_", "lines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "extra", "prec_", "(_", "ctx_", ",_", "n_", ",_", "normali", "ze", "\\u", "output_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "block", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "extra", "prec", "(", "n", "):", "\\", "10", ";", " ", " ", " ", " ", "<", "code", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "increase", "s", " ", "the", " ", "preci", "sion", " ", "n", " ", "bits", ",", " ", "execute", "s", " ", "<", "code", ">", ",", " ", "and", " ", "then", "\\", "10", ";", " ", " ", " ", " ", "restore", "s", " ", "the", " ", "preci", "sion", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "extra", "prec", "(", "n", ")(", "f", ")", " ", "return", "s", " ", "a", " ", "decorated", " ", "version", " ", "of", " ", "the", " ", "function", " ", "f", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", " ", "increase", "s", " ", "the", " ", "working", " ", "preci", "sion", " ", "by", " ", "n", " ", "bits", " ", "bef", "ore", " ", "executi", "on", ",", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "restore", "s", " ", "the", " ", "parent", " ", "preci", "sion", " ", "after", "ward", "s", ".", " ", "With", "\\", "10", ";", " ", " ", " ", " ", "normali", "ze", "\\u", "output", "=", "Tru", "e", ",", " ", "it", " ", "round", "s", " ", "the", " ", "return", " ", "value", " ", "to", " ", "the", " ", "parent", "\\", "10", ";", " ", " ", " ", " ", "preci", "sion", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Precis", "ion", "Manager_", "(_", "ctx_", ",_", "lambda_", "p_", ":_", "p_", "+_", "n_", ",_", "None_", ",_", "normali", "ze", "\\u", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "extra", "dps", "_", "(_", "ctx_", ",_", "n_", ",_", "normali", "ze", "\\u", "output_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "function", " ", "is", " ", "analog", "ous", " ", "to", " ", "extra", "prec", " ", "(", "see", " ", "documentation", ")", "\\", "10", ";", " ", " ", " ", " ", "but", " ", "change", "s", " ", "the", " ", "decima", "l", " ", "preci", "sion", " ", "inst", "ead", " ", "of", " ", "the", " ", "number", " ", "of", " ", "bits", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Precis", "ion", "Manager_", "(_", "ctx_", ",_", "None_", ",_", "lambda_", "d_", ":_", "d_", "+_", "n_", ",_", "normali", "ze", "\\u", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "work", "prec_", "(_", "ctx_", ",_", "n_", ",_", "normali", "ze", "\\u", "output_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "block", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "work", "prec", "(", "n", "):", "\\", "10", ";", " ", " ", " ", " ", "<", "code", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "sets", " ", "the", " ", "preci", "sion", " ", "to", " ", "n", " ", "bits", ",", " ", "execute", "s", " ", "<", "code", ">", ",", " ", "and", " ", "then", " ", "restore", "s", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "preci", "sion", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "work", "prec", "(", "n", ")(", "f", ")", " ", "return", "s", " ", "a", " ", "decorated", " ", "version", " ", "of", " ", "the", " ", "function", " ", "f", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", " ", "sets", " ", "the", " ", "preci", "sion", " ", "to", " ", "n", " ", "bits", " ", "bef", "ore", " ", "executi", "on", ",", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "restore", "s", " ", "the", " ", "preci", "sion", " ", "after", "ward", "s", ".", " ", "With", " ", "normali", "ze", "\\u", "output", "=", "Tru", "e", ",", "\\", "10", ";", " ", " ", " ", " ", "it", " ", "round", "s", " ", "the", " ", "return", " ", "value", " ", "to", " ", "the", " ", "parent", " ", "preci", "sion", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Precis", "ion", "Manager_", "(_", "ctx_", ",_", "lambda_", "p_", ":_", "n_", ",_", "None_", ",_", "normali", "ze", "\\u", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "work", "dps", "_", "(_", "ctx_", ",_", "n_", ",_", "normali", "ze", "\\u", "output_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "function", " ", "is", " ", "analog", "ous", " ", "to", " ", "work", "prec", " ", "(", "see", " ", "documentation", ")", "\\", "10", ";", " ", " ", " ", " ", "but", " ", "change", "s", " ", "the", " ", "decima", "l", " ", "preci", "sion", " ", "inst", "ead", " ", "of", " ", "the", " ", "number", " ", "of", " ", "bits", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Precis", "ion", "Manager_", "(_", "ctx_", ",_", "None_", ",_", "lambda_", "d_", ":_", "n_", ",_", "normali", "ze", "\\u", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "autop", "rec_", "(_", "ctx_", ",_", "f_", ",_", "maxp", "rec_", "=_", "None_", ",_", "catch", "_", "=_", "(_", ")_", ",_", "verbose_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "wrapp", "ed", " ", "copy", " ", "of", " ", "*", "f", "*", " ", "tha", "t", " ", "repeated", "ly", " ", "evaluate", "s", " ", "*", "f", "*", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "incr", "easi", "ng", " ", "preci", "sion", " ", "unti", "l", " ", "the", " ", "result", " ", "converg", "es", " ", "to", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "full", " ", "preci", "sion", " ", "used", " ", "at", " ", "the", " ", "point", " ", "of", " ", "the", " ", "call", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "heuristic", "ally", " ", "protect", "s", " ", "against", " ", "rounding", " ", "error", "s", ",", " ", "at", " ", "the", " ", "cost", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "rough", "ly", " ", "a", " ", "2x", " ", "slow", "down", " ", "compare", "d", " ", "to", " ", "manu", "ally", " ", "setti", "ng", " ", "the", " ", "optim", "al", "\\", "10", ";", " ", " ", " ", " ", "preci", "sion", ".", " ", "Thi", "s", " ", "method", " ", "can", ",", " ", "how", "ever", ",", " ", "easi", "ly", " ", "be", " ", "foo", "led", " ", "if", " ", "the", " ", "results", "\\", "10", ";", " ", " ", " ", " ", "from", " ", "*", "f", "*", " ", "depend", " ", "\"", "discon", "tin", "uo", "usl", "y", "\"", " ", "on", " ", "the", " ", "preci", "sion", ",", " ", "for", " ", "instance", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "cata", "stro", "phi", "c", " ", "cancellat", "ion", " ", "can", " ", "occur", ".", " ", "There", "fore", ",", " ", ":", "func", ":`", "~", "mpm", "ath", ".", "autop", "rec", "`", "\\", "10", ";", " ", " ", " ", " ", "shou", "ld", " ", "be", " ", "used", " ", "ju", "dic", "ious", "ly", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "**", "Exam", "ples", "**", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Many", " ", "function", "s", " ", "are", " ", "sensi", "tiv", "e", " ", "to", " ", "perturbation", "s", " ", "of", " ", "the", " ", "input", " ", "argu", "ment", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "the", " ", "argu", "ment", "s", " ", "are", " ", "decima", "l", " ", "numbers", ",", " ", "the", "y", " ", "may", " ", "have", " ", "to", " ", "be", " ", "convert", "ed", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "binar", "y", " ", "at", " ", "a", " ", "muc", "h", " ", "higher", " ", "preci", "sion", ".", " ", "If", " ", "the", " ", "amo", "unt", " ", "of", " ", "require", "d", "\\", "10", ";", " ", " ", " ", " ", "extra", " ", "preci", "sion", " ", "is", " ", "unknown", ",", " ", ":", "func", ":`", "~", "mpm", "ath", ".", "autop", "rec", "`", " ", "is", " ", "convenien", "t", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "mpm", "ath", " ", "import", " ", "*", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "mp", ".", "dps", " ", "=", " ", "15", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "mp", ".", "pretty", " ", "=", " ", "Tru", "e", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "bes", "sel", "j", "(", "5", ",", " ", "125", " ", "*", " ", "10", "**", "2", "8", ")", " ", " ", " ", " ", "#", " ", "Exa", "ct", " ", "input", "\\", "10", ";", " ", " ", " ", " ", "-", "8.0", "328", "478", "559", "180", "1e-1", "7", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "bes", "sel", "j", "(", "5", ",", " ", "'", "1.2", "5e", "30", "')", " ", " ", " ", "#", " ", "Ba", "d", "\\", "10", ";", " ", " ", " ", " ", "7.1", "295", "486", "831", "665", "2e-", "16", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "autop", "rec", "(", "bes", "sel", "j", ")(", "5", ",", " ", "'", "1.2", "5e", "30", "')", " ", " ", " ", "#", " ", "Good", "\\", "10", ";", " ", " ", " ", " ", "-", "8.0", "328", "478", "559", "180", "1e-1", "7", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "follow", "ing", " ", "fail", "s", " ", "to", " ", "converg", "e", " ", "bec", "aus", "e", " ", "`", "\\\\", "sin", "(\\\\", "pi", ")", " ", "=", " ", "0", "`", " ", "where", "as", " ", "all", "\\", "10", ";", " ", " ", " ", " ", "finite", "-", "preci", "sion", " ", "approx", "imat", "ion", "s", " ", "of", " ", "`", "\\\\", "pi", "`", " ", "give", " ", "nonzero", " ", "values", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "autop", "rec", "(", "sin", ")(", "pi", ")", " ", "#", " ", "docte", "st", ":", " ", "+", "IGNORE", "\\u", "EXCEPTION", "\\u", "DETAIL", "\\", "10", ";", " ", " ", " ", " ", "Trace", "back", " ", "(", "most", " ", "recent", " ", "call", " ", "last", "):", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "...", "\\", "10", ";", " ", " ", " ", " ", "No", "Converge", "nce", ":", " ", "autop", "rec", ":", " ", "prec", " ", "increase", "d", " ", "to", " ", "291", "0", " ", "with", "out", " ", "convergence", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "As", " ", "the", " ", "follow", "ing", " ", "example", " ", "show", "s", ",", " ", ":", "func", ":`", "~", "mpm", "ath", ".", "autop", "rec", "`", " ", "can", " ", "protect", " ", "against", "\\", "10", ";", " ", " ", " ", " ", "cancellat", "ion", ",", " ", "but", " ", "is", " ", "foo", "led", " ", "by", " ", "too", " ", "sever", "e", " ", "cancellat", "ion", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "x", " ", "=", " ", "1e-1", "0", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "exp", "(", "x", ")-", "1", ";", " ", "exp", "m1", "(", "x", ");", " ", "autop", "rec", "(", "lambda", " ", "t", ":", " ", "exp", "(", "t", ")-", "1", ")(", "x", ")", "\\", "10", ";", " ", " ", " ", " ", "1.000000", "082", "740", "3", "7e", "-1", "0", "\\", "10", ";", " ", " ", " ", " ", "1.000000", "0000", "5e-", "10", "\\", "10", ";", " ", " ", " ", " ", "1.000000", "0000", "5e-", "10", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "x", " ", "=", " ", "1e-", "50", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "exp", "(", "x", ")-", "1", ";", " ", "exp", "m1", "(", "x", ");", " ", "autop", "rec", "(", "lambda", " ", "t", ":", " ", "exp", "(", "t", ")-", "1", ")(", "x", ")", "\\", "10", ";", " ", " ", " ", " ", "0.", "0", "\\", "10", ";", " ", " ", " ", " ", "1.0e-", "50", "\\", "10", ";", " ", " ", " ", " ", "0.", "0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "With", " ", "*", "catch", "*", ",", " ", "an", " ", "exception", " ", "or", " ", "list", " ", "of", " ", "exception", "s", " ", "to", " ", "intercept", "\\", "10", ";", " ", " ", " ", " ", "may", " ", "be", " ", "specified", ".", " ", "The", " ", "raise", "d", " ", "exception", " ", "is", " ", "interprete", "d", "\\", "10", ";", " ", " ", " ", " ", "as", " ", "signal", "ing", " ", "insuf", "ficient", " ", "preci", "sion", ".", " ", "Thi", "s", " ", "permit", "s", ",", " ", "for", " ", "example", ",", "\\", "10", ";", " ", " ", " ", " ", "evaluat", "ing", " ", "a", " ", "function", " ", "where", " ", "a", " ", "too", " ", "low", " ", "preci", "sion", " ", "results", " ", "in", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "divisi", "on", " ", "by", " ", "zero", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "f", " ", "=", " ", "lambda", " ", "x", ":", " ", "1", "/(", "exp", "(", "x", ")-", "1", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "f", "(", "1e-", "30", ")", "\\", "10", ";", " ", " ", " ", " ", "Trace", "back", " ", "(", "most", " ", "recent", " ", "call", " ", "last", "):", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "...", "\\", "10", ";", " ", " ", " ", " ", "Zero", "Divis", "ion", "Error", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "autop", "rec", "(", "f", ",", " ", "catch", "=", "Zero", "Divis", "ion", "Error", ")(", "1e-", "30", ")", "\\", "10", ";", " ", " ", " ", " ", "1.0", "e", "+", "30", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "f", "\\u", "autop", "rec", "\\u", "wrapped_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prec_", "=_", "ctx_", "._", "prec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "maxp", "rec_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "maxp", "rec", "2_", "=_", "ctx_", "._", "\\u", "default", "\\u", "hyper", "\\u", "maxp", "rec_", "(_", "prec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "maxp", "rec", "2_", "=_", "maxp", "rec_", "\\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 ", " _", "ctx_", "._", "prec_", "=_", "prec_", "+_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v1_", "=_", "f_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "catch", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v1_", "=_", "ctx_", "._", "nan_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prec", "2_", "=_", "prec_", "+_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "ctx_", "._", "prec_", "=_", "prec", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "v2_", "=_", "f_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "catch", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "v2_", "=_", "ctx_", "._", "nan_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "v1_", "==_", "v2_", ":_", "\\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_", "err_", "=_", "ctx_", "._", "mag_", "(_", "v2_", "-_", "v1_", ")_", "-_", "ctx_", "._", "mag_", "(_", "v2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "err_", "<_", "(_", "-_", "prec_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "(_", "\"", "autop", "rec", ":", " ", "target", "=", "%", "s", ",", " ", "prec", "=", "%", "s", ",", " ", "accu", "rac", "y", "=", "%", "s", "\"_", "%_", "(_", "prec_", ",_", "prec", "2_", ",_", "-_", "err_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "v1_", "=_", "v2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "prec", "2_", ">=_", "maxp", "rec", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "ctx_", "._", "No", "Converge", "nce_", "(_", "\"", "autop", "rec", ":", " ", "prec", " ", "increase", "d", " ", "to", " ", "%", "i", " ", "with", "out", " ", "convergence", "\"_", "%_", "prec", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prec", "2_", "+=_", "int_", "(_", "prec", "2_", "*_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prec", "2_", "=_", "min_", "(_", "prec", "2_", ",_", "maxp", "rec", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "prec_", "=_", "prec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "+_", "v2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "f", "\\u", "autop", "rec", "\\u", "wrapped_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "nstr", "_", "(_", "ctx_", ",_", "x_", ",_", "n_", "=_", "6_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Convert", " ", "an", " ", "``", "mpf", "``", " ", "or", " ", "``", "mpc", "``", " ", "to", " ", "a", " ", "decima", "l", " ", "string", " ", "literal", " ", "with", " ", "*", "n", "*", "\\", "10", ";", " ", " ", " ", " ", "significant", " ", "digit", "s", ".", " ", "The", " ", "small", " ", "default", " ", "value", " ", "for", " ", "*", "n", "*", " ", "is", " ", "chosen", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "make", " ", "this", " ", "function", " ", "usef", "ul", " ", "for", " ", "printin", "g", " ", "collection", "s", " ", "of", " ", "numbers", "\\", "10", ";", " ", " ", " ", " ", "(", "lists", ",", " ", "matric", "es", ",", " ", "etc", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "*", "x", "*", " ", "is", " ", "a", " ", "list", " ", "or", " ", "tuple", ",", " ", ":", "func", ":`", "~", "mpm", "ath", ".", "nstr", "`", " ", "is", " ", "applied", " ", "recurs", "ively", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "each", " ", "element", ".", " ", "For", " ", "unre", "cogni", "zed", " ", "classe", "s", ",", " ", ":", "func", ":`", "~", "mpm", "ath", ".", "nstr", "`", "\\", "10", ";", " ", " ", " ", " ", "simp", "ly", " ", "return", "s", " ", "``", "str", "(", "x", ")``.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "compan", "ion", " ", "function", " ", ":", "func", ":`", "~", "mpm", "ath", ".", "npr", "int", "`", " ", "print", "s", " ", "the", " ", "result", "\\", "10", ";", " ", " ", " ", " ", "inst", "ead", " ", "of", " ", "return", "ing", " ", "it", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "keyw", "ord", " ", "argu", "ment", "s", " ", "*", "strip", "\\u", "zero", "s", "*", ",", " ", "*", "min", "\\u", "fixed", "*", ",", " ", "*", "max", "\\u", "fixed", "*", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "*", "show", "\\u", "zero", "\\u", "expon", "ent", "*", " ", "are", " ", "forwarded", " ", "to", " ", ":", "func", ":`", "~", "mpm", "ath", ".", "libm", "p", ".", "to", "\\u", "str", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "number", " ", "will", " ", "be", " ", "printed", " ", "in", " ", "fixed", "-", "point", " ", "format", " ", "if", " ", "the", " ", "position", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "the", " ", "lead", "ing", " ", "digit", " ", "is", " ", "strict", "ly", " ", "bet", "ween", " ", "min", "\\u", "fixed", "\\", "10", ";", " ", " ", " ", " ", "(", "default", " ", "=", " ", "min", "(-", "dps", "/", "3", ",-", "5", "))", " ", "and", " ", "max", "\\u", "fixed", " ", "(", "default", " ", "=", " ", "dps", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "To", " ", "force", " ", "fixed", "-", "point", " ", "format", " ", "alw", "ay", "s", ",", " ", "set", " ", "min", "\\u", "fixed", " ", "=", " ", "-", "inf", ",", "\\", "10", ";", " ", " ", " ", " ", "max", "\\u", "fixed", " ", "=", " ", "+", "inf", ".", " ", "To", " ", "force", " ", "float", "ing", "-", "point", " ", "format", ",", " ", "set", "\\", "10", ";", " ", " ", " ", " ", "min", "\\u", "fixed", " ", ">=", " ", "max", "\\u", "fixed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "mpm", "ath", " ", "import", " ", "*", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "nstr", "([", "+", "pi", ",", " ", "lde", "xp", "(", "1", ",-", "500", ")])", "\\", "10", ";", " ", " ", " ", " ", "'[", "3.14", "159", ",", " ", "3.0", "549", "4e", "-1", "5", "1", "]'", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "npr", "int", "([", "+", "pi", ",", " ", "lde", "xp", "(", "1", ",-", "500", ")])", "\\", "10", ";", " ", " ", " ", " ", "[", "3.14", "159", ",", " ", "3.0", "549", "4e", "-1", "5", "1", "]", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "nstr", "(", "mpf", "(\"", "5e-", "10", "\")", ",", " ", "5", ")", "\\", "10", ";", " ", " ", " ", " ", "'", "5.0", "e-1", "0", "'", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "nstr", "(", "mpf", "(\"", "5e-", "10", "\")", ",", " ", "5", ",", " ", "strip", "\\u", "zero", "s", "=", "Fal", "se", ")", "\\", "10", ";", " ", " ", " ", " ", "'", "5.0", "000", "e-1", "0", "'", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "nstr", "(", "mpf", "(\"", "5e-", "10", "\")", ",", " ", "5", ",", " ", "strip", "\\u", "zero", "s", "=", "Fal", "se", ",", " ", "min", "\\u", "fixed", "=-", "11", ")", "\\", "10", ";", " ", " ", " ", " ", "'", "0.000000000", "5000", "0", "'", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "nstr", "(", "mpf", "(", "0", "),", " ", "5", ",", " ", "show", "\\u", "zero", "\\u", "expon", "ent", "=", "Tru", "e", ")", "\\", "10", ";", " ", " ", " ", " ", "'", "0.", "0e", "+0", "'", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "x_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"[", "%", "s", "]\"_", "%_", "(_", "\",", " ", "\"_", "._", "join_", "(_", "ctx_", "._", "nstr", "_", "(_", "c_", ",_", "n_", ",_", "**_", "kwargs_", ")_", "for_", "c_", "in_", "x_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "x_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"(", "%", "s", ")\"_", "%_", "(_", "\",", " ", "\"_", "._", "join_", "(_", "ctx_", "._", "nstr", "_", "(_", "c_", ",_", "n_", ",_", "**_", "kwargs_", ")_", "for_", "c_", "in_", "x_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "to", "\\u", "str_", "(_", "x_", "._", "\\u", "mpf", "\\u_", ",_", "n_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpc", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"(\"_", "+_", "mpc", "\\u", "to", "\\u", "str_", "(_", "x_", "._", "\\u", "mpc", "\\u_", ",_", "n_", ",_", "**_", "kwargs_", ")_", "+_", "\")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "x_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "repr_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "x_", ",_", "ctx_", "._", "matrix_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "x_", "._", "\\u\\u", "nstr", "\\u\\u_", "(_", "n_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "str_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "convert", "\\u", "fallback_", "(_", "ctx_", ",_", "x_", ",_", "strings_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "strings_", "and_", "isinstance_", "(_", "x_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "j", "'_", "in_", "x_", "._", "lower_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "x_", "._", "lower_", "(_", ")_", "._", "replace_", "(_", "'", " ", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match_", "=_", "get", "\\u", "complex_", "._", "match_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "re_", "=_", "match_", "._", "group_", "(_", "'", "re", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "re_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "re_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "im_", "=_", "match_", "._", "group_", "(_", "'", "im", "'_", ")_", "._", "rstrip_", "(_", "'", "j", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ctx_", "._", "mpc", "_", "(_", "ctx_", "._", "convert_", "(_", "re_", ")_", ",_", "ctx_", "._", "convert_", "(_", "im_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "\"\\u", "mpi", "\\u\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", ",_", "b_", "=_", "x_", "._", "\\u", "mpi", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "a_", "==_", "b_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "can", " ", "only", " ", "create", " ", "mpf", " ", "from", " ", "zero", "-", "widt", "h", " ", "interval", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Type", "Error_", "(_", "\"", "cann", "ot", " ", "create", " ", "mpf", " ", "from", " ", "\"_", "+_", "repr_", "(_", "x_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "parse", "\\u", "prec_", "(_", "ctx_", ",_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "kwargs_", "._", "get_", "(_", "'", "exact", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0_", ",_", "'", "f", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prec_", ",_", "rounding", "_", "=_", "ctx_", "._", "\\u", "prec", "\\u", "rounding", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "rounding", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rounding", "_", "=_", "kwargs_", "[_", "'", "rounding", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "prec", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prec_", "=_", "kwargs_", "[_", "'", "prec", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "prec_", "==_", "ctx_", "._", "inf_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "0_", ",_", "'", "f", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "prec_", "=_", "int_", "(_", "prec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "dps", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dps", "_", "=_", "kwargs_", "[_", "'", "dps", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "dps", "_", "==_", "ctx_", "._", "inf_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "0_", ",_", "'", "f", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prec_", "=_", "dps", "\\u", "to", "\\u", "prec_", "(_", "dps", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "prec_", ",_", "rounding", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ctx_", "._", "\\u", "prec", "\\u", "rounding", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "hyp", "sum_", "(_", "ctx_", ",_", "p_", ",_", "q_", ",_", "flags_", ",_", "coeffs_", ",_", "z_", ",_", "accurate", "\\u", "small_", "=_", "True_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "z_", ",_", "\"\\u", "mpf", "\\u\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "p_", ",_", "q_", ",_", "flags_", ",_", "'", "R", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "z_", "._", "\\u", "mpf", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "hasattr_", "(_", "z_", ",_", "\"\\u", "mpc", "\\u\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "p_", ",_", "q_", ",_", "flags_", ",_", "'", "C", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "z_", "._", "\\u", "mpc", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "key_", "not_", "in_", "ctx_", "._", "hyp", "\\u", "summa", "tors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "hyp", "\\u", "summa", "tors_", "[_", "key_", "]_", "=_", "libm", "p_", "._", "make", "\\u", "hyp", "\\u", "summa", "tor_", "(_", "key_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "summa", "tor_", "=_", "ctx_", "._", "hyp", "\\u", "summa", "tors_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prec_", "=_", "ctx_", "._", "prec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxp", "rec_", "=_", "kwargs_", "._", "get_", "(_", "'", "maxp", "rec", "'_", ",_", "ctx_", "._", "\\u", "default", "\\u", "hyper", "\\u", "maxp", "rec_", "(_", "prec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "prec_", "=_", "50_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eps", "shift_", "=_", "25_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Jum", "ps", " ", "in", " ", "magnitude", " ", "occur", " ", "whe", "n", " ", "parameter", "s", " ", "are", " ", "close", " ", "to", " ", "negative_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "integ", "ers", ".", " ", "We", " ", "must", " ", "ensure", " ", "tha", "t", " ", "these", " ", "term", "s", " ", "are", " ", "include", "d", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "sum", " ", "and", " ", "adde", "d", " ", "accurate", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "magnitude", "\\u", "check_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "total", "\\u", "jump_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "c_", "in_", "enumerate_", "(_", "coeffs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "flags_", "[_", "i_", "]_", "==_", "'", "Z", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", ">=_", "p_", "and_", "c_", "<=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "ok_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ii_", ",_", "cc_", "in_", "enumerate_", "(_", "coeffs_", "[_", ":_", "p_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", "e", ":", " ", "c", " ", "<=", " ", "cc", " ", "or", " ", "c", " ", "<", " ", "cc", ",", " ", "depend", "ing", " ", "on", " ", "convention", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "flags_", "[_", "ii_", "]_", "==_", "'", "Z", "'_", "and_", "cc_", "<=_", "0_", "and_", "c_", "<=_", "cc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ok_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "ok_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "Zero", "Divis", "ion", "Error_", "(_", "\"", "pole", " ", "in", " ", "hyper", "geometric", " ", "series", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "n_", ",_", "d_", "=_", "ctx_", "._", "nin", "t", "\\u", "distance_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "-_", "int_", "(_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "-_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "i_", ">=_", "p_", "and_", "n_", ">=_", "0_", "and_", "d_", ">_", "4_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "n_", "in_", "magnitude", "\\u", "check_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "magnitude", "\\u", "check_", "[_", "n_", "]_", "+=_", "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 ", " ", "_", "magnitude", "\\u", "check_", "[_", "n_", "]_", "=_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "extra", "prec_", "=_", "max_", "(_", "extra", "prec_", ",_", "d_", "-_", "prec_", "+_", "60_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "max", "\\u", "total", "\\u", "jump_", "+=_", "abs_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "extra", "prec_", ">_", "maxp", "rec_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "ctx_", "._", "\\u", "hyp", "sum", "\\u", "msg_", "%_", "(_", "prec_", ",_", "prec_", "+_", "extra", "prec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "wp_", "=_", "prec_", "+_", "extra", "prec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "magnitude", "\\u", "check_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mag", "\\u", "dict_", "=_", "dict_", "(_", "(_", "n_", ",_", "None_", ")_", "for_", "n_", "in_", "magnitude", "\\u", "check_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mag", "\\u", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "zv", "_", ",_", "have", "\\u", "complex_", ",_", "magnitude_", "=_", "summa", "tor_", "(_", "coeffs_", ",_", "v_", ",_", "prec_", ",_", "wp_", ",_", "eps", "shift_", ",_", "mag", "\\u", "dict_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cancel_", "=_", "-_", "magnitude_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "jumps", "\\u", "resolved_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "extra", "prec_", "<_", "max", "\\u", "total", "\\u", "jump_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "n_", "in_", "mag", "\\u", "dict_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "(_", "n_", "is_", "None_", ")_", "or_", "(_", "n_", "<_", "prec_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "jumps", "\\u", "resolved_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "accurate", "_", "=_", "(_", "cancel_", "<_", "extra", "prec_", "-_", "25_", "-_", "5_", "or_", "not_", "accurate", "\\u", "small_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "jumps", "\\u", "resolved_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "accurate", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "zero", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "zero", "prec_", "=_", "kwargs_", "._", "get_", "(_", "'", "zero", "prec", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "zero", "prec_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "cancel_", ">_", "zero", "prec_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "have", "\\u", "complex_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "return_", "ctx_", "._", "mpc", "_", "(_", "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 ", " ", " _", "return_", "ctx_", "._", "zero_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Some", " ", "near", "-", "singular", "iti", "es", " ", "wer", "e", " ", "not", " ", "include", "d", ",", " ", "so", " ", "increase", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "preci", "sion", " ", "and", " ", "repeat", " ", "unti", "l", " ", "the", "y", " ", "are", "_", "\\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_", "extra", "prec_", "*=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Poss", "ibl", "e", " ", "workar", "ound", " ", "for", " ", "bad", " ", "round", "off", " ", "in", " ", "fixed", "-", "point", " ", "arithmetic", "_", "\\u\\u\\uNL\\u\\u\\u_", "eps", "shift_", "+=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "prec_", "+=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "zv", "_", ")_", "is_", "tuple_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "have", "\\u", "complex_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "zv", "_", ")_", "\\u\\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_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "zv", "_", ")_", "\\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_", "zv", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "lde", "xp_", "(_", "ctx_", ",_", "x_", ",_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Compute", "s", " ", "`", "x", " ", "2", "^", "n", "`", " ", "efficien", "tl", "y", ".", " ", "No", " ", "rounding", " ", "is", " ", "perform", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "argu", "ment", " ", "`", "x", "`", " ", "must", " ", "be", " ", "a", " ", "real", " ", "float", "ing", "-", "point", " ", "number", " ", "(", "or", "\\", "10", ";", " ", " ", " ", " ", "possib", "le", " ", "to", " ", "convert", " ", "int", "o", " ", "one", ")", " ", "and", " ", "`", "n", "`", " ", "must", " ", "be", " ", "a", " ", "Pyth", "on", " ", "``", "int", "``.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "mpm", "ath", " ", "import", " ", "*", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "mp", ".", "dps", " ", "=", " ", "15", ";", " ", "mp", ".", "pretty", " ", "=", " ", "Fal", "se", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "lde", "xp", "(", "1", ",", " ", "10", ")", "\\", "10", ";", " ", " ", " ", " ", "mpf", "('", "1024.", "0", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "lde", "xp", "(", "1", ",", " ", "-", "3", ")", "\\", "10", ";", " ", " ", " ", " ", "mpf", "('", "0.12", "5", "')", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "ctx_", "._", "convert_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "libm", "p_", "._", "mpf", "\\u", "shift_", "(_", "x_", "._", "\\u", "mpf", "\\u_", ",_", "n_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fre", "xp_", "(_", "ctx_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Give", "n", " ", "a", " ", "real", " ", "number", " ", "`", "x", "`", ",", " ", "return", "s", " ", "`", "(", "y", ",", " ", "n", ")`", " ", "with", " ", "`", "y", " ", "\\\\", "in", " ", "[", "0.", "5", ",", " ", "1", ")`", ",", "\\", "10", ";", " ", " ", " ", " ", "`", "n", "`", " ", "a", " ", "Pyth", "on", " ", "integ", "er", ",", " ", "and", " ", "suc", "h", " ", "tha", "t", " ", "`", "x", " ", "=", " ", "y", " ", "2", "^", "n", "`.", " ", "No", " ", "rounding", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "perform", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "mpm", "ath", " ", "import", " ", "*", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "mp", ".", "dps", " ", "=", " ", "15", ";", " ", "mp", ".", "pretty", " ", "=", " ", "Fal", "se", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fre", "xp", "(", "7.5", ")", "\\", "10", ";", " ", " ", " ", " ", "(", "mpf", "('", "0.93", "7", "5", "')", ",", " ", "3", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "ctx_", "._", "convert_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", ",_", "n_", "=_", "libm", "p_", "._", "mpf", "\\u", "fre", "xp_", "(_", "x_", "._", "\\u", "mpf", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "y_", ")_", ",_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fn", "eg_", "(_", "ctx_", ",_", "x_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Nega", "tes", " ", "the", " ", "number", " ", "*", "x", "*", ",", " ", "gi", "ving", " ", "a", " ", "float", "ing", "-", "point", " ", "result", ",", " ", "option", "ally", "\\", "10", ";", " ", " ", " ", " ", "usi", "ng", " ", "a", " ", "custom", " ", "preci", "sion", " ", "and", " ", "rounding", " ", "mode", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "See", " ", "the", " ", "documentation", " ", "of", " ", ":", "func", ":`", "~", "mpm", "ath", ".", "fad", "d", "`", " ", "for", " ", "a", " ", "detailed", " ", "description", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "how", " ", "to", " ", "speci", "fy", " ", "preci", "sion", " ", "and", " ", "rounding", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "**", "Exam", "ples", "**", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "An", " ", "mpm", "ath", " ", "number", " ", "is", " ", "return", "ed", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "mpm", "ath", " ", "import", " ", "*", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "mp", ".", "dps", " ", "=", " ", "15", ";", " ", "mp", ".", "pretty", " ", "=", " ", "Fal", "se", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fn", "eg", "(", "2.5", ")", "\\", "10", ";", " ", " ", " ", " ", "mpf", "('", "-", "2.5", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fn", "eg", "(-", "5", "+", "2j", ")", "\\", "10", ";", " ", " ", " ", " ", "mpc", "(", "real", "='", "5.0", "',", " ", "imag", "='", "-", "2.0", "')", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Precis", "e", " ", "control", " ", "over", " ", "rounding", " ", "is", " ", "possib", "le", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "x", " ", "=", " ", "fad", "d", "(", "2", ",", " ", "1e-1", "00", ",", " ", "exact", "=", "Tru", "e", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fn", "eg", "(", "x", ")", "\\", "10", ";", " ", " ", " ", " ", "mpf", "('", "-", "2.0", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fn", "eg", "(", "x", ",", " ", "rounding", "='", "f", "')", "\\", "10", ";", " ", " ", " ", " ", "mpf", "('", "-", "2.0", "0000000000000", "04", "')", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Nega", "ting", " ", "with", " ", "and", " ", "with", "out", " ", "round", "off", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "n", " ", "=", " ", "20000000", "0000000000000", "001", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "int", "(-", "mpf", "(", "n", ")))", "\\", "10", ";", " ", " ", " ", " ", "-", "20000000", "00000000", "1677721", "6", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "int", "(", "fn", "eg", "(", "n", ")))", "\\", "10", ";", " ", " ", " ", " ", "-", "20000000", "00000000", "1677721", "6", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "int", "(", "fn", "eg", "(", "n", ",", " ", "prec", "=", "log", "(", "n", ",", "2", ")+", "1", ")))", "\\", "10", ";", " ", " ", " ", " ", "-", "20000000", "0000000000000", "001", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "int", "(", "fn", "eg", "(", "n", ",", " ", "dps", "=", "log", "(", "n", ",", "10", ")+", "1", ")))", "\\", "10", ";", " ", " ", " ", " ", "-", "20000000", "0000000000000", "001", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "int", "(", "fn", "eg", "(", "n", ",", " ", "prec", "=", "inf", ")))", "\\", "10", ";", " ", " ", " ", " ", "-", "20000000", "0000000000000", "001", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "int", "(", "fn", "eg", "(", "n", ",", " ", "dps", "=", "inf", ")))", "\\", "10", ";", " ", " ", " ", " ", "-", "20000000", "0000000000000", "001", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "int", "(", "fn", "eg", "(", "n", ",", " ", "exact", "=", "Tru", "e", ")))", "\\", "10", ";", " ", " ", " ", " ", "-", "20000000", "0000000000000", "001", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prec_", ",_", "rounding", "_", "=_", "ctx_", "._", "\\u", "parse", "\\u", "prec_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "ctx_", "._", "convert_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "mpf", "\\u", "neg_", "(_", "x_", "._", "\\u", "mpf", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpc", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "mpc", "\\u", "neg_", "(_", "x_", "._", "\\u", "mpc", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "\"", "Arg", "ument", "s", " ", "need", " ", "to", " ", "be", " ", "mpf", " ", "or", " ", "mpc", " ", "compatible", " ", "numbers", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fad", "d_", "(_", "ctx_", ",_", "x_", ",_", "y_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Add", "s", " ", "the", " ", "numbers", " ", "*", "x", "*", " ", "and", " ", "*", "y", "*", ",", " ", "gi", "ving", " ", "a", " ", "float", "ing", "-", "point", " ", "result", ",", "\\", "10", ";", " ", " ", " ", " ", "option", "ally", " ", "usi", "ng", " ", "a", " ", "custom", " ", "preci", "sion", " ", "and", " ", "rounding", " ", "mode", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "default", " ", "preci", "sion", " ", "is", " ", "the", " ", "working", " ", "preci", "sion", " ", "of", " ", "the", " ", "context", ".", "\\", "10", ";", " ", " ", " ", " ", "You", " ", "can", " ", "speci", "fy", " ", "a", " ", "custom", " ", "preci", "sion", " ", "in", " ", "bits", " ", "by", " ", "passi", "ng", " ", "the", " ", "*", "prec", "*", " ", "keyw", "ord", "\\", "10", ";", " ", " ", " ", " ", "argu", "ment", ",", " ", "or", " ", "by", " ", "provi", "ding", " ", "an", " ", "equivalent", " ", "decima", "l", " ", "preci", "sion", " ", "with", " ", "the", " ", "*", "dps", "*", "\\", "10", ";", " ", " ", " ", " ", "keyw", "ord", " ", "argu", "ment", ".", " ", "If", " ", "the", " ", "preci", "sion", " ", "is", " ", "set", " ", "to", " ", "``", "+", "inf", "``", ",", " ", "or", " ", "if", " ", "the", " ", "flag", "\\", "10", ";", " ", " ", " ", " ", "*", "exact", "=", "Tru", "e", "*", " ", "is", " ", "pass", "ed", ",", " ", "an", " ", "exact", " ", "addition", " ", "with", " ", "no", " ", "rounding", " ", "is", " ", "perform", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Whe", "n", " ", "the", " ", "preci", "sion", " ", "is", " ", "finite", ",", " ", "the", " ", "option", "al", " ", "*", "rounding", "*", " ", "keyw", "ord", " ", "argu", "ment", "\\", "10", ";", " ", " ", " ", " ", "speci", "fie", "s", " ", "the", " ", "direction", " ", "of", " ", "rounding", ".", " ", "Valid", " ", "options", " ", "are", " ", "``", "'", "n", "'``", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "near", "est", " ", "(", "default", "),", " ", "``", "'", "f", "'``", " ", "for", " ", "floor", ",", " ", "``", "'", "c", "'``", " ", "for", " ", "ceil", "ing", ",", " ", "``", "'", "d", "'``", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "down", ",", " ", "``", "'", "u", "'``", " ", "for", " ", "up", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "**", "Exam", "ples", "**", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Us", "ing", " ", ":", "func", ":`", "~", "mpm", "ath", ".", "fad", "d", "`", " ", "with", " ", "preci", "sion", " ", "and", " ", "rounding", " ", "control", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "mpm", "ath", " ", "import", " ", "*", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "mp", ".", "dps", " ", "=", " ", "15", ";", " ", "mp", ".", "pretty", " ", "=", " ", "Fal", "se", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fad", "d", "(", "2", ",", " ", "1e-", "20", ")", "\\", "10", ";", " ", " ", " ", " ", "mpf", "('", "2.0", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fad", "d", "(", "2", ",", " ", "1e-", "20", ",", " ", "rounding", "='", "u", "')", "\\", "10", ";", " ", " ", " ", " ", "mpf", "('", "2.0", "0000000000000", "04", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "npr", "int", "(", "fad", "d", "(", "2", ",", " ", "1e-", "20", ",", " ", "prec", "=", "100", "),", " ", "25", ")", "\\", "10", ";", " ", " ", " ", " ", "2.0", "0000000000000", "000001", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "npr", "int", "(", "fad", "d", "(", "2", ",", " ", "1e-", "20", ",", " ", "dps", "=", "15", "),", " ", "25", ")", "\\", "10", ";", " ", " ", " ", " ", "2.0", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "npr", "int", "(", "fad", "d", "(", "2", ",", " ", "1e-", "20", ",", " ", "dps", "=", "25", "),", " ", "25", ")", "\\", "10", ";", " ", " ", " ", " ", "2.0", "0000000000000", "000001", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "npr", "int", "(", "fad", "d", "(", "2", ",", " ", "1e-", "20", ",", " ", "exact", "=", "Tru", "e", "),", " ", "25", ")", "\\", "10", ";", " ", " ", " ", " ", "2.0", "0000000000000", "000001", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Exa", "ct", " ", "addition", " ", "avoid", "s", " ", "cancellat", "ion", " ", "error", "s", ",", " ", "enf", "orc", "ing", " ", "famil", "iar", " ", "law", "s", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "numbers", " ", "suc", "h", " ", "as", " ", "`", "x", "+", "y", "-", "x", " ", "=", " ", "y", "`", ",", " ", "whi", "ch", " ", "don", "'", "t", " ", "hold", " ", "in", " ", "float", "ing", "-", "point", "\\", "10", ";", " ", " ", " ", " ", "arithmetic", " ", "with", " ", "finite", " ", "preci", "sion", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "x", ",", " ", "y", " ", "=", " ", "mpf", "(", "2", "),", " ", "mpf", "('", "1e-1", "000", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "x", " ", "+", " ", "y", " ", "-", " ", "x", ")", "\\", "10", ";", " ", " ", " ", " ", "0.", "0", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "fad", "d", "(", "x", ",", " ", "y", ",", " ", "prec", "=", "inf", ")", " ", "-", " ", "x", ")", "\\", "10", ";", " ", " ", " ", " ", "1.0e-", "1000", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "fad", "d", "(", "x", ",", " ", "y", ",", " ", "exact", "=", "Tru", "e", ")", " ", "-", " ", "x", ")", "\\", "10", ";", " ", " ", " ", " ", "1.0e-", "1000", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Exa", "ct", " ", "addition", " ", "can", " ", "be", " ", "ine", "ffic", "ient", " ", "and", " ", "may", " ", "be", " ", "impossible", " ", "to", " ", "perform", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "large", " ", "magnitude", " ", "difference", "s", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fad", "d", "(", "1", ",", " ", "'", "1e-1", "0000000000000", "0000000", "',", " ", "prec", "=", "inf", ")", "\\", "10", ";", " ", " ", " ", " ", "Trace", "back", " ", "(", "most", " ", "recent", " ", "call", " ", "last", "):", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "...", "\\", "10", ";", " ", " ", " ", " ", "Over", "flow", "Error", ":", " ", "the", " ", "exact", " ", "result", " ", "doe", "s", " ", "not", " ", "fit", " ", "in", " ", "memory", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prec_", ",_", "rounding", "_", "=_", "ctx_", "._", "\\u", "parse", "\\u", "prec_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "ctx_", "._", "convert_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "ctx_", "._", "convert_", "(_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "y_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "mpf", "\\u", "add_", "(_", "x_", "._", "\\u", "mpf", "\\u_", ",_", "y_", "._", "\\u", "mpf", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "y_", ",_", "'\\u", "mpc", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "mpc", "\\u", "add", "\\u", "mpf", "_", "(_", "y_", "._", "\\u", "mpc", "\\u_", ",_", "x_", "._", "\\u", "mpf", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpc", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "y_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "mpc", "\\u", "add", "\\u", "mpf", "_", "(_", "x_", "._", "\\u", "mpc", "\\u_", ",_", "y_", "._", "\\u", "mpf", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "y_", ",_", "'\\u", "mpc", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "mpc", "\\u", "add_", "(_", "x_", "._", "\\u", "mpc", "\\u_", ",_", "y_", "._", "\\u", "mpc", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\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_", "(_", "Value", "Error_", ",_", "Over", "flow", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Over", "flow", "Error_", "(_", "ctx_", "._", "\\u", "exact", "\\u", "overflow", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "\"", "Arg", "ument", "s", " ", "need", " ", "to", " ", "be", " ", "mpf", " ", "or", " ", "mpc", " ", "compatible", " ", "numbers", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fsu", "b_", "(_", "ctx_", ",_", "x_", ",_", "y_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Subtract", "s", " ", "the", " ", "numbers", " ", "*", "x", "*", " ", "and", " ", "*", "y", "*", ",", " ", "gi", "ving", " ", "a", " ", "float", "ing", "-", "point", " ", "result", ",", "\\", "10", ";", " ", " ", " ", " ", "option", "ally", " ", "usi", "ng", " ", "a", " ", "custom", " ", "preci", "sion", " ", "and", " ", "rounding", " ", "mode", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "See", " ", "the", " ", "documentation", " ", "of", " ", ":", "func", ":`", "~", "mpm", "ath", ".", "fad", "d", "`", " ", "for", " ", "a", " ", "detailed", " ", "description", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "how", " ", "to", " ", "speci", "fy", " ", "preci", "sion", " ", "and", " ", "rounding", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "**", "Exam", "ples", "**", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Us", "ing", " ", ":", "func", ":`", "~", "mpm", "ath", ".", "fsu", "b", "`", " ", "with", " ", "preci", "sion", " ", "and", " ", "rounding", " ", "control", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "mpm", "ath", " ", "import", " ", "*", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "mp", ".", "dps", " ", "=", " ", "15", ";", " ", "mp", ".", "pretty", " ", "=", " ", "Fal", "se", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fsu", "b", "(", "2", ",", " ", "1e-", "20", ")", "\\", "10", ";", " ", " ", " ", " ", "mpf", "('", "2.0", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fsu", "b", "(", "2", ",", " ", "1e-", "20", ",", " ", "rounding", "='", "d", "')", "\\", "10", ";", " ", " ", " ", " ", "mpf", "('", "1.9", "9999999999999", "98", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "npr", "int", "(", "fsu", "b", "(", "2", ",", " ", "1e-", "20", ",", " ", "prec", "=", "100", "),", " ", "25", ")", "\\", "10", ";", " ", " ", " ", " ", "1.9", "9999999999999", "999999", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "npr", "int", "(", "fsu", "b", "(", "2", ",", " ", "1e-", "20", ",", " ", "dps", "=", "15", "),", " ", "25", ")", "\\", "10", ";", " ", " ", " ", " ", "2.0", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "npr", "int", "(", "fsu", "b", "(", "2", ",", " ", "1e-", "20", ",", " ", "dps", "=", "25", "),", " ", "25", ")", "\\", "10", ";", " ", " ", " ", " ", "1.9", "9999999999999", "999999", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "npr", "int", "(", "fsu", "b", "(", "2", ",", " ", "1e-", "20", ",", " ", "exact", "=", "Tru", "e", "),", " ", "25", ")", "\\", "10", ";", " ", " ", " ", " ", "1.9", "9999999999999", "999999", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Exa", "ct", " ", "subtract", "ion", " ", "avoid", "s", " ", "cancellat", "ion", " ", "error", "s", ",", " ", "enf", "orc", "ing", " ", "famil", "iar", " ", "law", "s", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "numbers", " ", "suc", "h", " ", "as", " ", "`", "x", "-", "y", "+", "y", " ", "=", " ", "x", "`", ",", " ", "whi", "ch", " ", "don", "'", "t", " ", "hold", " ", "in", " ", "float", "ing", "-", "point", "\\", "10", ";", " ", " ", " ", " ", "arithmetic", " ", "with", " ", "finite", " ", "preci", "sion", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "x", ",", " ", "y", " ", "=", " ", "mpf", "(", "2", "),", " ", "mpf", "('", "1e1", "000", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "x", " ", "-", " ", "y", " ", "+", " ", "y", ")", "\\", "10", ";", " ", " ", " ", " ", "0.", "0", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "fsu", "b", "(", "x", ",", " ", "y", ",", " ", "prec", "=", "inf", ")", " ", "+", " ", "y", ")", "\\", "10", ";", " ", " ", " ", " ", "2.0", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "fsu", "b", "(", "x", ",", " ", "y", ",", " ", "exact", "=", "Tru", "e", ")", " ", "+", " ", "y", ")", "\\", "10", ";", " ", " ", " ", " ", "2.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Exa", "ct", " ", "addition", " ", "can", " ", "be", " ", "ine", "ffic", "ient", " ", "and", " ", "may", " ", "be", " ", "impossible", " ", "to", " ", "perform", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "large", " ", "magnitude", " ", "difference", "s", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fsu", "b", "(", "1", ",", " ", "'", "1e-1", "0000000000000", "0000000", "',", " ", "prec", "=", "inf", ")", "\\", "10", ";", " ", " ", " ", " ", "Trace", "back", " ", "(", "most", " ", "recent", " ", "call", " ", "last", "):", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "...", "\\", "10", ";", " ", " ", " ", " ", "Over", "flow", "Error", ":", " ", "the", " ", "exact", " ", "result", " ", "doe", "s", " ", "not", " ", "fit", " ", "in", " ", "memory", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prec_", ",_", "rounding", "_", "=_", "ctx_", "._", "\\u", "parse", "\\u", "prec_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "ctx_", "._", "convert_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "ctx_", "._", "convert_", "(_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "y_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "mpf", "\\u", "sub_", "(_", "x_", "._", "\\u", "mpf", "\\u_", ",_", "y_", "._", "\\u", "mpf", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "y_", ",_", "'\\u", "mpc", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "mpc", "\\u", "sub_", "(_", "(_", "x_", "._", "\\u", "mpf", "\\u_", ",_", "fz", "ero", "_", ")_", ",_", "y_", "._", "\\u", "mpc", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpc", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "y_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "mpc", "\\u", "sub\\u", "mpf", "_", "(_", "x_", "._", "\\u", "mpc", "\\u_", ",_", "y_", "._", "\\u", "mpf", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "y_", ",_", "'\\u", "mpc", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "mpc", "\\u", "sub_", "(_", "x_", "._", "\\u", "mpc", "\\u_", ",_", "y_", "._", "\\u", "mpc", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\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_", "(_", "Value", "Error_", ",_", "Over", "flow", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Over", "flow", "Error_", "(_", "ctx_", "._", "\\u", "exact", "\\u", "overflow", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "\"", "Arg", "ument", "s", " ", "need", " ", "to", " ", "be", " ", "mpf", " ", "or", " ", "mpc", " ", "compatible", " ", "numbers", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fm", "ul_", "(_", "ctx_", ",_", "x_", ",_", "y_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Multipl", "ies", " ", "the", " ", "numbers", " ", "*", "x", "*", " ", "and", " ", "*", "y", "*", ",", " ", "gi", "ving", " ", "a", " ", "float", "ing", "-", "point", " ", "result", ",", "\\", "10", ";", " ", " ", " ", " ", "option", "ally", " ", "usi", "ng", " ", "a", " ", "custom", " ", "preci", "sion", " ", "and", " ", "rounding", " ", "mode", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "See", " ", "the", " ", "documentation", " ", "of", " ", ":", "func", ":`", "~", "mpm", "ath", ".", "fad", "d", "`", " ", "for", " ", "a", " ", "detailed", " ", "description", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "how", " ", "to", " ", "speci", "fy", " ", "preci", "sion", " ", "and", " ", "rounding", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "**", "Exam", "ples", "**", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "result", " ", "is", " ", "an", " ", "mpm", "ath", " ", "number", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "mpm", "ath", " ", "import", " ", "*", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "mp", ".", "dps", " ", "=", " ", "15", ";", " ", "mp", ".", "pretty", " ", "=", " ", "Fal", "se", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fm", "ul", "(", "2", ",", " ", "5.0", ")", "\\", "10", ";", " ", " ", " ", " ", "mpf", "('", "10.", "0", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fm", "ul", "(", "0.", "5", "j", ",", " ", "0.", "5", ")", "\\", "10", ";", " ", " ", " ", " ", "mpc", "(", "real", "='", "0.", "0", "',", " ", "imag", "='", "0.25", "')", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Av", "oid", "ing", " ", "round", "off", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "x", ",", " ", "y", " ", "=", " ", "10", "**", "10", "+", "1", ",", " ", "10", "**", "15", "+", "1", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "x", "*", "y", ")", "\\", "10", ";", " ", " ", " ", " ", "1000000000", "10000", "1000000000", "1", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "mpf", "(", "x", ")", " ", "*", " ", "mpf", "(", "y", "))\\", "10", ";", " ", " ", " ", " ", "1.000000", "0001", "e", "+", "25", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "int", "(", "mpf", "(", "x", ")", " ", "*", " ", "mpf", "(", "y", ")))", "\\", "10", ";", " ", " ", " ", " ", "1000000000", "10000", "1102", "639", "923", "2", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "int", "(", "fm", "ul", "(", "x", ",", " ", "y", ")))", "\\", "10", ";", " ", " ", " ", " ", "1000000000", "10000", "1102", "639", "923", "2", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "int", "(", "fm", "ul", "(", "x", ",", " ", "y", ",", " ", "dps", "=", "25", ")))", "\\", "10", ";", " ", " ", " ", " ", "1000000000", "10000", "1000000000", "1", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "int", "(", "fm", "ul", "(", "x", ",", " ", "y", ",", " ", "exact", "=", "Tru", "e", ")))", "\\", "10", ";", " ", " ", " ", " ", "1000000000", "10000", "1000000000", "1", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Exa", "ct", " ", "multiplication", " ", "with", " ", "complex", " ", "numbers", " ", "can", " ", "be", " ", "ine", "ffic", "ient", " ", "and", " ", "may", "\\", "10", ";", " ", " ", " ", " ", "be", " ", "impossible", " ", "to", " ", "perform", " ", "with", " ", "large", " ", "magnitude", " ", "difference", "s", " ", "bet", "ween", "\\", "10", ";", " ", " ", " ", " ", "real", " ", "and", " ", "imagin", "ary", " ", "part", "s", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "x", " ", "=", " ", "1", "+", "2j", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "y", " ", "=", " ", "mpc", "(", "2", ",", " ", "'", "1e-1", "0000000000000", "0000000", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fm", "ul", "(", "x", ",", " ", "y", ")", "\\", "10", ";", " ", " ", " ", " ", "mpc", "(", "real", "='", "2.0", "',", " ", "imag", "='", "4.0", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fm", "ul", "(", "x", ",", " ", "y", ",", " ", "rounding", "='", "u", "')", "\\", "10", ";", " ", " ", " ", " ", "mpc", "(", "real", "='", "2.0", "',", " ", "imag", "='", "4.0", "0000000000000", "09", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fm", "ul", "(", "x", ",", " ", "y", ",", " ", "exact", "=", "Tru", "e", ")", "\\", "10", ";", " ", " ", " ", " ", "Trace", "back", " ", "(", "most", " ", "recent", " ", "call", " ", "last", "):", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "...", "\\", "10", ";", " ", " ", " ", " ", "Over", "flow", "Error", ":", " ", "the", " ", "exact", " ", "result", " ", "doe", "s", " ", "not", " ", "fit", " ", "in", " ", "memory", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prec_", ",_", "rounding", "_", "=_", "ctx_", "._", "\\u", "parse", "\\u", "prec_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "ctx_", "._", "convert_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "ctx_", "._", "convert_", "(_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "y_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "mpf", "\\u", "mul_", "(_", "x_", "._", "\\u", "mpf", "\\u_", ",_", "y_", "._", "\\u", "mpf", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "y_", ",_", "'\\u", "mpc", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "mpc", "\\u", "mul", "\\u", "mpf", "_", "(_", "y_", "._", "\\u", "mpc", "\\u_", ",_", "x_", "._", "\\u", "mpf", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpc", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "y_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "mpc", "\\u", "mul", "\\u", "mpf", "_", "(_", "x_", "._", "\\u", "mpc", "\\u_", ",_", "y_", "._", "\\u", "mpf", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "y_", ",_", "'\\u", "mpc", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "mpc", "\\u", "mul_", "(_", "x_", "._", "\\u", "mpc", "\\u_", ",_", "y_", "._", "\\u", "mpc", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\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_", "(_", "Value", "Error_", ",_", "Over", "flow", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Over", "flow", "Error_", "(_", "ctx_", "._", "\\u", "exact", "\\u", "overflow", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "\"", "Arg", "ument", "s", " ", "need", " ", "to", " ", "be", " ", "mpf", " ", "or", " ", "mpc", " ", "compatible", " ", "numbers", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fdi", "v_", "(_", "ctx_", ",_", "x_", ",_", "y_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Divide", "s", " ", "the", " ", "numbers", " ", "*", "x", "*", " ", "and", " ", "*", "y", "*", ",", " ", "gi", "ving", " ", "a", " ", "float", "ing", "-", "point", " ", "result", ",", "\\", "10", ";", " ", " ", " ", " ", "option", "ally", " ", "usi", "ng", " ", "a", " ", "custom", " ", "preci", "sion", " ", "and", " ", "rounding", " ", "mode", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "See", " ", "the", " ", "documentation", " ", "of", " ", ":", "func", ":`", "~", "mpm", "ath", ".", "fad", "d", "`", " ", "for", " ", "a", " ", "detailed", " ", "description", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "how", " ", "to", " ", "speci", "fy", " ", "preci", "sion", " ", "and", " ", "rounding", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "**", "Exam", "ples", "**", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "result", " ", "is", " ", "an", " ", "mpm", "ath", " ", "number", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "mpm", "ath", " ", "import", " ", "*", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "mp", ".", "dps", " ", "=", " ", "15", ";", " ", "mp", ".", "pretty", " ", "=", " ", "Fal", "se", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fdi", "v", "(", "3", ",", " ", "2", ")", "\\", "10", ";", " ", " ", " ", " ", "mpf", "('", "1.5", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fdi", "v", "(", "2", ",", " ", "3", ")", "\\", "10", ";", " ", " ", " ", " ", "mpf", "('", "0.66", "6666666666", "6666", "3", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fdi", "v", "(", "2", "+", "4j", ",", " ", "0.", "5", ")", "\\", "10", ";", " ", " ", " ", " ", "mpc", "(", "real", "='", "4.0", "',", " ", "imag", "='", "8.0", "')", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "rounding", " ", "direction", " ", "and", " ", "preci", "sion", " ", "can", " ", "be", " ", "controlle", "d", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fdi", "v", "(", "2", ",", " ", "3", ",", " ", "dps", "=", "3", ")", " ", " ", " ", " ", "#", " ", "Sho", "ul", "d", " ", "be", " ", "accurate", " ", "to", " ", "at", " ", "leas", "t", " ", "3", " ", "digit", "s", "\\", "10", ";", " ", " ", " ", " ", "mpf", "('", "0.66", "662", "597", "656", "25", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fdi", "v", "(", "2", ",", " ", "3", ",", " ", "rounding", "='", "d", "')", "\\", "10", ";", " ", " ", " ", " ", "mpf", "('", "0.66", "6666666666", "6666", "3", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fdi", "v", "(", "2", ",", " ", "3", ",", " ", "prec", "=", "60", ")", "\\", "10", ";", " ", " ", " ", " ", "mpf", "('", "0.66", "6666666666", "6666", "7", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fdi", "v", "(", "2", ",", " ", "3", ",", " ", "rounding", "='", "u", "')", "\\", "10", ";", " ", " ", " ", " ", "mpf", "('", "0.66", "6666666666", "6667", "4", "')", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Check", "ing", " ", "the", " ", "error", " ", "of", " ", "a", " ", "divisi", "on", " ", "by", " ", "perform", "ing", " ", "it", " ", "at", " ", "higher", " ", "preci", "sion", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fdi", "v", "(", "2", ",", " ", "3", ")", " ", "-", " ", "fdi", "v", "(", "2", ",", " ", "3", ",", " ", "prec", "=", "100", ")", "\\", "10", ";", " ", " ", " ", " ", "mpf", "('", "-", "3.7", "007", "434", "154", "172", "148", "e-1", "7", "')", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Unli", "ke", " ", ":", "func", ":`", "~", "mpm", "ath", ".", "fad", "d", "`", ",", " ", ":", "func", ":`", "~", "mpm", "ath", ".", "fm", "ul", "`", ",", " ", "etc", ".,", " ", "exact", " ", "divisi", "on", " ", "is", " ", "not", "\\", "10", ";", " ", " ", " ", " ", "allow", "ed", " ", "sinc", "e", " ", "the", " ", "quot", "ient", " ", "of", " ", "two", " ", "float", "ing", "-", "point", " ", "numbers", " ", "genera", "ll", "y", "\\", "10", ";", " ", " ", " ", " ", "doe", "s", " ", "not", " ", "have", " ", "an", " ", "exact", " ", "float", "ing", "-", "point", " ", "represent", "ation", ".", " ", "(", "In", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "future", " ", "this", " ", "mig", "ht", " ", "be", " ", "change", "d", " ", "to", " ", "allow", " ", "the", " ", "case", " ", "where", " ", "the", " ", "divisi", "on", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "actual", "ly", " ", "exact", ".)", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fdi", "v", "(", "2", ",", " ", "3", ",", " ", "exact", "=", "Tru", "e", ")", "\\", "10", ";", " ", " ", " ", " ", "Trace", "back", " ", "(", "most", " ", "recent", " ", "call", " ", "last", "):", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "...", "\\", "10", ";", " ", " ", " ", " ", "Value", "Error", ":", " ", "divisi", "on", " ", "is", " ", "not", " ", "an", " ", "exact", " ", "operati", "on", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prec_", ",_", "rounding", "_", "=_", "ctx_", "._", "\\u", "parse", "\\u", "prec_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "prec_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "divisi", "on", " ", "is", " ", "not", " ", "an", " ", "exact", " ", "operati", "on", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "x_", "=_", "ctx_", "._", "convert_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "ctx_", "._", "convert_", "(_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "y_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "mpf", "\\u", "div_", "(_", "x_", "._", "\\u", "mpf", "\\u_", ",_", "y_", "._", "\\u", "mpf", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "y_", ",_", "'\\u", "mpc", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "mpc", "\\u", "div_", "(_", "(_", "x_", "._", "\\u", "mpf", "\\u_", ",_", "fz", "ero", "_", ")_", ",_", "y_", "._", "\\u", "mpc", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpc", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "y_", ",_", "'\\u", "mpf", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "mpc", "\\u", "div", "\\u", "mpf", "_", "(_", "x_", "._", "\\u", "mpc", "\\u_", ",_", "y_", "._", "\\u", "mpf", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "y_", ",_", "'\\u", "mpc", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "mpc", "\\u", "div_", "(_", "x_", "._", "\\u", "mpc", "\\u_", ",_", "y_", "._", "\\u", "mpc", "\\u_", ",_", "prec_", ",_", "rounding", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "\"", "Arg", "ument", "s", " ", "need", " ", "to", " ", "be", " ", "mpf", " ", "or", " ", "mpc", " ", "compatible", " ", "numbers", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "nin", "t", "\\u", "distance_", "(_", "ctx_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "`", "(", "n", ",", "d", ")`", " ", "where", " ", "`", "n", "`", " ", "is", " ", "the", " ", "near", "est", " ", "integ", "er", " ", "to", " ", "`", "x", "`", " ", "and", " ", "`", "d", "`", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "an", " ", "estimate", " ", "of", " ", "`", "\\\\", "log", "\\u", "2", "(", "|", "x", "-", "n", "|)", "`.", " ", "If", " ", "`", "d", " ", "<", " ", "0", "`", ",", " ", "`-", "d", "`", " ", "give", "s", " ", "the", " ", "preci", "sion", "\\", "10", ";", " ", " ", " ", " ", "(", "measure", "d", " ", "in", " ", "bits", ")", " ", "lost", " ", "to", " ", "cancellat", "ion", " ", "whe", "n", " ", "compu", "ting", " ", "`", "x", "-", "n", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "mpm", "ath", " ", "import", " ", "*", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "n", ",", " ", "d", " ", "=", " ", "nin", "t", "\\u", "distance", "(", "5", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "n", ");", " ", "print", "(", "d", ")", "\\", "10", ";", " ", " ", " ", " ", "5", "\\", "10", ";", " ", " ", " ", " ", "-", "inf", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "n", ",", " ", "d", " ", "=", " ", "nin", "t", "\\u", "distance", "(", "mpf", "(", "5", "))\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "n", ");", " ", "print", "(", "d", ")", "\\", "10", ";", " ", " ", " ", " ", "5", "\\", "10", ";", " ", " ", " ", " ", "-", "inf", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "n", ",", " ", "d", " ", "=", " ", "nin", "t", "\\u", "distance", "(", "mpf", "(", "5.0", "0000001", "))\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "n", ");", " ", "print", "(", "d", ")", "\\", "10", ";", " ", " ", " ", " ", "5", "\\", "10", ";", " ", " ", " ", " ", "-", "2", "6", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "n", ",", " ", "d", " ", "=", " ", "nin", "t", "\\u", "distance", "(", "mpf", "(", "4.9", "9999999", "))\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "n", ");", " ", "print", "(", "d", ")", "\\", "10", ";", " ", " ", " ", " ", "5", "\\", "10", ";", " ", " ", " ", " ", "-", "2", "6", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "n", ",", " ", "d", " ", "=", " ", "nin", "t", "\\u", "distance", "(", "mpc", "(", "5", ",", "10", "))\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "n", ");", " ", "print", "(", "d", ")", "\\", "10", ";", " ", " ", " ", " ", "5", "\\", "10", ";", " ", " ", " ", " ", "4", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "n", ",", " ", "d", " ", "=", " ", "nin", "t", "\\u", "distance", "(", "mpc", "(", "5", ",", "0.000001", "))\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "n", ");", " ", "print", "(", "d", ")", "\\", "10", ";", " ", " ", " ", " ", "5", "\\", "10", ";", " ", " ", " ", " ", "-1", "9", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "typ", "x_", "=_", "type_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "typ", "x_", "in_", "int\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "int_", "(_", "x_", ")_", ",_", "ctx_", "._", "nin", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "typ", "x_", "is_", "rational", "_", "._", "mp", "q_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", ",_", "q_", "=_", "x_", "._", "\\u", "mp", "q", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", ",_", "r_", "=_", "divmod_", "(_", "p_", ",_", "q_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "2_", "*_", "r_", ">=_", "q_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "r_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "n_", ",_", "ctx_", "._", "nin", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "log", "(", "p", "/", "q", "-", "n", ")", " ", "=", " ", "log", "((", "p", "-", "nq", ")/", "q", ")", " ", "=", " ", "log", "(", "p", "-", "nq", ")", " ", "-", " ", "log", "(", "q", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "bit", "count_", "(_", "abs_", "(_", "p_", "-_", "n_", "*_", "q_", ")_", ")_", "-_", "bit", "count_", "(_", "q_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "n_", ",_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "\"\\u", "mpf", "\\u\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "re_", "=_", "x_", "._", "\\u", "mpf", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "im", "\\u", "dist_", "=_", "ctx_", "._", "nin", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "hasattr_", "(_", "x_", ",_", "\"\\u", "mpc", "\\u\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "re_", ",_", "im_", "=_", "x_", "._", "\\u", "mpc", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "isi", "gn_", ",_", "ima", "n_", ",_", "iex", "p_", ",_", "ib", "c_", "=_", "im_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ima", "n_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "im", "\\u", "dist_", "=_", "iex", "p_", "+_", "ib", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "im_", "==_", "fz", "ero", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "im", "\\u", "dist_", "=_", "ctx_", "._", "nin", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "require", "s", " ", "a", " ", "finite", " ", "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 ", " _", "x_", "=_", "ctx_", "._", "convert_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "\"\\u", "mpf", "\\u\"_", ")_", "or_", "hasattr_", "(_", "x_", ",_", "\"\\u", "mpc", "\\u\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ctx_", "._", "nin", "t", "\\u", "distance_", "(_", "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 ", " _", "raise_", "Type", "Error_", "(_", "\"", "require", "s", " ", "an", " ", "mpf", "/", "mpc", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sign_", ",_", "man_", ",_", "exp_", ",_", "bc_", "=_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mag_", "=_", "exp_", "+_", "bc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "|", "x", "|", " ", "<", " ", "0.5_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "mag_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "re", "\\u", "dist_", "=_", "mag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "man_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "exact", " ", "integer_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "exp_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "man_", "<<_", "exp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "re", "\\u", "dist_", "=_", "ctx_", "._", "nin", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "exact", " ", "half", "-", "integer_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "exp_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "(_", "man_", ">>_", "1_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "re", "\\u", "dist_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "(_", "-_", "exp_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "man_", ">>_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "t_", "&_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "t_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "man_", "=_", "(_", "t_", "<<_", "d_", ")_", "-_", "man_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "man_", "-=_", "(_", "t_", "<<_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "n_", "=_", "t_", ">>_", "1_", "#", " ", "int", "(", "t", ")>", ">", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "re", "\\u", "dist_", "=_", "exp_", "+_", "bit", "count_", "(_", "man_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "sign_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "-_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "re_", "==_", "fz", "ero", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "re", "\\u", "dist_", "=_", "ctx_", "._", "nin", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "require", "s", " ", "a", " ", "finite", " ", "number", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "n_", ",_", "max_", "(_", "re", "\\u", "dist_", ",_", "im", "\\u", "dist_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fpro", "d_", "(_", "ctx_", ",_", "factors_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Calculat", "es", " ", "a", " ", "product", " ", "contain", "ing", " ", "a", " ", "finite", " ", "number", " ", "of", " ", "factor", "s", " ", "(", "for", "\\", "10", ";", " ", " ", " ", " ", "infini", "te", " ", "products", ",", " ", "see", " ", ":", "func", ":`", "~", "mpm", "ath", ".", "npr", "od", "`)", ".", " ", "The", " ", "factor", "s", " ", "will", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "convert", "ed", " ", "to", " ", "mpm", "ath", " ", "numbers", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "mpm", "ath", " ", "import", " ", "*", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "mp", ".", "dps", " ", "=", " ", "15", ";", " ", "mp", ".", "pretty", " ", "=", " ", "Fal", "se", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "fpro", "d", "([", "1", ",", " ", "2", ",", " ", "0.", "5", ",", " ", "7", "])", "\\", "10", ";", " ", " ", " ", " ", "mpf", "('", "7.0", "')", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "orig_", "=_", "ctx_", "._", "prec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "ctx_", "._", "one_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "factors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "*=_", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "prec_", "=_", "orig_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "+_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rand_", "(_", "ctx_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "an", " ", "``", "mpf", "``", " ", "with", " ", "value", " ", "chosen", " ", "random", "ly", " ", "from", " ", "`", "[", "0", ",", " ", "1", ")`", ".", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "number", " ", "of", " ", "random", "ly", " ", "generat", "ed", " ", "bits", " ", "in", " ", "the", " ", "mant", "issa", " ", "is", " ", "equal", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "the", " ", "working", " ", "preci", "sion", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "mpf", "\\u", "rand_", "(_", "ctx_", "._", "\\u", "prec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fraction_", "(_", "ctx_", ",_", "p_", ",_", "q_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Give", "n", " ", "Pyth", "on", " ", "integ", "ers", " ", "`", "(", "p", ",", " ", "q", ")`", ",", " ", "return", "s", " ", "a", " ", "lazy", " ", "``", "mpf", "``", " ", "represent", "ing", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "fract", "ion", " ", "`", "p", "/", "q", "`.", " ", "The", " ", "value", " ", "is", " ", "update", "d", " ", "with", " ", "the", " ", "preci", "sion", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "mpm", "ath", " ", "import", " ", "*", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "mp", ".", "dps", " ", "=", " ", "15", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "a", " ", "=", " ", "fract", "ion", "(", "1", ",", "100", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "b", " ", "=", " ", "mpf", "(", "1", ")/", "100", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "a", ");", " ", "print", "(", "b", ")", "\\", "10", ";", " ", " ", " ", " ", "0.01", "\\", "10", ";", " ", " ", " ", " ", "0.01", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "mp", ".", "dps", " ", "=", " ", "30", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "print", "(", "a", ");", " ", "print", "(", "b", ")", " ", " ", "#", " ", "a", " ", "will", " ", "be", " ", "accurate", "\\", "10", ";", " ", " ", " ", " ", "0.01", "\\", "10", ";", " ", " ", " ", " ", "0.010", "0000000000000", "0020", "816", "681", "711", "7", "2", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "mp", ".", "dps", " ", "=", " ", "15", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ctx_", "._", "constant_", "(_", "lambda_", "prec_", ",_", "rnd_", ":_", "from", "\\u", "rational", "_", "(_", "p_", ",_", "q_", ",_", "prec_", ",_", "rnd_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'%", "s", "/", "%", "s", "'_", "%_", "(_", "p_", ",_", "q_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "abs", "min_", "(_", "ctx_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "abs_", "(_", "ctx_", "._", "convert_", "(_", "x_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "abs", "max_", "(_", "ctx_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "abs_", "(_", "ctx_", "._", "convert_", "(_", "x_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "as", "\\u", "points_", "(_", "ctx_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "XX", "X", ":", " ", "remove", " ", "this", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "x_", ",_", "'\\u", "mpi", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", ",_", "b_", "=_", "x_", "._", "\\u", "mpi", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "a_", ")_", ",_", "ctx_", "._", "make", "\\u", "mpf", "_", "(_", "b_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "Context_", "(_", "Base", "MP", "Context_", ",_", "Standard", "Base", "Context_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "zeta", "sum", "\\u", "fast_", "(_", "ctx_", ",_", "s_", ",_", "a_", ",_", "n_", ",_", "derivatives", "_", "=_", "[_", "0_", "]_", ",_", "reflect", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "(_", "ctx_", "._", "isin", "t_", "(_", "a_", ")_", "and_", "hasattr_", "(_", "s_", ",_", "\"\\u", "mpc", "\\u\"_", ")_", ")_", ":_", "\\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_", "a_", "=_", "int_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prec_", "=_", "ctx_", "._", "\\u", "prec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xs_", ",_", "ys_", "=_", "libm", "p_", "._", "mpc", "\\u", "zeta", "sum_", "(_", "s_", "._", "\\u", "mpc", "\\u_", ",_", "a_", ",_", "n_", ",_", "derivatives", "_", ",_", "reflect", "_", ",_", "prec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xs_", "=_", "[_", "ctx_", "._", "make", "\\u", "mpc", "_", "(_", "x_", ")_", "for_", "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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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
babble/babble/include/jython/Lib/test/test_cmp_jy.py
[ { "content": " def testCompareWithString(self):\n class Test(long):\n pass\n self.assertNotEqual(Test(0), 'foo')\n self.assertTrue('foo' in [Test(12), 'foo'])", "metadata": "root.LongDerivedCmp.testCompareWithString", "header": "['class', 'LongDerivedCmp', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 17 } ]
[ { "span": "self.assertTrue('foo' in [Test(12), 'foo'])", "start_line": 21, "start_column": 8, "end_line": 21, "end_column": 51 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Long", "Derive", "d", "Cmp", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test", "Compare", "With", "String_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Test_", "(_", "long_", ")_", ":_", "\\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", "Not", "Equal_", "(_", "Test_", "(_", "0_", ")_", ",_", "'", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "foo", "'_", "in_", "[_", "Test_", "(_", "12_", ")_", ",_", "'", "foo", "'_", "]_", ")_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused import
chapmanb/cloudbiolinux/cloudbio/custom/vcr.py
[ { "content": "#\n# vcr.py\n# - Configures the environment for running the Viral Assembly (viral_assembly_pipeline.py) and VIGOR (VIGOR3.pl) pipelines (creating directory structure and installs software). \n#\n\nimport os.path, re, mmap\nfrom fabric.api import cd, env, hide, local, run, settings, sudo, task\nfrom fabric.network import disconnect_all\n\n# Common variables\ndependency_URL = \"http://s3.amazonaws.com/VIGOR-GSC\"\n\n\n# Galaxy VCR\ngalaxy_central = \"/mnt/galaxyTools/galaxy-central\"\ngalaxy_VCR_path = \"/%s/tools/viral_assembly_annotation\" % galaxy_central\n\n# Galaxy VCR - install method\n\n\n# Viral Assembly\nviral_dirs = {}\nviral_urls = {}\nviral_tars = {}\n\n# Viral Assembly - install methods\n\n\n# Viral Assembly - utility methods\n\n\n\n\n\n\n# VIGOR\n\nvigor_dirs = {}\nvigor_urls = {}\nvigor_tars = {}\nvigor_names = {}\n\n# VIGOR - install methods\n\n\n\n\n\n# VIGOR - utility methods\n\n\n\n\n\n\n\n\n\n\n\n\n# VICVB - install methods\n\n\n\n\n# Common methods\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def install_galaxy_vcr(env):\n\twith cd(\"~\"):\n\t\tprint(\"Installing galaxy VCR tools (python and xml scripts).\")\n\t\tsudo(\"git clone git://github.com/JCVI-Cloud/galaxy-tools-vcr.git\")\n\t\tsudo(\"cp -R galaxy-tools-vcr/tools/viral_assembly_annotation %s\" % galaxy_VCR_path)\n\t\tsudo(\"chown -R galaxy:galaxy %s\" % galaxy_VCR_path)\n\twith cd(galaxy_central):\n\t\tprint(\"Adding VCR to tool_conf.xml.\")\n\t\ttcx_file = \"tool_conf.xml\"\n\t\t_set_pre_VCR(tcx_file,\"galaxy\",\"galaxy\")\n\t\ttcx_string = _get_file_string(tcx_file,galaxy_central)\n\t\t\n\t\tvcr_header = \"<section name=\\\"Viral Assembly and Annotation\\\" id=\\\"viral_assembly_annotation\\\">\\\"\"\n\t\tif (tcx_string.find(vcr_header) != -1):\n\t\t\tprint(\"Galaxy VCR tools already included in tools_conf.xml!\")\n\t\telse:\n\t\t\tsudo(\"sed -i '$d' %s/%s\" % (galaxy_central,tcx_file))\n\t\t\tsudo(\"echo -e ' <section name=\\\"Viral Assembly and Annotation\\\" id=\\\"viral_assembly_annotation\\\">' >> %s\" % tcx_file)\n\t\t\tsudo(\"echo -e ' <tool file=\\\"viral_assembly_annotation/viral_assembly.xml\\\" />' >> %s\" % tcx_file)\n\t\t\tsudo(\"echo -e ' <tool file=\\\"viral_assembly_annotation/VIGOR.xml\\\" />' >> %s\" % tcx_file)\n\t\t\tsudo(\"echo -e ' </section>' >> %s\" % tcx_file)\n\t\t\tsudo(\"echo -e '</toolbox>' >> %s\" % tcx_file)\n\t\t\n\t\tprint(\"Adding 'sanitize_all_html = False' to universe_wsgi.ini to enable JBrowse for VICVB.\")\n\t\tuwi_file = \"universe_wsgi.ini\"\n\t\t_set_pre_VCR(uwi_file,\"galaxy\",\"galaxy\")\n\t\tuwi_string = _get_file_string(uwi_file,galaxy_central)\n\t\t\n\t\tif (uwi_string.find(\"sanitize_all_html\") != -1):\n\t\t\tprint(\"Setting sanitize_all_html in %s to False.\" % uwi_file)\n\t\t\tsudo(\"sed -i '/^sanitize_all_html/c\\sanitize_all_html = False' %s\" % uwi_file)\n\t\telse:\n\t\t\tprint(\"No sanitize_all_html present! Adding...\")\n\t\t\tsudo(\"sed -i '/^\\[app:main\\]/a\\\\\\nsanitize_all_html = False' %s\" % uwi_file)", "metadata": "root.install_galaxy_vcr", "header": "['module', '___EOS___']", "index": 18 }, { "content": "def install_viralassembly(env):\n\ttry:\n\t\t_initialize_area_viral()\n\t\t_add_tools_viral()\n\t\t_add_refs()\n\t\tsudo(\"chmod -R 755 %(VIRAL_ROOT_DIR)s\" % env)\n\tfinally:\n\t\tdisconnect_all()", "metadata": "root.install_viralassembly", "header": "['module', '___EOS___']", "index": 60 }, { "content": "def install_viralassembly_cleanall(env):\n\ttry:\n\t\t_initialize_env(\"viral\")\n\t\t_remove_dir(\"%(VIRAL_ROOT_DIR)s\" % env)\n\t\tprint(\"Viral Assembly Removed\\n\")\n\tfinally:\n\t\tdisconnect_all()", "metadata": "root.install_viralassembly_cleanall", "header": "['module', '___EOS___']", "index": 69 }, { "content": "def _initialize_area_viral():\n\t_initialize_env(\"viral\")\n\t\n\tenv.VIRAL_SCRIPT = \"%s/viral_assembly_pipeline.py\" % dependency_URL\n\t\n\tviral_dirs[\"PROJECT_DIR\"] = \"%(VIRAL_ROOT_DIR)s/project\" % env\n\tviral_dirs[\"REF_DIR\"] = \"%(VIRAL_ROOT_DIR)s/references\" % env\n\tviral_dirs[\"TOOLS_DIR\"] = \"%(VIRAL_ROOT_DIR)s/tools\" % env\n\tviral_dirs[\"TOOLS_BINARIES_DIR\"] = \"%s/BINARIES\" % viral_dirs[\"TOOLS_DIR\"]\n\tviral_dirs[\"TOOLS_PERL_DIR\"] = \"%s/PERL\" % viral_dirs[\"TOOLS_DIR\"]\n\t\n\tenv.VIRAL_REF_FILES = \"corona_virus,hadv,influenza_a_virus,jev,mpv,norv,rota_virus,rsv,veev,vzv,yfv\"\n\t\n\tviral_urls[\"BIO_LINUX_URL\"] = \"http://nebc.nerc.ac.uk/bio-linux/\"\n\t\n\tviral_tars[\"BINARIES_TARBALL\"] = \"BINARIES.tgz\"\n\tviral_tars[\"PERL_TARBALL\"] = \"PERL.tgz\"\n\t\n\tprint(\"user: %(user)s\" % env)\n\tprint(\"host: %(host)s\" % env)\n\tprint(\"ROOT DIR: %(VIRAL_ROOT_DIR)s\" % env)\n\tprint(\"VIRAL ASSEMBLY SCRIPT: %(VIRAL_SCRIPT)s\" % env)\n\tfor name in sorted(viral_dirs.keys()):\n\t\tif not _path_is_dir(viral_dirs[name]):\n\t\t\tsudo(\"mkdir -p %s\" % viral_dirs[name])\n\t\tprint(\"%s: %s\" % (name,viral_dirs[name]))\n\tprint(\"VIRAL ASSEMBLY REFS FILES: %(VIRAL_REF_FILES)s\" % env)\n\tfor name in sorted(viral_urls.keys()):\n\t\tprint(\"%s: %s\" % (name,viral_urls[name]))\n\tfor name in sorted(viral_tars.keys()):\n\t\tprint(\"%s: %s\" % (name,viral_tars[name]))", "metadata": "root._initialize_area_viral", "header": "['module', '___EOS___']", "index": 79 }, { "content": "def _add_tools_viral():\n\twith cd(\"/home/ubuntu/\"):\n\t\tbashrc_file = \".bashrc\"\n\t\t_set_pre_VCR(bashrc_file,\"ubuntu\",\"ubuntu\")\n\t\tbashrc_string = _get_file_string(bashrc_file,\"/home/ubuntu/\")\n\t\t\n\t\tif (bashrc_string.find(\"DEBIAN_FRONTEND\") != -1):\n\t\t\tprint(\"Setting DEBIAN_FRONTEND in %s to noninteractive.\" % bashrc_file)\n\t\t\tsudo(\"sed -i \\\"/DEBIAN_FRONTEND/c\\DEBIAN_FRONTEND=noninteractive\\\" %s/%s\" % (\"/home/ubuntu\",bashrc_file))\n\t\telse:\n\t\t\tprint(\"No DEBIAN_FRONTEND present! Adding...\")\n\t\t\tsudo(\"echo -e \\\"DEBIAN_FRONTEND=noninteractive\\\" >> %s\" % bashrc_file)\n\t\n\tsudo(\"wget --no-check-certificate -O %s/viral_assembly_pipeline.py %s\" % (env.VIRAL_ROOT_DIR,env.VIRAL_SCRIPT))\n\t_add_package(dependency_URL,viral_tars[\"BINARIES_TARBALL\"],viral_dirs[\"TOOLS_BINARIES_DIR\"],\"tar\")\n\t_add_package(dependency_URL,viral_tars[\"PERL_TARBALL\"],viral_dirs[\"TOOLS_PERL_DIR\"],\"tar\")\n\t_apt_get_install(\"csh\")\n\t_apt_get_install(\"gawk\")\n\t_initialize_bio_linux()", "metadata": "root._add_tools_viral", "header": "['module', '___EOS___']", "index": 111 }, { "content": "def _add_refs():\n\tfiles = (env.VIRAL_REF_FILES).split(\",\")\n\tfor file in files:\n\t\t_add_package(dependency_URL,\"%s.tgz\" % file,viral_dirs[\"REF_DIR\"],\"tar\")", "metadata": "root._add_refs", "header": "['module', '___EOS___']", "index": 131 }, { "content": "def _initialize_bio_linux():\n\tsudo(\"echo -e \\\"deb %s unstable bio-linux\\\" >> /etc/apt/sources.list\" % viral_urls[\"BIO_LINUX_URL\"])\n\tsudo(\"sudo apt-get update\")\n\t_apt_get_install(\"bio-linux-keyring\")\n\t_apt_get_install(\"bwa\")\n\t_apt_get_install(\"samtools\")\n\t_apt_get_install(\"bio-linux-cap3\")\n\t_apt_get_install(\"emboss\")", "metadata": "root._initialize_bio_linux", "header": "['module', '___EOS___']", "index": 136 }, { "content": "def install_viralvigor(env):\n\ttry:\n\t\t_initialize_area_vigor()\n\t\t_initialize_host()\n\t\t_add_vigor()\n\t\t_add_tools_vigor()\n\tfinally:\n\t\tdisconnect_all()", "metadata": "root.install_viralvigor", "header": "['module', '___EOS___']", "index": 155 }, { "content": "def install_viralvigor_test(env):\n\ttry:\n\t\t_initialize_area_vigor()\n\t\tcmd = (\"\"\"%s/VIGOR3.pl \\\n\t\t\t\t-D yfv \\\n\t\t\t\t-i %s/westnile.fasta \\\n\t\t\t\t-O %s/westnile \\\n\t\t\t\t> %s/westnile_test_run.log 2>&1 \\\n\t\t\t\t\"\"\") % (vigor_dirs[\"VIGOR_RUNTIME_DIR\"],vigor_dirs[\"VIGOR_SAMPLE_DATA_DIR\"],vigor_dirs[\"VIGOR_TEST_OUTPUT_DIR\"],env.VIGOR_SCRATCH_DIR)\n\t\tprint(\"DEBUG: cmd[%s]\" % cmd)\n\t\trun(cmd)\n\tfinally:\n\t\tdisconnect_all()", "metadata": "root.install_viralvigor_test", "header": "['module', '___EOS___']", "index": 164 }, { "content": "def install_viralvigor_validate(env):\n\ttry:\n\t\t_initialize_area_vigor()\n\t\tsudo(\"rm -f %s/westnile.rpt\" % vigor_dirs[\"VIGOR_TEST_OUTPUT_DIR\"])\n\t\tsudo(\"rm -f %s/westnile.rpt\" % vigor_dirs[\"VIGOR_SAMPLE_DATA_DIR\"])\n\t\twith settings(hide(\"running\",\"stdout\")):\n\t\t\tresults = run(\"\"\"diff -Bwr %s %s || echo 'VALIDATION FAILED'\"\"\" % (vigor_dirs[\"VIGOR_SAMPLE_DATA_DIR\"],vigor_dirs[\"VIGOR_TEST_OUTPUT_DIR\"]))\n\t\tif results:\n\t\t\tprint(\"\\n\\nValidation Failed:\\n\\n%s\\n\" % results)\n\tfinally:\n\t\tdisconnect_all()", "metadata": "root.install_viralvigor_validate", "header": "['module', '___EOS___']", "index": 178 }, { "content": "def install_viralvigor_cleanall(env):\n\ttry:\n\t\t_initialize_env(\"vigor\")\n\t\t_remove_dir(env.VIGOR_ROOT_DIR)\n\t\t_remove_dir(env.VIGOR_SCRATCH_DIR)\n\t\tprint(\"Vigor Removed\\n\")\n\tfinally:\n\t\tdisconnect_all()", "metadata": "root.install_viralvigor_cleanall", "header": "['module', '___EOS___']", "index": 190 }, { "content": "def _initialize_area_vigor():\n\tmachine = run(\"uname -m\")\n\t\n\tif machine.find('64')>0:\n\t\tenv.ARCH = 'x64-linux'\n\telse:\n\t\tenv.ARCH = 'ia32-linux'\n\t\n\t_initialize_env(\"vigor\")\n\t\n\tvigor_dirs[\"TOOLS_DIR\"] = \"%s/tools\" % env.VIGOR_ROOT_DIR\n\tvigor_dirs[\"VIGOR_STORED_DIR\"] = \"%s/vigor\" % vigor_dirs[\"TOOLS_DIR\"]\n\tvigor_dirs[\"VIGOR_RUNTIME_DIR\"] = \"%s/prod3\" % vigor_dirs[\"VIGOR_STORED_DIR\"]\n\tvigor_dirs[\"VIGOR_TEMPSPACE_DIR\"] = \"%s/tempspace\" % env.VIGOR_SCRATCH_DIR\n\tvigor_dirs[\"VIGOR_SAMPLE_DATA_DIR\"] = \"%s/samples\" % vigor_dirs[\"VIGOR_STORED_DIR\"]\n\tvigor_dirs[\"VIGOR_TEST_OUTPUT_DIR\"] = \"%s/test\" % vigor_dirs[\"VIGOR_STORED_DIR\"]\n\tvigor_dirs[\"BLAST_DIR\"] = \"%s/blast\" % vigor_dirs[\"TOOLS_DIR\"]\n\tvigor_dirs[\"CLUSTALW_DIR\"] = \"%s/clustalw\" % vigor_dirs[\"TOOLS_DIR\"]\n\tvigor_dirs[\"EXE_DIR\"] = vigor_dirs[\"VIGOR_RUNTIME_DIR\"]\n\t\n\tvigor_names[\"BLAST_NAME\"] = 'blast-2.2.15'\n\tvigor_names[\"CLUSTALW_NAME\"] = 'clustalw-1.83'\n\tvigor_names[\"VIGOR_NAME\"] = 'vigor-GSCcloud'\n\t\n\tvigor_tars[\"VIGOR_TAR_FILENAME\"] = \"%s.tgz\" % vigor_names[\"VIGOR_NAME\"]\n\tvigor_tars[\"BLAST_TAR_FILENAME\"] = \"%s-%s.tar.gz\" % (vigor_names[\"BLAST_NAME\"],env.ARCH)\n\tvigor_tars[\"CLUSTALW_TAR_FILENAME\"] = \"%s-%s.deb\" % (vigor_names[\"CLUSTALW_NAME\"],env.ARCH)\n\t\n\tprint(\"user: %(user)s\" % env)\n\tprint(\"host: %(host)s\" % env)\n\tprint(\"ARCH: %(ARCH)s\" % env)\n\tprint(\"ROOT DIR: %(VIGOR_ROOT_DIR)s\" % env)\n\tprint(\"SCRATCH DIR: %(VIGOR_SCRATCH_DIR)s\" % env)\n\tfor name in sorted(vigor_dirs.keys()):\n\t\tprint(\"%s: %s\" % (name,vigor_dirs[name]))\n\tfor name in sorted(vigor_urls.keys()):\n\t\tprint(\"%s: %s\" % (name,vigor_urls[name]))\n\tprint(\"BLAST_NAME: %s\" % vigor_names[\"BLAST_NAME\"])\n\tprint(\"CLUSTALW_NAME: %s\" % vigor_names[\"CLUSTALW_NAME\"])\n\tprint(\"VIGOR_NAME: %s\" % vigor_names[\"VIGOR_NAME\"])\n\tfor name in sorted(vigor_tars.keys()):\n\t\tprint(\"%s: %s\" % (name,vigor_tars[name]))", "metadata": "root._initialize_area_vigor", "header": "['module', '___EOS___']", "index": 201 }, { "content": "def _initialize_host():\n\tlocal(\"ssh-keygen -R %(host)s\" % env)\n\t_fix_etc_hosts()\n\t_create_vigor_scratch_dir()", "metadata": "root._initialize_host", "header": "['module', '___EOS___']", "index": 244 }, { "content": "def _add_vigor():\n\tprint(\"Installing VIGOR...\")\n\t_create_vigor_tempspace_dir()\n\t_create_vigor_scratch_dir()\n\t_add_package(dependency_URL, vigor_tars[\"VIGOR_TAR_FILENAME\"], vigor_dirs[\"VIGOR_STORED_DIR\"], \"tar\")\n\tsudo(\"chmod 755 %s\" % os.path.join(vigor_dirs[\"VIGOR_RUNTIME_DIR\"], \"*.pl\"))\n\tif not _path_exists(os.path.join(vigor_dirs[\"EXE_DIR\"], \"perl\")):\n\t\tsudo(\"ln -sf %s %s\" % (\"/usr/bin/perl\", vigor_dirs[\"EXE_DIR\"]))\n\t\tsudo(\"ln -sf %s %s\" % (\"/usr/bin/perl\", \"/usr/local/bin\"))\n\tif not _path_exists(os.path.join(vigor_dirs[\"EXE_DIR\"], \"vigorscratch\")):\n\t\tsudo(\"ln -sf %s %s/vigorscratch\" % (vigor_dirs[\"VIGOR_TEMPSPACE_DIR\"], vigor_dirs[\"EXE_DIR\"]))", "metadata": "root._add_vigor", "header": "['module', '___EOS___']", "index": 249 }, { "content": "def _add_tools_vigor():\n\tprint(\"Install tools...\")\n\t_create_tools_dir()\n\t_add_blast()\n\t_add_clustalw()\n\t_apt_get_install(\"libapache-dbi-perl\")\n\t_apt_get_install(\"libclass-dbi-sqlite-perl\")", "metadata": "root._add_tools_vigor", "header": "['module', '___EOS___']", "index": 261 }, { "content": "def _fix_etc_hosts():\n\tinternal_ip = sudo(\"hostname\")\n\tprint(\"internal_ip[%s]\" % internal_ip)\n\tfilespec = \"/etc/hosts\"\n\tsudo(\"echo '127.0.0.1 %s' >> %s\" % (internal_ip, filespec))", "metadata": "root._fix_etc_hosts", "header": "['module', '___EOS___']", "index": 269 }, { "content": "def _create_vigor_tempspace_dir():\n\tif not _path_is_dir(vigor_dirs[\"VIGOR_TEMPSPACE_DIR\"]):\n\t\tsudo(\"mkdir -p %s\" % vigor_dirs[\"VIGOR_TEMPSPACE_DIR\"])\n\t\tsudo(\"chown -R %s:%s %s\" % (env.user, env.user, vigor_dirs[\"VIGOR_TEMPSPACE_DIR\"]))\n\t\tsudo(\"find %s -type d -exec chmod 777 {} \\;\" % vigor_dirs[\"VIGOR_TEMPSPACE_DIR\"])", "metadata": "root._create_vigor_tempspace_dir", "header": "['module', '___EOS___']", "index": 275 }, { "content": "def _create_vigor_scratch_dir():\n\tif not _path_is_dir(env.VIGOR_SCRATCH_DIR):\n\t\tsudo(\"mkdir -p %s\" % env.VIGOR_SCRATCH_DIR)\n\tsudo(\"find %s -type f -exec chmod 666 {} \\;\" % env.VIGOR_SCRATCH_DIR)\n\tsudo(\"find %s -type d -exec chmod 777 {} \\;\" % env.VIGOR_SCRATCH_DIR)", "metadata": "root._create_vigor_scratch_dir", "header": "['module', '___EOS___']", "index": 281 }, { "content": "def _create_tools_dir():\n\tif not _path_is_dir(vigor_dirs[\"TOOLS_DIR\"]):\n\t\tsudo(\"mkdir -p %s\" % vigor_dirs[\"TOOLS_DIR\"])\n\tsudo(\"chown -R %s:%s %s\" % (env.user,env.user,vigor_dirs[\"TOOLS_DIR\"]))", "metadata": "root._create_tools_dir", "header": "['module', '___EOS___']", "index": 287 }, { "content": "def _add_blast():\n\tprint(\" Installing blast...\")\n\t_create_tools_dir()\n\t_add_package(dependency_URL, vigor_tars[\"BLAST_TAR_FILENAME\"], vigor_dirs[\"BLAST_DIR\"], \"tar\")\n\tif not _path_exists(os.path.join(vigor_dirs[\"EXE_DIR\"], \"blastall\")):\n\t\tsudo(\"ln -sf %s %s\" % (os.path.join(vigor_dirs[\"BLAST_DIR\"], vigor_names[\"BLAST_NAME\"], \"bin\", \"bl2seq\"), vigor_dirs[\"EXE_DIR\"]))\n\t\tsudo(\"ln -sf %s %s\" % (os.path.join(vigor_dirs[\"BLAST_DIR\"], vigor_names[\"BLAST_NAME\"], \"bin\", \"blastall\"), vigor_dirs[\"EXE_DIR\"]))\n\t\tsudo(\"ln -sf %s %s\" % (os.path.join(vigor_dirs[\"BLAST_DIR\"], vigor_names[\"BLAST_NAME\"], \"bin\", \"fastacmd\"), vigor_dirs[\"EXE_DIR\"]))\n\t\tsudo(\"ln -sf %s %s\" % (os.path.join(vigor_dirs[\"BLAST_DIR\"], vigor_names[\"BLAST_NAME\"], \"bin\", \"formatdb\"), vigor_dirs[\"EXE_DIR\"]))", "metadata": "root._add_blast", "header": "['module', '___EOS___']", "index": 292 }, { "content": "def _add_clustalw():\n\tprint(\" Installing clustalw...\")\n\t_create_tools_dir()\n\t_add_package(dependency_URL, vigor_tars[\"CLUSTALW_TAR_FILENAME\"], vigor_dirs[\"CLUSTALW_DIR\"], \"deb\")\n\tif not _path_exists(os.path.join(vigor_dirs[\"EXE_DIR\"], \"clustalw\")):\n\t\tsudo(\"ln -sf %s %s\" % (os.path.join(vigor_dirs[\"CLUSTALW_DIR\"], vigor_names[\"CLUSTALW_NAME\"], \"clustalw\"), vigor_dirs[\"EXE_DIR\"]))", "metadata": "root._add_clustalw", "header": "['module', '___EOS___']", "index": 302 }, { "content": "def install_vicvb(env):\n\ttry:\n\t\t_initialize_env(\"vicvb\")\n\t\t\n\t\t_apt_get_install(\"libperlio-gzip-perl\")\n\t\t_apt_get_install(\"liblocal-lib-perl\")\n\t\t\n\t\ttbl2asn_download_dir = \"/usr/local/tbl2asn_download\"\n\t\ttbl2asn_dir = \"/usr/local/bin\"\n\t\tif _path_exists(os.path.join(tbl2asn_dir,\"tbl2asn\")):\n\t\t\tsudo(\"mv %s/tbl2asn %s/tbl2asn_pre_VCR\" % (tbl2asn_dir,tbl2asn_dir))\n\t\t_add_package(\"ftp://ftp.ncbi.nih.gov/toolbox/ncbi_tools/converters/by_program/tbl2asn\",\"linux64.tbl2asn.gz\",tbl2asn_download_dir,\"gzip\")\n\t\tsudo(\"chmod 777 %s/linux64.tbl2asn\" % tbl2asn_download_dir)\n\t\tsudo(\"mv %s/linux64.tbl2asn %s/tbl2asn\" % (tbl2asn_download_dir,tbl2asn_dir))\n\t\t_remove_dir(tbl2asn_download_dir)\n\t\t\n\t\twith cd(\"~\"):\n\t\t\tsudo(\"git clone git://github.com/JCVI-Cloud/VICVB.git\")\n\t\twith cd(\"~/VICVB\"):\n\t\t\tsudo(\"lib/VICVB/data/install/install_to_dir_full.sh %s /mnt/galaxyTools/galaxy-central /\" % (env.VICVB_LOCAL_DIR))\n\tfinally:\n\t\tdisconnect_all()", "metadata": "root.install_vicvb", "header": "['module', '___EOS___']", "index": 312 }, { "content": "def install_vicvb_cleanall(env):\n\ttry:\n\t\t_initialize_env(\"vicvb\")\n\t\t_remove_dir(env.VICVB_LOCAL_DIR)\n\t\t_remove_dir(env.VICVB_GALAXY_DIR)\n\t\twith cd (\"~\"):\n\t\t\tsudo(\"rm -fr ~/VICVB\")\n\t\tprint(\"VICVB Removed\\n\")\n\tfinally:\n\t\tdisconnect_all()", "metadata": "root.install_vicvb_cleanall", "header": "['module', '___EOS___']", "index": 335 }, { "content": "def _initialize_env(pipeline):\n\tif pipeline == \"viral\":\n\t\tenv.VIRAL_ROOT_DIR = \"/usr/local/VHTNGS\"\n\t\tif not _path_exists(env.VIRAL_ROOT_DIR):\n\t\t\tsudo(\"mkdir -p %s\" % env.VIRAL_ROOT_DIR)\n\telif pipeline == \"vigor\":\n\t\tenv.VIGOR_ROOT_DIR = \"/usr/local/VIGOR\"\n\t\tif not _path_exists(env.VIGOR_ROOT_DIR):\n\t\t\tsudo(\"mkdir -p %s\" % env.VIGOR_ROOT_DIR)\n\t\tenv.VIGOR_SCRATCH_DIR = \"/usr/local/scratch/vigor\"\n\t\tif not _path_exists(env.VIGOR_SCRATCH_DIR):\n\t\t\tsudo(\"mkdir -p %s\" % env.VIGOR_SCRATCH_DIR)\n\t\t\tsudo(\"find %s -type f -exec chmod 666 {} \\;\" % env.VIGOR_SCRATCH_DIR)\n\t\t\tsudo(\"find %s -type d -exec chmod 777 {} \\;\" % env.VIGOR_SCRATCH_DIR)\n\telse:\n\t\tenv.VICVB_LOCAL_DIR = \"/usr/local/VICVB\";\n\t\tenv.VICVB_GALAXY_DIR = \"/mnt/galaxyTools/galaxy-central/static/vicvb\";", "metadata": "root._initialize_env", "header": "['module', '___EOS___']", "index": 349 }, { "content": "def _add_package(download_url, filename, install_dir, type):\n\tif not _path_is_dir(install_dir):\n\t\tsudo(\"mkdir -p %s\" % install_dir)\n\twith cd(install_dir):\n\t\tif not _path_exists(os.path.join(install_dir, filename)):\n\t\t\tsudo(\"\"\"wget --no-host-directories --cut-dirs=1 --directory-prefix=%s %s/%s\"\"\" % (install_dir, download_url, filename))\n\t\t\tif type == \"tar\":\n\t\t\t\tsudo(\"tar xvfz %s\" % filename)\n\t\t\telif type == \"bz2\":\n\t\t\t\tsudo(\"tar xfj %s\" % filename)\n\t\t\telif type == \"gzip\":\n\t\t\t\tsudo(\"gunzip %s\" % filename)\n\t\t\telse: \n\t\t\t\tsudo(\"dpkg -x %s %s\" % (filename,install_dir))\n\t\t\t\tsudo(\"mkdir %s/%s\" % (install_dir, vigor_names[\"CLUSTALW_NAME\"]))\n\t\t\t\tsudo(\"cp %s/usr/bin/* %s/%s\" % (install_dir,install_dir,vigor_names[\"CLUSTALW_NAME\"]))\n\tsudo(\"chown -R %s:%s %s\" % (env.user, env.user, install_dir))\n\tsudo(\"find %s -type d -exec chmod 755 {} \\;\" % install_dir)", "metadata": "root._add_package", "header": "['module', '___EOS___']", "index": 367 }, { "content": "def _remove_dir(dirspec):\n\tif _path_is_dir(dirspec):\n\t\t_unlock_dir(dirspec)\n\t\tsudo(\"rm -rf %s\" % dirspec)\n\telse:\n\t\tprint(\"DEBUG: _remove_dir[%s] -- NOT FOUND\" % dirspec)", "metadata": "root._remove_dir", "header": "['module', '___EOS___']", "index": 386 }, { "content": "def _unlock_dir(dirspec):\n\twith settings(hide(\"running\",\"stdout\")):\n\t\tsudo(\"find %s -type d -exec chmod 755 {} \\;\" % dirspec)\n\t\tsudo(\"find %s -type d -exec chmod g+s {} \\;\" % dirspec)\n\t\tsudo(\"find %s -type f -exec chmod 644 {} \\;\" % dirspec)", "metadata": "root._unlock_dir", "header": "['module', '___EOS___']", "index": 393 }, { "content": "def _apt_get_install(tool):\n\tsudo(\"apt-get -q -y --force-yes install %s\" % tool)", "metadata": "root._apt_get_install", "header": "['module', '___EOS___']", "index": 399 }, { "content": "def _path_exists(path):\n\tfound = False\n\twith settings(hide(\"running\",\"stdout\")):\n\t\tresult = sudo(\"test -e '%s' || echo 'FALSE'\" % path)\n\tif result != \"FALSE\": found = True\n\treturn found", "metadata": "root._path_exists", "header": "['module', '___EOS___']", "index": 402 }, { "content": "def _path_is_dir(path):\n\tfound = False\n\twith settings(hide(\"running\",\"stdout\")):\n\t\tresult = sudo(\"test -d '%s' || echo 'FALSE'\" % path)\n\tif result != \"FALSE\": found = True\n\treturn found", "metadata": "root._path_is_dir", "header": "['module', '___EOS___']", "index": 409 }, { "content": "def _set_pre_VCR(filename,user,group):\n\tsudo(\"cp %s %s_pre_VCR\" %(filename,filename))\n\tsudo(\"chown %s:%s %s_pre_VCR\" % (user,group,filename))", "metadata": "root._set_pre_VCR", "header": "['module', '___EOS___']", "index": 416 }, { "content": "def _get_file_string(filename,directory):\n\tfh = open(\"%s/%s\" % (directory,filename))\n\tstring = mmap.mmap(fh.fileno(),0,access=mmap.ACCESS_READ)\n\tfh.close()\n\treturn string", "metadata": "root._get_file_string", "header": "['module', '___EOS___']", "index": 420 } ]
[ { "span": "import os.path, re, mmap", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 24 }, { "span": "from fabric.api import cd, env, hide, local, run, settings, sudo, task", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 70 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "vcr", ".", "py_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "-", " ", "Configure", "s", " ", "the", " ", "environ", "ment", " ", "for", " ", "runn", "ing", " ", "the", " ", "Vir", "al", " ", "Asse", "mbly", " ", "(", "vir", "al", "\\u", "assem", "bly", "\\u", "pipeline", ".", "py", ")", " ", "and", " ", "VI", "GO", "R", " ", "(", "VI", "GO", "R3", ".", "pl", ")", " ", "pipeline", "s", " ", "(", "creati", "ng", " ", "director", "y", " ", "structure", " ", "and", " ", "install", "s", " ", "software", ").", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "._", "path_", ",_", "re_", ",_", "mmap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fabric_", "._", "api_", "import_", "cd_", ",_", "env_", ",_", "hide_", ",_", "local_", ",_", "run_", ",_", "settings_", ",_", "sudo_", ",_", "task_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fabric_", "._", "network_", "import_", "discon", "nect", "\\u", "all_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Common", " ", "variables_", "\\u\\u\\uNL\\u\\u\\u_", "dependen", "cy", "\\u", "URL_", "=_", "\"", "http", "://", "s3", ".", "amaz", "ona", "ws", ".", "com", "/", "VI", "GO", "R", "-", "GS", "C", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Gal", "ax", "y", " ", "VC", "R_", "\\u\\u\\uNL\\u\\u\\u_", "galax", "y", "\\u", "central", "_", "=_", "\"/", "mnt", "/", "galax", "y", "Tool", "s", "/", "galax", "y", "-", "central", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "galax", "y", "\\u", "VC", "R", "\\u", "path_", "=_", "\"/%", "s", "/", "tool", "s", "/", "vir", "al", "\\u", "assem", "bly", "\\u", "annot", "ation", "\"_", "%_", "galax", "y", "\\u", "central", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Gal", "ax", "y", " ", "VC", "R", " ", "-", " ", "install", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Vir", "al", " ", "Asse", "mbly", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "vir", "al", "\\u", "dirs_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vir", "al", "\\u", "urls_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vir", "al", "\\u", "tar", "s_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Vir", "al", " ", "Asse", "mbly", " ", "-", " ", "install", " ", "methods_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Vir", "al", " ", "Asse", "mbly", " ", "-", " ", "utility", " ", "methods_", "\\u\\u\\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_", "#", " ", "VI", "GO", "R_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "vig", "or", "\\u", "dirs_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vig", "or", "\\u", "urls_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vig", "or", "\\u", "tar", "s_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vig", "or", "\\u", "names_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "VI", "GO", "R", " ", "-", " ", "install", " ", "methods_", "\\u\\u\\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_", "#", " ", "VI", "GO", "R", " ", "-", " ", "utility", " ", "methods_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "VI", "CV", "B", " ", "-", " ", "install", " ", "methods_", "\\u\\u\\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_", "#", " ", "Common", " ", "methods_", "\\u\\u\\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\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "install", "\\u", "galax", "y", "\\u", "vcr", "_", "(_", "env_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "with_", "cd_", "(_", "\"~\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "print_", "(_", "\"", "Install", "ing", " ", "galax", "y", " ", "VC", "R", " ", "tool", "s", " ", "(", "python", " ", "and", " ", "xml", " ", "scripts", ").\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "git", " ", "clone", " ", "git", "://", "git", "hub", ".", "com", "/", "JC", "VI", "-", "Cloud", "/", "galax", "y", "-", "tool", "s", "-", "vcr", ".", "git", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "cp", " ", "-", "R", " ", "galax", "y", "-", "tool", "s", "-", "vcr", "/", "tool", "s", "/", "vir", "al", "\\u", "assem", "bly", "\\u", "annot", "ation", " ", "%", "s", "\"_", "%_", "galax", "y", "\\u", "VC", "R", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "chown", " ", "-", "R", " ", "galax", "y", ":", "galax", "y", " ", "%", "s", "\"_", "%_", "galax", "y", "\\u", "VC", "R", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "cd_", "(_", "galax", "y", "\\u", "central", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "print_", "(_", "\"", "Add", "ing", " ", "VC", "R", " ", "to", " ", "tool", "\\u", "conf", ".", "xml", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tc", "x", "\\u", "file_", "=_", "\"", "tool", "\\u", "conf", ".", "xml", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set\\u", "pre", "\\u", "VC", "R_", "(_", "tc", "x", "\\u", "file_", ",_", "\"", "galax", "y", "\"_", ",_", "\"", "galax", "y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tc", "x", "\\u", "string_", "=_", "\\u", "get", "\\u", "file", "\\u", "string_", "(_", "tc", "x", "\\u", "file_", ",_", "galax", "y", "\\u", "central", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "vcr", "\\u", "header_", "=_", "\"<", "section", " ", "name", "=\\\\\"", "Vir", "al", " ", "Asse", "mbly", " ", "and", " ", "Annot", "ation", "\\\\\"", " ", "id", "=\\\\\"", "vir", "al", "\\u", "assem", "bly", "\\u", "annot", "ation", "\\\\\">", "\\\\\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "tc", "x", "\\u", "string_", "._", "find_", "(_", "vcr", "\\u", "header_", ")_", "!=_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "print_", "(_", "\"", "Gal", "ax", "y", " ", "VC", "R", " ", "tool", "s", " ", "alr", "ead", "y", " ", "include", "d", " ", "in", " ", "tool", "s", "\\u", "conf", ".", "xml", "!\"_", ")_", "\\u\\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_", "sudo_", "(_", "\"", "sed", " ", "-", "i", " ", "'$", "d", "'", " ", "%", "s", "/", "%", "s", "\"_", "%_", "(_", "galax", "y", "\\u", "central", "_", ",_", "tc", "x", "\\u", "file_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "echo", " ", "-", "e", " ", "'", " ", " ", "<", "section", " ", "name", "=\\\\\"", "Vir", "al", " ", "Asse", "mbly", " ", "and", " ", "Annot", "ation", "\\\\\"", " ", "id", "=\\\\\"", "vir", "al", "\\u", "assem", "bly", "\\u", "annot", "ation", "\\\\\">", "'", " ", ">>", " ", "%", "s", "\"_", "%_", "tc", "x", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "echo", " ", "-", "e", " ", "'", " ", " ", " ", " ", "<", "tool", " ", "file", "=\\\\\"", "vir", "al", "\\u", "assem", "bly", "\\u", "annot", "ation", "/", "vir", "al", "\\u", "assem", "bly", ".", "xml", "\\\\\"", " ", "/>", "'", " ", ">>", " ", "%", "s", "\"_", "%_", "tc", "x", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "echo", " ", "-", "e", " ", "'", " ", " ", " ", " ", "<", "tool", " ", "file", "=\\\\\"", "vir", "al", "\\u", "assem", "bly", "\\u", "annot", "ation", "/", "VI", "GO", "R", ".", "xml", "\\\\\"", " ", "/>", "'", " ", ">>", " ", "%", "s", "\"_", "%_", "tc", "x", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "echo", " ", "-", "e", " ", "'", " ", " ", "</", "section", ">'", " ", ">>", " ", "%", "s", "\"_", "%_", "tc", "x", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "echo", " ", "-", "e", " ", "'<", "/", "toolb", "ox", ">'", " ", ">>", " ", "%", "s", "\"_", "%_", "tc", "x", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "\"", "Add", "ing", " ", "'", "sanitize", "\\u", "all", "\\u", "html", " ", "=", " ", "Fal", "se", "'", " ", "to", " ", "univ", "erse", "\\u", "wsgi", ".", "ini", " ", "to", " ", "enable", " ", "JB", "rowse", " ", "for", " ", "VI", "CV", "B", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uw", "i", "\\u", "file_", "=_", "\"", "univ", "erse", "\\u", "wsgi", ".", "ini", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set\\u", "pre", "\\u", "VC", "R_", "(_", "uw", "i", "\\u", "file_", ",_", "\"", "galax", "y", "\"_", ",_", "\"", "galax", "y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uw", "i", "\\u", "string_", "=_", "\\u", "get", "\\u", "file", "\\u", "string_", "(_", "uw", "i", "\\u", "file_", ",_", "galax", "y", "\\u", "central", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "uw", "i", "\\u", "string_", "._", "find_", "(_", "\"", "sanitize", "\\u", "all", "\\u", "html", "\"_", ")_", "!=_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "print_", "(_", "\"", "Sett", "ing", " ", "sanitize", "\\u", "all", "\\u", "html", " ", "in", " ", "%", "s", " ", "to", " ", "Fal", "se", ".\"_", "%_", "uw", "i", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "sed", " ", "-", "i", " ", "'/", "^", "sanitize", "\\u", "all", "\\u", "html", "/", "c", "\\\\", "sanitize", "\\u", "all", "\\u", "html", " ", "=", " ", "Fal", "se", "'", " ", "%", "s", "\"_", "%_", "uw", "i", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "print_", "(_", "\"", "No", " ", "sanitize", "\\u", "all", "\\u", "html", " ", "presen", "t", "!", " ", "Add", "ing", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "sed", " ", "-", "i", " ", "'/", "^", "\\\\[", "app", ":", "main", "\\\\]", "/", "a", "\\\\\\\\\\\\", "nsa", "niti", "ze", "\\u", "all", "\\u", "html", " ", "=", " ", "Fal", "se", "'", " ", "%", "s", "\"_", "%_", "uw", "i", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "install", "\\u", "vir", "ala", "sse", "mbly", "_", "(_", "env_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "initialize", "\\u", "area", "\\u", "vir", "al_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "add", "\\u", "tool", "s", "\\u", "vir", "al_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "add", "\\u", "refs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "chm", "od", " ", "-", "R", " ", "755", " ", "%", "(", "VIR", "AL", "\\u", "ROO", "T", "\\u", "DIR", ")", "s", "\"_", "%_", "env_", ")_", "\\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\t", "\t_", "discon", "nect", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "install", "\\u", "vir", "ala", "sse", "mbly", "\\u", "clean", "all_", "(_", "env_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "initialize", "\\u", "env_", "(_", "\"", "vir", "al", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "remove", "\\u", "dir_", "(_", "\"%", "(", "VIR", "AL", "\\u", "ROO", "T", "\\u", "DIR", ")", "s", "\"_", "%_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Vir", "al", " ", "Asse", "mbly", " ", "Remove", "d", "\\\\", "n", "\"_", ")_", "\\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\t", "\t_", "discon", "nect", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "initialize", "\\u", "area", "\\u", "vir", "al_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\\u", "initialize", "\\u", "env_", "(_", "\"", "vir", "al", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "env_", "._", "VIR", "AL", "\\u", "SCRIPT_", "=_", "\"%", "s", "/", "vir", "al", "\\u", "assem", "bly", "\\u", "pipeline", ".", "py", "\"_", "%_", "dependen", "cy", "\\u", "URL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "vir", "al", "\\u", "dirs_", "[_", "\"", "PROJECT", "\\u", "DIR", "\"_", "]_", "=_", "\"%", "(", "VIR", "AL", "\\u", "ROO", "T", "\\u", "DIR", ")", "s", "/", "project", "\"_", "%_", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vir", "al", "\\u", "dirs_", "[_", "\"", "REF", "\\u", "DIR", "\"_", "]_", "=_", "\"%", "(", "VIR", "AL", "\\u", "ROO", "T", "\\u", "DIR", ")", "s", "/", "reference", "s", "\"_", "%_", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vir", "al", "\\u", "dirs_", "[_", "\"", "TOOLS", "\\u", "DIR", "\"_", "]_", "=_", "\"%", "(", "VIR", "AL", "\\u", "ROO", "T", "\\u", "DIR", ")", "s", "/", "tool", "s", "\"_", "%_", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vir", "al", "\\u", "dirs_", "[_", "\"", "TOOLS", "\\u", "BIN", "ARI", "ES", "\\u", "DIR", "\"_", "]_", "=_", "\"%", "s", "/", "BIN", "ARI", "ES", "\"_", "%_", "vir", "al", "\\u", "dirs_", "[_", "\"", "TOOLS", "\\u", "DIR", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vir", "al", "\\u", "dirs_", "[_", "\"", "TOOLS", "\\u", "PER", "L", "\\u", "DIR", "\"_", "]_", "=_", "\"%", "s", "/", "PER", "L", "\"_", "%_", "vir", "al", "\\u", "dirs_", "[_", "\"", "TOOLS", "\\u", "DIR", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "env_", "._", "VIR", "AL", "\\u", "REF", "\\u", "FILES_", "=_", "\"", "coro", "na", "\\u", "virus", ",", "had", "v", ",", "infl", "ue", "nz", "a", "\\u", "a", "\\u", "virus", ",", "je", "v", ",", "mp", "v", ",", "nor", "v", ",", "rota", "\\u", "virus", ",", "rsv", ",", "ve", "ev", ",", "vz", "v", ",", "yf", "v", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "vir", "al", "\\u", "urls_", "[_", "\"", "BIO", "\\u", "LINUX", "\\u", "URL", "\"_", "]_", "=_", "\"", "http", "://", "neb", "c", ".", "ner", "c", ".", "ac", ".", "uk", "/", "bio", "-", "linux", "/\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "vir", "al", "\\u", "tar", "s_", "[_", "\"", "BIN", "ARI", "ES", "\\u", "TAR", "BAL", "L", "\"_", "]_", "=_", "\"", "BIN", "ARI", "ES", ".", "tg", "z", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vir", "al", "\\u", "tar", "s_", "[_", "\"", "PER", "L", "\\u", "TAR", "BAL", "L", "\"_", "]_", "=_", "\"", "PER", "L", ".", "tg", "z", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"", "user", ":", " ", " ", " ", "%", "(", "user", ")", "s", "\"_", "%_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "host", ":", " ", " ", " ", "%", "(", "host", ")", "s", "\"_", "%_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "ROO", "T", " ", "DIR", ":", " ", " ", " ", "%", "(", "VIR", "AL", "\\u", "ROO", "T", "\\u", "DIR", ")", "s", "\"_", "%_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "VIR", "AL", " ", "ASS", "EMBL", "Y", " ", "SCRIPT", ":", " ", " ", " ", "%", "(", "VIR", "AL", "\\u", "SCRIPT", ")", "s", "\"_", "%_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", "in_", "sorted_", "(_", "vir", "al", "\\u", "dirs_", "._", "keys_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "not_", "\\u", "path", "\\u", "is", "\\u", "dir_", "(_", "vir", "al", "\\u", "dirs_", "[_", "name_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sudo_", "(_", "\"", "mkd", "ir", " ", "-", "p", " ", "%", "s", "\"_", "%_", "vir", "al", "\\u", "dirs_", "[_", "name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "\"%", "s", ":", " ", " ", " ", "%", "s", "\"_", "%_", "(_", "name_", ",_", "vir", "al", "\\u", "dirs_", "[_", "name_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "\"", "VIR", "AL", " ", "ASS", "EMBL", "Y", " ", "REF", "S", " ", "FILE", "S", ":", " ", "%", "(", "VIR", "AL", "\\u", "REF", "\\u", "FILE", "S", ")", "s", "\"_", "%_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", "in_", "sorted_", "(_", "vir", "al", "\\u", "urls_", "._", "keys_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "print_", "(_", "\"%", "s", ":", " ", " ", " ", "%", "s", "\"_", "%_", "(_", "name_", ",_", "vir", "al", "\\u", "urls_", "[_", "name_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "name_", "in_", "sorted_", "(_", "vir", "al", "\\u", "tar", "s_", "._", "keys_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "print_", "(_", "\"%", "s", ":", " ", " ", " ", "%", "s", "\"_", "%_", "(_", "name_", ",_", "vir", "al", "\\u", "tar", "s_", "[_", "name_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "add", "\\u", "tool", "s", "\\u", "vir", "al_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "with_", "cd_", "(_", "\"/", "home", "/", "ubu", "ntu", "/\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "bash", "rc", "\\u", "file_", "=_", "\".", "bash", "rc", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "set\\u", "pre", "\\u", "VC", "R_", "(_", "bash", "rc", "\\u", "file_", ",_", "\"", "ubu", "ntu", "\"_", ",_", "\"", "ubu", "ntu", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bash", "rc", "\\u", "string_", "=_", "\\u", "get", "\\u", "file", "\\u", "string_", "(_", "bash", "rc", "\\u", "file_", ",_", "\"/", "home", "/", "ubu", "ntu", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "bash", "rc", "\\u", "string_", "._", "find_", "(_", "\"", "DEB", "IAN", "\\u", "FRONT", "END", "\"_", ")_", "!=_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "print_", "(_", "\"", "Sett", "ing", " ", "DEB", "IAN", "\\u", "FRONT", "END", " ", "in", " ", "%", "s", " ", "to", " ", "non", "interactive", ".\"_", "%_", "bash", "rc", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "sed", " ", "-", "i", " ", "\\\\\"", "/", "DEB", "IAN", "\\u", "FRONT", "END", "/", "c", "\\\\", "DEB", "IAN", "\\u", "FRONT", "END", "=", "non", "interactive", "\\\\\"", " ", "%", "s", "/", "%", "s", "\"_", "%_", "(_", "\"/", "home", "/", "ubu", "ntu", "\"_", ",_", "bash", "rc", "\\u", "file_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "print_", "(_", "\"", "No", " ", "DEB", "IAN", "\\u", "FRONT", "END", " ", "presen", "t", "!", " ", "Add", "ing", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "echo", " ", "-", "e", " ", "\\\\\"", "DEB", "IAN", "\\u", "FRONT", "END", "=", "non", "interactive", "\\\\\"", " ", ">>", " ", "%", "s", "\"_", "%_", "bash", "rc", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sudo_", "(_", "\"", "wg", "et", " ", "--", "no", "-", "check", "-", "certifica", "te", " ", "-", "O", " ", "%", "s", "/", "vir", "al", "\\u", "assem", "bly", "\\u", "pipeline", ".", "py", " ", "%", "s", "\"_", "%_", "(_", "env_", "._", "VIR", "AL", "\\u", "ROO", "T", "\\u", "DIR_", ",_", "env_", "._", "VIR", "AL", "\\u", "SCRIPT_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "add", "\\u", "package_", "(_", "dependen", "cy", "\\u", "URL_", ",_", "vir", "al", "\\u", "tar", "s_", "[_", "\"", "BIN", "ARI", "ES", "\\u", "TAR", "BAL", "L", "\"_", "]_", ",_", "vir", "al", "\\u", "dirs_", "[_", "\"", "TOOLS", "\\u", "BIN", "ARI", "ES", "\\u", "DIR", "\"_", "]_", ",_", "\"", "tar", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "add", "\\u", "package_", "(_", "dependen", "cy", "\\u", "URL_", ",_", "vir", "al", "\\u", "tar", "s_", "[_", "\"", "PER", "L", "\\u", "TAR", "BAL", "L", "\"_", "]_", ",_", "vir", "al", "\\u", "dirs_", "[_", "\"", "TOOLS", "\\u", "PER", "L", "\\u", "DIR", "\"_", "]_", ",_", "\"", "tar", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "apt", "\\u", "get", "\\u", "install_", "(_", "\"", "csh", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "apt", "\\u", "get", "\\u", "install_", "(_", "\"", "ga", "wk", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "initialize", "\\u", "bio", "\\u", "linux_", "(_", ")_", "\\u\\u\\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", "add", "\\u", "refs_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "files_", "=_", "(_", "env_", "._", "VIR", "AL", "\\u", "REF", "\\u", "FILES_", ")_", "._", "split_", "(_", "\",\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "file_", "in_", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "add", "\\u", "package_", "(_", "dependen", "cy", "\\u", "URL_", ",_", "\"%", "s", ".", "tg", "z", "\"_", "%_", "file_", ",_", "vir", "al", "\\u", "dirs_", "[_", "\"", "REF", "\\u", "DIR", "\"_", "]_", ",_", "\"", "tar", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "initialize", "\\u", "bio", "\\u", "linux_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "sudo_", "(_", "\"", "echo", " ", "-", "e", " ", "\\\\\"", "deb", " ", "%", "s", " ", "unstable", " ", "bio", "-", "linux", "\\\\\"", " ", ">>", " ", "/", "etc", "/", "apt", "/", "source", "s", ".", "list", "\"_", "%_", "vir", "al", "\\u", "urls_", "[_", "\"", "BIO", "\\u", "LINUX", "\\u", "URL", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "sudo", " ", "apt", "-", "get", " ", "update", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "apt", "\\u", "get", "\\u", "install_", "(_", "\"", "bio", "-", "linux", "-", "keyring", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "apt", "\\u", "get", "\\u", "install_", "(_", "\"", "bwa", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "apt", "\\u", "get", "\\u", "install_", "(_", "\"", "samtools", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "apt", "\\u", "get", "\\u", "install_", "(_", "\"", "bio", "-", "linux", "-", "cap", "3", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "apt", "\\u", "get", "\\u", "install_", "(_", "\"", "emb", "oss", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "install", "\\u", "vir", "al", "vig", "or_", "(_", "env_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "initialize", "\\u", "area", "\\u", "vig", "or_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "initialize", "\\u", "host_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "add", "\\u", "vig", "or_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "add", "\\u", "tool", "s", "\\u", "vig", "or_", "(_", ")_", "\\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\t", "\t_", "discon", "nect", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "install", "\\u", "vir", "al", "vig", "or", "\\u", "test_", "(_", "env_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "initialize", "\\u", "area", "\\u", "vig", "or_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd_", "=_", "(_", "\"\"\"", "%", "s", "/", "VI", "GO", "R3", ".", "pl", " ", "\\\\", "\\", "10", ";", "\t\t\t", "\t", "-", "D", " ", "yf", "v", " ", "\\\\", "\\", "10", ";", "\t\t\t", "\t", "-", "i", " ", "%", "s", "/", "west", "nil", "e", ".", "fasta", " ", "\\\\", "\\", "10", ";", "\t\t\t", "\t", "-", "O", " ", "%", "s", "/", "west", "nil", "e", " ", "\\\\", "\\", "10", ";", "\t\t\t", "\t", ">", " ", "%", "s", "/", "west", "nil", "e\\u", "test\\u", "run", ".", "log", " ", "2", ">", "&", "1", " ", "\\\\", "\\", "10", ";", "\t\t\t", "\t", "\"\"\"_", ")_", "%_", "(_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "RUNT", "IME", "\\u", "DIR", "\"_", "]_", ",_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "SAMPLE", "\\u", "DATA", "\\u", "DIR", "\"_", "]_", ",_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "TEST", "\\u", "OUTPU", "T", "\\u", "DIR", "\"_", "]_", ",_", "env_", "._", "VI", "GO", "R", "\\u", "SCR", "ATCH", "\\u", "DIR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "DEBU", "G", ":", " ", "cmd", "[", "%", "s", "]\"_", "%_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run_", "(_", "cmd_", ")_", "\\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\t", "\t_", "discon", "nect", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "install", "\\u", "vir", "al", "vig", "or", "\\u", "validate_", "(_", "env_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "initialize", "\\u", "area", "\\u", "vig", "or_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "rm", " ", "-", "f", " ", "%", "s", "/", "west", "nil", "e", ".", "rpt", "\"_", "%_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "TEST", "\\u", "OUTPU", "T", "\\u", "DIR", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "rm", " ", "-", "f", " ", "%", "s", "/", "west", "nil", "e", ".", "rpt", "\"_", "%_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "SAMPLE", "\\u", "DATA", "\\u", "DIR", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "settings_", "(_", "hide_", "(_", "\"", "runn", "ing", "\"_", ",_", "\"", "stdout", "\"_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "results_", "=_", "run_", "(_", "\"\"\"", "diff", " ", "-", "Bw", "r", " ", "%", "s", " ", "%", "s", " ", "||", " ", "echo", " ", "'", "VALIDATION", " ", "FAIL", "ED", "'\"\"\"_", "%_", "(_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "SAMPLE", "\\u", "DATA", "\\u", "DIR", "\"_", "]_", ",_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "TEST", "\\u", "OUTPU", "T", "\\u", "DIR", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "print_", "(_", "\"\\\\", "n", "\\\\", "n", "Validat", "ion", " ", "Fail", "ed", ":\\\\", "n", "\\\\", "n", "%", "s", "\\\\", "n", "\"_", "%_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "discon", "nect", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "install", "\\u", "vir", "al", "vig", "or", "\\u", "clean", "all_", "(_", "env_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "initialize", "\\u", "env_", "(_", "\"", "vig", "or", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "remove", "\\u", "dir_", "(_", "env_", "._", "VI", "GO", "R", "\\u", "ROO", "T", "\\u", "DIR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "remove", "\\u", "dir_", "(_", "env_", "._", "VI", "GO", "R", "\\u", "SCR", "ATCH", "\\u", "DIR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Vi", "gor", " ", "Remove", "d", "\\\\", "n", "\"_", ")_", "\\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\t", "\t_", "discon", "nect", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "initialize", "\\u", "area", "\\u", "vig", "or_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "machine_", "=_", "run_", "(_", "\"", "una", "me", " ", "-", "m", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "machine_", "._", "find_", "(_", "'", "64", "'_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "env_", "._", "ARCH", "_", "=_", "'", "x6", "4", "-", "linux", "'_", "\\u\\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_", "env_", "._", "ARCH", "_", "=_", "'", "ia", "32", "-", "linux", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "initialize", "\\u", "env_", "(_", "\"", "vig", "or", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "vig", "or", "\\u", "dirs_", "[_", "\"", "TOOLS", "\\u", "DIR", "\"_", "]_", "=_", "\"%", "s", "/", "tool", "s", "\"_", "%_", "env_", "._", "VI", "GO", "R", "\\u", "ROO", "T", "\\u", "DIR_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "STORE", "D", "\\u", "DIR", "\"_", "]_", "=_", "\"%", "s", "/", "vig", "or", "\"_", "%_", "vig", "or", "\\u", "dirs_", "[_", "\"", "TOOLS", "\\u", "DIR", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "RUNT", "IME", "\\u", "DIR", "\"_", "]_", "=_", "\"%", "s", "/", "prod", "3", "\"_", "%_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "STORE", "D", "\\u", "DIR", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "TEMP", "SPACE", "\\u", "DIR", "\"_", "]_", "=_", "\"%", "s", "/", "temps", "pace", "\"_", "%_", "env_", "._", "VI", "GO", "R", "\\u", "SCR", "ATCH", "\\u", "DIR_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "SAMPLE", "\\u", "DATA", "\\u", "DIR", "\"_", "]_", "=_", "\"%", "s", "/", "samples", "\"_", "%_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "STORE", "D", "\\u", "DIR", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "TEST", "\\u", "OUTPU", "T", "\\u", "DIR", "\"_", "]_", "=_", "\"%", "s", "/", "test", "\"_", "%_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "STORE", "D", "\\u", "DIR", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vig", "or", "\\u", "dirs_", "[_", "\"", "BLAS", "T", "\\u", "DIR", "\"_", "]_", "=_", "\"%", "s", "/", "blast", "\"_", "%_", "vig", "or", "\\u", "dirs_", "[_", "\"", "TOOLS", "\\u", "DIR", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vig", "or", "\\u", "dirs_", "[_", "\"", "CL", "UST", "AL", "W", "\\u", "DIR", "\"_", "]_", "=_", "\"%", "s", "/", "clust", "alw", "\"_", "%_", "vig", "or", "\\u", "dirs_", "[_", "\"", "TOOLS", "\\u", "DIR", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vig", "or", "\\u", "dirs_", "[_", "\"", "EXE", "\\u", "DIR", "\"_", "]_", "=_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "RUNT", "IME", "\\u", "DIR", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "vig", "or", "\\u", "names_", "[_", "\"", "BLAS", "T", "\\u", "NAME", "\"_", "]_", "=_", "'", "blast", "-", "2.2", ".1", "5", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vig", "or", "\\u", "names_", "[_", "\"", "CL", "UST", "AL", "W", "\\u", "NAME", "\"_", "]_", "=_", "'", "clust", "alw", "-1", ".8", "3", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vig", "or", "\\u", "names_", "[_", "\"", "VI", "GO", "R", "\\u", "NAME", "\"_", "]_", "=_", "'", "vig", "or", "-", "GS", "Cc", "loud", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "vig", "or", "\\u", "tar", "s_", "[_", "\"", "VI", "GO", "R", "\\u", "TAR", "\\u", "FILE", "NAME", "\"_", "]_", "=_", "\"%", "s", ".", "tg", "z", "\"_", "%_", "vig", "or", "\\u", "names_", "[_", "\"", "VI", "GO", "R", "\\u", "NAME", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vig", "or", "\\u", "tar", "s_", "[_", "\"", "BLAS", "T", "\\u", "TAR", "\\u", "FILE", "NAME", "\"_", "]_", "=_", "\"%", "s", "-%", "s", ".", "tar", ".", "gz", "\"_", "%_", "(_", "vig", "or", "\\u", "names_", "[_", "\"", "BLAS", "T", "\\u", "NAME", "\"_", "]_", ",_", "env_", "._", "ARCH", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vig", "or", "\\u", "tar", "s_", "[_", "\"", "CL", "UST", "AL", "W", "\\u", "TAR", "\\u", "FILE", "NAME", "\"_", "]_", "=_", "\"%", "s", "-%", "s", ".", "deb", "\"_", "%_", "(_", "vig", "or", "\\u", "names_", "[_", "\"", "CL", "UST", "AL", "W", "\\u", "NAME", "\"_", "]_", ",_", "env_", "._", "ARCH", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"", "user", ":", " ", " ", " ", "%", "(", "user", ")", "s", "\"_", "%_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "host", ":", " ", " ", " ", "%", "(", "host", ")", "s", "\"_", "%_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "ARCH", ":", " ", " ", " ", "%", "(", "ARCH", ")", "s", "\"_", "%_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "ROO", "T", " ", "DIR", ":", " ", " ", " ", "%", "(", "VI", "GO", "R", "\\u", "ROO", "T", "\\u", "DIR", ")", "s", "\"_", "%_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "SCR", "ATCH", " ", "DIR", ":", " ", " ", " ", "%", "(", "VI", "GO", "R", "\\u", "SCR", "ATCH", "\\u", "DIR", ")", "s", "\"_", "%_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", "in_", "sorted_", "(_", "vig", "or", "\\u", "dirs_", "._", "keys_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "print_", "(_", "\"%", "s", ":", " ", " ", " ", "%", "s", "\"_", "%_", "(_", "name_", ",_", "vig", "or", "\\u", "dirs_", "[_", "name_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "name_", "in_", "sorted_", "(_", "vig", "or", "\\u", "urls_", "._", "keys_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "print_", "(_", "\"%", "s", ":", " ", " ", " ", "%", "s", "\"_", "%_", "(_", "name_", ",_", "vig", "or", "\\u", "urls_", "[_", "name_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "\"", "BLAS", "T", "\\u", "NAME", ":", " ", " ", " ", "%", "s", "\"_", "%_", "vig", "or", "\\u", "names_", "[_", "\"", "BLAS", "T", "\\u", "NAME", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "CL", "UST", "AL", "W", "\\u", "NAME", ":", " ", " ", " ", "%", "s", "\"_", "%_", "vig", "or", "\\u", "names_", "[_", "\"", "CL", "UST", "AL", "W", "\\u", "NAME", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "VI", "GO", "R", "\\u", "NAME", ":", " ", " ", " ", "%", "s", "\"_", "%_", "vig", "or", "\\u", "names_", "[_", "\"", "VI", "GO", "R", "\\u", "NAME", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", "in_", "sorted_", "(_", "vig", "or", "\\u", "tar", "s_", "._", "keys_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "print_", "(_", "\"%", "s", ":", " ", " ", " ", "%", "s", "\"_", "%_", "(_", "name_", ",_", "vig", "or", "\\u", "tar", "s_", "[_", "name_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "initialize", "\\u", "host_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "local_", "(_", "\"", "ssh", "-", "key", "gen", " ", "-", "R", " ", "%", "(", "host", ")", "s", "\"_", "%_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "fix", "\\u", "etc", "\\u", "hosts_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "create", "\\u", "vig", "or", "\\u", "scratch", "\\u", "dir_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "add", "\\u", "vig", "or_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "print_", "(_", "\"", "Install", "ing", " ", "VI", "GO", "R", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "create", "\\u", "vig", "or", "\\u", "temps", "pace\\u", "dir_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "create", "\\u", "vig", "or", "\\u", "scratch", "\\u", "dir_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "add", "\\u", "package_", "(_", "dependen", "cy", "\\u", "URL_", ",_", "vig", "or", "\\u", "tar", "s_", "[_", "\"", "VI", "GO", "R", "\\u", "TAR", "\\u", "FILE", "NAME", "\"_", "]_", ",_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "STORE", "D", "\\u", "DIR", "\"_", "]_", ",_", "\"", "tar", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "chm", "od", " ", "755", " ", "%", "s", "\"_", "%_", "os_", "._", "path_", "._", "join_", "(_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "RUNT", "IME", "\\u", "DIR", "\"_", "]_", ",_", "\"*", ".", "pl", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "\\u", "path", "\\u", "exists_", "(_", "os_", "._", "path_", "._", "join_", "(_", "vig", "or", "\\u", "dirs_", "[_", "\"", "EXE", "\\u", "DIR", "\"_", "]_", ",_", "\"", "perl", "\"_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "sudo_", "(_", "\"", "ln", " ", "-", "sf", " ", "%", "s", " ", "%", "s", "\"_", "%_", "(_", "\"/", "usr", "/", "bin", "/", "perl", "\"_", ",_", "vig", "or", "\\u", "dirs_", "[_", "\"", "EXE", "\\u", "DIR", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "ln", " ", "-", "sf", " ", "%", "s", " ", "%", "s", "\"_", "%_", "(_", "\"/", "usr", "/", "bin", "/", "perl", "\"_", ",_", "\"/", "usr", "/", "local", "/", "bin", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "\\u", "path", "\\u", "exists_", "(_", "os_", "._", "path_", "._", "join_", "(_", "vig", "or", "\\u", "dirs_", "[_", "\"", "EXE", "\\u", "DIR", "\"_", "]_", ",_", "\"", "vig", "ors", "cra", "tch", "\"_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "sudo_", "(_", "\"", "ln", " ", "-", "sf", " ", "%", "s", " ", "%", "s", "/", "vig", "ors", "cra", "tch", "\"_", "%_", "(_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "TEMP", "SPACE", "\\u", "DIR", "\"_", "]_", ",_", "vig", "or", "\\u", "dirs_", "[_", "\"", "EXE", "\\u", "DIR", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "add", "\\u", "tool", "s", "\\u", "vig", "or_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "print_", "(_", "\"", "Install", " ", "tool", "s", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "create", "\\u", "tool", "s", "\\u", "dir_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "add", "\\u", "blast", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "add", "\\u", "clust", "alw", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "apt", "\\u", "get", "\\u", "install_", "(_", "\"", "liba", "pac", "he", "-", "dbi", "-", "perl", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "apt", "\\u", "get", "\\u", "install_", "(_", "\"", "libc", "lass", "-", "dbi", "-", "sql", "ite", "-", "perl", "\"_", ")_", "\\u\\u\\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", "fix", "\\u", "etc", "\\u", "hosts_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "internal", "\\u", "ip_", "=_", "sudo_", "(_", "\"", "host", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "internal", "\\u", "ip", "[", "%", "s", "]\"_", "%_", "internal", "\\u", "ip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "files", "pec_", "=_", "\"/", "etc", "/", "host", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "echo", " ", "'", "127", ".0", ".0", ".1", " ", "%", "s", "'", " ", ">>", " ", "%", "s", "\"_", "%_", "(_", "internal", "\\u", "ip_", ",_", "files", "pec_", ")_", ")_", "\\u\\u\\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", "create", "\\u", "vig", "or", "\\u", "temps", "pace\\u", "dir_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "if_", "not_", "\\u", "path", "\\u", "is", "\\u", "dir_", "(_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "TEMP", "SPACE", "\\u", "DIR", "\"_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "sudo_", "(_", "\"", "mkd", "ir", " ", "-", "p", " ", "%", "s", "\"_", "%_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "TEMP", "SPACE", "\\u", "DIR", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "chown", " ", "-", "R", " ", "%", "s", ":", "%", "s", " ", "%", "s", "\"_", "%_", "(_", "env_", "._", "user_", ",_", "env_", "._", "user_", ",_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "TEMP", "SPACE", "\\u", "DIR", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "find", " ", "%", "s", " ", "-", "type", " ", "d", " ", "-", "exec", " ", "chm", "od", " ", "777", " ", "{}", " ", "\\\\", ";\"_", "%_", "vig", "or", "\\u", "dirs_", "[_", "\"", "VI", "GO", "R", "\\u", "TEMP", "SPACE", "\\u", "DIR", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "create", "\\u", "vig", "or", "\\u", "scratch", "\\u", "dir_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "if_", "not_", "\\u", "path", "\\u", "is", "\\u", "dir_", "(_", "env_", "._", "VI", "GO", "R", "\\u", "SCR", "ATCH", "\\u", "DIR_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "sudo_", "(_", "\"", "mkd", "ir", " ", "-", "p", " ", "%", "s", "\"_", "%_", "env_", "._", "VI", "GO", "R", "\\u", "SCR", "ATCH", "\\u", "DIR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sudo_", "(_", "\"", "find", " ", "%", "s", " ", "-", "type", " ", "f", " ", "-", "exec", " ", "chm", "od", " ", "666", " ", "{}", " ", "\\\\", ";\"_", "%_", "env_", "._", "VI", "GO", "R", "\\u", "SCR", "ATCH", "\\u", "DIR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "find", " ", "%", "s", " ", "-", "type", " ", "d", " ", "-", "exec", " ", "chm", "od", " ", "777", " ", "{}", " ", "\\\\", ";\"_", "%_", "env_", "._", "VI", "GO", "R", "\\u", "SCR", "ATCH", "\\u", "DIR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "create", "\\u", "tool", "s", "\\u", "dir_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "if_", "not_", "\\u", "path", "\\u", "is", "\\u", "dir_", "(_", "vig", "or", "\\u", "dirs_", "[_", "\"", "TOOLS", "\\u", "DIR", "\"_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "sudo_", "(_", "\"", "mkd", "ir", " ", "-", "p", " ", "%", "s", "\"_", "%_", "vig", "or", "\\u", "dirs_", "[_", "\"", "TOOLS", "\\u", "DIR", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sudo_", "(_", "\"", "chown", " ", "-", "R", " ", "%", "s", ":", "%", "s", " ", "%", "s", "\"_", "%_", "(_", "env_", "._", "user_", ",_", "env_", "._", "user_", ",_", "vig", "or", "\\u", "dirs_", "[_", "\"", "TOOLS", "\\u", "DIR", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "add", "\\u", "blast", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "print_", "(_", "\"", " ", " ", " ", " ", "Install", "ing", " ", "blast", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "create", "\\u", "tool", "s", "\\u", "dir_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "add", "\\u", "package_", "(_", "dependen", "cy", "\\u", "URL_", ",_", "vig", "or", "\\u", "tar", "s_", "[_", "\"", "BLAS", "T", "\\u", "TAR", "\\u", "FILE", "NAME", "\"_", "]_", ",_", "vig", "or", "\\u", "dirs_", "[_", "\"", "BLAS", "T", "\\u", "DIR", "\"_", "]_", ",_", "\"", "tar", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "\\u", "path", "\\u", "exists_", "(_", "os_", "._", "path_", "._", "join_", "(_", "vig", "or", "\\u", "dirs_", "[_", "\"", "EXE", "\\u", "DIR", "\"_", "]_", ",_", "\"", "blast", "all", "\"_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "sudo_", "(_", "\"", "ln", " ", "-", "sf", " ", "%", "s", " ", "%", "s", "\"_", "%_", "(_", "os_", "._", "path_", "._", "join_", "(_", "vig", "or", "\\u", "dirs_", "[_", "\"", "BLAS", "T", "\\u", "DIR", "\"_", "]_", ",_", "vig", "or", "\\u", "names_", "[_", "\"", "BLAS", "T", "\\u", "NAME", "\"_", "]_", ",_", "\"", "bin", "\"_", ",_", "\"", "bl", "2se", "q", "\"_", ")_", ",_", "vig", "or", "\\u", "dirs_", "[_", "\"", "EXE", "\\u", "DIR", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "ln", " ", "-", "sf", " ", "%", "s", " ", "%", "s", "\"_", "%_", "(_", "os_", "._", "path_", "._", "join_", "(_", "vig", "or", "\\u", "dirs_", "[_", "\"", "BLAS", "T", "\\u", "DIR", "\"_", "]_", ",_", "vig", "or", "\\u", "names_", "[_", "\"", "BLAS", "T", "\\u", "NAME", "\"_", "]_", ",_", "\"", "bin", "\"_", ",_", "\"", "blast", "all", "\"_", ")_", ",_", "vig", "or", "\\u", "dirs_", "[_", "\"", "EXE", "\\u", "DIR", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "ln", " ", "-", "sf", " ", "%", "s", " ", "%", "s", "\"_", "%_", "(_", "os_", "._", "path_", "._", "join_", "(_", "vig", "or", "\\u", "dirs_", "[_", "\"", "BLAS", "T", "\\u", "DIR", "\"_", "]_", ",_", "vig", "or", "\\u", "names_", "[_", "\"", "BLAS", "T", "\\u", "NAME", "\"_", "]_", ",_", "\"", "bin", "\"_", ",_", "\"", "fasta", "cmd", "\"_", ")_", ",_", "vig", "or", "\\u", "dirs_", "[_", "\"", "EXE", "\\u", "DIR", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "ln", " ", "-", "sf", " ", "%", "s", " ", "%", "s", "\"_", "%_", "(_", "os_", "._", "path_", "._", "join_", "(_", "vig", "or", "\\u", "dirs_", "[_", "\"", "BLAS", "T", "\\u", "DIR", "\"_", "]_", ",_", "vig", "or", "\\u", "names_", "[_", "\"", "BLAS", "T", "\\u", "NAME", "\"_", "]_", ",_", "\"", "bin", "\"_", ",_", "\"", "format", "db", "\"_", ")_", ",_", "vig", "or", "\\u", "dirs_", "[_", "\"", "EXE", "\\u", "DIR", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "add", "\\u", "clust", "alw", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "print_", "(_", "\"", " ", " ", " ", " ", "Install", "ing", " ", "clust", "alw", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "create", "\\u", "tool", "s", "\\u", "dir_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "add", "\\u", "package_", "(_", "dependen", "cy", "\\u", "URL_", ",_", "vig", "or", "\\u", "tar", "s_", "[_", "\"", "CL", "UST", "AL", "W", "\\u", "TAR", "\\u", "FILE", "NAME", "\"_", "]_", ",_", "vig", "or", "\\u", "dirs_", "[_", "\"", "CL", "UST", "AL", "W", "\\u", "DIR", "\"_", "]_", ",_", "\"", "deb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "\\u", "path", "\\u", "exists_", "(_", "os_", "._", "path_", "._", "join_", "(_", "vig", "or", "\\u", "dirs_", "[_", "\"", "EXE", "\\u", "DIR", "\"_", "]_", ",_", "\"", "clust", "alw", "\"_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "sudo_", "(_", "\"", "ln", " ", "-", "sf", " ", "%", "s", " ", "%", "s", "\"_", "%_", "(_", "os_", "._", "path_", "._", "join_", "(_", "vig", "or", "\\u", "dirs_", "[_", "\"", "CL", "UST", "AL", "W", "\\u", "DIR", "\"_", "]_", ",_", "vig", "or", "\\u", "names_", "[_", "\"", "CL", "UST", "AL", "W", "\\u", "NAME", "\"_", "]_", ",_", "\"", "clust", "alw", "\"_", ")_", ",_", "vig", "or", "\\u", "dirs_", "[_", "\"", "EXE", "\\u", "DIR", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "install", "\\u", "vic", "vb_", "(_", "env_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "initialize", "\\u", "env_", "(_", "\"", "vic", "vb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "apt", "\\u", "get", "\\u", "install_", "(_", "\"", "libp", "erl", "io", "-", "gzip", "-", "perl", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "apt", "\\u", "get", "\\u", "install_", "(_", "\"", "lib", "local", "-", "lib", "-", "perl", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tbl", "2a", "sn", "\\u", "download", "\\u", "dir_", "=_", "\"/", "usr", "/", "local", "/", "tbl", "2a", "sn", "\\u", "download", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tbl", "2a", "sn", "\\u", "dir_", "=_", "\"/", "usr", "/", "local", "/", "bin", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\\u", "path", "\\u", "exists_", "(_", "os_", "._", "path_", "._", "join_", "(_", "tbl", "2a", "sn", "\\u", "dir_", ",_", "\"", "tbl", "2a", "sn", "\"_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sudo_", "(_", "\"", "mv", " ", "%", "s", "/", "tbl", "2a", "sn", " ", "%", "s", "/", "tbl", "2a", "sn", "\\u", "pre", "\\u", "VC", "R", "\"_", "%_", "(_", "tbl", "2a", "sn", "\\u", "dir_", ",_", "tbl", "2a", "sn", "\\u", "dir_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "add", "\\u", "package_", "(_", "\"", "ftp", "://", "ftp", ".", "ncbi", ".", "ni", "h", ".", "gov", "/", "toolb", "ox", "/", "ncbi", "\\u", "tool", "s", "/", "converter", "s", "/", "by", "\\u", "program", "/", "tbl", "2a", "sn", "\"_", ",_", "\"", "linux", "64.", "tbl", "2a", "sn", ".", "gz", "\"_", ",_", "tbl", "2a", "sn", "\\u", "download", "\\u", "dir_", ",_", "\"", "gzip", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "chm", "od", " ", "777", " ", "%", "s", "/", "linux", "64.", "tbl", "2a", "sn", "\"_", "%_", "tbl", "2a", "sn", "\\u", "download", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "mv", " ", "%", "s", "/", "linux", "64.", "tbl", "2a", "sn", " ", "%", "s", "/", "tbl", "2a", "sn", "\"_", "%_", "(_", "tbl", "2a", "sn", "\\u", "download", "\\u", "dir_", ",_", "tbl", "2a", "sn", "\\u", "dir_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "remove", "\\u", "dir_", "(_", "tbl", "2a", "sn", "\\u", "download", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "cd_", "(_", "\"~\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sudo_", "(_", "\"", "git", " ", "clone", " ", "git", "://", "git", "hub", ".", "com", "/", "JC", "VI", "-", "Cloud", "/", "VI", "CV", "B", ".", "git", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "cd_", "(_", "\"~/", "VI", "CV", "B", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sudo_", "(_", "\"", "lib", "/", "VI", "CV", "B", "/", "data", "/", "install", "/", "install", "\\u", "to", "\\u", "dir\\u", "full", ".", "sh", " ", "%", "s", " ", "/", "mnt", "/", "galax", "y", "Tool", "s", "/", "galax", "y", "-", "central", " ", "/\"_", "%_", "(_", "env_", "._", "VI", "CV", "B", "\\u", "LOCAL", "\\u", "DIR_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "discon", "nect", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "install", "\\u", "vic", "vb", "\\u", "clean", "all_", "(_", "env_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "initialize", "\\u", "env_", "(_", "\"", "vic", "vb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "remove", "\\u", "dir_", "(_", "env_", "._", "VI", "CV", "B", "\\u", "LOCAL", "\\u", "DIR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "remove", "\\u", "dir_", "(_", "env_", "._", "VI", "CV", "B", "\\u", "GAL", "AX", "Y", "\\u", "DIR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "cd_", "(_", "\"~\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sudo_", "(_", "\"", "rm", " ", "-", "fr", " ", "~", "/", "VI", "CV", "B", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "\"", "VI", "CV", "B", " ", "Remove", "d", "\\\\", "n", "\"_", ")_", "\\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\t", "\t_", "discon", "nect", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "initialize", "\\u", "env_", "(_", "pipeline_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "if_", "pipeline_", "==_", "\"", "vir", "al", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "env_", "._", "VIR", "AL", "\\u", "ROO", "T", "\\u", "DIR_", "=_", "\"/", "usr", "/", "local", "/", "VH", "TN", "GS", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "\\u", "path", "\\u", "exists_", "(_", "env_", "._", "VIR", "AL", "\\u", "ROO", "T", "\\u", "DIR_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sudo_", "(_", "\"", "mkd", "ir", " ", "-", "p", " ", "%", "s", "\"_", "%_", "env_", "._", "VIR", "AL", "\\u", "ROO", "T", "\\u", "DIR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "pipeline_", "==_", "\"", "vig", "or", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "env_", "._", "VI", "GO", "R", "\\u", "ROO", "T", "\\u", "DIR_", "=_", "\"/", "usr", "/", "local", "/", "VI", "GO", "R", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "\\u", "path", "\\u", "exists_", "(_", "env_", "._", "VI", "GO", "R", "\\u", "ROO", "T", "\\u", "DIR_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sudo_", "(_", "\"", "mkd", "ir", " ", "-", "p", " ", "%", "s", "\"_", "%_", "env_", "._", "VI", "GO", "R", "\\u", "ROO", "T", "\\u", "DIR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "env_", "._", "VI", "GO", "R", "\\u", "SCR", "ATCH", "\\u", "DIR_", "=_", "\"/", "usr", "/", "local", "/", "scratch", "/", "vig", "or", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "\\u", "path", "\\u", "exists_", "(_", "env_", "._", "VI", "GO", "R", "\\u", "SCR", "ATCH", "\\u", "DIR_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sudo_", "(_", "\"", "mkd", "ir", " ", "-", "p", " ", "%", "s", "\"_", "%_", "env_", "._", "VI", "GO", "R", "\\u", "SCR", "ATCH", "\\u", "DIR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "find", " ", "%", "s", " ", "-", "type", " ", "f", " ", "-", "exec", " ", "chm", "od", " ", "666", " ", "{}", " ", "\\\\", ";\"_", "%_", "env_", "._", "VI", "GO", "R", "\\u", "SCR", "ATCH", "\\u", "DIR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "find", " ", "%", "s", " ", "-", "type", " ", "d", " ", "-", "exec", " ", "chm", "od", " ", "777", " ", "{}", " ", "\\\\", ";\"_", "%_", "env_", "._", "VI", "GO", "R", "\\u", "SCR", "ATCH", "\\u", "DIR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "env_", "._", "VI", "CV", "B", "\\u", "LOCAL", "\\u", "DIR_", "=_", "\"/", "usr", "/", "local", "/", "VI", "CV", "B", "\"_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env_", "._", "VI", "CV", "B", "\\u", "GAL", "AX", "Y", "\\u", "DIR_", "=_", "\"/", "mnt", "/", "galax", "y", "Tool", "s", "/", "galax", "y", "-", "central", "/", "static", "/", "vic", "vb", "\"_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "add", "\\u", "package_", "(_", "download", "\\u", "url_", ",_", "filename_", ",_", "install", "\\u", "dir_", ",_", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "if_", "not_", "\\u", "path", "\\u", "is", "\\u", "dir_", "(_", "install", "\\u", "dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "sudo_", "(_", "\"", "mkd", "ir", " ", "-", "p", " ", "%", "s", "\"_", "%_", "install", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "cd_", "(_", "install", "\\u", "dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "not_", "\\u", "path", "\\u", "exists_", "(_", "os_", "._", "path_", "._", "join_", "(_", "install", "\\u", "dir_", ",_", "filename_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sudo_", "(_", "\"\"\"", "wg", "et", " ", "--", "no", "-", "host", "-", "director", "ies", " ", "--", "cut", "-", "dirs", "=", "1", " ", "--", "director", "y", "-", "prefix", "=", "%", "s", " ", "%", "s", "/", "%", "s", "\"\"\"_", "%_", "(_", "install", "\\u", "dir_", ",_", "download", "\\u", "url_", ",_", "filename_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "==_", "\"", "tar", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "sudo_", "(_", "\"", "tar", " ", "xv", "fz", " ", "%", "s", "\"_", "%_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "==_", "\"", "bz2", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "sudo_", "(_", "\"", "tar", " ", "xf", "j", " ", "%", "s", "\"_", "%_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "==_", "\"", "gzip", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "sudo_", "(_", "\"", "gun", "zip", " ", "%", "s", "\"_", "%_", "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\t", "\t\t\t_", "sudo_", "(_", "\"", "dpkg", " ", "-", "x", " ", "%", "s", " ", "%", "s", "\"_", "%_", "(_", "filename_", ",_", "install", "\\u", "dir_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "mkd", "ir", " ", "%", "s", "/", "%", "s", "\"_", "%_", "(_", "install", "\\u", "dir_", ",_", "vig", "or", "\\u", "names_", "[_", "\"", "CL", "UST", "AL", "W", "\\u", "NAME", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "cp", " ", "%", "s", "/", "usr", "/", "bin", "/*", " ", "%", "s", "/", "%", "s", "\"_", "%_", "(_", "install", "\\u", "dir_", ",_", "install", "\\u", "dir_", ",_", "vig", "or", "\\u", "names_", "[_", "\"", "CL", "UST", "AL", "W", "\\u", "NAME", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sudo_", "(_", "\"", "chown", " ", "-", "R", " ", "%", "s", ":", "%", "s", " ", "%", "s", "\"_", "%_", "(_", "env_", "._", "user_", ",_", "env_", "._", "user_", ",_", "install", "\\u", "dir_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "find", " ", "%", "s", " ", "-", "type", " ", "d", " ", "-", "exec", " ", "chm", "od", " ", "755", " ", "{}", " ", "\\\\", ";\"_", "%_", "install", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "remove", "\\u", "dir_", "(_", "dirs", "pec_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "if_", "\\u", "path", "\\u", "is", "\\u", "dir_", "(_", "dirs", "pec_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "unlock", "\\u", "dir_", "(_", "dirs", "pec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "rm", " ", "-", "rf", " ", "%", "s", "\"_", "%_", "dirs", "pec_", ")_", "\\u\\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_", "print_", "(_", "\"", "DEBU", "G", ":", " ", "\\u", "remove", "\\u", "dir", "[", "%", "s", "]", " ", "--", " ", "NOT", " ", "FO", "UND", "\"_", "%_", "dirs", "pec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "unlock", "\\u", "dir_", "(_", "dirs", "pec_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "with_", "settings_", "(_", "hide_", "(_", "\"", "runn", "ing", "\"_", ",_", "\"", "stdout", "\"_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "sudo_", "(_", "\"", "find", " ", "%", "s", " ", "-", "type", " ", "d", " ", "-", "exec", " ", "chm", "od", " ", "755", " ", "{}", " ", "\\\\", ";\"_", "%_", "dirs", "pec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "find", " ", "%", "s", " ", "-", "type", " ", "d", " ", "-", "exec", " ", "chm", "od", " ", "g", "+", "s", " ", "{}", " ", "\\\\", ";\"_", "%_", "dirs", "pec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "find", " ", "%", "s", " ", "-", "type", " ", "f", " ", "-", "exec", " ", "chm", "od", " ", "644", " ", "{}", " ", "\\\\", ";\"_", "%_", "dirs", "pec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "apt", "\\u", "get", "\\u", "install_", "(_", "tool_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "sudo_", "(_", "\"", "apt", "-", "get", " ", "-", "q", " ", "-", "y", " ", "--", "force", "-", "ye", "s", " ", "install", " ", "%", "s", "\"_", "%_", "tool_", ")_", "\\u\\u\\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", "path", "\\u", "exists_", "(_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "found_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "settings_", "(_", "hide_", "(_", "\"", "runn", "ing", "\"_", ",_", "\"", "stdout", "\"_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "result_", "=_", "sudo_", "(_", "\"", "test", " ", "-", "e", " ", "'%", "s", "'", " ", "||", " ", "echo", " ", "'", "FAL", "SE", "'\"_", "%_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "result_", "!=_", "\"", "FAL", "SE", "\"_", ":_", "found_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "found_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "path", "\\u", "is", "\\u", "dir_", "(_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "found_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "settings_", "(_", "hide_", "(_", "\"", "runn", "ing", "\"_", ",_", "\"", "stdout", "\"_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "result_", "=_", "sudo_", "(_", "\"", "test", " ", "-", "d", " ", "'%", "s", "'", " ", "||", " ", "echo", " ", "'", "FAL", "SE", "'\"_", "%_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "result_", "!=_", "\"", "FAL", "SE", "\"_", ":_", "found_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "found_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "set\\u", "pre", "\\u", "VC", "R_", "(_", "filename_", ",_", "user_", ",_", "group_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "sudo_", "(_", "\"", "cp", " ", "%", "s", " ", "%", "s", "\\u", "pre", "\\u", "VC", "R", "\"_", "%_", "(_", "filename_", ",_", "filename_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "chown", " ", "%", "s", ":", "%", "s", " ", "%", "s", "\\u", "pre", "\\u", "VC", "R", "\"_", "%_", "(_", "user_", ",_", "group_", ",_", "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_", "\\u", "get", "\\u", "file", "\\u", "string_", "(_", "filename_", ",_", "directory_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "fh_", "=_", "open_", "(_", "\"%", "s", "/", "%", "s", "\"_", "%_", "(_", "directory_", ",_", "filename_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "string_", "=_", "mmap_", "._", "mmap_", "(_", "fh_", "._", "fileno_", "(_", ")_", ",_", "0_", ",_", "access_", "=_", "mmap_", "._", "ACCESS", "\\u", "READ_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fh_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "string_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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.3/tests/regressiontests/backends/tests.py
[ { "content": " @unittest.skipUnless(connection.vendor == 'oracle',\n \"No need to check Oracle connection semantics\")\n def test_client_encoding(self):\n # If the backend is Oracle, test that the client encoding is set\n # correctly. This was broken under Cygwin prior to r14781.\n c = connection.cursor() # Ensure the connection is initialized.\n self.assertEqual(connection.connection.encoding, \"UTF-8\")\n self.assertEqual(connection.connection.nencoding, \"UTF-8\")", "metadata": "root.OracleChecks.test_client_encoding", "header": "['class', 'OracleChecks', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 49 }, { "content": " @skipUnlessDBFeature('test_db_allows_multiple_connections')\n def test_signal(self):\n data = {}\n def receiver(sender, connection, **kwargs):\n data[\"connection\"] = connection\n\n connection_created.connect(receiver)\n connection.close()\n cursor = connection.cursor()\n self.assertTrue(data[\"connection\"] is connection)\n\n connection_created.disconnect(receiver)\n data.clear()\n cursor = connection.cursor()\n self.assertTrue(data == {})", "metadata": "root.ConnectionCreatedSignalTest.test_signal", "header": "['class', 'ConnectionCreatedSignalTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 179 } ]
[ { "span": "c ", "start_line": 54, "start_column": 8, "end_line": 54, "end_column": 9 }, { "span": "cursor ", "start_line": 192, "start_column": 8, "end_line": 192, "end_column": 14 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Ora", "cle", "Check", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "unittest_", "._", "skip", "Unless_", "(_", "connection_", "._", "vendor_", "==_", "'", "oracle", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "No", " ", "need", " ", "to", " ", "check", " ", "Ora", "cle", " ", "connecti", "on", " ", "semantics", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "client", "\\u", "encoding_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "back", "end", " ", "is", " ", "Ora", "cle", ",", " ", "test", " ", "tha", "t", " ", "the", " ", "client", " ", "encoding", " ", "is", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "correct", "ly", ".", " ", " ", "Thi", "s", " ", "was", " ", "broken", " ", "under", " ", "Cy", "gw", "in", " ", "prior", " ", "to", " ", "r1", "478", "1._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "connection_", "._", "cursor_", "(_", ")_", "#", " ", "Ensur", "e", " ", "the", " ", "connecti", "on", " ", "is", " ", "initialize", "d", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "connection_", "._", "connection_", "._", "encoding_", ",_", "\"", "UT", "F", "-", "8", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "connection_", "._", "connection_", "._", "nen", "coding_", ",_", "\"", "UT", "F", "-", "8", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Connect", "ion", "Creat", "ed", "Signal", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "skip", "Un", "less", "DB", "Feature_", "(_", "'", "test\\u", "db", "\\u", "allow", "s", "\\u", "multiple", "\\u", "connections", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "signal_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "receiver_", "(_", "sender_", ",_", "connection_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "\"", "connecti", "on", "\"_", "]_", "=_", "connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "connecti", "on", "\\u", "created_", "._", "connect_", "(_", "receiver_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connection_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cursor_", "=_", "connection_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "data_", "[_", "\"", "connecti", "on", "\"_", "]_", "is_", "connection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "connecti", "on", "\\u", "created_", "._", "disconnect_", "(_", "receiver_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cursor_", "=_", "connection_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "data_", "==_", "{_", "}_", ")_", "\\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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
stamparm/maltrail/core/httpd.py
[ { "content": "#!/usr/bin/env python\n\n\"\"\"\nCopyright (c) 2014-2016 Miroslav Stampar (@stamparm)\nSee the file 'LICENSE' for copying permission\n\"\"\"\n\nimport BaseHTTPServer\nimport cStringIO\nimport datetime\nimport httplib\nimport glob\nimport gzip\nimport hashlib\nimport io\nimport json\nimport mimetypes\nimport os\nimport re\nimport socket\nimport SocketServer\nimport subprocess\nimport threading\nimport time\nimport traceback\nimport urllib\nimport urlparse\n\nfrom core.addr import addr_to_int\nfrom core.addr import int_to_addr\nfrom core.addr import make_mask\nfrom core.attribdict import AttribDict\nfrom core.common import get_regex\nfrom core.common import ipcat_lookup\nfrom core.common import worst_asns\nfrom core.enums import HTTP_HEADER\nfrom core.settings import config\nfrom core.settings import CONTENT_EXTENSIONS_EXCLUSIONS\nfrom core.settings import DATE_FORMAT\nfrom core.settings import DISABLED_CONTENT_EXTENSIONS\nfrom core.settings import DISPOSED_NONCES\nfrom core.settings import HTML_DIR\nfrom core.settings import HTTP_TIME_FORMAT\nfrom core.settings import MAX_NOFILE\nfrom core.settings import NAME\nfrom core.settings import PING_RESPONSE\nfrom core.settings import SERVER_HEADER\nfrom core.settings import SESSION_COOKIE_NAME\nfrom core.settings import SESSION_EXPIRATION_HOURS\nfrom core.settings import SESSION_ID_LENGTH\nfrom core.settings import SESSIONS\nfrom core.settings import TRAILS_FILE\nfrom core.settings import UNAUTHORIZED_SLEEP_TIME\nfrom core.settings import VERSION\n\ntry:\n # Reference: https://bugs.python.org/issue7980\n # Reference: http://code-trick.com/python-bug-attribute-error-_strptime/\n import _strptime\nexcept ImportError:\n pass\n\ntry:\n import resource\n resource.setrlimit(resource.RLIMIT_NOFILE, (MAX_NOFILE, MAX_NOFILE))\nexcept:\n pass\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def start_httpd(address=None, port=None, join=False, pem=None):\n \"\"\"\n Starts HTTP server\n \"\"\"\n\n class ThreadingServer(SocketServer.ThreadingMixIn, BaseHTTPServer.HTTPServer):\n def server_bind(self):\n self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n BaseHTTPServer.HTTPServer.server_bind(self)\n\n def finish_request(self, *args, **kwargs):\n try:\n BaseHTTPServer.HTTPServer.finish_request(self, *args, **kwargs)\n except:\n if config.SHOW_DEBUG:\n traceback.print_exc()\n\n class SSLThreadingServer(ThreadingServer):\n def __init__(self, server_address, pem, HandlerClass):\n import OpenSSL # python-openssl\n\n ThreadingServer.__init__(self, server_address, HandlerClass)\n ctx = OpenSSL.SSL.Context(OpenSSL.SSL.TLSv1_METHOD)\n ctx.use_privatekey_file(pem)\n ctx.use_certificate_file(pem)\n self.socket = OpenSSL.SSL.Connection(ctx, socket.socket(self.address_family, self.socket_type))\n self.server_bind()\n self.server_activate()\n\n def shutdown_request(self, request):\n try:\n request.shutdown()\n except:\n if config.SHOW_DEBUG:\n traceback.print_exc()\n\n class ReqHandler(BaseHTTPServer.BaseHTTPRequestHandler):\n def do_GET(self):\n path, query = self.path.split('?', 1) if '?' in self.path else (self.path, \"\")\n params = {}\n content = None\n skip = False\n\n if hasattr(self, \"data\"):\n params.update(urlparse.parse_qs(self.data))\n\n if query:\n params.update(urlparse.parse_qs(query))\n\n for key in params:\n if params[key]:\n params[key] = params[key][-1]\n\n if path == '/':\n path = \"index.html\"\n\n path = path.strip('/')\n extension = os.path.splitext(path)[-1].lower()\n\n if hasattr(self, \"_%s\" % path):\n content = getattr(self, \"_%s\" % path)(params)\n\n else:\n path = path.replace('/', os.path.sep)\n path = os.path.abspath(os.path.join(HTML_DIR, path)).strip()\n\n if not os.path.isfile(path) and os.path.isfile(\"%s.html\" % path):\n path = \"%s.html\" % path\n\n if \"..\" not in os.path.relpath(path, HTML_DIR) and os.path.isfile(path) and (extension not in DISABLED_CONTENT_EXTENSIONS or os.path.split(path)[-1] in CONTENT_EXTENSIONS_EXCLUSIONS):\n mtime = time.gmtime(os.path.getmtime(path))\n if_modified_since = self.headers.get(HTTP_HEADER.IF_MODIFIED_SINCE)\n\n if if_modified_since and extension not in (\".htm\", \".html\"):\n if_modified_since = [_ for _ in if_modified_since.split(';') if _.upper().endswith(\"GMT\")][0]\n if time.mktime(mtime) <= time.mktime(time.strptime(if_modified_since, HTTP_TIME_FORMAT)):\n self.send_response(httplib.NOT_MODIFIED)\n self.send_header(HTTP_HEADER.CONNECTION, \"close\")\n skip = True\n\n if not skip:\n content = open(path, \"rb\").read()\n last_modified = time.strftime(HTTP_TIME_FORMAT, mtime)\n self.send_response(httplib.OK)\n self.send_header(HTTP_HEADER.CONNECTION, \"close\")\n self.send_header(HTTP_HEADER.CONTENT_TYPE, mimetypes.guess_type(path)[0] or \"application/octet-stream\")\n self.send_header(HTTP_HEADER.LAST_MODIFIED, last_modified)\n if extension not in (\".htm\", \".html\"):\n self.send_header(HTTP_HEADER.EXPIRES, \"Sun, 17-Jan-2038 19:14:07 GMT\") # Reference: http://blog.httpwatch.com/2007/12/10/two-simple-rules-for-http-caching/\n self.send_header(HTTP_HEADER.CACHE_CONTROL, \"max-age=3600, must-revalidate\") # Reference: http://stackoverflow.com/a/5084555\n else:\n self.send_header(HTTP_HEADER.CACHE_CONTROL, \"no-cache\")\n\n else:\n self.send_response(httplib.NOT_FOUND)\n self.send_header(HTTP_HEADER.CONNECTION, \"close\")\n content = '<!DOCTYPE html><html lang=\"en\"><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL %s was not found on this server.</p></body></html>' % self.path.split('?')[0]\n\n if content is not None:\n for match in re.finditer(r\"<\\!(\\w+)\\!>\", content):\n name = match.group(1)\n _ = getattr(self, \"_%s\" % name.lower(), None)\n if _:\n content = self._format(content, **{ name: _() })\n\n if \"gzip\" in self.headers.getheader(HTTP_HEADER.ACCEPT_ENCODING, \"\"):\n self.send_header(HTTP_HEADER.CONTENT_ENCODING, \"gzip\")\n _ = cStringIO.StringIO()\n compress = gzip.GzipFile(\"\", \"w+b\", 9, _)\n compress._stream = _\n compress.write(content)\n compress.flush()\n compress.close()\n content = compress._stream.getvalue()\n\n self.send_header(HTTP_HEADER.CONTENT_LENGTH, str(len(content)))\n\n self.end_headers()\n\n if content:\n self.wfile.write(content)\n\n self.wfile.flush()\n self.wfile.close()\n\n def do_POST(self):\n length = self.headers.getheader(HTTP_HEADER.CONTENT_LENGTH)\n data = self.rfile.read(int(length))\n data = urllib.unquote_plus(data)\n self.data = data\n self.do_GET()\n\n def get_session(self):\n retval = None\n cookie = self.headers.get(HTTP_HEADER.COOKIE)\n\n if cookie:\n match = re.search(r\"%s\\s*=\\s*([^;]+)\" % SESSION_COOKIE_NAME, cookie)\n if match:\n session = match.group(1)\n if session in SESSIONS:\n if SESSIONS[session].client_ip != self.client_address[0]:\n pass\n elif SESSIONS[session].expiration > time.time():\n retval = SESSIONS[session]\n else:\n del SESSIONS[session]\n\n return retval\n\n def delete_session(self):\n cookie = self.headers.get(HTTP_HEADER.COOKIE)\n\n if cookie:\n match = re.search(r\"%s=(.+)\" % SESSION_COOKIE_NAME, cookie)\n if match:\n session = match.group(1)\n if session in SESSIONS:\n del SESSIONS[session]\n\n def version_string(self):\n return SERVER_HEADER\n\n def end_headers(self):\n if not hasattr(self, \"_headers_ended\"):\n BaseHTTPServer.BaseHTTPRequestHandler.end_headers(self)\n self._headers_ended = True\n\n def log_message(self, format, *args):\n return\n\n def finish(self):\n try:\n BaseHTTPServer.BaseHTTPRequestHandler.finish(self)\n except:\n if config.SHOW_DEBUG:\n traceback.print_exc()\n\n def _version(self):\n return VERSION\n\n def _format(self, content, **params):\n if content:\n for key, value in params.items():\n content = content.replace(\"<!%s!>\" % key, value)\n\n return content\n\n def _login(self, params):\n valid = False\n\n if params.get(\"username\") and params.get(\"hash\") and params.get(\"nonce\"):\n if params.get(\"nonce\") not in DISPOSED_NONCES:\n DISPOSED_NONCES.add(params.get(\"nonce\"))\n for entry in (config.USERS or []):\n entry = re.sub(r\"\\s\", \"\", entry)\n username, stored_hash, uid, netfilter = entry.split(':')\n if username == params.get(\"username\"):\n try:\n if params.get(\"hash\") == hashlib.sha256(stored_hash.strip() + params.get(\"nonce\")).hexdigest():\n valid = True\n break\n except:\n if config.SHOW_DEBUG:\n traceback.print_exc()\n\n if valid:\n session_id = os.urandom(SESSION_ID_LENGTH).encode(\"hex\")\n expiration = time.time() + 3600 * SESSION_EXPIRATION_HOURS\n\n self.send_response(httplib.OK)\n self.send_header(HTTP_HEADER.CONNECTION, \"close\")\n self.send_header(HTTP_HEADER.SET_COOKIE, \"%s=%s; expires=%s; path=/; HttpOnly\" % (SESSION_COOKIE_NAME, session_id, time.strftime(HTTP_TIME_FORMAT, time.gmtime(expiration))))\n\n if netfilter in (\"\", \"0.0.0.0/0\"):\n netfilters = None\n else:\n addresses = set()\n netmasks = set()\n\n for item in set(re.split(r\"[;,]\", netfilter)):\n item = item.strip()\n if '/' in item:\n _ = item.split('/')[-1]\n if _.isdigit() and int(_) >= 16:\n lower = addr_to_int(item.split('/')[0])\n mask = make_mask(int(_))\n upper = lower | (0xffffffff ^ mask)\n while lower <= upper:\n addresses.add(int_to_addr(lower))\n lower += 1\n else:\n netmasks.add(item)\n elif '-' in item:\n _ = item.split('-')\n lower, upper = addr_to_int(_[0]), addr_to_int(_[1])\n while lower <= upper:\n addresses.add(int_to_addr(lower))\n lower += 1\n elif re.search(r\"\\d+\\.\\d+\\.\\d+\\.\\d+\", item):\n addresses.add(item)\n\n netfilters = netmasks\n if addresses:\n netfilters.add(get_regex(addresses))\n\n SESSIONS[session_id] = AttribDict({\"username\": username, \"uid\": uid, \"netfilters\": netfilters, \"expiration\": expiration, \"client_ip\": self.client_address[0]})\n else:\n time.sleep(UNAUTHORIZED_SLEEP_TIME)\n self.send_response(httplib.UNAUTHORIZED)\n self.send_header(HTTP_HEADER.CONNECTION, \"close\")\n\n self.send_header(HTTP_HEADER.CONTENT_TYPE, \"text/plain\")\n content = \"Login %s\" % (\"success\" if valid else \"failed\")\n\n if not subprocess.mswindows:\n try:\n subprocess.check_output(\"logger -p auth.info -t \\\"%s[%d]\\\" \\\"%s password for %s from %s port %s\\\"\" % (NAME.lower(), os.getpid(), \"Accepted\" if valid else \"Failed\", params.get(\"username\"), self.client_address[0], self.client_address[1]), stderr=subprocess.STDOUT, shell=True)\n except Exception:\n if config.SHOW_DEBUG:\n traceback.print_exc()\n\n return content\n\n def _logout(self, params):\n self.delete_session()\n self.send_response(httplib.FOUND)\n self.send_header(HTTP_HEADER.CONNECTION, \"close\")\n self.send_header(HTTP_HEADER.LOCATION, \"/\")\n\n def _whoami(self, params):\n session = self.get_session()\n username = session.username if session else \"\"\n\n self.send_response(httplib.OK)\n self.send_header(HTTP_HEADER.CONNECTION, \"close\")\n self.send_header(HTTP_HEADER.CONTENT_TYPE, \"text/plain\")\n\n return username\n\n def _check_ip(self, params):\n session = self.get_session()\n\n if session is None:\n self.send_response(httplib.UNAUTHORIZED)\n self.send_header(HTTP_HEADER.CONNECTION, \"close\")\n return None\n\n self.send_response(httplib.OK)\n self.send_header(HTTP_HEADER.CONNECTION, \"close\")\n self.send_header(HTTP_HEADER.CONTENT_TYPE, \"text/plain\")\n\n try:\n result_worst = worst_asns(params.get(\"address\"))\n if result_worst:\n result_ipcat = result_worst\n else:\n _ = (ipcat_lookup(params.get(\"address\")) or \"\").lower().split(' ')\n result_ipcat = _[1] if _[0] == 'the' else _[0]\n return (\"%s\" if not params.get(\"callback\") else \"%s(%%s)\" % params.get(\"callback\")) % json.dumps({\"ipcat\": result_ipcat, \"worst_asns\": str(result_worst is not None).lower()})\n except:\n if config.SHOW_DEBUG:\n traceback.print_exc()\n\n def _trails(self, params):\n self.send_response(httplib.OK)\n self.send_header(HTTP_HEADER.CONNECTION, \"close\")\n self.send_header(HTTP_HEADER.CONTENT_TYPE, \"text/plain\")\n\n return open(TRAILS_FILE, \"rb\").read()\n\n def _ping(self, params):\n self.send_response(httplib.OK)\n self.send_header(HTTP_HEADER.CONNECTION, \"close\")\n self.send_header(HTTP_HEADER.CONTENT_TYPE, \"text/plain\")\n\n return PING_RESPONSE\n\n def _events(self, params):\n session = self.get_session()\n\n if session is None:\n self.send_response(httplib.UNAUTHORIZED)\n self.send_header(HTTP_HEADER.CONNECTION, \"close\")\n return None\n\n start, end, size, total = None, None, -1, None\n content = None\n event_log_path = os.path.join(config.LOG_DIR, \"%s.log\" % params.get(\"date\", \"\"))\n\n if os.path.exists(event_log_path):\n total = os.stat(event_log_path).st_size\n\n if self.headers.get(HTTP_HEADER.RANGE):\n match = re.search(r\"bytes=(\\d+)-(\\d+)\", self.headers[HTTP_HEADER.RANGE])\n if match:\n start, end = int(match.group(1)), int(match.group(2))\n max_size = end - start + 1\n end = min(total - 1, end)\n size = end - start + 1\n\n if start == 0 or not session.range_handle:\n session.range_handle = open(event_log_path, \"rb\")\n\n if session.netfilters is None:\n session.range_handle.seek(start)\n self.send_response(httplib.PARTIAL_CONTENT)\n self.send_header(HTTP_HEADER.CONNECTION, \"close\")\n self.send_header(HTTP_HEADER.CONTENT_TYPE, \"text/plain\")\n self.send_header(HTTP_HEADER.CONTENT_RANGE, \"bytes %d-%d/%d\" % (start, end, total))\n content = session.range_handle.read(size)\n else:\n self.send_response(httplib.OK)\n self.send_header(HTTP_HEADER.CONNECTION, \"close\")\n self.send_header(HTTP_HEADER.CONTENT_TYPE, \"text/plain\")\n\n buffer, addresses, netmasks, regex = cStringIO.StringIO(), set(), [], \"\"\n for netfilter in session.netfilters:\n if not netfilter:\n continue\n if '/' in netfilter:\n netmasks.append(netfilter)\n elif re.search(r\"\\A[\\d.]+\\Z\", netfilter):\n addresses.add(netfilter)\n elif '\\.' in netfilter:\n regex = r\"\\b(%s)\\b\" % netfilter\n else:\n print \"[!] invalid network filter '%s'\" % netfilter\n return\n\n for line in session.range_handle:\n display = False\n ip = None\n\n if regex:\n match = re.search(regex, line)\n if match:\n ip = match.group(1)\n display = True\n\n if not display and (addresses or netmasks):\n for match in re.finditer(r\"\\b(\\d+\\.\\d+\\.\\d+\\.\\d+)\\b\", line):\n if not display:\n ip = match.group(1)\n else:\n break\n\n if ip in addresses:\n display = True\n break\n elif netmasks:\n for _ in netmasks:\n prefix, mask = _.split('/')\n if addr_to_int(ip) & make_mask(int(mask)) == addr_to_int(prefix):\n addresses.add(ip)\n display = True\n break\n\n if display:\n if \",%s\" % ip in line or \"%s,\" % ip in line:\n line = re.sub(r\" ([\\d.,]+,)?%s(,[\\d.,]+)? \" % re.escape(ip), \" %s \" % ip, line)\n buffer.write(line)\n if buffer.tell() >= max_size:\n break\n\n content = buffer.getvalue()\n end = start + len(content) - 1\n self.send_header(HTTP_HEADER.CONTENT_RANGE, \"bytes %d-%d/%d\" % (start, end, end + 1 + max_size * (len(content) >= max_size)))\n\n if len(content) < max_size:\n session.range_handle.close()\n session.range_handle = None\n\n if size == -1:\n self.send_response(httplib.OK)\n self.send_header(HTTP_HEADER.CONNECTION, \"close\")\n self.send_header(HTTP_HEADER.CONTENT_TYPE, \"text/plain\")\n self.end_headers()\n\n with open(event_log_path, \"rb\") as f:\n while True:\n data = f.read(io.DEFAULT_BUFFER_SIZE)\n if not data:\n break\n else:\n self.wfile.write(data)\n\n else:\n self.send_response(httplib.OK) # instead of httplib.NO_CONTENT (compatibility reasons)\n self.send_header(HTTP_HEADER.CONNECTION, \"close\")\n if self.headers.get(HTTP_HEADER.RANGE):\n self.send_header(HTTP_HEADER.CONTENT_RANGE, \"bytes 0-0/0\")\n\n return content\n\n def _counts(self, params):\n counts = {}\n\n session = self.get_session()\n\n if session is None:\n self.send_response(httplib.UNAUTHORIZED)\n self.send_header(HTTP_HEADER.CONNECTION, \"close\")\n return None\n\n self.send_response(httplib.OK)\n self.send_header(HTTP_HEADER.CONNECTION, \"close\")\n self.send_header(HTTP_HEADER.CONTENT_TYPE, \"application/json\")\n\n match = re.search(r\"\\d+\\-\\d+\\-\\d+\", params.get(\"from\", \"\"))\n if match:\n min_ = datetime.datetime.strptime(match.group(0), DATE_FORMAT)\n else:\n min_ = datetime.datetime.fromtimestamp(0)\n\n match = re.search(r\"\\d+\\-\\d+\\-\\d+\", params.get(\"to\", \"\"))\n if match:\n max_ = datetime.datetime.strptime(match.group(0), DATE_FORMAT)\n else:\n max_ = datetime.datetime.now()\n\n min_ = min_.replace(hour=0, minute=0, second=0, microsecond=0)\n max_ = max_.replace(hour=23, minute=59, second=59, microsecond=999999)\n\n for filepath in sorted(glob.glob(os.path.join(config.LOG_DIR, \"*.log\"))):\n filename = os.path.basename(filepath)\n if not re.search(r\"\\A\\d{4}-\\d{2}-\\d{2}\\.log\\Z\", filename):\n continue\n try:\n current = datetime.datetime.strptime(os.path.splitext(filename)[0], DATE_FORMAT)\n except:\n if config.SHOW_DEBUG:\n traceback.print_exc()\n else:\n if min_ <= current <= max_:\n timestamp = int(time.mktime(current.timetuple()))\n size = os.path.getsize(filepath)\n with open(filepath, \"rb\") as f:\n content = f.read(io.DEFAULT_BUFFER_SIZE)\n if size >= io.DEFAULT_BUFFER_SIZE:\n total = 1.0 * content.count('\\n') * size / io.DEFAULT_BUFFER_SIZE\n counts[timestamp] = int(round(total / 100) * 100)\n else:\n counts[timestamp] = content.count('\\n')\n\n return json.dumps(counts)\n\n class SSLReqHandler(ReqHandler):\n def setup(self):\n self.connection = self.request\n self.rfile = socket._fileobject(self.request, \"rb\", self.rbufsize)\n self.wfile = socket._fileobject(self.request, \"wb\", self.wbufsize)\n\n try:\n if pem:\n server = SSLThreadingServer((address or '', int(port) if str(port or \"\").isdigit() else 0), pem, SSLReqHandler)\n else:\n server = ThreadingServer((address or '', int(port) if str(port or \"\").isdigit() else 0), ReqHandler)\n except Exception as ex:\n if \"Address already in use\" in str(ex):\n exit(\"[!] another instance already running\")\n elif \"Name or service not known\" in str(ex):\n exit(\"[!] invalid configuration value for 'HTTP_ADDRESS' ('%s')\" % config.HTTP_ADDRESS)\n elif \"Cannot assign requested address\" in str(ex):\n exit(\"[!] can't use configuration value for 'HTTP_ADDRESS' ('%s')\" % config.HTTP_ADDRESS)\n else:\n raise\n\n print \"[i] starting HTTP%s server at 'http%s://%s:%d/'\" % ('S' if pem else \"\", 's' if pem else \"\", server.server_address[0], server.server_address[1])\n\n print \"[o] running...\"\n\n if join:\n server.serve_forever()\n else:\n thread = threading.Thread(target=server.serve_forever)\n thread.daemon = True\n thread.start()", "metadata": "root.start_httpd", "header": "['module', '___EOS___']", "index": 68 } ]
[ { "span": "except:", "start_line": 65, "start_column": 0, "end_line": 65, "end_column": 7 }, { "span": "except:", "start_line": 81, "start_column": 12, "end_line": 81, "end_column": 19 }, { "span": "except:", "start_line": 100, "start_column": 12, "end_line": 100, "end_column": 19 }, { "span": "except:", "start_line": 242, "start_column": 12, "end_line": 242, "end_column": 19 }, { "span": "except:", "start_line": 270, "start_column": 28, "end_line": 270, "end_column": 35 }, { "span": "except:", "start_line": 368, "start_column": 12, "end_line": 368, "end_column": 19 }, { "span": "except:", "start_line": 538, "start_column": 16, "end_line": 538, "end_column": 23 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Copy", "right", " ", "(", "c", ")", " ", "2014", "-", "2016", " ", "Mir", "os", "lav", " ", "Sta", "mpa", "r", " ", "(", "@", "stamp", "arm", ")", "\\", "10", ";", "See", " ", "the", " ", "file", " ", "'", "LICENSE", "'", " ", "for", " ", "copy", "ing", " ", "permissi", "on", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "Base", "HTTP", "Server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "c", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "httplib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "glob_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "gzip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "hashlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "io_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "mimetypes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Sock", "et", "Server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "threading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urlparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "core_", "._", "addr_", "import_", "addr", "\\u", "to", "\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "addr_", "import_", "int\\u", "to", "\\u", "addr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "addr_", "import_", "make", "\\u", "mask_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "attrib", "dict_", "import_", "Attrib", "Dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "common_", "import_", "get", "\\u", "regex_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "common_", "import_", "ipc", "at", "\\u", "lookup_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "common_", "import_", "worst", "\\u", "asn", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "enums_", "import_", "HTTP", "\\u", "HEADER_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "settings_", "import_", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "settings_", "import_", "CONTE", "NT", "\\u", "EXTENSION", "S", "\\u", "EXC", "LUS", "IONS", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "settings_", "import_", "DAT", "E", "\\u", "FORMAT_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "settings_", "import_", "DISABLED", "\\u", "CONTE", "NT", "\\u", "EXTENSIONS_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "settings_", "import_", "DISP", "OSE", "D", "\\u", "NON", "CES", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "settings_", "import_", "HTM", "L", "\\u", "DIR_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "settings_", "import_", "HTTP", "\\u", "TIME", "\\u", "FORMAT_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "settings_", "import_", "MAX", "\\u", "NO", "FILE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "settings_", "import_", "NAME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "settings_", "import_", "PING", "\\u", "RESPONSE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "settings_", "import_", "SERVER", "\\u", "HEADER_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "settings_", "import_", "SES", "SION", "\\u", "COOKIE", "\\u", "NAME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "settings_", "import_", "SES", "SION", "\\u", "EXP", "IRA", "TIO", "N", "\\u", "HOUR", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "settings_", "import_", "SES", "SION", "\\u", "ID", "\\u", "LENGTH_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "settings_", "import_", "SES", "SION", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "settings_", "import_", "TRA", "IL", "S", "\\u", "FILE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "settings_", "import_", "UNA", "UTH", "ORI", "ZED", "\\u", "SLEEP", "\\u", "TIME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "settings_", "import_", "VERSION_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Reference", ":", " ", "https", "://", "bug", "s", ".", "python", ".", "org", "/", "issue", "798", "0_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Reference", ":", " ", "http", "://", "code", "-", "trick", ".", "com", "/", "python", "-", "bug", "-", "attribute", "-", "error", "-\\u", "strp", "time", "/_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "\\u", "strptime_", "\\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_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "resource_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resource_", "._", "set", "rli", "mit_", "(_", "resource_", "._", "RL", "IM", "IT", "\\u", "NO", "FILE_", ",_", "(_", "MAX", "\\u", "NO", "FILE_", ",_", "MAX", "\\u", "NO", "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\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "start", "\\u", "httpd_", "(_", "address_", "=_", "None_", ",_", "port_", "=_", "None_", ",_", "join_", "=_", "False_", ",_", "pem_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Start", "s", " ", "HTTP", " ", "server", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Thread", "ing", "Server_", "(_", "Sock", "et", "Server_", "._", "Thread", "ing", "Mix", "In_", ",_", "Base", "HTTP", "Server_", "._", "HTTP", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "server", "\\u", "bind_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "socket_", "._", "setsockopt_", "(_", "socket_", "._", "SOL", "\\u", "SOCKET_", ",_", "socket_", "._", "SO", "\\u", "REUSE", "ADDR_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Base", "HTTP", "Server_", "._", "HTTP", "Server_", "._", "server", "\\u", "bind_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "finish", "\\u", "request_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Base", "HTTP", "Server_", "._", "HTTP", "Server_", "._", "finish", "\\u", "request_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "config_", "._", "SHOW", "\\u", "DEBUG_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "traceback_", "._", "print", "\\u", "exc_", "(_", ")_", "\\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_", "class_", "SS", "LT", "hread", "ing", "Server_", "(_", "Thread", "ing", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "server", "\\u", "address_", ",_", "pem_", ",_", "Handle", "r", "Class_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "Open", "SSL_", "#", " ", "python", "-", "openss", "l_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Thread", "ing", "Server_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "server", "\\u", "address_", ",_", "Handle", "r", "Class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "=_", "Open", "SSL_", "._", "SSL_", "._", "Context_", "(_", "Open", "SSL_", "._", "SSL_", "._", "TLS", "v1", "\\u", "METHOD_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "use", "\\u", "private", "key", "\\u", "file_", "(_", "pem_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "use", "\\u", "certifica", "te", "\\u", "file_", "(_", "pem_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "socket_", "=_", "Open", "SSL_", "._", "SSL_", "._", "Connection_", "(_", "ctx_", ",_", "socket_", "._", "socket_", "(_", "self_", "._", "address", "\\u", "family_", ",_", "self_", "._", "socket", "\\u", "type_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "server", "\\u", "bind_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "server", "\\u", "activate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "shut", "down", "\\u", "request_", "(_", "self_", ",_", "request_", ")_", ":_", "\\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 ", " _", "request_", "._", "shutdown_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "config_", "._", "SHOW", "\\u", "DEBUG_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "traceback_", "._", "print", "\\u", "exc_", "(_", ")_", "\\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_", "class_", "Re", "q", "Handler_", "(_", "Base", "HTTP", "Server_", "._", "Base", "HTTP", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "do", "\\u", "GET_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", ",_", "query_", "=_", "self_", "._", "path_", "._", "split_", "(_", "'?'_", ",_", "1_", ")_", "if_", "'?'_", "in_", "self_", "._", "path_", "else_", "(_", "self_", "._", "path_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "skip_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "self_", ",_", "\"", "data", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "._", "update_", "(_", "urlparse_", "._", "parse", "\\u", "qs_", "(_", "self_", "._", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "query_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "._", "update_", "(_", "urlparse_", "._", "parse", "\\u", "qs_", "(_", "query_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", "in_", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "params_", "[_", "key_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "params_", "[_", "key_", "]_", "=_", "params_", "[_", "key_", "]_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "path_", "==_", "'/'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", "=_", "\"", "index", ".", "html", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "path_", "=_", "path_", "._", "strip_", "(_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extension_", "=_", "os_", "._", "path_", "._", "splitext_", "(_", "path_", ")_", "[_", "-_", "1_", "]_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "self_", ",_", "\"\\u", "%", "s", "\"_", "%_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", "=_", "getattr_", "(_", "self_", ",_", "\"\\u", "%", "s", "\"_", "%_", "path_", ")_", "(_", "params_", ")_", "\\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 ", " _", "path_", "=_", "path_", "._", "replace_", "(_", "'/'_", ",_", "os_", "._", "path_", "._", "sep_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "os_", "._", "path_", "._", "join_", "(_", "HTM", "L", "\\u", "DIR_", ",_", "path_", ")_", ")_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "isfile_", "(_", "path_", ")_", "and_", "os_", "._", "path_", "._", "isfile_", "(_", "\"%", "s", ".", "html", "\"_", "%_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "path_", "=_", "\"%", "s", ".", "html", "\"_", "%_", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\"..\"_", "not_", "in_", "os_", "._", "path_", "._", "relpath_", "(_", "path_", ",_", "HTM", "L", "\\u", "DIR_", ")_", "and_", "os_", "._", "path_", "._", "isfile_", "(_", "path_", ")_", "and_", "(_", "extension_", "not_", "in_", "DISABLED", "\\u", "CONTE", "NT", "\\u", "EXTENSIONS_", "or_", "os_", "._", "path_", "._", "split_", "(_", "path_", ")_", "[_", "-_", "1_", "]_", "in_", "CONTE", "NT", "\\u", "EXTENSION", "S", "\\u", "EXC", "LUS", "IONS", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "mtime_", "=_", "time_", "._", "gmtime_", "(_", "os_", "._", "path_", "._", "getmtime_", "(_", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if", "\\u", "modifi", "ed", "\\u", "since_", "=_", "self_", "._", "headers_", "._", "get_", "(_", "HTTP", "\\u", "HEADER_", "._", "IF", "\\u", "MODIFIE", "D", "\\u", "SIN", "CE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "if", "\\u", "modifi", "ed", "\\u", "since_", "and_", "extension_", "not_", "in_", "(_", "\".", "ht", "m", "\"_", ",_", "\".", "html", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if", "\\u", "modifi", "ed", "\\u", "since_", "=_", "[_", "\\u_", "for_", "\\u_", "in_", "if", "\\u", "modifi", "ed", "\\u", "since_", "._", "split_", "(_", "';'_", ")_", "if_", "\\u_", "._", "upper_", "(_", ")_", "._", "endswith_", "(_", "\"", "GM", "T", "\"_", ")_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "time_", "._", "mktime_", "(_", "mtime_", ")_", "<=_", "time_", "._", "mktime_", "(_", "time_", "._", "strptime_", "(_", "if", "\\u", "modifi", "ed", "\\u", "since_", ",_", "HTTP", "\\u", "TIME", "\\u", "FORMAT_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "send", "\\u", "response_", "(_", "httplib_", "._", "NOT", "\\u", "MODIFIE", "D_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONNECTION", "_", ",_", "\"", "close", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "skip_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "skip_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "content_", "=_", "open_", "(_", "path_", ",_", "\"", "rb", "\"_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "modified_", "=_", "time_", "._", "strftime_", "(_", "HTTP", "\\u", "TIME", "\\u", "FORMAT_", ",_", "mtime_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "response_", "(_", "httplib_", "._", "OK_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONNECTION", "_", ",_", "\"", "close", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONTE", "NT", "\\u", "TYPE_", ",_", "mimetypes_", "._", "guess", "\\u", "type_", "(_", "path_", ")_", "[_", "0_", "]_", "or_", "\"", "applica", "tion", "/", "oct", "et", "-", "stream", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "LAS", "T", "\\u", "MODIFIE", "D_", ",_", "last", "\\u", "modified_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "extension_", "not_", "in_", "(_", "\".", "ht", "m", "\"_", ",_", "\".", "html", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "EXPIRE", "S_", ",_", "\"", "Sun", ",", " ", "1", "7", "-", "Jan", "-", "203", "8", " ", "1", "9", ":", "14", ":", "0", "7", " ", "GM", "T", "\"_", ")_", "#", " ", "Reference", ":", " ", "http", "://", "blog", ".", "http", "watch", ".", "com", "/", "2007", "/", "1", "2", "/", "10", "/", "two", "-", "simple", "-", "rule", "s", "-", "for", "-", "http", "-", "caching", "/_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CACHE", "\\u", "CONTROL_", ",_", "\"", "max", "-", "age", "=", "3600", ",", " ", "must", "-", "rev", "alid", "ate", "\"_", ")_", "#", " ", "Reference", ":", " ", "http", "://", "stack", "overflow", ".", "com", "/", "a", "/", "508", "455", "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_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CACHE", "\\u", "CONTROL_", ",_", "\"", "no", "-", "cache", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "send", "\\u", "response_", "(_", "httplib_", "._", "NOT", "\\u", "FOUND_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONNECTION", "_", ",_", "\"", "close", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "'<!", "DOC", "TYPE", " ", "html", "><", "html", " ", "lang", "=\"", "en", "\">", "<", "head", "><", "title", ">", "404", " ", "Not", " ", "Foun", "d", "</", "title", "><", "/", "head", "><", "body", "><", "h1", ">", "Not", " ", "Foun", "d", "</", "h1", "><", "p", ">", "The", " ", "request", "ed", " ", "URL", " ", "%", "s", " ", "was", " ", "not", " ", "found", " ", "on", " ", "this", " ", "server", ".", "</", "p", "><", "/", "body", "><", "/", "html", ">'_", "%_", "self_", "._", "path_", "._", "split_", "(_", "'?'_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "content_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "match_", "in_", "re_", "._", "finditer_", "(_", "r", "\"<", "\\\\", "!(", "\\\\", "w", "+)\\\\", "!", ">\"_", ",_", "content_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "name_", "=_", "match_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u_", "=_", "getattr_", "(_", "self_", ",_", "\"\\u", "%", "s", "\"_", "%_", "name_", "._", "lower_", "(_", ")_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "content_", "=_", "self_", "._", "\\u", "format_", "(_", "content_", ",_", "**_", "{_", "name_", ":_", "\\u_", "(_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\"", "gzip", "\"_", "in_", "self_", "._", "headers_", "._", "getheader_", "(_", "HTTP", "\\u", "HEADER_", "._", "ACCEPT", "\\u", "ENCODING_", ",_", "\"\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONTE", "NT", "\\u", "ENCODING_", ",_", "\"", "gzip", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u_", "=_", "c", "String", "IO_", "._", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compress_", "=_", "gzip_", "._", "Gz", "ip", "File_", "(_", "\"\"_", ",_", "\"", "w", "+", "b", "\"_", ",_", "9_", ",_", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compress_", "._", "\\u", "stream_", "=_", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compress_", "._", "write_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compress_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compress_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "compress_", "._", "\\u", "stream_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONTE", "NT", "\\u", "LENGTH_", ",_", "str_", "(_", "len_", "(_", "content_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "end", "\\u", "headers_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "content_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "wfile_", "._", "write_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "wfile_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wfile_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do", "\\u", "POST_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "length_", "=_", "self_", "._", "headers_", "._", "getheader_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONTE", "NT", "\\u", "LENGTH_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "self_", "._", "rfile_", "._", "read_", "(_", "int_", "(_", "length_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "urllib_", "._", "unqu", "ote", "\\u", "plus_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "data_", "=_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "do", "\\u", "GET_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "session_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "retval_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cookie_", "=_", "self_", "._", "headers_", "._", "get_", "(_", "HTTP", "\\u", "HEADER_", "._", "COOKIE", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "cookie_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "match_", "=_", "re_", "._", "search_", "(_", "r", "\"%", "s", "\\\\", "s", "*=", "\\\\", "s", "*([", "^", ";", "]+)\"", "_", "%_", "SES", "SION", "\\u", "COOKIE", "\\u", "NAME_", ",_", "cookie_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "session_", "=_", "match_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "session_", "in_", "SES", "SION", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "SES", "SION", "S_", "[_", "session_", "]_", "._", "client", "\\u", "ip_", "!=_", "self_", "._", "client", "\\u", "address_", "[_", "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_", "elif_", "SES", "SION", "S_", "[_", "session_", "]_", "._", "expiration_", ">_", "time_", "._", "time_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "retval_", "=_", "SES", "SION", "S_", "[_", "session_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "del_", "SES", "SION", "S_", "[_", "session_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "retval_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "session_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cookie_", "=_", "self_", "._", "headers_", "._", "get_", "(_", "HTTP", "\\u", "HEADER_", "._", "COOKIE", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "cookie_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "match_", "=_", "re_", "._", "search_", "(_", "r", "\"%", "s", "=(", ".+)", "\"_", "%_", "SES", "SION", "\\u", "COOKIE", "\\u", "NAME_", ",_", "cookie_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "session_", "=_", "match_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "session_", "in_", "SES", "SION", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "del_", "SES", "SION", "S_", "[_", "session_", "]_", "\\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_", "def_", "version", "\\u", "string_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "SERVER", "\\u", "HEADER_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "end", "\\u", "headers_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "hasattr_", "(_", "self_", ",_", "\"\\u", "header", "s", "\\u", "ende", "d", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Base", "HTTP", "Server_", "._", "Base", "HTTP", "Request", "Handler_", "._", "end", "\\u", "headers_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "header", "s", "\\u", "ended_", "=_", "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_", "def_", "log", "\\u", "message_", "(_", "self_", ",_", "format_", ",_", "*_", "args_", ")_", ":_", "\\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_", "def_", "finish_", "(_", "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 ", " _", "Base", "HTTP", "Server_", "._", "Base", "HTTP", "Request", "Handler_", "._", "finish_", "(_", "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 ", " _", "if_", "config_", "._", "SHOW", "\\u", "DEBUG_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "traceback_", "._", "print", "\\u", "exc_", "(_", ")_", "\\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_", "def_", "\\u", "version_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "VERSION_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "format_", "(_", "self_", ",_", "content_", ",_", "**_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "content_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "key_", ",_", "value_", "in_", "params_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "content_", "=_", "content_", "._", "replace_", "(_", "\"<", "!%", "s", "!", ">\"_", "%_", "key_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "login_", "(_", "self_", ",_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "valid_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "params_", "._", "get_", "(_", "\"", "user", "name", "\"_", ")_", "and_", "params_", "._", "get_", "(_", "\"", "hash", "\"_", ")_", "and_", "params_", "._", "get_", "(_", "\"", "nonc", "e", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "params_", "._", "get_", "(_", "\"", "nonc", "e", "\"_", ")_", "not_", "in_", "DISP", "OSE", "D", "\\u", "NON", "CES", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "DISP", "OSE", "D", "\\u", "NON", "CES", "_", "._", "add_", "(_", "params_", "._", "get_", "(_", "\"", "nonc", "e", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "entry_", "in_", "(_", "config_", "._", "USERS", "_", "or_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "entry_", "=_", "re_", "._", "sub_", "(_", "r", "\"\\\\", "s", "\"_", ",_", "\"\"_", ",_", "entry_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "username_", ",_", "store", "d\\u", "hash_", ",_", "uid_", ",_", "netf", "ilter_", "=_", "entry_", "._", "split_", "(_", "':'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "username_", "==_", "params_", "._", "get_", "(_", "\"", "user", "name", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "params_", "._", "get_", "(_", "\"", "hash", "\"_", ")_", "==_", "hashlib_", "._", "sha256_", "(_", "store", "d\\u", "hash_", "._", "strip_", "(_", ")_", "+_", "params_", "._", "get_", "(_", "\"", "nonc", "e", "\"_", ")_", ")_", "._", "hexdigest_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "valid_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "config_", "._", "SHOW", "\\u", "DEBUG_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "traceback_", "._", "print", "\\u", "exc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "valid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "session", "\\u", "id_", "=_", "os_", "._", "urandom_", "(_", "SES", "SION", "\\u", "ID", "\\u", "LENGTH_", ")_", "._", "encode_", "(_", "\"", "hex", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expiration_", "=_", "time_", "._", "time_", "(_", ")_", "+_", "3600_", "*_", "SES", "SION", "\\u", "EXP", "IRA", "TIO", "N", "\\u", "HOUR", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "send", "\\u", "response_", "(_", "httplib_", "._", "OK_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONNECTION", "_", ",_", "\"", "close", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "SET", "\\u", "COOKIE", "_", ",_", "\"%", "s", "=", "%", "s", ";", " ", "expir", "es", "=", "%", "s", ";", " ", "path", "=", "/", ";", " ", "Http", "On", "ly", "\"_", "%_", "(_", "SES", "SION", "\\u", "COOKIE", "\\u", "NAME_", ",_", "session", "\\u", "id_", ",_", "time_", "._", "strftime_", "(_", "HTTP", "\\u", "TIME", "\\u", "FORMAT_", ",_", "time_", "._", "gmtime_", "(_", "expiration_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "netf", "ilter_", "in_", "(_", "\"\"_", ",_", "\"", "0.", "0.", "0.", "0", "/", "0", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "netf", "ilter", "s_", "=_", "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 ", " ", "_", "addresses_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "net", "masks_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "item_", "in_", "set_", "(_", "re_", "._", "split_", "(_", "r", "\"[", ";", ",]", "\"_", ",_", "netf", "ilter_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "item_", "=_", "item_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'/'_", "in_", "item_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "\\u_", "=_", "item_", "._", "split_", "(_", "'/'_", ")_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\\u_", "._", "isdigit_", "(_", ")_", "and_", "int_", "(_", "\\u_", ")_", ">=_", "16_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "lower_", "=_", "addr", "\\u", "to", "\\u", "int_", "(_", "item_", "._", "split_", "(_", "'/'_", ")_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mask_", "=_", "make", "\\u", "mask_", "(_", "int_", "(_", "\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "upper_", "=_", "lower_", "|_", "(_", "0xffffffff_", "^_", "mask_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "lower_", "<=_", "upper_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "addresses_", "._", "add_", "(_", "int\\u", "to", "\\u", "addr_", "(_", "lower_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lower_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "net", "masks_", "._", "add_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'-'_", "in_", "item_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "\\u_", "=_", "item_", "._", "split_", "(_", "'-'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lower_", ",_", "upper_", "=_", "addr", "\\u", "to", "\\u", "int_", "(_", "\\u_", "[_", "0_", "]_", ")_", ",_", "addr", "\\u", "to", "\\u", "int_", "(_", "\\u_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "lower_", "<=_", "upper_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "addresses_", "._", "add_", "(_", "int\\u", "to", "\\u", "addr_", "(_", "lower_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lower_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "re_", "._", "search_", "(_", "r", "\"\\\\", "d", "+\\\\.", "\\\\", "d", "+\\\\.", "\\\\", "d", "+\\\\.", "\\\\", "d", "+\"_", ",_", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "addresses_", "._", "add_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "netf", "ilter", "s_", "=_", "net", "masks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "addresses_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "netf", "ilter", "s_", "._", "add_", "(_", "get", "\\u", "regex_", "(_", "addresses_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "SES", "SION", "S_", "[_", "session", "\\u", "id_", "]_", "=_", "Attrib", "Dict_", "(_", "{_", "\"", "user", "name", "\"_", ":_", "username_", ",_", "\"", "uid", "\"_", ":_", "uid_", ",_", "\"", "netf", "ilter", "s", "\"_", ":_", "netf", "ilter", "s_", ",_", "\"", "expir", "ation", "\"_", ":_", "expiration_", ",_", "\"", "client", "\\u", "ip", "\"_", ":_", "self_", "._", "client", "\\u", "address_", "[_", "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 ", " _", "time_", "._", "sleep_", "(_", "UNA", "UTH", "ORI", "ZED", "\\u", "SLEEP", "\\u", "TIME_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "response_", "(_", "httplib_", "._", "UNA", "UTH", "ORI", "ZED", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONNECTION", "_", ",_", "\"", "close", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONTE", "NT", "\\u", "TYPE_", ",_", "\"", "text", "/", "plain", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "\"", "Logi", "n", " ", "%", "s", "\"_", "%_", "(_", "\"", "success", "\"_", "if_", "valid_", "else_", "\"", "fail", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "subprocess_", "._", "ms", "windows_", ":_", "\\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 ", " ", "_", "subprocess_", "._", "check", "\\u", "output_", "(_", "\"", "logg", "er", " ", "-", "p", " ", "auth", ".", "info", " ", "-", "t", " ", "\\\\\"", "%", "s", "[", "%", "d", "]\\\\", "\"", " ", "\\\\\"", "%", "s", " ", "password", " ", "for", " ", "%", "s", " ", "from", " ", "%", "s", " ", "port", " ", "%", "s", "\\\\\"\"_", "%_", "(_", "NAME_", "._", "lower_", "(_", ")_", ",_", "os_", "._", "getpid_", "(_", ")_", ",_", "\"", "Accept", "ed", "\"_", "if_", "valid_", "else_", "\"", "Fail", "ed", "\"_", ",_", "params_", "._", "get_", "(_", "\"", "user", "name", "\"_", ")_", ",_", "self_", "._", "client", "\\u", "address_", "[_", "0_", "]_", ",_", "self_", "._", "client", "\\u", "address_", "[_", "1_", "]_", ")_", ",_", "stderr_", "=_", "subprocess_", "._", "STDOUT_", ",_", "shell_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "config_", "._", "SHOW", "\\u", "DEBUG_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "traceback_", "._", "print", "\\u", "exc_", "(_", ")_", "\\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_", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "logout_", "(_", "self_", ",_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "delete", "\\u", "session_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "response_", "(_", "httplib_", "._", "FOUND_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONNECTION", "_", ",_", "\"", "close", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "LOCATION_", ",_", "\"/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "who", "ami_", "(_", "self_", ",_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "session_", "=_", "self_", "._", "get", "\\u", "session_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "username_", "=_", "session_", "._", "username_", "if_", "session_", "else_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "send", "\\u", "response_", "(_", "httplib_", "._", "OK_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONNECTION", "_", ",_", "\"", "close", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONTE", "NT", "\\u", "TYPE_", ",_", "\"", "text", "/", "plain", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "username_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "check", "\\u", "ip_", "(_", "self_", ",_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "session_", "=_", "self_", "._", "get", "\\u", "session_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "session_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "send", "\\u", "response_", "(_", "httplib_", "._", "UNA", "UTH", "ORI", "ZED", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONNECTION", "_", ",_", "\"", "close", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "send", "\\u", "response_", "(_", "httplib_", "._", "OK_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONNECTION", "_", ",_", "\"", "close", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONTE", "NT", "\\u", "TYPE_", ",_", "\"", "text", "/", "plain", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result", "\\u", "worst", "_", "=_", "worst", "\\u", "asn", "s_", "(_", "params_", "._", "get_", "(_", "\"", "address", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result", "\\u", "worst", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "result", "\\u", "ipc", "at_", "=_", "result", "\\u", "worst", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "\\u_", "=_", "(_", "ipc", "at", "\\u", "lookup_", "(_", "params_", "._", "get_", "(_", "\"", "address", "\"_", ")_", ")_", "or_", "\"\"_", ")_", "._", "lower_", "(_", ")_", "._", "split_", "(_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result", "\\u", "ipc", "at_", "=_", "\\u_", "[_", "1_", "]_", "if_", "\\u_", "[_", "0_", "]_", "==_", "'", "the", "'_", "else_", "\\u_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "\"%", "s", "\"_", "if_", "not_", "params_", "._", "get_", "(_", "\"", "callback", "\"_", ")_", "else_", "\"%", "s", "(%", "%", "s", ")\"_", "%_", "params_", "._", "get_", "(_", "\"", "callback", "\"_", ")_", ")_", "%_", "json_", "._", "dumps_", "(_", "{_", "\"", "ipc", "at", "\"_", ":_", "result", "\\u", "ipc", "at_", ",_", "\"", "worst", "\\u", "asn", "s", "\"_", ":_", "str_", "(_", "result", "\\u", "worst", "_", "is_", "not_", "None_", ")_", "._", "lower_", "(_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "config_", "._", "SHOW", "\\u", "DEBUG_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "traceback_", "._", "print", "\\u", "exc_", "(_", ")_", "\\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_", "def_", "\\u", "trail", "s_", "(_", "self_", ",_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "send", "\\u", "response_", "(_", "httplib_", "._", "OK_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONNECTION", "_", ",_", "\"", "close", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONTE", "NT", "\\u", "TYPE_", ",_", "\"", "text", "/", "plain", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "open_", "(_", "TRA", "IL", "S", "\\u", "FILE_", ",_", "\"", "rb", "\"_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "ping_", "(_", "self_", ",_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "send", "\\u", "response_", "(_", "httplib_", "._", "OK_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONNECTION", "_", ",_", "\"", "close", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONTE", "NT", "\\u", "TYPE_", ",_", "\"", "text", "/", "plain", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "PING", "\\u", "RESPONSE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "events_", "(_", "self_", ",_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "session_", "=_", "self_", "._", "get", "\\u", "session_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "session_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "send", "\\u", "response_", "(_", "httplib_", "._", "UNA", "UTH", "ORI", "ZED", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONNECTION", "_", ",_", "\"", "close", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "start_", ",_", "end_", ",_", "size_", ",_", "total_", "=_", "None_", ",_", "None_", ",_", "-_", "1_", ",_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "event", "\\u", "log", "\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "config_", "._", "LOG", "\\u", "DIR_", ",_", "\"%", "s", ".", "log", "\"_", "%_", "params_", "._", "get_", "(_", "\"", "date", "\"_", ",_", "\"\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "event", "\\u", "log", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "total_", "=_", "os_", "._", "stat_", "(_", "event", "\\u", "log", "\\u", "path_", ")_", "._", "st", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "headers_", "._", "get_", "(_", "HTTP", "\\u", "HEADER_", "._", "RANGE_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "match_", "=_", "re_", "._", "search_", "(_", "r", "\"", "bytes", "=(", "\\\\", "d", "+)", "-(", "\\\\", "d", "+)\"_", ",_", "self_", "._", "headers_", "[_", "HTTP", "\\u", "HEADER_", "._", "RANGE_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "start_", ",_", "end_", "=_", "int_", "(_", "match_", "._", "group_", "(_", "1_", ")_", ")_", ",_", "int_", "(_", "match_", "._", "group_", "(_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "size_", "=_", "end_", "-_", "start_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end_", "=_", "min_", "(_", "total_", "-_", "1_", ",_", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "size_", "=_", "end_", "-_", "start_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "start_", "==_", "0_", "or_", "not_", "session_", "._", "range", "\\u", "handle_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "session_", "._", "range", "\\u", "handle_", "=_", "open_", "(_", "event", "\\u", "log", "\\u", "path_", ",_", "\"", "rb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "session_", "._", "netf", "ilter", "s_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "session_", "._", "range", "\\u", "handle_", "._", "seek_", "(_", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "response_", "(_", "httplib_", "._", "PARTI", "AL", "\\u", "CONTENT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONNECTION", "_", ",_", "\"", "close", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONTE", "NT", "\\u", "TYPE_", ",_", "\"", "text", "/", "plain", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONTE", "NT", "\\u", "RANGE_", ",_", "\"", "bytes", " ", "%", "d", "-%", "d", "/", "%", "d", "\"_", "%_", "(_", "start_", ",_", "end_", ",_", "total_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "session_", "._", "range", "\\u", "handle_", "._", "read_", "(_", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "send", "\\u", "response_", "(_", "httplib_", "._", "OK_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONNECTION", "_", ",_", "\"", "close", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONTE", "NT", "\\u", "TYPE_", ",_", "\"", "text", "/", "plain", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "buffer_", ",_", "addresses_", ",_", "net", "masks_", ",_", "regex_", "=_", "c", "String", "IO_", "._", "String", "IO_", "(_", ")_", ",_", "set_", "(_", ")_", ",_", "[_", "]_", ",_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "netf", "ilter_", "in_", "session_", "._", "netf", "ilter", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "not_", "netf", "ilter_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'/'_", "in_", "netf", "ilter_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "net", "masks_", "._", "append_", "(_", "netf", "ilter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "re_", "._", "search_", "(_", "r", "\"\\\\", "A", "[\\\\", "d", ".]+", "\\\\", "Z", "\"_", ",_", "netf", "ilter_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "addresses_", "._", "add_", "(_", "netf", "ilter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'\\\\.", "'_", "in_", "netf", "ilter_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "regex_", "=_", "r", "\"\\\\", "b", "(%", "s", ")\\\\", "b", "\"_", "%_", "netf", "ilter_", "\\u\\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_", "\"[", "!]", " ", "invalid", " ", "network", " ", "filter", " ", "'%", "s", "'\"_", "%_", "netf", "ilter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "line_", "in_", "session_", "._", "range", "\\u", "handle_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "display_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "regex_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "match_", "=_", "re_", "._", "search_", "(_", "regex_", ",_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "ip_", "=_", "match_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "display_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "display_", "and_", "(_", "addresses_", "or_", "net", "masks_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "match_", "in_", "re_", "._", "finditer_", "(_", "r", "\"\\\\", "b", "(\\\\", "d", "+\\\\.", "\\\\", "d", "+\\\\.", "\\\\", "d", "+\\\\.", "\\\\", "d", "+)\\\\", "b", "\"_", ",_", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "if_", "not_", "display_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "ip_", "=_", "match_", "._", "group_", "(_", "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 ", " ", " ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ip_", "in_", "addresses_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "display_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "net", "masks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "for_", "\\u_", "in_", "net", "masks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "prefix_", ",_", "mask_", "=_", "\\u_", "._", "split_", "(_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "addr", "\\u", "to", "\\u", "int_", "(_", "ip_", ")_", "&_", "make", "\\u", "mask_", "(_", "int_", "(_", "mask_", ")_", ")_", "==_", "addr", "\\u", "to", "\\u", "int_", "(_", "prefix_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "addresses_", "._", "add_", "(_", "ip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "display_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "display_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "\",", "%", "s", "\"_", "%_", "ip_", "in_", "line_", "or_", "\"%", "s", ",\"_", "%_", "ip_", "in_", "line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "line_", "=_", "re_", "._", "sub_", "(_", "r", "\"", " ", "([\\\\", "d", ".,", "]+", ",)", "?", "%", "s", "(", ",", "[\\\\", "d", ".,", "]+)", "?", " ", "\"_", "%_", "re_", "._", "escape_", "(_", "ip_", ")_", ",_", "\"", " ", "%", "s", " ", "\"_", "%_", "ip_", ",_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "buffer_", "._", "write_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "buffer_", "._", "tell_", "(_", ")_", ">=_", "max", "\\u", "size_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "content_", "=_", "buffer_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end_", "=_", "start_", "+_", "len_", "(_", "content_", ")_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONTE", "NT", "\\u", "RANGE_", ",_", "\"", "bytes", " ", "%", "d", "-%", "d", "/", "%", "d", "\"_", "%_", "(_", "start_", ",_", "end_", ",_", "end_", "+_", "1_", "+_", "max", "\\u", "size_", "*_", "(_", "len_", "(_", "content_", ")_", ">=_", "max", "\\u", "size_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "content_", ")_", "<_", "max", "\\u", "size_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "session_", "._", "range", "\\u", "handle_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "range", "\\u", "handle_", "=_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "size_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "send", "\\u", "response_", "(_", "httplib_", "._", "OK_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONNECTION", "_", ",_", "\"", "close", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONTE", "NT", "\\u", "TYPE_", ",_", "\"", "text", "/", "plain", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "end", "\\u", "headers_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "open_", "(_", "event", "\\u", "log", "\\u", "path_", ",_", "\"", "rb", "\"_", ")_", "as_", "f_", ":_", "\\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 ", " ", " _", "data_", "=_", "f_", "._", "read_", "(_", "io_", "._", "DEF", "AUL", "T", "\\u", "BUFF", "ER", "\\u", "SIZE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "wfile_", "._", "write_", "(_", "data_", ")_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "send", "\\u", "response_", "(_", "httplib_", "._", "OK_", ")_", "#", " ", "inst", "ead", " ", "of", " ", "http", "lib", ".", "NO", "\\u", "CONTE", "NT", " ", "(", "compatibility", " ", "reasons", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONNECTION", "_", ",_", "\"", "close", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "headers_", "._", "get_", "(_", "HTTP", "\\u", "HEADER_", "._", "RANGE_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONTE", "NT", "\\u", "RANGE_", ",_", "\"", "bytes", " ", "0", "-0", "/", "0", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "counts_", "(_", "self_", ",_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "counts_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "session_", "=_", "self_", "._", "get", "\\u", "session_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "session_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "send", "\\u", "response_", "(_", "httplib_", "._", "UNA", "UTH", "ORI", "ZED", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONNECTION", "_", ",_", "\"", "close", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "send", "\\u", "response_", "(_", "httplib_", "._", "OK_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONNECTION", "_", ",_", "\"", "close", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "HTTP", "\\u", "HEADER_", "._", "CONTE", "NT", "\\u", "TYPE_", ",_", "\"", "applica", "tion", "/", "json", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "match_", "=_", "re_", "._", "search_", "(_", "r", "\"\\\\", "d", "+\\\\", "-\\\\", "d", "+\\\\", "-\\\\", "d", "+\"_", ",_", "params_", "._", "get_", "(_", "\"", "from", "\"_", ",_", "\"\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "min", "\\u_", "=_", "datetime_", "._", "datetime_", "._", "strptime_", "(_", "match_", "._", "group_", "(_", "0_", ")_", ",_", "DAT", "E", "\\u", "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 ", " _", "min", "\\u_", "=_", "datetime_", "._", "datetime_", "._", "fromtimestamp_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "match_", "=_", "re_", "._", "search_", "(_", "r", "\"\\\\", "d", "+\\\\", "-\\\\", "d", "+\\\\", "-\\\\", "d", "+\"_", ",_", "params_", "._", "get_", "(_", "\"", "to", "\"_", ",_", "\"\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "max", "\\u_", "=_", "datetime_", "._", "datetime_", "._", "strptime_", "(_", "match_", "._", "group_", "(_", "0_", ")_", ",_", "DAT", "E", "\\u", "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 ", " _", "max", "\\u_", "=_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "min", "\\u_", "=_", "min", "\\u_", "._", "replace_", "(_", "hour_", "=_", "0_", ",_", "minute_", "=_", "0_", ",_", "second_", "=_", "0_", ",_", "microsecond_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u_", "=_", "max", "\\u_", "._", "replace_", "(_", "hour_", "=_", "23_", ",_", "minute_", "=_", "59_", ",_", "second_", "=_", "59_", ",_", "microsecond_", "=_", "999999", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "filepath_", "in_", "sorted_", "(_", "glob_", "._", "glob_", "(_", "os_", "._", "path_", "._", "join_", "(_", "config_", "._", "LOG", "\\u", "DIR_", ",_", "\"*", ".", "log", "\"_", ")_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "os_", "._", "path_", "._", "basename_", "(_", "filepath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "re_", "._", "search_", "(_", "r", "\"\\\\", "A", "\\\\", "d", "{", "4", "}-", "\\\\", "d", "{", "2", "}-", "\\\\", "d", "{", "2", "}\\\\.", "log", "\\\\", "Z", "\"_", ",_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "current_", "=_", "datetime_", "._", "datetime_", "._", "strptime_", "(_", "os_", "._", "path_", "._", "splitext_", "(_", "filename_", ")_", "[_", "0_", "]_", ",_", "DAT", "E", "\\u", "FORMAT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "config_", "._", "SHOW", "\\u", "DEBUG_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "traceback_", "._", "print", "\\u", "exc_", "(_", ")_", "\\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_", "min", "\\u_", "<=_", "current_", "<=_", "max", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "timestamp_", "=_", "int_", "(_", "time_", "._", "mktime_", "(_", "current_", "._", "timetuple_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "size_", "=_", "os_", "._", "path_", "._", "getsize_", "(_", "filepath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "filepath_", ",_", "\"", "rb", "\"_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "content_", "=_", "f_", "._", "read_", "(_", "io_", "._", "DEF", "AUL", "T", "\\u", "BUFF", "ER", "\\u", "SIZE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "size_", ">=_", "io_", "._", "DEF", "AUL", "T", "\\u", "BUFF", "ER", "\\u", "SIZE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "total_", "=_", "1.0_", "*_", "content_", "._", "count_", "(_", "'\\\\", "n", "'_", ")_", "*_", "size_", "/_", "io_", "._", "DEF", "AUL", "T", "\\u", "BUFF", "ER", "\\u", "SIZE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "counts_", "[_", "timestamp_", "]_", "=_", "int_", "(_", "round_", "(_", "total_", "/_", "100_", ")_", "*_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "counts_", "[_", "timestamp_", "]_", "=_", "content_", "._", "count_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "json_", "._", "dumps_", "(_", "counts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "SS", "LR", "eq", "Handler_", "(_", "Re", "q", "Handler_", ")_", ":_", "\\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 ", " _", "self_", "._", "connection_", "=_", "self_", "._", "request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rfile_", "=_", "socket_", "._", "\\u", "fileo", "bject_", "(_", "self_", "._", "request_", ",_", "\"", "rb", "\"_", ",_", "self_", "._", "rbu", "fsize_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wfile_", "=_", "socket_", "._", "\\u", "fileo", "bject_", "(_", "self_", "._", "request_", ",_", "\"", "wb", "\"_", ",_", "self_", "._", "wb", "uf", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "pem_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "server_", "=_", "SS", "LT", "hread", "ing", "Server_", "(_", "(_", "address_", "or_", "''_", ",_", "int_", "(_", "port_", ")_", "if_", "str_", "(_", "port_", "or_", "\"\"_", ")_", "._", "isdigit_", "(_", ")_", "else_", "0_", ")_", ",_", "pem_", ",_", "SS", "LR", "eq", "Handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "server_", "=_", "Thread", "ing", "Server_", "(_", "(_", "address_", "or_", "''_", ",_", "int_", "(_", "port_", ")_", "if_", "str_", "(_", "port_", "or_", "\"\"_", ")_", "._", "isdigit_", "(_", ")_", "else_", "0_", ")_", ",_", "Re", "q", "Handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "ex_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\"", "Address", " ", "alr", "ead", "y", " ", "in", " ", "use", "\"_", "in_", "str_", "(_", "ex_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exit_", "(_", "\"[", "!]", " ", "anot", "her", " ", "instance", " ", "alr", "ead", "y", " ", "runn", "ing", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "\"", "Name", " ", "or", " ", "service", " ", "not", " ", "know", "n", "\"_", "in_", "str_", "(_", "ex_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exit_", "(_", "\"[", "!]", " ", "invalid", " ", "configura", "tion", " ", "value", " ", "for", " ", "'", "HTTP", "\\u", "ADDR", "ESS", "'", " ", "('", "%", "s", "')\"_", "%_", "config_", "._", "HTTP", "\\u", "ADDRESS_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "\"", "Cann", "ot", " ", "assign", " ", "request", "ed", " ", "address", "\"_", "in_", "str_", "(_", "ex_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exit_", "(_", "\"[", "!]", " ", "can", "'", "t", " ", "use", " ", "configura", "tion", " ", "value", " ", "for", " ", "'", "HTTP", "\\u", "ADDR", "ESS", "'", " ", "('", "%", "s", "')\"_", "%_", "config_", "._", "HTTP", "\\u", "ADDRESS_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"[", "i", "]", " ", "startin", "g", " ", "HTTP", "%", "s", " ", "server", " ", "at", " ", "'", "http", "%", "s", "://", "%", "s", ":", "%", "d", "/'", "\"_", "%_", "(_", "'", "S", "'_", "if_", "pem_", "else_", "\"\"_", ",_", "'", "s", "'_", "if_", "pem_", "else_", "\"\"_", ",_", "server_", "._", "server", "\\u", "address_", "[_", "0_", "]_", ",_", "server_", "._", "server", "\\u", "address_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"[", "o", "]", " ", "runn", "ing", "...\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "join_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "server_", "._", "serve", "\\u", "forever_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thread_", "=_", "threading_", "._", "Thread_", "(_", "target_", "=_", "server_", "._", "serve", "\\u", "forever_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "thread_", "._", "daemon_", "=_", "True_", "\\u\\u\\u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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Testing equality to None
katharosada/botchallenge/client/botchallenge/robot.py
[ { "content": " def direction(self, other):\n \"\"\"Find the direction (North, South, East or West) of the other\n location from this one.\"\"\"\n if other == None:\n return None\n loc = [0, 0, 0]\n loc[0] = other.x_coord - self.x_coord\n loc[1] = other.y_coord - self.y_coord\n loc[2] = other.z_coord - self.z_coord\n max_value = max(list(map(abs, loc)))\n max_direction = 0\n if max_value in loc:\n max_direction = loc.index(max_value)\n else:\n max_direction = loc.index(-1 * max_value)\n # check up/down first\n if max_direction == 1:\n if loc[1] > 0:\n return Dir.UP\n return Dir.DOWN\n if max_direction == 0:\n if loc[0] > 0:\n return Dir.EAST\n return Dir.WEST\n if loc[2] > 0:\n return Dir.SOUTH\n return Dir.NORTH", "metadata": "root.Location.direction", "header": "['class', 'Location', '(', 'object', ')', ':', '___EOS___']", "index": 197 } ]
[ { "span": "other == None:", "start_line": 200, "start_column": 11, "end_line": 200, "end_column": 24 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "Location_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "direction_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fin", "d", " ", "the", " ", "direction", " ", "(", "North", ",", " ", "South", ",", " ", "Eas", "t", " ", "or", " ", "West", ")", " ", "of", " ", "the", " ", "other", "\\", "10", ";", " ", " ", " ", " ", "location", " ", "from", " ", "this", " ", "one", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "other_", "==_", "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_", "loc_", "=_", "[_", "0_", ",_", "0_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loc_", "[_", "0_", "]_", "=_", "other_", "._", "x", "\\u", "coord_", "-_", "self_", "._", "x", "\\u", "coord_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loc_", "[_", "1_", "]_", "=_", "other_", "._", "y", "\\u", "coord_", "-_", "self_", "._", "y", "\\u", "coord_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loc_", "[_", "2_", "]_", "=_", "other_", "._", "z", "\\u", "coord_", "-_", "self_", "._", "z", "\\u", "coord_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "value_", "=_", "max_", "(_", "list_", "(_", "map_", "(_", "abs_", ",_", "loc_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "direction_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "max", "\\u", "value_", "in_", "loc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "max", "\\u", "direction_", "=_", "loc_", "._", "index_", "(_", "max", "\\u", "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 ", " _", "max", "\\u", "direction_", "=_", "loc_", "._", "index_", "(_", "-_", "1_", "*_", "max", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "check", " ", "up", "/", "down", " ", "first_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "max", "\\u", "direction_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "loc_", "[_", "1_", "]_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Dir_", "._", "UP_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Dir_", "._", "DOWN_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "max", "\\u", "direction_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "loc_", "[_", "0_", "]_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Dir_", "._", "EAS", "T_", "\\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 ]
Variable defined multiple times
EliotBerriot/django-dynamic-preferences/tests/tests.py
[ { "content": " def test_can_cache_single_preference(self):\n\n manager = global_preferences_registry.manager()\n v = manager['no_section']\n with self.assertNumQueries(0):\n v = manager['no_section']\n v = manager['no_section']\n v = manager['no_section']", "metadata": "root.TestModels.test_can_cache_single_preference", "header": "['class', 'TestModels', '(', 'BaseTest', ',', 'TestCase', ')', ':', '___EOS___']", "index": 91 }, { "content": " def test_global_preferences_manager_by_name(self):\n manager = global_preferences_registry.manager()\n self.assertEqual(manager.by_name()['max_users'], manager['user__max_users'])\n self.assertEqual(len(manager.all()), len(manager.by_name()))", "metadata": "root.TestModels.test_global_preferences_manager_by_name", "header": "['class', 'TestModels', '(', 'BaseTest', ',', 'TestCase', ')', ':', '___EOS___']", "index": 129 }, { "content": " def test_global_preferences_manager_by_name(self):\n manager = global_preferences_registry.manager()\n self.assertEqual(manager.by_name()['max_users'], manager['user__max_users'])\n self.assertEqual(len(manager.all()), len(manager.by_name()))", "metadata": "root.TestModels.test_global_preferences_manager_by_name", "header": "['class', 'TestModels', '(', 'BaseTest', ',', 'TestCase', ')', ':', '___EOS___']", "index": 134 } ]
[ { "span": "v ", "start_line": 94, "start_column": 8, "end_line": 94, "end_column": 9 }, { "span": "v ", "start_line": 96, "start_column": 12, "end_line": 96, "end_column": 13 }, { "span": "v ", "start_line": 97, "start_column": 12, "end_line": 97, "end_column": 13 }, { "span": "test_global_preferences_manager_by_name(", "start_line": 129, "start_column": 8, "end_line": 129, "end_column": 47 } ]
[ { "span": "test_global_preferences_manager_by_name(", "start_line": 134, "start_column": 8, "end_line": 134, "end_column": 47 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Test", "Models_", "(_", "Base", "Test_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "can", "\\u", "cache", "\\u", "single", "\\u", "preference_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "manager_", "=_", "global", "\\u", "preference", "s", "\\u", "registry_", "._", "manager_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "manager_", "[_", "'", "no", "\\u", "section", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Num", "Querie", "s_", "(_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "manager_", "[_", "'", "no", "\\u", "section", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "manager_", "[_", "'", "no", "\\u", "section", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "manager_", "[_", "'", "no", "\\u", "section", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Models_", "(_", "Base", "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", "global", "\\u", "preference", "s", "\\u", "manage", "r", "\\u", "by", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "manager_", "=_", "global", "\\u", "preference", "s", "\\u", "registry_", "._", "manager_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "manager_", "._", "by", "\\u", "name_", "(_", ")_", "[_", "'", "max", "\\u", "users", "'_", "]_", ",_", "manager_", "[_", "'", "user", "\\u\\u", "max", "\\u", "users", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "manager_", "._", "all_", "(_", ")_", ")_", ",_", "len_", "(_", "manager_", "._", "by", "\\u", "name_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Models_", "(_", "Base", "Test_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "global", "\\u", "preference", "s", "\\u", "manage", "r", "\\u", "by", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "manager_", "=_", "global", "\\u", "preference", "s", "\\u", "registry_", "._", "manager_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "manager_", "._", "by", "\\u", "name_", "(_", ")_", "[_", "'", "max", "\\u", "users", "'_", "]_", ",_", "manager_", "[_", "'", "user", "\\u\\u", "max", "\\u", "users", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "manager_", "._", "all_", "(_", ")_", ")_", ",_", "len_", "(_", "manager_", "._", "by", "\\u", "name_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_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# Copyright (C) 2000-2001 Pete Shinners\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Library General Public\n# License as published by the Free Software Foundation; either\n# version 2 of the License, or (at your option) any later version.\n#\n# This library is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n# Library General Public License for more details.\n#\n# You should have received a copy of the GNU Library General Public\n# License along with this library; if not, write to the Free\n# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n#\n# Pete Shinners\n# [email protected]\n\n\"\"\"Top-level Pygame module.\n\nPygame is a set of Python modules designed for writing games.\nIt is written on top of the excellent SDL library. This allows you\nto create fully featured games and multimedia programs in the Python\nlanguage. The package is highly portable, with games running on\nWindows, MacOS, OS X, BeOS, FreeBSD, IRIX, and Linux.\n\"\"\"\n\nfrom __future__ import division, print_function, unicode_literals\nimport six\n\n__docformat__ = 'restructuredtext'\n__version__ = '$Id: __init__.py 899 2006-08-04 16:52:18Z aholkner $'\n\nimport os\nimport sys\n\n\n\n# we need to import like this, each at a time. the cleanest way to import\n# our modules is with the import command (not the __import__ function)\n\n# first, the \"required\" modules\n# from pygame.array import *\nfrom cocos.audio.pygame.base import *\nfrom cocos.audio.pygame.version import *\n__version__ = ver\n\n# next, the \"standard\" modules\n# we still allow them to be missing for stripped down pygame distributions\n\ntry:\n import cocos.audio.pygame.mixer\nexcept (ImportError, IOError) as msg:\n mixer = MissingModule(\"mixer\", msg, 0)\n\n# there's also a couple \"internal\" modules not needed\n# by users, but putting them here helps \"dependency finder\"\n# programs get everything they need (like py2exe)\n\ntry:\n import cocos.audio.pygame.mixer_music\n del cocos.audio.pygame.mixer_music\nexcept (ImportError, IOError):\n pass\n\n# cleanup namespace\ndel os, sys, # TODO rwobject, surflock, MissingModule, copy_reg\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class MissingModule:\n\n\n if six.PY2:\n else:\n", "metadata": "root.MissingModule", "header": "['module', '___EOS___']", "index": 39 }, { "content": " def __init__(self, name, info='', urgent=0):\n self.name = name\n self.info = str(info)\n self.urgent = urgent\n if urgent:\n self.warn()", "metadata": "root.MissingModule.__init__", "header": "['class', 'MissingModule', ':', '___EOS___']", "index": 40 }, { "content": " def __getattr__(self, var):\n if not self.urgent:\n self.warn()\n self.urgent = 1\n MissingPygameModule = \"%s module not available\" % self.name\n raise NotImplementedError(MissingPygameModule)", "metadata": "root.MissingModule.__getattr__", "header": "['class', 'MissingModule', ':', '___EOS___']", "index": 47 }, { "content": " def __nonzero__(self):\n return 0", "metadata": "root.MissingModule.__nonzero__", "header": "['class', 'MissingModule', ':', '___EOS___']", "index": 55 }, { "content": " def __bool__(self):\n return 0", "metadata": "root.MissingModule.__bool__", "header": "['class', 'MissingModule', ':', '___EOS___']", "index": 58 }, { "content": " def warn(self):\n if self.urgent:\n type = 'import'\n else:\n type = 'use'\n message = '%s %s: %s' % (type, self.name, self.info)\n try:\n import warnings\n if self.urgent:\n level = 4\n else:\n level = 3\n warnings.warn(message, RuntimeWarning, level)\n except ImportError:\n print(message)", "metadata": "root.MissingModule.warn", "header": "['class', 'MissingModule', ':', '___EOS___']", "index": 61 } ]
[ { "span": "import os", "start_line": 35, "start_column": 0, "end_line": 35, "end_column": 9 }, { "span": "import sys", "start_line": 36, "start_column": 0, "end_line": 36, "end_column": 10 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "pyga", "me", " ", "-", " ", "Pyth", "on", " ", "Game", " ", "Library_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2000", "-", "200", "1", " ", " ", "Pet", "e", " ", "Shi", "nne", "rs_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "librar", "y", " ", "is", " ", "free", " ", "software", ";", " ", "you", " ", "can", " ", "redis", "tribut", "e", " ", "it", " ", "and", "/", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "modif", "y", " ", "it", " ", "under", " ", "the", " ", "term", "s", " ", "of", " ", "the", " ", "GN", "U", " ", "Libr", "ary", " ", "General", " ", "Public", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", " ", "as", " ", "publi", "shed", " ", "by", " ", "the", " ", "Free", " ", "Sof", "twa", "re", " ", "Foun", "dati", "on", ";", " ", "eit", "her_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "version", " ", "2", " ", "of", " ", "the", " ", "License", ",", " ", "or", " ", "(", "at", " ", "your", " ", "option", ")", " ", "any", " ", "late", "r", " ", "version", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "librar", "y", " ", "is", " ", "distributed", " ", "in", " ", "the", " ", "hop", "e", " ", "tha", "t", " ", "it", " ", "will", " ", "be", " ", "usef", "ul", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "but", " ", "WITH", "OUT", " ", "ANY", " ", "WAR", "RAN", "TY", ";", " ", "with", "out", " ", "even", " ", "the", " ", "impli", "ed", " ", "warr", "ant", "y", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "or", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", ".", " ", " ", "See", " ", "the", " ", "GN", "U_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Libr", "ary", " ", "General", " ", "Public", " ", "License", " ", "for", " ", "more", " ", "deta", "il", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "You", " ", "shou", "ld", " ", "have", " ", "receive", "d", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "GN", "U", " ", "Libr", "ary", " ", "General", " ", "Public", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", " ", "along", " ", "with", " ", "this", " ", "librar", "y", ";", " ", "if", " ", "not", ",", " ", "write", " ", "to", " ", "the", " ", "Free", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Foun", "dati", "on", ",", " ", "Inc", ".,", " ", "5", "9", " ", "Temp", "le", " ", "Place", ",", " ", "Suit", "e", " ", "330", ",", " ", "Bo", "ston", ",", " ", "MA", " ", " ", "0211", "1", "-1", "307", " ", " ", "USA", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pet", "e", " ", "Shi", "nne", "rs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pet", "e", "@", "shin", "ners", ".", "org_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Top", "-", "level", " ", "Pyg", "ame", " ", "module", ".", "\\", "10", ";", "\\", "10", ";", "Pyg", "ame", " ", "is", " ", "a", " ", "set", " ", "of", " ", "Pyth", "on", " ", "module", "s", " ", "design", "ed", " ", "for", " ", "writ", "ing", " ", "games", ".", "\\", "10", ";", "It", " ", "is", " ", "writt", "en", " ", "on", " ", "top", " ", "of", " ", "the", " ", "exce", "llen", "t", " ", "SDL", " ", "librar", "y", ".", " ", "Thi", "s", " ", "allow", "s", " ", "you", "\\", "10", ";", "to", " ", "create", " ", "full", "y", " ", "feature", "d", " ", "games", " ", "and", " ", "multim", "edia", " ", "program", "s", " ", "in", " ", "the", " ", "Pyth", "on", "\\", "10", ";", "language", ".", " ", "The", " ", "package", " ", "is", " ", "highl", "y", " ", "portab", "le", ",", " ", "with", " ", "games", " ", "runn", "ing", " ", "on", "\\", "10", ";", "Window", "s", ",", " ", "Mac", "OS", ",", " ", "OS", " ", "X", ",", " ", "Be", "OS", ",", " ", "Free", "BS", "D", ",", " ", "IRI", "X", ",", " ", "and", " ", "Lin", "ux", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "division_", ",_", "print", "\\u", "function_", ",_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "six_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "docformat", "\\u\\u_", "=_", "'", "restructur", "edt", "ext", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "version\\u\\u_", "=_", "'$", "Id", ":", " ", "\\u\\u", "init", "\\u\\u", ".", "py", " ", "899", " ", "2006", "-0", "8", "-0", "4", " ", "16", ":", "5", "2", ":", "1", "8", "Z", " ", "ah", "ol", "kne", "r", " ", "$'_", "\\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_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "need", " ", "to", " ", "import", " ", "like", " ", "this", ",", " ", "each", " ", "at", " ", "a", " ", "time", ".", " ", "the", " ", "clean", "est", " ", "way", " ", "to", " ", "import_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "our", " ", "module", "s", " ", "is", " ", "with", " ", "the", " ", "import", " ", "command", " ", "(", "not", " ", "the", " ", "\\u\\u", "import", "\\u\\u", " ", "function", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "first", ",", " ", "the", " ", "\"", "require", "d", "\"", " ", "modules_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "pyga", "me", ".", "array", " ", "import", " ", "*_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "coco", "s_", "._", "audio_", "._", "pygame_", "._", "base_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "coco", "s_", "._", "audio_", "._", "pygame_", "._", "version_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "version\\u\\u_", "=_", "ver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "next", ",", " ", "the", " ", "\"", "standard", "\"", " ", "modules_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "still", " ", "allow", " ", "them", " ", "to", " ", "be", " ", "missi", "ng", " ", "for", " ", "strip", "ped", " ", "down", " ", "pyga", "me", " ", "distributions_", "\\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 ", " _", "import_", "coco", "s_", "._", "audio_", "._", "pygame_", "._", "mixer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Import", "Error_", ",_", "IO", "Error_", ")_", "as_", "msg_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mixer_", "=_", "Missing", "Module_", "(_", "\"", "mixer", "\"_", ",_", "msg_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "there", "'", "s", " ", "als", "o", " ", "a", " ", "couple", " ", "\"", "internal", "\"", " ", "module", "s", " ", "not", " ", "needed_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "by", " ", "users", ",", " ", "but", " ", "put", "ting", " ", "them", " ", "here", " ", "helps", " ", "\"", "dependen", "cy", " ", "finde", "r", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "program", "s", " ", "get", " ", "every", "thing", " ", "the", "y", " ", "need", " ", "(", "like", " ", "py2", "exe", ")_", "\\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 ", " _", "import_", "coco", "s_", "._", "audio_", "._", "pygame_", "._", "mixer", "\\u", "music_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "coco", "s_", "._", "audio_", "._", "pygame_", "._", "mixer", "\\u", "music_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Import", "Error_", ",_", "IO", "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_", "#", " ", "clean", "up", " ", "namespace_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "del_", "os_", ",_", "sys_", ",_", "#", " ", "TOD", "O", " ", "rw", "object", ",", " ", "surf", "lock", ",", " ", "Missing", "Modul", "e", ",", " ", "copy", "\\u", "reg_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Missing", "Module_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "six_", "._", "PY", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Missing", "Module_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ",_", "info_", "=_", "''_", ",_", "urgen", "t_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "info_", "=_", "str_", "(_", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "urgen", "t_", "=_", "urgen", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "urgen", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "warn_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Missing", "Module_", ":_", "\\u\\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", "getattr\\u\\u_", "(_", "self_", ",_", "var_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "urgen", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "warn_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "urgen", "t_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Missing", "Pyg", "ame", "Module_", "=_", "\"%", "s", " ", "module", " ", "not", " ", "avail", "able", "\"_", "%_", "self_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "Missing", "Pyg", "ame", "Module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Missing", "Module_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "nonzero\\u", "\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Missing", "Module_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "bool\\u", "\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Missing", "Module_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "warn_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "urgen", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "type_", "=_", "'", "import", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "type_", "=_", "'", "use", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "message_", "=_", "'%", "s", " ", "%", "s", ":", " ", "%", "s", "'_", "%_", "(_", "type_", ",_", "self_", "._", "name_", ",_", "self_", "._", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "warnings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "urgen", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "level_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "level_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "warnings_", "._", "warn_", "(_", "message_", ",_", "Run", "time", "Warning_", ",_", "level_", ")_", "\\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_", "(_", "message_", ")_", "\\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,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*- coding: utf-8 -*-\n\"\"\"\n tipfyext.wtforms\n ~~~~~~~~~~~~~~~~~\n\n Enhanced WTForms form library support for tipfy.\n\n :copyright: 2011 WTForms authors.\n :copyright: 2011 tipfy.org.\n :copyright: 2009 Plurk Inc.\n :license: BSD, see LICENSE.txt for more details.\n\"\"\"\nfrom tipfy import REQUIRED_VALUE\nfrom tipfyext.wtforms import validators, widgets\nfrom tipfyext.wtforms.fields import *\nfrom tipfyext.wtforms.form import Form\nfrom tipfyext.wtforms.validators import ValidationError\n\n\n#: Default configuration values for this module. Keys are:\n#:\n#: - ``recaptcha_options``: A dictionary of options to customize the look of\n#: the reCAPTCHA widget. See a description of the available options in\n#: the `API docs <http://recaptcha.net/apidocs/captcha/client.html>`_.\n#:\n#: - ``recaptcha_use_ssl``: ``True`` to use SSL for ReCaptcha requests,\n#: ``False`` otherwise.\n#:\n#: - ``recaptcha_public_key``: Public key for ReCaptcha.\n#:\n#: - ``recaptcha_private_key``: Private key for ReCaptcha.\n#:\n#: - ``csrf_tokens``: Maximum number of CSRF protection tokens to store in\n#: session.\ndefault_config = {\n 'recaptcha_options': None,\n 'recaptcha_use_ssl': False,\n 'recaptcha_public_key': REQUIRED_VALUE,\n 'recaptcha_private_key': REQUIRED_VALUE,\n 'csrf_tokens': 5,\n}\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from tipfyext.wtforms import validators, widgets", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 48 }, { "span": "from tipfyext.wtforms.form import Form", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 38 }, { "span": "from tipfyext.wtforms.validators import ValidationError", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 55 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "tip", "fy", "ext", ".", "wtf", "orms", "\\", "10", ";", " ", " ", " ", " ", "~~~~~~~~~~~", "~~~~~", "~", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Enhance", "d", " ", "WT", "Form", "s", " ", "form", " ", "librar", "y", " ", "support", " ", "for", " ", "tip", "fy", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "copyr", "ight", ":", " ", "2011", " ", "WT", "Form", "s", " ", "author", "s", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "copyr", "ight", ":", " ", "2011", " ", "tip", "fy", ".", "org", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "copyr", "ight", ":", " ", "200", "9", " ", "Plur", "k", " ", "Inc", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "license", ":", " ", "BS", "D", ",", " ", "see", " ", "LICENSE", ".", "txt", " ", "for", " ", "more", " ", "deta", "il", "s", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tip", "fy_", "import_", "REQUIRE", "D", "\\u", "VALUE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tip", "fy", "ext_", "._", "wtforms_", "import_", "validators_", ",_", "widgets_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tip", "fy", "ext_", "._", "wtforms_", "._", "fields_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tip", "fy", "ext_", "._", "wtforms_", "._", "form_", "import_", "Form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tip", "fy", "ext_", "._", "wtforms_", "._", "validators_", "import_", "Validat", "ion", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", ":", " ", "Default", " ", "configura", "tion", " ", "values", " ", "for", " ", "this", " ", "module", ".", " ", "Keys", " ", "are", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", ":", " ", "-", " ", "``", "recap", "tcha", "\\u", "options", "``", ":", " ", "A", " ", "dictionar", "y", " ", "of", " ", "options", " ", "to", " ", "customize", " ", "the", " ", "look", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", ":", " ", " ", " ", "the", " ", "re", "CAPT", "CHA", " ", "widget", ".", " ", "See", " ", "a", " ", "description", " ", "of", " ", "the", " ", "avail", "able", " ", "options", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", ":", " ", " ", " ", "the", " ", "`", "API", " ", "docs", " ", "<", "http", "://", "recap", "tcha", ".", "net", "/", "apid", "ocs", "/", "captcha", "/", "client", ".", "html", ">`\\u", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", ":", " ", "-", " ", "``", "recap", "tcha", "\\u", "use", "\\u", "ssl", "``", ":", " ", "``", "Tru", "e", "``", " ", "to", " ", "use", " ", "SS", "L", " ", "for", " ", "Re", "Capt", "cha", " ", "request", "s", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", ":", " ", " ", " ", "``", "Fal", "se", "``", " ", "other", "wis", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", ":", " ", "-", " ", "``", "recap", "tcha", "\\u", "public", "\\u", "key", "``", ":", " ", "Public", " ", "key", " ", "for", " ", "Re", "Capt", "cha", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", ":", " ", "-", " ", "``", "recap", "tcha", "\\u", "private", "\\u", "key", "``", ":", " ", "Priva", "te", " ", "key", " ", "for", " ", "Re", "Capt", "cha", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", ":", " ", "-", " ", "``", "csr", "f", "\\u", "token", "s", "``", ":", " ", "Maxim", "um", " ", "number", " ", "of", " ", "CSRF", " ", "protection", " ", "token", "s", " ", "to", " ", "store", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", ":", " ", " ", " ", "session", "._", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "config_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "recap", "tcha", "\\u", "options", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "recap", "tcha", "\\u", "use", "\\u", "ssl", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "recap", "tcha", "\\u", "public", "\\u", "key", "'_", ":_", "REQUIRE", "D", "\\u", "VALUE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "recap", "tcha", "\\u", "private", "\\u", "key", "'_", ":_", "REQUIRE", "D", "\\u", "VALUE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "csr", "f", "\\u", "token", "s", "'_", ":_", "5_", ",_", "\\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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
uwdata/termite-data-server/web2py/applications-original/admin/controllers/default.py
[ { "content": "def site():\n \"\"\" Site handler \"\"\"\n\n myversion = request.env.web2py_version\n\n # Shortcut to make the elif statements more legible\n file_or_appurl = 'file' in request.vars or 'appurl' in request.vars\n\n class IS_VALID_APPNAME(object):\n def __call__(self, value):\n if not re.compile('^\\w+$').match(value):\n return (value, T('Invalid application name'))\n if not request.vars.overwrite and \\\n os.path.exists(os.path.join(apath(r=request), value)):\n return (value, T('Application exists already'))\n return (value, None)\n\n is_appname = IS_VALID_APPNAME()\n form_create = SQLFORM.factory(Field('name', requires=is_appname),\n table_name='appcreate')\n form_update = SQLFORM.factory(Field('name', requires=is_appname),\n Field('file', 'upload', uploadfield=False),\n Field('url'),\n Field('overwrite', 'boolean'),\n table_name='appupdate')\n form_create.process()\n form_update.process()\n\n if DEMO_MODE:\n pass\n\n elif form_create.accepted:\n # create a new application\n appname = cleanpath(form_create.vars.name)\n created, error = app_create(appname, request, info=True)\n if created:\n if MULTI_USER_MODE:\n db.app.insert(name=appname, owner=auth.user.id)\n log_progress(appname)\n session.flash = T('new application \"%s\" created', appname)\n redirect(URL('design', args=appname))\n else:\n session.flash = \\\n DIV(T('unable to create application \"%s\"', appname),\n PRE(error))\n redirect(URL(r=request))\n\n elif form_update.accepted:\n if (form_update.vars.url or '').endswith('.git'):\n if not have_git:\n session.flash = GIT_MISSING\n redirect(URL(r=request))\n target = os.path.join(apath(r=request), form_update.vars.name)\n try:\n new_repo = git.Repo.clone_from(form_update.vars.url, target)\n session.flash = T('new application \"%s\" imported',\n form_update.vars.name)\n except git.GitCommandError, err:\n session.flash = T('Invalid git repository specified.')\n redirect(URL(r=request))\n\n elif form_update.vars.url:\n # fetch an application via URL or file upload\n try:\n f = urllib.urlopen(form_update.vars.url)\n if f.code == 404:\n raise Exception(\"404 file not found\")\n except Exception, e:\n session.flash = \\\n DIV(T('Unable to download app because:'), PRE(str(e)))\n redirect(URL(r=request))\n fname = form_update.vars.url\n\n elif form_update.accepted and form_update.vars.file:\n fname = request.vars.file.filename\n f = request.vars.file.file\n\n else:\n session.flash = 'No file uploaded and no URL specified'\n redirect(URL(r=request))\n\n if f:\n appname = cleanpath(form_update.vars.name)\n installed = app_install(appname, f,\n request, fname,\n overwrite=form_update.vars.overwrite)\n if f and installed:\n msg = 'application %(appname)s installed with md5sum: %(digest)s'\n if MULTI_USER_MODE:\n db.app.insert(name=appname, owner=auth.user.id)\n log_progress(appname)\n session.flash = T(msg, dict(appname=appname,\n digest=md5_hash(installed)))\n elif f and form_update.vars.overwrite:\n msg = 'unable to install application \"%(appname)s\"'\n session.flash = T(msg, dict(appname=form_update.vars.name))\n else:\n msg = 'unable to install application \"%(appname)s\"'\n session.flash = T(msg, dict(appname=form_update.vars.name))\n redirect(URL(r=request))\n\n regex = re.compile('^\\w+$')\n\n if is_manager():\n apps = [f for f in os.listdir(apath(r=request)) if regex.match(f)]\n else:\n apps = [f.name for f in db(db.app.owner == auth.user_id).select()]\n\n if FILTER_APPS:\n apps = [f for f in apps if f in FILTER_APPS]\n\n apps = sorted(apps, lambda a, b: cmp(a.upper(), b.upper()))\n myplatform = platform.python_version()\n return dict(app=None, apps=apps, myversion=myversion, myplatform=myplatform,\n form_create=form_create, form_update=form_update)", "metadata": "root.site", "header": "['module', '___EOS___']", "index": 201 }, { "content": "def uninstall():\n app = get_app()\n\n dialog = FORM.confirm(T('Uninstall'),\n {T('Cancel'): URL('site')})\n dialog['_id'] = 'confirm_form'\n dialog['_class'] = 'well'\n for component in dialog.components:\n component['_class'] = 'btn'\n\n if dialog.accepted:\n if MULTI_USER_MODE:\n if is_manager() and db(db.app.name == app).delete():\n pass\n elif db(db.app.name == app)(db.app.owner == auth.user.id).delete():\n pass\n else:\n session.flash = T('no permission to uninstall \"%s\"', app)\n redirect(URL('site'))\n try:\n filename = app_pack(app, request, raise_ex=True)\n except:\n session.flash = T('unable to uninstall \"%s\"', app)\n else:\n if app_uninstall(app, request):\n session.flash = T('application \"%s\" uninstalled', app)\n else:\n session.flash = T('unable to uninstall \"%s\"', app)\n redirect(URL('site'))\n return dict(app=app, dialog=dialog)", "metadata": "root.uninstall", "header": "['module', '___EOS___']", "index": 413 }, { "content": "def edit():\n \"\"\" File edit handler \"\"\"\n # Load json only if it is ajax edited...\n app = get_app(request.vars.app)\n app_path = apath(app, r=request)\n preferences={'theme':'web2py', 'editor': 'default', 'closetag': 'true', 'codefolding': 'false', 'tabwidth':'4', 'indentwithtabs':'false', 'linenumbers':'true', 'highlightline':'true'}\n config = Config(os.path.join(request.folder, 'settings.cfg'),\n section='editor', default_values={})\n preferences.update(config.read())\n\n if not(request.ajax) and not(is_mobile):\n # return the scaffolding, the rest will be through ajax requests\n response.title = T('Editing %s') % app\n return response.render ('default/edit.html', dict(app=app, editor_settings=preferences))\n\n # show settings tab and save prefernces\n if 'settings' in request.vars:\n if request.post_vars: #save new preferences\n post_vars = request.post_vars.items()\n # Since unchecked checkbox are not serialized, we must set them as false by hand to store the correct preference in the settings \n post_vars+= [(opt, 'false') for opt in preferences if opt not in request.post_vars ]\n if config.save(post_vars):\n response.headers[\"web2py-component-flash\"] = T('Preferences saved correctly')\n else:\n response.headers[\"web2py-component-flash\"] = T('Preferences saved on session only')\n response.headers[\"web2py-component-command\"] = \"update_editor(%s);$('a[href=#editor_settings] button.close').click();\" % response.json(config.read())\n return\n else:\n details = {'realfilename':'settings', 'filename':'settings', 'id':'editor_settings', 'force': False}\n details['plain_html'] = response.render('default/editor_settings.html', {'editor_settings':preferences})\n return response.json(details)\n\n \"\"\" File edit handler \"\"\"\n # Load json only if it is ajax edited...\n app = get_app(request.vars.app)\n filename = '/'.join(request.args)\n realfilename = request.args[-1]\n if request.vars.app:\n path = abspath(filename)\n else:\n path = apath(filename, r=request)\n # Try to discover the file type\n if filename[-3:] == '.py':\n filetype = 'python'\n elif filename[-5:] == '.html':\n filetype = 'html'\n elif filename[-5:] == '.load':\n filetype = 'html'\n elif filename[-4:] == '.css':\n filetype = 'css'\n elif filename[-3:] == '.js':\n filetype = 'javascript'\n else:\n filetype = 'html'\n\n # ## check if file is not there\n if ('revert' in request.vars) and os.path.exists(path + '.bak'):\n try:\n data = safe_read(path + '.bak')\n data1 = safe_read(path)\n except IOError:\n session.flash = T('Invalid action')\n if 'from_ajax' in request.vars:\n return response.json({'error': str(T('Invalid action'))})\n else:\n redirect(URL('site'))\n\n safe_write(path, data)\n file_hash = md5_hash(data)\n saved_on = time.ctime(os.stat(path)[stat.ST_MTIME])\n safe_write(path + '.bak', data1)\n response.flash = T('file \"%s\" of %s restored', (filename, saved_on))\n else:\n try:\n data = safe_read(path)\n except IOError:\n session.flash = T('Invalid action')\n if 'from_ajax' in request.vars:\n return response.json({'error': str(T('Invalid action'))})\n else:\n redirect(URL('site'))\n\n lineno_old = count_lines(data)\n file_hash = md5_hash(data)\n saved_on = time.ctime(os.stat(path)[stat.ST_MTIME])\n\n if request.vars.file_hash and request.vars.file_hash != file_hash:\n session.flash = T('file changed on disk')\n data = request.vars.data.replace('\\r\\n', '\\n').strip() + '\\n'\n safe_write(path + '.1', data)\n if 'from_ajax' in request.vars:\n return response.json({'error': str(T('file changed on disk')),\n 'redirect': URL('resolve',\n args=request.args)})\n else:\n redirect(URL('resolve', args=request.args))\n elif request.vars.data:\n safe_write(path + '.bak', data)\n data = request.vars.data.replace('\\r\\n', '\\n').strip() + '\\n'\n safe_write(path, data)\n lineno_new = count_lines(data)\n log_progress(\n app, 'EDIT', filename, progress=lineno_new - lineno_old)\n file_hash = md5_hash(data)\n saved_on = time.ctime(os.stat(path)[stat.ST_MTIME])\n response.flash = T('file saved on %s', saved_on)\n\n data_or_revert = (request.vars.data or request.vars.revert)\n\n # Check compile errors\n highlight = None\n if filetype == 'python' and request.vars.data:\n import _ast\n try:\n code = request.vars.data.rstrip().replace('\\r\\n', '\\n') + '\\n'\n compile(code, path, \"exec\", _ast.PyCF_ONLY_AST)\n except Exception, e:\n # offset calculation is only used for textarea (start/stop)\n start = sum([len(line) + 1 for l, line\n in enumerate(request.vars.data.split(\"\\n\"))\n if l < e.lineno - 1])\n if e.text and e.offset:\n offset = e.offset - (len(e.text) - len(\n e.text.splitlines()[-1]))\n else:\n offset = 0\n highlight = {'start': start, 'end': start +\n offset + 1, 'lineno': e.lineno, 'offset': offset}\n try:\n ex_name = e.__class__.__name__\n except:\n ex_name = 'unknown exception!'\n response.flash = DIV(T('failed to compile file because:'), BR(),\n B(ex_name), ' ' + T('at line %s', e.lineno),\n offset and ' ' +\n T('at char %s', offset) or '',\n PRE(str(e)))\n if data_or_revert and request.args[1] == 'modules':\n # Lets try to reload the modules\n try:\n mopath = '.'.join(request.args[2:])[:-3]\n exec 'import applications.%s.modules.%s' % (\n request.args[0], mopath)\n reload(sys.modules['applications.%s.modules.%s'\n % (request.args[0], mopath)])\n except Exception, e:\n response.flash = DIV(\n T('failed to reload module because:'), PRE(str(e)))\n\n edit_controller = None\n editviewlinks = None\n view_link = None\n if filetype == 'html' and len(request.args) >= 3:\n cfilename = os.path.join(request.args[0], 'controllers',\n request.args[2] + '.py')\n if os.path.exists(apath(cfilename, r=request)):\n edit_controller = URL('edit', args=[cfilename.replace(os.sep, \"/\")])\n view = request.args[3].replace('.html', '')\n view_link = URL(request.args[0], request.args[2], view)\n elif filetype == 'python' and request.args[1] == 'controllers':\n ## it's a controller file.\n ## Create links to all of the associated view files.\n app = get_app()\n viewname = os.path.splitext(request.args[2])[0]\n viewpath = os.path.join(app, 'views', viewname)\n aviewpath = apath(viewpath, r=request)\n viewlist = []\n if os.path.exists(aviewpath):\n if os.path.isdir(aviewpath):\n viewlist = glob(os.path.join(aviewpath, '*.html'))\n elif os.path.exists(aviewpath + '.html'):\n viewlist.append(aviewpath + '.html')\n if len(viewlist):\n editviewlinks = []\n for v in viewlist:\n vf = os.path.split(v)[-1]\n vargs = \"/\".join([viewpath.replace(os.sep, \"/\"), vf])\n editviewlinks.append(A(vf.split(\".\")[0],\n _class=\"editor_filelink\",\n _href=URL('edit', args=[vargs])))\n\n if len(request.args) > 2 and request.args[1] == 'controllers':\n controller = (request.args[2])[:-3]\n functions = find_exposed_functions(data)\n else:\n (controller, functions) = (None, None)\n\n if 'from_ajax' in request.vars:\n return response.json({'file_hash': file_hash, 'saved_on': saved_on, 'functions': functions, 'controller': controller, 'application': request.args[0], 'highlight': highlight})\n else:\n file_details = dict(app=request.args[0],\n lineno=request.vars.lineno or 1,\n editor_settings=preferences,\n filename=filename,\n realfilename=realfilename,\n filetype=filetype,\n data=data,\n edit_controller=edit_controller,\n file_hash=file_hash,\n saved_on=saved_on,\n controller=controller,\n functions=functions,\n view_link=view_link,\n editviewlinks=editviewlinks,\n id=IS_SLUG()(filename)[0],\n force= True if (request.vars.restore or \n request.vars.revert) else False)\n plain_html = response.render('default/edit_js.html', file_details)\n file_details['plain_html'] = plain_html\n if is_mobile:\n return response.render('default.mobile/edit.html', \n file_details, editor_settings=preferences)\n else:\n return response.json(file_details)", "metadata": "root.edit", "header": "['module', '___EOS___']", "index": 572 }, { "content": "def todolist():\n \"\"\" Returns all TODO of the requested app\n \"\"\"\n app = request.vars.app or ''\n app_path = apath('%(app)s' % {'app':app}, r=request)\n dirs=['models', 'controllers', 'modules', 'private' ]\n def listfiles(app, dir, regexp='.*\\.py$'):\n files = sorted( listdir(apath('%(app)s/%(dir)s/' % {'app':app, 'dir':dir}, r=request), regexp))\n files = [x.replace(os.path.sep, '/') for x in files if not x.endswith('.bak')]\n return files\n\n pattern = '#\\s*(todo)+\\s+(.*)'\n regex = re.compile(pattern, re.IGNORECASE)\n\n output = []\n for d in dirs:\n for f in listfiles(app, d):\n matches = []\n filename= apath(os.path.join(app, d, f), r=request)\n with open(filename, 'r') as f_s:\n src = f_s.read()\n for m in regex.finditer(src):\n start = m.start()\n lineno = src.count('\\n', 0, start) + 1\n matches.append({'text':m.group(0), 'lineno':lineno})\n if len(matches) != 0:\n output.append({'filename':f,'matches':matches, 'dir':d})\n\n return {'todo':output, 'app': app}", "metadata": "root.todolist", "header": "['module', '___EOS___']", "index": 787 }, { "content": "def edit_language():\n \"\"\" Edit language file \"\"\"\n app = get_app()\n filename = '/'.join(request.args)\n response.title = request.args[-1]\n strings = read_dict(apath(filename, r=request))\n\n if '__corrupted__' in strings:\n form = SPAN(strings['__corrupted__'], _class='error')\n return dict(filename=filename, form=form)\n\n keys = sorted(strings.keys(), lambda x, y: cmp(\n unicode(x, 'utf-8').lower(), unicode(y, 'utf-8').lower()))\n rows = []\n rows.append(H2(T('Original/Translation')))\n\n for key in keys:\n name = md5_hash(key)\n s = strings[key]\n (prefix, sep, key) = key.partition('\\x01')\n if sep:\n prefix = SPAN(prefix + ': ', _class='tm_ftag')\n k = key\n else:\n (k, prefix) = (prefix, '')\n\n _class = 'untranslated' if k == s else 'translated'\n\n if len(s) <= 40:\n elem = INPUT(_type='text', _name=name, value=s,\n _size=70, _class=_class)\n else:\n elem = TEXTAREA(_name=name, value=s, _cols=70,\n _rows=5, _class=_class)\n\n # Making the short circuit compatible with <= python2.4\n k = (s != k) and k or B(k)\n\n new_row = DIV(LABEL(prefix, k, _style=\"font-weight:normal;\"),\n CAT(elem, '\\n', TAG.BUTTON(\n T('delete'),\n _onclick='return delkey(\"%s\")' % name,\n _class='btn')), _id=name, _class='span6 well well-small')\n\n rows.append(DIV(new_row,_class=\"row-fluid\"))\n rows.append(DIV(INPUT(_type='submit', _value=T('update'), _class=\"btn btn-primary\"), _class='controls'))\n form = FORM(*rows)\n if form.accepts(request.vars, keepvalues=True):\n strs = dict()\n for key in keys:\n name = md5_hash(key)\n if form.vars[name] == chr(127):\n continue\n strs[key] = form.vars[name]\n write_dict(apath(filename, r=request), strs)\n session.flash = T('file saved on %(time)s', dict(time=time.ctime()))\n redirect(URL(r=request, args=request.args))\n return dict(app=request.args[0], filename=filename, form=form)", "metadata": "root.edit_language", "header": "['module', '___EOS___']", "index": 899 }, { "content": "def edit_plurals():\n \"\"\" Edit plurals file \"\"\"\n app = get_app()\n filename = '/'.join(request.args)\n plurals = read_plural_dict(\n apath(filename, r=request)) # plural forms dictionary\n nplurals = int(request.vars.nplurals) - 1 # plural forms quantity\n xnplurals = xrange(nplurals)\n\n if '__corrupted__' in plurals:\n # show error message and exit\n form = SPAN(plurals['__corrupted__'], _class='error')\n return dict(filename=filename, form=form)\n\n keys = sorted(plurals.keys(), lambda x, y: cmp(\n unicode(x, 'utf-8').lower(), unicode(y, 'utf-8').lower()))\n tab_rows = []\n for key in keys:\n name = md5_hash(key)\n forms = plurals[key]\n\n if len(forms) < nplurals:\n forms.extend(None for i in xrange(nplurals - len(forms)))\n tab_col1 = DIV(CAT(LABEL(T(\"Singular Form\")), B(key,\n _class='fake-input')))\n tab_inputs = [SPAN(LABEL(T(\"Plural Form #%s\", n + 1)), INPUT(_type='text', _name=name + '_' + str(n), value=forms[n], _size=20), _class='span6') for n in xnplurals]\n tab_col2 = DIV(CAT(*tab_inputs))\n tab_col3 = DIV(CAT(LABEL(XML('&nbsp;')), TAG.BUTTON(T('delete'), _onclick='return delkey(\"%s\")' % name, _class='btn'), _class='span6'))\n tab_row = DIV(DIV(tab_col1, '\\n', tab_col2, '\\n', tab_col3, _class='well well-small'), _id=name, _class='row-fluid tab_row')\n tab_rows.append(tab_row)\n\n tab_rows.append(DIV(TAG['button'](T('update'), _type='submit',\n _class='btn btn-primary'),\n _class='controls'))\n tab_container = DIV(*tab_rows, **dict(_class=\"row-fluid\"))\n\n form = FORM(tab_container)\n if form.accepts(request.vars, keepvalues=True):\n new_plurals = dict()\n for key in keys:\n name = md5_hash(key)\n if form.vars[name + '_0'] == chr(127):\n continue\n new_plurals[key] = [form.vars[name + '_' + str(n)]\n for n in xnplurals]\n write_plural_dict(apath(filename, r=request), new_plurals)\n session.flash = T('file saved on %(time)s', dict(time=time.ctime()))\n redirect(URL(r=request, args=request.args, vars=dict(\n nplurals=request.vars.nplurals)))\n return dict(app=request.args[0], filename=filename, form=form)", "metadata": "root.edit_plurals", "header": "['module', '___EOS___']", "index": 959 }, { "content": "def errors():\n \"\"\" Error handler \"\"\"\n import operator\n import os\n import pickle\n import hashlib\n\n app = get_app()\n if is_gae:\n method = 'dbold' if ('old' in\n (request.args(1) or '')) else 'dbnew'\n else:\n method = request.args(1) or 'new'\n db_ready = {}\n db_ready['status'] = get_ticket_storage(app)\n db_ready['errmessage'] = T(\n \"No ticket_storage.txt found under /private folder\")\n db_ready['errlink'] = \"http://web2py.com/books/default/chapter/29/13#Collecting-tickets\"\n\n if method == 'new':\n errors_path = apath('%s/errors' % app, r=request)\n\n delete_hashes = []\n for item in request.vars:\n if item[:7] == 'delete_':\n delete_hashes.append(item[7:])\n\n hash2error = dict()\n\n for fn in listdir(errors_path, '^[a-fA-F0-9.\\-]+$'):\n fullpath = os.path.join(errors_path, fn)\n if not os.path.isfile(fullpath):\n continue\n try:\n fullpath_file = open(fullpath, 'r')\n try:\n error = pickle.load(fullpath_file)\n finally:\n fullpath_file.close()\n except IOError:\n continue\n except EOFError:\n continue\n\n hash = hashlib.md5(error['traceback']).hexdigest()\n\n if hash in delete_hashes:\n os.unlink(fullpath)\n else:\n try:\n hash2error[hash]['count'] += 1\n except KeyError:\n error_lines = error['traceback'].split(\"\\n\")\n last_line = error_lines[-2] if len(error_lines)>1 else 'unknown'\n error_causer = os.path.split(error['layer'])[1]\n hash2error[hash] = dict(count=1, pickel=error,\n causer=error_causer,\n last_line=last_line,\n hash=hash, ticket=fn)\n\n decorated = [(x['count'], x) for x in hash2error.values()]\n decorated.sort(key=operator.itemgetter(0), reverse=True)\n\n return dict(errors=[x[1] for x in decorated], app=app, method=method, db_ready=db_ready)\n\n elif method == 'dbnew':\n errors_path = apath('%s/errors' % app, r=request)\n tk_db, tk_table = get_ticket_storage(app)\n\n delete_hashes = []\n for item in request.vars:\n if item[:7] == 'delete_':\n delete_hashes.append(item[7:])\n\n hash2error = dict()\n\n for fn in tk_db(tk_table.id > 0).select():\n try:\n error = pickle.loads(fn.ticket_data)\n hash = hashlib.md5(error['traceback']).hexdigest()\n\n if hash in delete_hashes:\n tk_db(tk_table.id == fn.id).delete()\n tk_db.commit()\n else:\n try:\n hash2error[hash]['count'] += 1\n except KeyError:\n error_lines = error['traceback'].split(\"\\n\")\n last_line = error_lines[-2]\n error_causer = os.path.split(error['layer'])[1]\n hash2error[hash] = dict(count=1,\n pickel=error, causer=error_causer,\n last_line=last_line, hash=hash,\n ticket=fn.ticket_id)\n except AttributeError, e:\n tk_db(tk_table.id == fn.id).delete()\n tk_db.commit()\n\n decorated = [(x['count'], x) for x in hash2error.values()]\n decorated.sort(key=operator.itemgetter(0), reverse=True)\n return dict(errors=[x[1] for x in decorated], app=app,\n method=method, db_ready=db_ready)\n\n elif method == 'dbold':\n tk_db, tk_table = get_ticket_storage(app)\n for item in request.vars:\n if item[:7] == 'delete_':\n tk_db(tk_table.ticket_id == item[7:]).delete()\n tk_db.commit()\n tickets_ = tk_db(tk_table.id > 0).select(tk_table.ticket_id,\n tk_table.created_datetime,\n orderby=~tk_table.created_datetime)\n tickets = [row.ticket_id for row in tickets_]\n times = dict([(row.ticket_id, row.created_datetime) for\n row in tickets_])\n return dict(app=app, tickets=tickets, method=method,\n times=times, db_ready=db_ready)\n\n else:\n for item in request.vars:\n # delete_all rows doesn't contain any ticket\n # Remove anything else as requested\n if item[:7] == 'delete_' and (not item == \"delete_all}\"):\n os.unlink(apath('%s/errors/%s' % (app, item[7:]), r=request))\n func = lambda p: os.stat(apath('%s/errors/%s' %\n (app, p), r=request)).st_mtime\n tickets = sorted(\n listdir(apath('%s/errors/' % app, r=request), '^\\w.*'),\n key=func,\n reverse=True)\n\n return dict(app=app, tickets=tickets, method=method, db_ready=db_ready)", "metadata": "root.errors", "header": "['module', '___EOS___']", "index": 1517 }, { "content": "def get_ticket_storage(app):\n private_folder = apath('%s/private' % app, r=request)\n ticket_file = os.path.join(private_folder, 'ticket_storage.txt')\n if os.path.exists(ticket_file):\n db_string = open(ticket_file).read()\n db_string = db_string.strip().replace('\\r', '').replace('\\n', '')\n elif is_gae:\n # use Datastore as fallback if there is no ticket_file\n db_string = \"google:datastore\"\n else:\n return False\n tickets_table = 'web2py_ticket'\n tablename = tickets_table + '_' + app\n db_path = apath('%s/databases' % app, r=request)\n ticketsdb = DAL(db_string, folder=db_path, auto_import=True)\n if not ticketsdb.get(tablename):\n table = ticketsdb.define_table(\n tablename,\n Field('ticket_id', length=100),\n Field('ticket_data', 'text'),\n Field('created_datetime', 'datetime'),\n )\n return ticketsdb, ticketsdb.get(tablename)", "metadata": "root.get_ticket_storage", "header": "['module', '___EOS___']", "index": 1652 }, { "content": "def git_push():\n \"\"\" Git Push handler \"\"\"\n app = get_app()\n if not have_git:\n session.flash = GIT_MISSING\n redirect(URL('site'))\n form = SQLFORM.factory(Field('changelog', requires=IS_NOT_EMPTY()))\n form.element('input[type=submit]')['_value'] = T('Push')\n form.add_button(T('Cancel'), URL('site'))\n form.process()\n if form.accepted:\n try:\n repo = git.Repo(os.path.join(apath(r=request), app))\n index = repo.index\n index.add([apath(r=request) + app + '/*'])\n new_commit = index.commit(form.vars.changelog)\n origin = repo.remotes.origin\n origin.push()\n session.flash = T(\n \"Git repo updated with latest application changes.\")\n redirect(URL('site'))\n except git.UnmergedEntriesError:\n session.flash = T(\"Push failed, there are unmerged entries in the cache. Resolve merge issues manually and try again.\")\n redirect(URL('site'))\n return dict(app=app, form=form)", "metadata": "root.git_push", "header": "['module', '___EOS___']", "index": 1879 }, { "content": "def plugins():\n app = request.args(0)\n from serializers import loads_json\n if not session.plugins:\n try:\n rawlist = urllib.urlopen(\"http://www.web2pyslices.com/\" +\n \"public/api.json/action/list/content/Package?package\" +\n \"_type=plugin&search_index=false\").read()\n session.plugins = loads_json(rawlist)\n except:\n response.flash = T('Unable to download the list of plugins')\n session.plugins = []\n return dict(plugins=session.plugins[\"results\"], app=request.args(0))", "metadata": "root.plugins", "header": "['module', '___EOS___']", "index": 1905 }, { "content": "def install_plugin():\n app = request.args(0)\n source = request.vars.source\n plugin = request.vars.plugin\n if not (source and app):\n raise HTTP(500, T(\"Invalid request\"))\n form = SQLFORM.factory()\n result = None\n if form.process().accepted:\n # get w2p plugin\n if \"web2py.plugin.\" in source:\n filename = \"web2py.plugin.%s.w2p\" % \\\n source.split(\"web2py.plugin.\")[-1].split(\".w2p\")[0]\n else:\n filename = \"web2py.plugin.%s.w2p\" % cleanpath(plugin)\n if plugin_install(app, urllib.urlopen(source),\n request, filename):\n session.flash = T('New plugin installed: %s', filename)\n else:\n session.flash = \\\n T('unable to install plugin \"%s\"', filename)\n redirect(URL(f=\"plugins\", args=[app,]))\n return dict(form=form, app=app, plugin=plugin, source=source)", "metadata": "root.install_plugin", "header": "['module', '___EOS___']", "index": 1919 } ]
[ { "span": "file_or_appurl ", "start_line": 207, "start_column": 4, "end_line": 207, "end_column": 18 }, { "span": "new_repo ", "start_line": 255, "start_column": 16, "end_line": 255, "end_column": 24 }, { "span": "filename ", "start_line": 433, "start_column": 12, "end_line": 433, "end_column": 20 }, { "span": "app_path ", "start_line": 576, "start_column": 4, "end_line": 576, "end_column": 12 }, { "span": "app_path ", "start_line": 791, "start_column": 4, "end_line": 791, "end_column": 12 }, { "span": "app ", "start_line": 901, "start_column": 4, "end_line": 901, "end_column": 7 }, { "span": "app ", "start_line": 961, "start_column": 4, "end_line": 961, "end_column": 7 }, { "span": "errors_path ", "start_line": 1583, "start_column": 8, "end_line": 1583, "end_column": 19 }, { "span": "table ", "start_line": 1668, "start_column": 8, "end_line": 1668, "end_column": 13 }, { "span": "new_commit ", "start_line": 1894, "start_column": 12, "end_line": 1894, "end_column": 22 }, { "span": "app ", "start_line": 1906, "start_column": 4, "end_line": 1906, "end_column": 7 }, { "span": "result ", "start_line": 1926, "start_column": 4, "end_line": 1926, "end_column": 10 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "site_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Site", " ", "handler", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "myv", "ersion_", "=_", "request_", "._", "env_", "._", "web", "2py", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Short", "cut", " ", "to", " ", "make", " ", "the", " ", "eli", "f", " ", "statem", "ents", " ", "more", " ", "leg", "ible_", "\\u\\u\\uNL\\u\\u\\u_", "file", "\\u", "or", "\\u", "app", "url_", "=_", "'", "file", "'_", "in_", "request_", "._", "vars_", "or_", "'", "app", "url", "'_", "in_", "request_", "._", "vars_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "IS", "\\u", "VALID", "\\u", "APP", "NAME_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "call\\u\\u_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "re_", "._", "compile_", "(_", "'", "^", "\\\\", "w", "+$", "'_", ")_", "._", "match_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "value_", ",_", "T_", "(_", "'", "Inva", "lid", " ", "applica", "tion", " ", "name", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "request_", "._", "vars_", "._", "overwrite_", "and_", "os_", "._", "path_", "._", "exists_", "(_", "os_", "._", "path_", "._", "join_", "(_", "apa", "th_", "(_", "r_", "=_", "request_", ")_", ",_", "value_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "value_", ",_", "T_", "(_", "'", "Applica", "tion", " ", "exist", "s", " ", "alr", "ead", "y", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "value_", ",_", "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_", "is", "\\u", "appname_", "=_", "IS", "\\u", "VALID", "\\u", "APP", "NAME_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form", "\\u", "create_", "=_", "SQL", "FORM", "_", "._", "factory_", "(_", "Field_", "(_", "'", "name", "'_", ",_", "requires_", "=_", "is", "\\u", "appname_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "table", "\\u", "name_", "=_", "'", "appc", "reate", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form", "\\u", "update_", "=_", "SQL", "FORM", "_", "._", "factory_", "(_", "Field_", "(_", "'", "name", "'_", ",_", "requires_", "=_", "is", "\\u", "appname_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Field_", "(_", "'", "file", "'_", ",_", "'", "upload", "'_", ",_", "upload", "field_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Field_", "(_", "'", "url", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Field_", "(_", "'", "overwrit", "e", "'_", ",_", "'", "boolean", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "table", "\\u", "name_", "=_", "'", "app", "update", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form", "\\u", "create_", "._", "process_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form", "\\u", "update_", "._", "process_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "DEMO", "\\u", "MODE_", ":_", "\\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_", "elif_", "form", "\\u", "create_", "._", "accepted_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "new", " ", "application_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "appname_", "=_", "clean", "path_", "(_", "form", "\\u", "create_", "._", "vars_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "created_", ",_", "error_", "=_", "app", "\\u", "create_", "(_", "appname_", ",_", "request_", ",_", "info_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "created_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "MULTI", "\\u", "USER", "\\u", "MODE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "app_", "._", "insert_", "(_", "name_", "=_", "appname_", ",_", "owner_", "=_", "auth_", "._", "user_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log", "\\u", "progress_", "(_", "appname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "flash_", "=_", "T_", "(_", "'", "new", " ", "applica", "tion", " ", "\"%", "s", "\"", " ", "created", "'_", ",_", "appname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirect_", "(_", "URL_", "(_", "'", "design", "'_", ",_", "args_", "=_", "appname_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "session_", "._", "flash_", "=_", "DIV_", "(_", "T_", "(_", "'", "una", "ble", " ", "to", " ", "create", " ", "applica", "tion", " ", "\"%", "s", "\"'_", ",_", "appname_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PRE", "_", "(_", "error_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "redirect_", "(_", "URL_", "(_", "r_", "=_", "request_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "form", "\\u", "update_", "._", "accepted_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "form", "\\u", "update_", "._", "vars_", "._", "url_", "or_", "''_", ")_", "._", "endswith_", "(_", "'.", "git", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "have", "\\u", "git_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "session_", "._", "flash_", "=_", "GIT", "\\u", "MISSING", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirect_", "(_", "URL_", "(_", "r_", "=_", "request_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "target_", "=_", "os_", "._", "path_", "._", "join_", "(_", "apa", "th_", "(_", "r_", "=_", "request_", ")_", ",_", "form", "\\u", "update_", "._", "vars_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "repo_", "=_", "git_", "._", "Repo_", "._", "clone", "\\u", "from_", "(_", "form", "\\u", "update_", "._", "vars_", "._", "url_", ",_", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "flash_", "=_", "T_", "(_", "'", "new", " ", "applica", "tion", " ", "\"%", "s", "\"", " ", "import", "ed", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "form", "\\u", "update_", "._", "vars_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "git_", "._", "Git", "Command", "Error_", ",_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "session_", "._", "flash_", "=_", "T_", "(_", "'", "Inva", "lid", " ", "git", " ", "repos", "itor", "y", " ", "specified", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "redirect_", "(_", "URL_", "(_", "r_", "=_", "request_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "form", "\\u", "update_", "._", "vars_", "._", "url_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "fetch", " ", "an", " ", "applica", "tion", " ", "via", " ", "URL", " ", "or", " ", "file", " ", "upload_", "\\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 ", " _", "f_", "=_", "urllib_", "._", "urlopen_", "(_", "form", "\\u", "update_", "._", "vars_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "f_", "._", "code_", "==_", "404_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Exception_", "(_", "\"", "404", " ", "file", " ", "not", " ", "found", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "session_", "._", "flash_", "=_", "DIV_", "(_", "T_", "(_", "'", "Una", "ble", " ", "to", " ", "download", " ", "app", " ", "bec", "aus", "e", ":'_", ")_", ",_", "PRE", "_", "(_", "str_", "(_", "e_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirect_", "(_", "URL_", "(_", "r_", "=_", "request_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fname_", "=_", "form", "\\u", "update_", "._", "vars_", "._", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "form", "\\u", "update_", "._", "accepted_", "and_", "form", "\\u", "update_", "._", "vars_", "._", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fname_", "=_", "request_", "._", "vars_", "._", "file_", "._", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "request_", "._", "vars_", "._", "file_", "._", "file_", "\\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 ", " _", "session_", "._", "flash_", "=_", "'", "No", " ", "file", " ", "uploade", "d", " ", "and", " ", "no", " ", "URL", " ", "specified", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirect_", "(_", "URL_", "(_", "r_", "=_", "request_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "appname_", "=_", "clean", "path_", "(_", "form", "\\u", "update_", "._", "vars_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "installed_", "=_", "app", "\\u", "install_", "(_", "appname_", ",_", "f_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "request_", ",_", "fname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "overwrite_", "=_", "form", "\\u", "update_", "._", "vars_", "._", "overwrite_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "f_", "and_", "installed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "'", "applica", "tion", " ", "%", "(", "app", "name", ")", "s", " ", "install", "ed", " ", "with", " ", "md5sum", ":", " ", "%", "(", "digest", ")", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "MULTI", "\\u", "USER", "\\u", "MODE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "app_", "._", "insert_", "(_", "name_", "=_", "appname_", ",_", "owner_", "=_", "auth_", "._", "user_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log", "\\u", "progress_", "(_", "appname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "flash_", "=_", "T_", "(_", "msg_", ",_", "dict_", "(_", "appname_", "=_", "appname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "digest_", "=_", "md5", "\\u", "hash_", "(_", "installed_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "f_", "and_", "form", "\\u", "update_", "._", "vars_", "._", "overwrite_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "'", "una", "ble", " ", "to", " ", "install", " ", "applica", "tion", " ", "\"%", "(", "app", "name", ")", "s", "\"'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "flash_", "=_", "T_", "(_", "msg_", ",_", "dict_", "(_", "appname_", "=_", "form", "\\u", "update_", "._", "vars_", "._", "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 ", " _", "msg_", "=_", "'", "una", "ble", " ", "to", " ", "install", " ", "applica", "tion", " ", "\"%", "(", "app", "name", ")", "s", "\"'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "flash_", "=_", "T_", "(_", "msg_", ",_", "dict_", "(_", "appname_", "=_", "form", "\\u", "update_", "._", "vars_", "._", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "redirect_", "(_", "URL_", "(_", "r_", "=_", "request_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "regex_", "=_", "re_", "._", "compile_", "(_", "'", "^", "\\\\", "w", "+$", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "is", "\\u", "manager_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "apps_", "=_", "[_", "f_", "for_", "f_", "in_", "os_", "._", "listdir_", "(_", "apa", "th_", "(_", "r_", "=_", "request_", ")_", ")_", "if_", "regex_", "._", "match_", "(_", "f_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "apps_", "=_", "[_", "f_", "._", "name_", "for_", "f_", "in_", "db_", "(_", "db_", "._", "app_", "._", "owner_", "==_", "auth_", "._", "user", "\\u", "id_", ")_", "._", "select_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "FILTER", "\\u", "APPS_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "apps_", "=_", "[_", "f_", "for_", "f_", "in_", "apps_", "if_", "f_", "in_", "FILTER", "\\u", "APPS_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "apps_", "=_", "sorted_", "(_", "apps_", ",_", "lambda_", "a_", ",_", "b_", ":_", "cmp_", "(_", "a_", "._", "upper_", "(_", ")_", ",_", "b_", "._", "upper_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "myp", "latform", "_", "=_", "platform_", "._", "python", "\\u", "version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "dict_", "(_", "app_", "=_", "None_", ",_", "apps_", "=_", "apps_", ",_", "myv", "ersion_", "=_", "myv", "ersion_", ",_", "myp", "latform", "_", "=_", "myp", "latform", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "form", "\\u", "create_", "=_", "form", "\\u", "create_", ",_", "form", "\\u", "update_", "=_", "form", "\\u", "update_", ")_", "\\u\\u\\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_", "uninstall", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "get", "\\u", "app_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dialog_", "=_", "FORM", "_", "._", "confirm_", "(_", "T_", "(_", "'", "Unin", "stall", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "T_", "(_", "'", "Cancel", "'_", ")_", ":_", "URL_", "(_", "'", "site", "'_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dialog_", "[_", "'\\u", "id", "'_", "]_", "=_", "'", "confirm", "\\u", "form", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dialog_", "[_", "'\\u", "class", "'_", "]_", "=_", "'", "well", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "component_", "in_", "dialog_", "._", "components_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "component_", "[_", "'\\u", "class", "'_", "]_", "=_", "'", "btn", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "dialog_", "._", "accepted_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "MULTI", "\\u", "USER", "\\u", "MODE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "is", "\\u", "manager_", "(_", ")_", "and_", "db_", "(_", "db_", "._", "app_", "._", "name_", "==_", "app_", ")_", "._", "delete_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "db_", "(_", "db_", "._", "app_", "._", "name_", "==_", "app_", ")_", "(_", "db_", "._", "app_", "._", "owner_", "==_", "auth_", "._", "user_", "._", "id_", ")_", "._", "delete_", "(_", ")_", ":_", "\\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 ", " _", "session_", "._", "flash_", "=_", "T_", "(_", "'", "no", " ", "permissi", "on", " ", "to", " ", "uninstall", " ", "\"%", "s", "\"'_", ",_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirect_", "(_", "URL_", "(_", "'", "site", "'_", ")_", ")_", "\\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 ", " _", "filename_", "=_", "app", "\\u", "pack_", "(_", "app_", ",_", "request_", ",_", "raise", "\\u", "ex_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "session_", "._", "flash_", "=_", "T_", "(_", "'", "una", "ble", " ", "to", " ", "uninstall", " ", "\"%", "s", "\"'_", ",_", "app_", ")_", "\\u\\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_", "app", "\\u", "uninstall", "_", "(_", "app_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "session_", "._", "flash_", "=_", "T_", "(_", "'", "applica", "tion", " ", "\"%", "s", "\"", " ", "uninstall", "ed", "'_", ",_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "session_", "._", "flash_", "=_", "T_", "(_", "'", "una", "ble", " ", "to", " ", "uninstall", " ", "\"%", "s", "\"'_", ",_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "redirect_", "(_", "URL_", "(_", "'", "site", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "dict_", "(_", "app_", "=_", "app_", ",_", "dialog_", "=_", "dialog_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "edit_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "File", " ", "edit", " ", "handler", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Load", " ", "json", " ", "only", " ", "if", " ", "it", " ", "is", " ", "aja", "x", " ", "edited", "..._", "\\u\\u\\uNL\\u\\u\\u_", "app_", "=_", "get", "\\u", "app_", "(_", "request_", "._", "vars_", "._", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app", "\\u", "path_", "=_", "apa", "th_", "(_", "app_", ",_", "r_", "=_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "preferences_", "=_", "{_", "'", "them", "e", "'_", ":_", "'", "web", "2py", "'_", ",_", "'", "editor", "'_", ":_", "'", "default", "'_", ",_", "'", "close", "tag", "'_", ":_", "'", "true", "'_", ",_", "'", "code", "fold", "ing", "'_", ":_", "'", "fal", "se", "'_", ",_", "'", "tab", "widt", "h", "'_", ":_", "'", "4", "'_", ",_", "'", "indent", "with", "tabs", "'_", ":_", "'", "fal", "se", "'_", ",_", "'", "linenum", "bers", "'_", ":_", "'", "true", "'_", ",_", "'", "highlight", "line", "'_", ":_", "'", "true", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config_", "=_", "Config_", "(_", "os_", "._", "path_", "._", "join_", "(_", "request_", "._", "folder_", ",_", "'", "settings", ".", "cfg", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "section_", "=_", "'", "editor", "'_", ",_", "default", "\\u", "values_", "=_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "preferences_", "._", "update_", "(_", "config_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "(_", "request_", "._", "ajax_", ")_", "and_", "not_", "(_", "is", "\\u", "mobile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "return", " ", "the", " ", "scaffold", "ing", ",", " ", "the", " ", "rest", " ", "will", " ", "be", " ", "through", " ", "aja", "x", " ", "requests_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "._", "title_", "=_", "T_", "(_", "'", "Editing", " ", "%", "s", "'_", ")_", "%_", "app_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "response_", "._", "render_", "(_", "'", "default", "/", "edit", ".", "html", "'_", ",_", "dict_", "(_", "app_", "=_", "app_", ",_", "editor", "\\u", "settings_", "=_", "preferences_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "show", " ", "settings", " ", "tab", " ", "and", " ", "save", " ", "prefer", "nces_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "settings", "'_", "in_", "request_", "._", "vars_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "request_", "._", "post", "\\u", "vars_", ":_", "#", "save", " ", "new", " ", "preferences_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "post", "\\u", "vars_", "=_", "request_", "._", "post", "\\u", "vars_", "._", "items_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Sin", "ce", " ", "uncheck", "ed", " ", "checkb", "ox", " ", "are", " ", "not", " ", "serialize", "d", ",", " ", "we", " ", "must", " ", "set", " ", "them", " ", "as", " ", "fal", "se", " ", "by", " ", "hand", " ", "to", " ", "store", " ", "the", " ", "correct", " ", "preference", " ", "in", " ", "the", " ", "settings", " _", "\\u\\u\\uNL\\u\\u\\u_", "post", "\\u", "vars_", "+=_", "[_", "(_", "opt_", ",_", "'", "fal", "se", "'_", ")_", "for_", "opt_", "in_", "preferences_", "if_", "opt_", "not_", "in_", "request_", "._", "post", "\\u", "vars_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "config_", "._", "save_", "(_", "post", "\\u", "vars_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "._", "headers_", "[_", "\"", "web", "2py", "-", "component", "-", "flash", "\"_", "]_", "=_", "T_", "(_", "'", "Preference", "s", " ", "saved", " ", "correct", "ly", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "._", "headers_", "[_", "\"", "web", "2py", "-", "component", "-", "flash", "\"_", "]_", "=_", "T_", "(_", "'", "Preference", "s", " ", "saved", " ", "on", " ", "session", " ", "only", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "._", "headers_", "[_", "\"", "web", "2py", "-", "component", "-", "command", "\"_", "]_", "=_", "\"", "update", "\\u", "editor", "(%", "s", ");", "$(", "'", "a", "[", "href", "=", "#", "editor", "\\u", "settings", "]", " ", "button", ".", "close", "')", ".", "click", "();", "\"_", "%_", "response_", "._", "json_", "(_", "config_", "._", "read_", "(_", ")_", ")_", "\\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 ", " _", "details_", "=_", "{_", "'", "real", "filename", "'_", ":_", "'", "settings", "'_", ",_", "'", "filename", "'_", ":_", "'", "settings", "'_", ",_", "'", "id", "'_", ":_", "'", "editor", "\\u", "settings", "'_", ",_", "'", "force", "'_", ":_", "False_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "details_", "[_", "'", "plain", "\\u", "html", "'_", "]_", "=_", "response_", "._", "render_", "(_", "'", "default", "/", "editor", "\\u", "settings", ".", "html", "'_", ",_", "{_", "'", "editor", "\\u", "settings", "'_", ":_", "preferences_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "response_", "._", "json_", "(_", "details_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\"\"\"", " ", "File", " ", "edit", " ", "handler", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Load", " ", "json", " ", "only", " ", "if", " ", "it", " ", "is", " ", "aja", "x", " ", "edited", "..._", "\\u\\u\\uNL\\u\\u\\u_", "app_", "=_", "get", "\\u", "app_", "(_", "request_", "._", "vars_", "._", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", "=_", "'/'_", "._", "join_", "(_", "request_", "._", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "real", "filename_", "=_", "request_", "._", "args_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "request_", "._", "vars_", "._", "app_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", "=_", "abspath_", "(_", "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 ", " _", "path_", "=_", "apa", "th_", "(_", "filename_", ",_", "r_", "=_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Tr", "y", " ", "to", " ", "discove", "r", " ", "the", " ", "file", " ", "type_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "filename_", "[_", "-_", "3_", ":_", "]_", "==_", "'.", "py", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filetype_", "=_", "'", "python", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "filename_", "[_", "-_", "5_", ":_", "]_", "==_", "'.", "html", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filetype_", "=_", "'", "html", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "filename_", "[_", "-_", "5_", ":_", "]_", "==_", "'.", "load", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filetype_", "=_", "'", "html", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "filename_", "[_", "-_", "4_", ":_", "]_", "==_", "'.", "css", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filetype_", "=_", "'", "css", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "filename_", "[_", "-_", "3_", ":_", "]_", "==_", "'.", "js", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filetype_", "=_", "'", "javascript", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filetype_", "=_", "'", "html", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "##", " ", "check", " ", "if", " ", "file", " ", "is", " ", "not", " ", "there", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "'", "revert", "'_", "in_", "request_", "._", "vars_", ")_", "and_", "os_", "._", "path_", "._", "exists_", "(_", "path_", "+_", "'.", "bak", "'_", ")_", ":_", "\\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 ", " _", "data_", "=_", "safe", "\\u", "read_", "(_", "path_", "+_", "'.", "bak", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data1_", "=_", "safe", "\\u", "read_", "(_", "path_", ")_", "\\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 ", " _", "session_", "._", "flash_", "=_", "T_", "(_", "'", "Inva", "lid", " ", "action", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "from", "\\u", "aja", "x", "'_", "in_", "request_", "._", "vars_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "response_", "._", "json_", "(_", "{_", "'", "error", "'_", ":_", "str_", "(_", "T_", "(_", "'", "Inva", "lid", " ", "action", "'_", ")_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "redirect_", "(_", "URL_", "(_", "'", "site", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "safe", "\\u", "write_", "(_", "path_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "hash_", "=_", "md5", "\\u", "hash_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "saved", "\\u", "on_", "=_", "time_", "._", "ctime_", "(_", "os_", "._", "stat_", "(_", "path_", ")_", "[_", "stat_", "._", "ST", "\\u", "MT", "IME", "_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "\\u", "write_", "(_", "path_", "+_", "'.", "bak", "'_", ",_", "data1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "._", "flash_", "=_", "T_", "(_", "'", "file", " ", "\"%", "s", "\"", " ", "of", " ", "%", "s", " ", "restore", "d", "'_", ",_", "(_", "filename_", ",_", "saved", "\\u", "on_", ")_", ")_", "\\u\\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 ", " _", "data_", "=_", "safe", "\\u", "read_", "(_", "path_", ")_", "\\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 ", " _", "session_", "._", "flash_", "=_", "T_", "(_", "'", "Inva", "lid", " ", "action", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "from", "\\u", "aja", "x", "'_", "in_", "request_", "._", "vars_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "response_", "._", "json_", "(_", "{_", "'", "error", "'_", ":_", "str_", "(_", "T_", "(_", "'", "Inva", "lid", " ", "action", "'_", ")_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "redirect_", "(_", "URL_", "(_", "'", "site", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "linen", "o", "\\u", "old_", "=_", "count", "\\u", "lines_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "hash_", "=_", "md5", "\\u", "hash_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "saved", "\\u", "on_", "=_", "time_", "._", "ctime_", "(_", "os_", "._", "stat_", "(_", "path_", ")_", "[_", "stat_", "._", "ST", "\\u", "MT", "IME", "_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "request_", "._", "vars_", "._", "file", "\\u", "hash_", "and_", "request_", "._", "vars_", "._", "file", "\\u", "hash_", "!=_", "file", "\\u", "hash_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "session_", "._", "flash_", "=_", "T_", "(_", "'", "file", " ", "change", "d", " ", "on", " ", "disk", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "request_", "._", "vars_", "._", "data_", "._", "replace_", "(_", "'\\\\", "r", "\\\\", "n", "'_", ",_", "'\\\\", "n", "'_", ")_", "._", "strip_", "(_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "\\u", "write_", "(_", "path_", "+_", "'.", "1", "'_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "from", "\\u", "aja", "x", "'_", "in_", "request_", "._", "vars_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "response_", "._", "json_", "(_", "{_", "'", "error", "'_", ":_", "str_", "(_", "T_", "(_", "'", "file", " ", "change", "d", " ", "on", " ", "disk", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "redirec", "t", "'_", ":_", "URL_", "(_", "'", "resolve", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "request_", "._", "args_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "redirect_", "(_", "URL_", "(_", "'", "resolve", "'_", ",_", "args_", "=_", "request_", "._", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "request_", "._", "vars_", "._", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "safe", "\\u", "write_", "(_", "path_", "+_", "'.", "bak", "'_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "request_", "._", "vars_", "._", "data_", "._", "replace_", "(_", "'\\\\", "r", "\\\\", "n", "'_", ",_", "'\\\\", "n", "'_", ")_", "._", "strip_", "(_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "safe", "\\u", "write_", "(_", "path_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "linen", "o", "\\u", "new_", "=_", "count", "\\u", "lines_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log", "\\u", "progress_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "app_", ",_", "'", "EDIT", "'_", ",_", "filename_", ",_", "progress_", "=_", "linen", "o", "\\u", "new_", "-_", "linen", "o", "\\u", "old_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "hash_", "=_", "md5", "\\u", "hash_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "saved", "\\u", "on_", "=_", "time_", "._", "ctime_", "(_", "os_", "._", "stat_", "(_", "path_", ")_", "[_", "stat_", "._", "ST", "\\u", "MT", "IME", "_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "._", "flash_", "=_", "T_", "(_", "'", "file", " ", "saved", " ", "on", " ", "%", "s", "'_", ",_", "saved", "\\u", "on_", ")_", "\\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\\u", "or", "\\u", "revert", "_", "=_", "(_", "request_", "._", "vars_", "._", "data_", "or_", "request_", "._", "vars_", "._", "revert", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "compile", " ", "errors_", "\\u\\u\\uNL\\u\\u\\u_", "highlight_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "filetype_", "==_", "'", "python", "'_", "and_", "request_", "._", "vars_", "._", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "\\u", "ast_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "code_", "=_", "request_", "._", "vars_", "._", "data_", "._", "rstrip_", "(_", ")_", "._", "replace_", "(_", "'\\\\", "r", "\\\\", "n", "'_", ",_", "'\\\\", "n", "'_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compile_", "(_", "code_", ",_", "path_", ",_", "\"", "exec", "\"_", ",_", "\\u", "ast_", "._", "Py", "CF", "\\u", "ONL", "Y", "\\u", "AST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "offset", " ", "calculati", "on", " ", "is", " ", "only", " ", "used", " ", "for", " ", "text", "area", " ", "(", "start", "/", "stop", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start_", "=_", "sum_", "(_", "[_", "len_", "(_", "line_", ")_", "+_", "1_", "for_", "l_", ",_", "line_", "\\u\\u\\uNL\\u\\u\\u_", "in_", "enumerate_", "(_", "request_", "._", "vars_", "._", "data_", "._", "split_", "(_", "\"\\\\", "n", "\"_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "l_", "<_", "e_", "._", "lineno_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "e_", "._", "text_", "and_", "e_", "._", "offset_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offset_", "=_", "e_", "._", "offset_", "-_", "(_", "len_", "(_", "e_", "._", "text_", ")_", "-_", "len_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "e_", "._", "text_", "._", "splitlines_", "(_", ")_", "[_", "-_", "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 ", " _", "offset_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "highlight_", "=_", "{_", "'", "start", "'_", ":_", "start_", ",_", "'", "end", "'_", ":_", "start_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "offset_", "+_", "1_", ",_", "'", "linen", "o", "'_", ":_", "e_", "._", "lineno_", ",_", "'", "offset", "'_", ":_", "offset_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ex", "\\u", "name_", "=_", "e_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\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 ", " _", "ex", "\\u", "name_", "=_", "'", "unknown", " ", "exception", "!'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "._", "flash_", "=_", "DIV_", "(_", "T_", "(_", "'", "fail", "ed", " ", "to", " ", "compile", " ", "file", " ", "bec", "aus", "e", ":'_", ")_", ",_", "BR", "_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "B_", "(_", "ex", "\\u", "name_", ")_", ",_", "'", " ", "'_", "+_", "T_", "(_", "'", "at", " ", "line", " ", "%", "s", "'_", ",_", "e_", "._", "lineno_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "offset_", "and_", "'", " ", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "(_", "'", "at", " ", "char", " ", "%", "s", "'_", ",_", "offset_", ")_", "or_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PRE", "_", "(_", "str_", "(_", "e_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "data\\u", "or", "\\u", "revert", "_", "and_", "request_", "._", "args_", "[_", "1_", "]_", "==_", "'", "module", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Let", "s", " ", "try", " ", "to", " ", "relo", "ad", " ", "the", " ", "modules_", "\\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 ", " _", "mop", "ath_", "=_", "'.'_", "._", "join_", "(_", "request_", "._", "args_", "[_", "2_", ":_", "]_", ")_", "[_", ":_", "-_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exec_", "'", "import", " ", "applica", "tion", "s", ".", "%", "s", ".", "module", "s", ".", "%", "s", "'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "request_", "._", "args_", "[_", "0_", "]_", ",_", "mop", "ath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reload_", "(_", "sys_", "._", "modules_", "[_", "'", "applica", "tion", "s", ".", "%", "s", ".", "module", "s", ".", "%", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "(_", "request_", "._", "args_", "[_", "0_", "]_", ",_", "mop", "ath_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "._", "flash_", "=_", "DIV_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "(_", "'", "fail", "ed", " ", "to", " ", "relo", "ad", " ", "module", " ", "bec", "aus", "e", ":'_", ")_", ",_", "PRE", "_", "(_", "str_", "(_", "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_", "edit", "\\u", "controller_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "edit", "view", "links_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view", "\\u", "link_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "filetype_", "==_", "'", "html", "'_", "and_", "len_", "(_", "request_", "._", "args_", ")_", ">=_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cfi", "lename", "_", "=_", "os_", "._", "path_", "._", "join_", "(_", "request_", "._", "args_", "[_", "0_", "]_", ",_", "'", "controlle", "rs", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "request_", "._", "args_", "[_", "2_", "]_", "+_", "'.", "py", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "apa", "th_", "(_", "cfi", "lename", "_", ",_", "r_", "=_", "request_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "edit", "\\u", "controller_", "=_", "URL_", "(_", "'", "edit", "'_", ",_", "args_", "=_", "[_", "cfi", "lename", "_", "._", "replace_", "(_", "os_", "._", "sep_", ",_", "\"/\"_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view_", "=_", "request_", "._", "args_", "[_", "3_", "]_", "._", "replace_", "(_", "'.", "html", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view", "\\u", "link_", "=_", "URL_", "(_", "request_", "._", "args_", "[_", "0_", "]_", ",_", "request_", "._", "args_", "[_", "2_", "]_", ",_", "view_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "filetype_", "==_", "'", "python", "'_", "and_", "request_", "._", "args_", "[_", "1_", "]_", "==_", "'", "controlle", "rs", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "##", " ", "it", "'", "s", " ", "a", " ", "controlle", "r", " ", "file", "._", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Creat", "e", " ", "link", "s", " ", "to", " ", "all", " ", "of", " ", "the", " ", "associate", "d", " ", "view", " ", "files", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "get", "\\u", "app_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view", "name_", "=_", "os_", "._", "path_", "._", "splitext_", "(_", "request_", "._", "args_", "[_", "2_", "]_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "app_", ",_", "'", "views", "'_", ",_", "view", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "avi", "ew", "path_", "=_", "apa", "th_", "(_", "view", "path_", ",_", "r_", "=_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "avi", "ew", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "os_", "._", "path_", "._", "isdir_", "(_", "avi", "ew", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "view", "list_", "=_", "glob_", "(_", "os_", "._", "path_", "._", "join_", "(_", "avi", "ew", "path_", ",_", "'*", ".", "html", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "os_", "._", "path_", "._", "exists_", "(_", "avi", "ew", "path_", "+_", "'.", "html", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "view", "list_", "._", "append_", "(_", "avi", "ew", "path_", "+_", "'.", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "view", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "edit", "view", "links_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "v_", "in_", "view", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vf_", "=_", "os_", "._", "path_", "._", "split_", "(_", "v_", ")_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "var", "gs_", "=_", "\"/\"_", "._", "join_", "(_", "[_", "view", "path_", "._", "replace_", "(_", "os_", "._", "sep_", ",_", "\"/\"_", ")_", ",_", "vf_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "edit", "view", "links_", "._", "append_", "(_", "A_", "(_", "vf_", "._", "split_", "(_", "\".\"_", ")_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "class_", "=_", "\"", "editor", "\\u", "fileli", "nk", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "href_", "=_", "URL_", "(_", "'", "edit", "'_", ",_", "args_", "=_", "[_", "var", "gs_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "request_", "._", "args_", ")_", ">_", "2_", "and_", "request_", "._", "args_", "[_", "1_", "]_", "==_", "'", "controlle", "rs", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "controller_", "=_", "(_", "request_", "._", "args_", "[_", "2_", "]_", ")_", "[_", ":_", "-_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "functions_", "=_", "find", "\\u", "exposed", "\\u", "functions_", "(_", "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 ", " _", "(_", "controller_", ",_", "functions_", ")_", "=_", "(_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "from", "\\u", "aja", "x", "'_", "in_", "request_", "._", "vars_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "response_", "._", "json_", "(_", "{_", "'", "file", "\\u", "hash", "'_", ":_", "file", "\\u", "hash_", ",_", "'", "saved", "\\u", "on", "'_", ":_", "saved", "\\u", "on_", ",_", "'", "function", "s", "'_", ":_", "functions_", ",_", "'", "controlle", "r", "'_", ":_", "controller_", ",_", "'", "applica", "tion", "'_", ":_", "request_", "._", "args_", "[_", "0_", "]_", ",_", "'", "highlight", "'_", ":_", "highlight_", "}_", ")_", "\\u\\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", "\\u", "details_", "=_", "dict_", "(_", "app_", "=_", "request_", "._", "args_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lineno_", "=_", "request_", "._", "vars_", "._", "lineno_", "or_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "editor", "\\u", "settings_", "=_", "preferences_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filename_", "=_", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "real", "filename_", "=_", "real", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filetype_", "=_", "filetype_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "data_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "edit", "\\u", "controller_", "=_", "edit", "\\u", "controller_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "file", "\\u", "hash_", "=_", "file", "\\u", "hash_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "saved", "\\u", "on_", "=_", "saved", "\\u", "on_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "controller_", "=_", "controller_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "functions_", "=_", "functions_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "view", "\\u", "link_", "=_", "view", "\\u", "link_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "edit", "view", "links_", "=_", "edit", "view", "links_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "id_", "=_", "IS", "\\u", "SLU", "G_", "(_", ")_", "(_", "filename_", ")_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "force_", "=_", "True_", "if_", "(_", "request_", "._", "vars_", "._", "restore_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "request_", "._", "vars_", "._", "revert", "_", ")_", "else_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plain", "\\u", "html_", "=_", "response_", "._", "render_", "(_", "'", "default", "/", "edit", "\\u", "js", ".", "html", "'_", ",_", "file", "\\u", "details_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "details_", "[_", "'", "plain", "\\u", "html", "'_", "]_", "=_", "plain", "\\u", "html_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "\\u", "mobile_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "response_", "._", "render_", "(_", "'", "default", ".", "mobile", "/", "edit", ".", "html", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "file", "\\u", "details_", ",_", "editor", "\\u", "settings_", "=_", "preferences_", ")_", "\\u\\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_", "response_", "._", "json_", "(_", "file", "\\u", "details_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "todo", "list_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Return", "s", " ", "all", " ", "TOD", "O", " ", "of", " ", "the", " ", "request", "ed", " ", "app", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "=_", "request_", "._", "vars_", "._", "app_", "or_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app", "\\u", "path_", "=_", "apa", "th_", "(_", "'%", "(", "app", ")", "s", "'_", "%_", "{_", "'", "app", "'_", ":_", "app_", "}_", ",_", "r_", "=_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dirs_", "=_", "[_", "'", "model", "s", "'_", ",_", "'", "controlle", "rs", "'_", ",_", "'", "module", "s", "'_", ",_", "'", "private", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "list", "files_", "(_", "app_", ",_", "dir_", ",_", "regexp_", "=_", "'.*", "\\\\.", "py", "$'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "files_", "=_", "sorted_", "(_", "listdir_", "(_", "apa", "th_", "(_", "'%", "(", "app", ")", "s", "/", "%", "(", "dir", ")", "s", "/'_", "%_", "{_", "'", "app", "'_", ":_", "app_", ",_", "'", "dir", "'_", ":_", "dir_", "}_", ",_", "r_", "=_", "request_", ")_", ",_", "regexp_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "files_", "=_", "[_", "x_", "._", "replace_", "(_", "os_", "._", "path_", "._", "sep_", ",_", "'/'_", ")_", "for_", "x_", "in_", "files_", "if_", "not_", "x_", "._", "endswith_", "(_", "'.", "bak", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "files_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pattern_", "=_", "'#", "\\\\", "s", "*(", "todo", ")+", "\\\\", "s", "+(", ".*)", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "regex_", "=_", "re_", "._", "compile_", "(_", "pattern_", ",_", "re_", "._", "IGNORECASE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "output_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "d_", "in_", "dirs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "f_", "in_", "list", "files_", "(_", "app_", ",_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "matches_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", "=_", "apa", "th_", "(_", "os_", "._", "path_", "._", "join_", "(_", "app_", ",_", "d_", ",_", "f_", ")_", ",_", "r_", "=_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "filename_", ",_", "'", "r", "'_", ")_", "as_", "f", "\\u", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "src_", "=_", "f", "\\u", "s_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "m_", "in_", "regex_", "._", "finditer_", "(_", "src_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "start_", "=_", "m_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lineno_", "=_", "src_", "._", "count_", "(_", "'\\\\", "n", "'_", ",_", "0_", ",_", "start_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matches_", "._", "append_", "(_", "{_", "'", "text", "'_", ":_", "m_", "._", "group_", "(_", "0_", ")_", ",_", "'", "linen", "o", "'_", ":_", "lineno_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "matches_", ")_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "output_", "._", "append_", "(_", "{_", "'", "filename", "'_", ":_", "f_", ",_", "'", "matche", "s", "'_", ":_", "matches_", ",_", "'", "dir", "'_", ":_", "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_", "{_", "'", "todo", "'_", ":_", "output_", ",_", "'", "app", "'_", ":_", "app_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "edit", "\\u", "language_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Edit", " ", "language", " ", "file", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "=_", "get", "\\u", "app_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", "=_", "'/'_", "._", "join_", "(_", "request_", "._", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "._", "title_", "=_", "request_", "._", "args_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "strings_", "=_", "read", "\\u", "dict_", "(_", "apa", "th_", "(_", "filename_", ",_", "r_", "=_", "request_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'\\u", "\\u", "corrupted", "\\u\\u'_", "in_", "strings_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "=_", "SPAN", "_", "(_", "strings_", "[_", "'\\u", "\\u", "corrupted", "\\u\\u'_", "]_", ",_", "\\u", "class_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "dict_", "(_", "filename_", "=_", "filename_", ",_", "form_", "=_", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "keys_", "=_", "sorted_", "(_", "strings_", "._", "keys_", "(_", ")_", ",_", "lambda_", "x_", ",_", "y_", ":_", "cmp_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "unicode_", "(_", "x_", ",_", "'", "utf", "-", "8", "'_", ")_", "._", "lower_", "(_", ")_", ",_", "unicode_", "(_", "y_", ",_", "'", "utf", "-", "8", "'_", ")_", "._", "lower_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rows_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rows_", "._", "append_", "(_", "H2", "_", "(_", "T_", "(_", "'", "Origina", "l", "/", "Translat", "ion", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", "in_", "keys_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "md5", "\\u", "hash_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "strings_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "prefix_", ",_", "sep_", ",_", "key_", ")_", "=_", "key_", "._", "partition_", "(_", "'\\\\", "x0", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sep_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "=_", "SPAN", "_", "(_", "prefix_", "+_", "':", " ", "'_", ",_", "\\u", "class_", "=_", "'", "tm", "\\u", "fta", "g", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "k_", "=_", "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 ", " _", "(_", "k_", ",_", "prefix_", ")_", "=_", "(_", "prefix_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "class_", "=_", "'", "untr", "ans", "late", "d", "'_", "if_", "k_", "==_", "s_", "else_", "'", "translat", "ed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "s_", ")_", "<=_", "40_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "elem_", "=_", "INPUT_", "(_", "\\u", "type_", "=_", "'", "text", "'_", ",_", "\\u", "name_", "=_", "name_", ",_", "value_", "=_", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "size_", "=_", "70_", ",_", "\\u", "class_", "=_", "\\u", "class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "elem_", "=_", "TEXT", "AREA", "_", "(_", "\\u", "name_", "=_", "name_", ",_", "value_", "=_", "s_", ",_", "\\u", "cols_", "=_", "70_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "rows_", "=_", "5_", ",_", "\\u", "class_", "=_", "\\u", "class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Maki", "ng", " ", "the", " ", "short", " ", "circuit", " ", "compatible", " ", "with", " ", "<=", " ", "python", "2.4", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "k_", "=_", "(_", "s_", "!=_", "k_", ")_", "and_", "k_", "or_", "B_", "(_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "row_", "=_", "DIV_", "(_", "LABEL_", "(_", "prefix_", ",_", "k_", ",_", "\\u", "style_", "=_", "\"", "font", "-", "weight", ":", "normal", ";\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "CAT", "_", "(_", "elem_", ",_", "'\\\\", "n", "'_", ",_", "TAG_", "._", "BUTTON_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "(_", "'", "delete", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "onc", "lick", "_", "=_", "'", "return", " ", "del", "key", "(\"", "%", "s", "\")'_", "%_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "class_", "=_", "'", "btn", "'_", ")_", ")_", ",_", "\\u", "id_", "=_", "name_", ",_", "\\u", "class_", "=_", "'", "span", "6", " ", "well", " ", "well", "-", "small", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rows_", "._", "append_", "(_", "DIV_", "(_", "new", "\\u", "row_", ",_", "\\u", "class_", "=_", "\"", "row", "-", "fluid", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rows_", "._", "append_", "(_", "DIV_", "(_", "INPUT_", "(_", "\\u", "type_", "=_", "'", "submit", "'_", ",_", "\\u", "value_", "=_", "T_", "(_", "'", "update", "'_", ")_", ",_", "\\u", "class_", "=_", "\"", "btn", " ", "btn", "-", "primary", "\"_", ")_", ",_", "\\u", "class_", "=_", "'", "controls", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "FORM", "_", "(_", "*_", "rows_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "form_", "._", "accepts", "_", "(_", "request_", "._", "vars_", ",_", "keep", "values_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "strs_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", "in_", "keys_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "md5", "\\u", "hash_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "form_", "._", "vars_", "[_", "name_", "]_", "==_", "chr_", "(_", "127_", ")_", ":_", "\\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_", "strs_", "[_", "key_", "]_", "=_", "form_", "._", "vars_", "[_", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "write", "\\u", "dict_", "(_", "apa", "th_", "(_", "filename_", ",_", "r_", "=_", "request_", ")_", ",_", "strs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "flash_", "=_", "T_", "(_", "'", "file", " ", "saved", " ", "on", " ", "%", "(", "time", ")", "s", "'_", ",_", "dict_", "(_", "time_", "=_", "time_", "._", "ctime_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirect_", "(_", "URL_", "(_", "r_", "=_", "request_", ",_", "args_", "=_", "request_", "._", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "dict_", "(_", "app_", "=_", "request_", "._", "args_", "[_", "0_", "]_", ",_", "filename_", "=_", "filename_", ",_", "form_", "=_", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "edit", "\\u", "plural", "s_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Edit", " ", "plural", "s", " ", "file", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "=_", "get", "\\u", "app_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", "=_", "'/'_", "._", "join_", "(_", "request_", "._", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plural", "s_", "=_", "read", "\\u", "plural", "\\u", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "apa", "th_", "(_", "filename_", ",_", "r_", "=_", "request_", ")_", ")_", "#", " ", "plural", " ", "forms", " ", "dictionary_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "npl", "ural", "s_", "=_", "int_", "(_", "request_", "._", "vars_", "._", "npl", "ural", "s_", ")_", "-_", "1_", "#", " ", "plural", " ", "forms", " ", "quantity_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xn", "plural", "s_", "=_", "xrange_", "(_", "npl", "ural", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'\\u", "\\u", "corrupted", "\\u\\u'_", "in_", "plural", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "show", " ", "error", " ", "message", " ", "and", " ", "exit_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "=_", "SPAN", "_", "(_", "plural", "s_", "[_", "'\\u", "\\u", "corrupted", "\\u\\u'_", "]_", ",_", "\\u", "class_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "dict_", "(_", "filename_", "=_", "filename_", ",_", "form_", "=_", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "keys_", "=_", "sorted_", "(_", "plural", "s_", "._", "keys_", "(_", ")_", ",_", "lambda_", "x_", ",_", "y_", ":_", "cmp_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "unicode_", "(_", "x_", ",_", "'", "utf", "-", "8", "'_", ")_", "._", "lower_", "(_", ")_", ",_", "unicode_", "(_", "y_", ",_", "'", "utf", "-", "8", "'_", ")_", "._", "lower_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tab", "\\u", "rows_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", "in_", "keys_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "md5", "\\u", "hash_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "forms_", "=_", "plural", "s_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "forms_", ")_", "<_", "npl", "ural", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "forms_", "._", "extend_", "(_", "None_", "for_", "i_", "in_", "xrange_", "(_", "npl", "ural", "s_", "-_", "len_", "(_", "forms_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tab", "\\u", "col1_", "=_", "DIV_", "(_", "CAT", "_", "(_", "LABEL_", "(_", "T_", "(_", "\"", "Sing", "ular", " ", "Form", "\"_", ")_", ")_", ",_", "B_", "(_", "key_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "class_", "=_", "'", "fake", "-", "input", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tab", "\\u", "inputs_", "=_", "[_", "SPAN", "_", "(_", "LABEL_", "(_", "T_", "(_", "\"", "Plur", "al", " ", "Form", " ", "#", "%", "s", "\"_", ",_", "n_", "+_", "1_", ")_", ")_", ",_", "INPUT_", "(_", "\\u", "type_", "=_", "'", "text", "'_", ",_", "\\u", "name_", "=_", "name_", "+_", "'\\u'_", "+_", "str_", "(_", "n_", ")_", ",_", "value_", "=_", "forms_", "[_", "n_", "]_", ",_", "\\u", "size_", "=_", "20_", ")_", ",_", "\\u", "class_", "=_", "'", "span", "6", "'_", ")_", "for_", "n_", "in_", "xn", "plural", "s_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tab", "\\u", "col2_", "=_", "DIV_", "(_", "CAT", "_", "(_", "*_", "tab", "\\u", "inputs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tab", "\\u", "col", "3_", "=_", "DIV_", "(_", "CAT", "_", "(_", "LABEL_", "(_", "XML_", "(_", "'&", "nb", "sp", ";'_", ")_", ")_", ",_", "TAG_", "._", "BUTTON_", "(_", "T_", "(_", "'", "delete", "'_", ")_", ",_", "\\u", "onc", "lick", "_", "=_", "'", "return", " ", "del", "key", "(\"", "%", "s", "\")'_", "%_", "name_", ",_", "\\u", "class_", "=_", "'", "btn", "'_", ")_", ",_", "\\u", "class_", "=_", "'", "span", "6", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tab", "\\u", "row_", "=_", "DIV_", "(_", "DIV_", "(_", "tab", "\\u", "col1_", ",_", "'\\\\", "n", "'_", ",_", "tab", "\\u", "col2_", ",_", "'\\\\", "n", "'_", ",_", "tab", "\\u", "col", "3_", ",_", "\\u", "class_", "=_", "'", "well", " ", "well", "-", "small", "'_", ")_", ",_", "\\u", "id_", "=_", "name_", ",_", "\\u", "class_", "=_", "'", "row", "-", "fluid", " ", "tab", "\\u", "row", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tab", "\\u", "rows_", "._", "append_", "(_", "tab", "\\u", "row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tab", "\\u", "rows_", "._", "append_", "(_", "DIV_", "(_", "TAG_", "[_", "'", "button", "'_", "]_", "(_", "T_", "(_", "'", "update", "'_", ")_", ",_", "\\u", "type_", "=_", "'", "submit", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "class_", "=_", "'", "btn", " ", "btn", "-", "primary", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "class_", "=_", "'", "controls", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tab", "\\u", "container_", "=_", "DIV_", "(_", "*_", "tab", "\\u", "rows_", ",_", "**_", "dict_", "(_", "\\u", "class_", "=_", "\"", "row", "-", "fluid", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "form_", "=_", "FORM", "_", "(_", "tab", "\\u", "container_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "form_", "._", "accepts", "_", "(_", "request_", "._", "vars_", ",_", "keep", "values_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "plural", "s_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", "in_", "keys_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "md5", "\\u", "hash_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "form_", "._", "vars_", "[_", "name_", "+_", "'\\u", "0", "'_", "]_", "==_", "chr_", "(_", "127_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "\\u", "plural", "s_", "[_", "key_", "]_", "=_", "[_", "form_", "._", "vars_", "[_", "name_", "+_", "'\\u'_", "+_", "str_", "(_", "n_", ")_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "n_", "in_", "xn", "plural", "s_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "write", "\\u", "plural", "\\u", "dict_", "(_", "apa", "th_", "(_", "filename_", ",_", "r_", "=_", "request_", ")_", ",_", "new", "\\u", "plural", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "flash_", "=_", "T_", "(_", "'", "file", " ", "saved", " ", "on", " ", "%", "(", "time", ")", "s", "'_", ",_", "dict_", "(_", "time_", "=_", "time_", "._", "ctime_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirect_", "(_", "URL_", "(_", "r_", "=_", "request_", ",_", "args_", "=_", "request_", "._", "args_", ",_", "vars_", "=_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "npl", "ural", "s_", "=_", "request_", "._", "vars_", "._", "npl", "ural", "s_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "dict_", "(_", "app_", "=_", "request_", "._", "args_", "[_", "0_", "]_", ",_", "filename_", "=_", "filename_", ",_", "form_", "=_", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "errors_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Error", " ", "handler", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "operator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "hashlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "app_", "=_", "get", "\\u", "app_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "\\u", "gae", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "method_", "=_", "'", "dbo", "ld", "'_", "if_", "(_", "'", "old", "'_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "request_", "._", "args_", "(_", "1_", ")_", "or_", "''_", ")_", ")_", "else_", "'", "db", "new", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "method_", "=_", "request_", "._", "args_", "(_", "1_", ")_", "or_", "'", "new", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "db", "\\u", "ready_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "ready_", "[_", "'", "status", "'_", "]_", "=_", "get", "\\u", "tick", "et", "\\u", "storage_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "ready_", "[_", "'", "err", "message", "'_", "]_", "=_", "T_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "No", " ", "tick", "et", "\\u", "storage", ".", "txt", " ", "found", " ", "under", " ", "/", "private", " ", "folder", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "ready_", "[_", "'", "err", "link", "'_", "]_", "=_", "\"", "http", "://", "web", "2py", ".", "com", "/", "books", "/", "default", "/", "chap", "ter", "/", "2", "9", "/", "13", "#", "Collecti", "ng", "-", "tick", "ets", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "method_", "==_", "'", "new", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "error", "s", "\\u", "path_", "=_", "apa", "th_", "(_", "'%", "s", "/", "error", "s", "'_", "%_", "app_", ",_", "r_", "=_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "delete", "\\u", "hashes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "request_", "._", "vars_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "item_", "[_", ":_", "7_", "]_", "==_", "'", "delete", "\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "delete", "\\u", "hashes_", "._", "append_", "(_", "item_", "[_", "7_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "hash", "2e", "rror_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "fn_", "in_", "listdir_", "(_", "error", "s", "\\u", "path_", ",_", "'", "^", "[", "a", "-", "f", "A", "-", "F0", "-", "9", ".\\\\", "-]+", "$'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fullpath_", "=_", "os_", "._", "path_", "._", "join_", "(_", "error", "s", "\\u", "path_", ",_", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "isfile_", "(_", "fullpath_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "full", "path", "\\u", "file_", "=_", "open_", "(_", "fullpath_", ",_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "error_", "=_", "pickle_", "._", "load_", "(_", "full", "path", "\\u", "file_", ")_", "\\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 ", " ", "_", "full", "path", "\\u", "file_", "._", "close_", "(_", ")_", "\\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 ", " _", "continue_", "\\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 ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "hash_", "=_", "hashlib_", "._", "md5_", "(_", "error_", "[_", "'", "traceback", "'_", "]_", ")_", "._", "hexdigest_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hash_", "in_", "delete", "\\u", "hashes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "unlink_", "(_", "fullpath_", ")_", "\\u\\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 ", " ", "_", "hash", "2e", "rror_", "[_", "hash_", "]_", "[_", "'", "count", "'_", "]_", "+=_", "1_", "\\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 ", " ", "_", "error", "\\u", "lines_", "=_", "error_", "[_", "'", "traceback", "'_", "]_", "._", "split_", "(_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "line_", "=_", "error", "\\u", "lines_", "[_", "-_", "2_", "]_", "if_", "len_", "(_", "error", "\\u", "lines_", ")_", ">_", "1_", "else_", "'", "unknown", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "caus", "er_", "=_", "os_", "._", "path_", "._", "split_", "(_", "error_", "[_", "'", "layer", "'_", "]_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hash", "2e", "rror_", "[_", "hash_", "]_", "=_", "dict_", "(_", "count_", "=_", "1_", ",_", "pick", "el_", "=_", "error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "caus", "er_", "=_", "error", "\\u", "caus", "er_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "last", "\\u", "line_", "=_", "last", "\\u", "line_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "hash_", "=_", "hash_", ",_", "ticket_", "=_", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "decorated_", "=_", "[_", "(_", "x_", "[_", "'", "count", "'_", "]_", ",_", "x_", ")_", "for_", "x_", "in_", "hash", "2e", "rror_", "._", "values_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decorated_", "._", "sort_", "(_", "key_", "=_", "operator_", "._", "itemgetter_", "(_", "0_", ")_", ",_", "reverse_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "dict_", "(_", "errors_", "=_", "[_", "x_", "[_", "1_", "]_", "for_", "x_", "in_", "decorated_", "]_", ",_", "app_", "=_", "app_", ",_", "method_", "=_", "method_", ",_", "db", "\\u", "ready_", "=_", "db", "\\u", "ready_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "method_", "==_", "'", "db", "new", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "error", "s", "\\u", "path_", "=_", "apa", "th_", "(_", "'%", "s", "/", "error", "s", "'_", "%_", "app_", ",_", "r_", "=_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tk", "\\u", "db_", ",_", "tk", "\\u", "table_", "=_", "get", "\\u", "tick", "et", "\\u", "storage_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "delete", "\\u", "hashes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "request_", "._", "vars_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "item_", "[_", ":_", "7_", "]_", "==_", "'", "delete", "\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "delete", "\\u", "hashes_", "._", "append_", "(_", "item_", "[_", "7_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "hash", "2e", "rror_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "fn_", "in_", "tk", "\\u", "db_", "(_", "tk", "\\u", "table_", "._", "id_", ">_", "0_", ")_", "._", "select_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "error_", "=_", "pickle_", "._", "loads_", "(_", "fn_", "._", "tick", "et", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hash_", "=_", "hashlib_", "._", "md5_", "(_", "error_", "[_", "'", "traceback", "'_", "]_", ")_", "._", "hexdigest_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hash_", "in_", "delete", "\\u", "hashes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "tk", "\\u", "db_", "(_", "tk", "\\u", "table_", "._", "id_", "==_", "fn_", "._", "id_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tk", "\\u", "db_", "._", "commit_", "(_", ")_", "\\u\\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 ", " ", " _", "hash", "2e", "rror_", "[_", "hash_", "]_", "[_", "'", "count", "'_", "]_", "+=_", "1_", "\\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 ", " ", " _", "error", "\\u", "lines_", "=_", "error_", "[_", "'", "traceback", "'_", "]_", "._", "split_", "(_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "line_", "=_", "error", "\\u", "lines_", "[_", "-_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "caus", "er_", "=_", "os_", "._", "path_", "._", "split_", "(_", "error_", "[_", "'", "layer", "'_", "]_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hash", "2e", "rror_", "[_", "hash_", "]_", "=_", "dict_", "(_", "count_", "=_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pick", "el_", "=_", "error_", ",_", "caus", "er_", "=_", "error", "\\u", "caus", "er_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "last", "\\u", "line_", "=_", "last", "\\u", "line_", ",_", "hash_", "=_", "hash_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ticket_", "=_", "fn_", "._", "tick", "et", "\\u", "id_", ")_", "\\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_", "Attribute", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tk", "\\u", "db_", "(_", "tk", "\\u", "table_", "._", "id_", "==_", "fn_", "._", "id_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tk", "\\u", "db_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "decorated_", "=_", "[_", "(_", "x_", "[_", "'", "count", "'_", "]_", ",_", "x_", ")_", "for_", "x_", "in_", "hash", "2e", "rror_", "._", "values_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decorated_", "._", "sort_", "(_", "key_", "=_", "operator_", "._", "itemgetter_", "(_", "0_", ")_", ",_", "reverse_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "dict_", "(_", "errors_", "=_", "[_", "x_", "[_", "1_", "]_", "for_", "x_", "in_", "decorated_", "]_", ",_", "app_", "=_", "app_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "method_", "=_", "method_", ",_", "db", "\\u", "ready_", "=_", "db", "\\u", "ready_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "method_", "==_", "'", "dbo", "ld", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tk", "\\u", "db_", ",_", "tk", "\\u", "table_", "=_", "get", "\\u", "tick", "et", "\\u", "storage_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "request_", "._", "vars_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "item_", "[_", ":_", "7_", "]_", "==_", "'", "delete", "\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tk", "\\u", "db_", "(_", "tk", "\\u", "table_", "._", "tick", "et", "\\u", "id_", "==_", "item_", "[_", "7_", ":_", "]_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tk", "\\u", "db_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tick", "ets", "\\u_", "=_", "tk", "\\u", "db_", "(_", "tk", "\\u", "table_", "._", "id_", ">_", "0_", ")_", "._", "select_", "(_", "tk", "\\u", "table_", "._", "tick", "et", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "tk", "\\u", "table_", "._", "created", "\\u", "datetime_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "orderby_", "=_", "~_", "tk", "\\u", "table_", "._", "created", "\\u", "datetime_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tickets_", "=_", "[_", "row_", "._", "tick", "et", "\\u", "id_", "for_", "row_", "in_", "tick", "ets", "\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "times_", "=_", "dict_", "(_", "[_", "(_", "row_", "._", "tick", "et", "\\u", "id_", ",_", "row_", "._", "created", "\\u", "datetime_", ")_", "for_", "\\u\\u\\uNL\\u\\u\\u_", "row_", "in_", "tick", "ets", "\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "dict_", "(_", "app_", "=_", "app_", ",_", "tickets_", "=_", "tickets_", ",_", "method_", "=_", "method_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "times_", "=_", "times_", ",_", "db", "\\u", "ready_", "=_", "db", "\\u", "ready_", ")_", "\\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 ", " _", "for_", "item_", "in_", "request_", "._", "vars_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "delete", "\\u", "all", " ", "rows", " ", "doe", "sn", "'", "t", " ", "contain", " ", "any", " ", "ticket_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remove", " ", "anyt", "hing", " ", "else", " ", "as", " ", "requested_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "item_", "[_", ":_", "7_", "]_", "==_", "'", "delete", "\\u'_", "and_", "(_", "not_", "item_", "==_", "\"", "delete", "\\u", "all", "}\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "unlink_", "(_", "apa", "th_", "(_", "'%", "s", "/", "error", "s", "/", "%", "s", "'_", "%_", "(_", "app_", ",_", "item_", "[_", "7_", ":_", "]_", ")_", ",_", "r_", "=_", "request_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "func_", "=_", "lambda_", "p_", ":_", "os_", "._", "stat_", "(_", "apa", "th_", "(_", "'%", "s", "/", "error", "s", "/", "%", "s", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "app_", ",_", "p_", ")_", ",_", "r_", "=_", "request_", ")_", ")_", "._", "st", "\\u", "mtime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tickets_", "=_", "sorted_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "listdir_", "(_", "apa", "th_", "(_", "'%", "s", "/", "error", "s", "/'_", "%_", "app_", ",_", "r_", "=_", "request_", ")_", ",_", "'", "^", "\\\\", "w", ".*'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key_", "=_", "func_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reverse_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "dict_", "(_", "app_", "=_", "app_", ",_", "tickets_", "=_", "tickets_", ",_", "method_", "=_", "method_", ",_", "db", "\\u", "ready_", "=_", "db", "\\u", "ready_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "tick", "et", "\\u", "storage_", "(_", "app_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "private", "\\u", "folder_", "=_", "apa", "th_", "(_", "'%", "s", "/", "private", "'_", "%_", "app_", ",_", "r_", "=_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tick", "et", "\\u", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "private", "\\u", "folder_", ",_", "'", "tick", "et", "\\u", "storage", ".", "txt", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "tick", "et", "\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "string_", "=_", "open_", "(_", "tick", "et", "\\u", "file_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "string_", "=_", "db", "\\u", "string_", "._", "strip_", "(_", ")_", "._", "replace_", "(_", "'\\\\", "r", "'_", ",_", "''_", ")_", "._", "replace_", "(_", "'\\\\", "n", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "is", "\\u", "gae", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "use", " ", "Datas", "tore", " ", "as", " ", "fall", "back", " ", "if", " ", "there", " ", "is", " ", "no", " ", "tick", "et", "\\u", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "string_", "=_", "\"", "google", ":", "datast", "ore", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tick", "ets", "\\u", "table_", "=_", "'", "web", "2py", "\\u", "tick", "et", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tablename_", "=_", "tick", "ets", "\\u", "table_", "+_", "'\\u'_", "+_", "app_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "path_", "=_", "apa", "th_", "(_", "'%", "s", "/", "databa", "ses", "'_", "%_", "app_", ",_", "r_", "=_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tick", "ets", "db_", "=_", "DA", "L_", "(_", "db", "\\u", "string_", ",_", "folder_", "=_", "db", "\\u", "path_", ",_", "auto", "\\u", "import_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "tick", "ets", "db_", "._", "get_", "(_", "tablename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "table_", "=_", "tick", "ets", "db_", "._", "defin", "e\\u", "table_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "tablename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Field_", "(_", "'", "tick", "et", "\\u", "id", "'_", ",_", "length_", "=_", "100_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Field_", "(_", "'", "tick", "et", "\\u", "data", "'_", ",_", "'", "text", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Field_", "(_", "'", "created", "\\u", "datetime", "'_", ",_", "'", "datetime", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "tick", "ets", "db_", ",_", "tick", "ets", "db_", "._", "get_", "(_", "tablename_", ")_", "\\u\\u\\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_", "git", "\\u", "push_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Git", " ", "Push", " ", "handler", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "=_", "get", "\\u", "app_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "have", "\\u", "git_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "session_", "._", "flash_", "=_", "GIT", "\\u", "MISSING", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirect_", "(_", "URL_", "(_", "'", "site", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "form_", "=_", "SQL", "FORM", "_", "._", "factory_", "(_", "Field_", "(_", "'", "change", "log", "'_", ",_", "requires_", "=_", "IS", "\\u", "NOT", "\\u", "EMPTY_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "._", "element_", "(_", "'", "input", "[", "type", "=", "submit", "]'_", ")_", "[_", "'\\u", "value", "'_", "]_", "=_", "T_", "(_", "'", "Push", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "._", "add", "\\u", "button_", "(_", "T_", "(_", "'", "Cancel", "'_", ")_", ",_", "URL_", "(_", "'", "site", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "._", "process_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "form_", "._", "accepted_", ":_", "\\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 ", " _", "repo_", "=_", "git_", "._", "Repo_", "(_", "os_", "._", "path_", "._", "join_", "(_", "apa", "th_", "(_", "r_", "=_", "request_", ")_", ",_", "app_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index_", "=_", "repo_", "._", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index_", "._", "add_", "(_", "[_", "apa", "th_", "(_", "r_", "=_", "request_", ")_", "+_", "app_", "+_", "'/*", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "commit_", "=_", "index_", "._", "commit_", "(_", "form_", "._", "vars_", "._", "changelog_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "origin_", "=_", "repo_", "._", "remotes", "_", "._", "origin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "origin_", "._", "push_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "flash_", "=_", "T_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Git", " ", "repo", " ", "update", "d", " ", "with", " ", "late", "st", " ", "applica", "tion", " ", "change", "s", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirect_", "(_", "URL_", "(_", "'", "site", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "git_", "._", "Un", "merge", "d", "Entr", "ies", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "session_", "._", "flash_", "=_", "T_", "(_", "\"", "Push", " ", "fail", "ed", ",", " ", "there", " ", "are", " ", "unm", "erge", "d", " ", "entri", "es", " ", "in", " ", "the", " ", "cache", ".", " ", "Resolv", "e", " ", "merge", " ", "issue", "s", " ", "manu", "ally", " ", "and", " ", "try", " ", "again", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirect_", "(_", "URL_", "(_", "'", "site", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "dict_", "(_", "app_", "=_", "app_", ",_", "form_", "=_", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "plugins_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "request_", "._", "args_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "serializers_", "import_", "load", "s", "\\u", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "session_", "._", "plugins_", ":_", "\\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 ", " _", "raw", "list_", "=_", "urllib_", "._", "urlopen_", "(_", "\"", "http", "://", "www", ".", "web", "2py", "slice", "s", ".", "com", "/\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "public", "/", "api", ".", "json", "/", "action", "/", "list", "/", "content", "/", "Packa", "ge", "?", "package", "\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "\"\\u", "type", "=", "plugin", "&", "search", "\\u", "index", "=", "fal", "se", "\"_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "plugins_", "=_", "load", "s", "\\u", "json_", "(_", "raw", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "._", "flash_", "=_", "T_", "(_", "'", "Una", "ble", " ", "to", " ", "download", " ", "the", " ", "list", " ", "of", " ", "plugin", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "plugins_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "dict_", "(_", "plugins_", "=_", "session_", "._", "plugins_", "[_", "\"", "results", "\"_", "]_", ",_", "app_", "=_", "request_", "._", "args_", "(_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "install", "\\u", "plugin_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "request_", "._", "args_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source_", "=_", "request_", "._", "vars_", "._", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plugin_", "=_", "request_", "._", "vars_", "._", "plugin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "(_", "source_", "and_", "app_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "HTTP_", "(_", "500_", ",_", "T_", "(_", "\"", "Inva", "lid", " ", "request", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "form_", "=_", "SQL", "FORM", "_", "._", "factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "form_", "._", "process_", "(_", ")_", "._", "accepted_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "w2", "p", " ", "plugin_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\"", "web", "2py", ".", "plugin", ".\"_", "in_", "source_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "\"", "web", "2py", ".", "plugin", ".", "%", "s", ".", "w2", "p", "\"_", "%_", "source_", "._", "split_", "(_", "\"", "web", "2py", ".", "plugin", ".\"_", ")_", "[_", "-_", "1_", "]_", "._", "split_", "(_", "\".", "w2", "p", "\"_", ")_", "[_", "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 ", " _", "filename_", "=_", "\"", "web", "2py", ".", "plugin", ".", "%", "s", ".", "w2", "p", "\"_", "%_", "clean", "path_", "(_", "plugin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "plugin", "\\u", "install_", "(_", "app_", ",_", "urllib_", "._", "urlopen_", "(_", "source_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "request_", ",_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "session_", "._", "flash_", "=_", "T_", "(_", "'", "New", " ", "plugin", " ", "install", "ed", ":", " ", "%", "s", "'_", ",_", "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 ", " _", "session_", "._", "flash_", "=_", "T_", "(_", "'", "una", "ble", " ", "to", " ", "install", " ", "plugin", " ", "\"%", "s", "\"'_", ",_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "redirect_", "(_", "URL_", "(_", "f_", "=_", "\"", "plugin", "s", "\"_", ",_", "args_", "=_", "[_", "app_", ",_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "dict_", "(_", "form_", "=_", "form_", ",_", "app_", "=_", "app_", ",_", "plugin_", "=_", "plugin_", ",_", "source_", "=_", "source_", ")_" ]
[ 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, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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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 ]
Unused local variable
lexich/yandex-disk-webdav/yandexwebdav.py
[ { "content": "def apply_async(name, func, params_list, limit=5):\n for params in params_list:\n if type(params) is list or type(params) is tuple:\n item = (name, func, params)\n else:\n item = (name, func, [params, ])\n res = qWork.put_nowait(item)\n\n if len(threadsContainer) > 0:\n return\n for i in range(limit):\n t = threading.Thread(target=__call)\n t.daemon = True\n threadsContainer.append(t)\n for th in threadsContainer:\n th.start()", "metadata": "root.apply_async", "header": "['module', '___EOS___']", "index": 146 } ]
[ { "span": "res ", "start_line": 152, "start_column": 8, "end_line": 152, "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_", "appl", "y", "\\u", "async_", "(_", "name_", ",_", "func_", ",_", "params", "\\u", "list_", ",_", "limit_", "=_", "5_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "params_", "in_", "params", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "params_", ")_", "is_", "list_", "or_", "type_", "(_", "params_", ")_", "is_", "tuple_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "item_", "=_", "(_", "name_", ",_", "func_", ",_", "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 ", " _", "item_", "=_", "(_", "name_", ",_", "func_", ",_", "[_", "params_", ",_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "q", "Work", "_", "._", "put", "\\u", "nowait_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "thread", "s", "Container_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "limit_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "threading_", "._", "Thread_", "(_", "target_", "=_", "\\u\\u", "call_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "daemon_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "thread", "s", "Container_", "._", "append_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "th_", "in_", "thread", "s", "Container_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "th_", "._", "start_", "(_", ")_", "\\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, 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 ]
Unused local variable
home-assistant/home-assistant/homeassistant/components/sun.py
[ { "content": "def next_setting_utc(hass, entity_id=None):\n \"\"\"UTC datetime object of the next sun setting.\"\"\"\n entity_id = entity_id or ENTITY_ID\n\n state = hass.states.get(ENTITY_ID)\n\n try:\n return dt_util.parse_datetime(\n state.attributes[STATE_ATTR_NEXT_SETTING])\n except (AttributeError, KeyError):\n # AttributeError if state is None\n # KeyError if STATE_ATTR_NEXT_SETTING does not exist\n return None", "metadata": "root.next_setting_utc", "header": "['module', '___EOS___']", "index": 45 }, { "content": "def next_rising_utc(hass, entity_id=None):\n \"\"\"UTC datetime object of the next sun rising.\"\"\"\n entity_id = entity_id or ENTITY_ID\n\n state = hass.states.get(ENTITY_ID)\n\n try:\n return dt_util.parse_datetime(state.attributes[STATE_ATTR_NEXT_RISING])\n except (AttributeError, KeyError):\n # AttributeError if state is None\n # KeyError if STATE_ATTR_NEXT_RISING does not exist\n return None", "metadata": "root.next_rising_utc", "header": "['module', '___EOS___']", "index": 67 } ]
[ { "span": "entity_id ", "start_line": 47, "start_column": 4, "end_line": 47, "end_column": 13 }, { "span": "entity_id ", "start_line": 69, "start_column": 4, "end_line": 69, "end_column": 13 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "next", "\\u", "setti", "ng", "\\u", "utc_", "(_", "hass_", ",_", "entity", "\\u", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "UT", "C", " ", "datetime", " ", "object", " ", "of", " ", "the", " ", "next", " ", "sun", " ", "setti", "ng", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entity", "\\u", "id_", "=_", "entity", "\\u", "id_", "or_", "ENTITY", "\\u", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "state_", "=_", "hass_", "._", "states_", "._", "get_", "(_", "ENTITY", "\\u", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "dt", "\\u", "util_", "._", "parse", "\\u", "datetime_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "state_", "._", "attributes_", "[_", "STATE", "\\u", "ATT", "R", "\\u", "NEXT", "\\u", "SETTING", "_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Attribute", "Error_", ",_", "Key", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Attribute", "Error", " ", "if", " ", "state", " ", "is", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Key", "Error", " ", "if", " ", "STATE", "\\u", "ATT", "R", "\\u", "NEXT", "\\u", "SETTING", " ", "doe", "s", " ", "not", " ", "exist_", "\\u\\u\\uNL\\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_", "def_", "next", "\\u", "ris", "ing", "\\u", "utc_", "(_", "hass_", ",_", "entity", "\\u", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "UT", "C", " ", "datetime", " ", "object", " ", "of", " ", "the", " ", "next", " ", "sun", " ", "ris", "ing", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entity", "\\u", "id_", "=_", "entity", "\\u", "id_", "or_", "ENTITY", "\\u", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "state_", "=_", "hass_", "._", "states_", "._", "get_", "(_", "ENTITY", "\\u", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "dt", "\\u", "util_", "._", "parse", "\\u", "datetime_", "(_", "state_", "._", "attributes_", "[_", "STATE", "\\u", "ATT", "R", "\\u", "NEXT", "\\u", "RIS", "ING_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Attribute", "Error_", ",_", "Key", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Attribute", "Error", " ", "if", " ", "state", " ", "is", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Key", "Error", " ", "if", " ", "STATE", "\\u", "ATT", "R", "\\u", "NEXT", "\\u", "RIS", "ING", " ", "doe", "s", " ", "not", " ", "exist_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4,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fr>\n# All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS-IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport re, random, cPickle, collections\n\nfrom androguard.core.androconf import error, warning, debug, is_ascii_problem,\\\n load_api_specific_resource_module\nfrom androguard.core.bytecodes import dvm\nfrom androguard.core.bytecodes.api_permissions import DVM_PERMISSIONS_BY_PERMISSION, DVM_PERMISSIONS_BY_ELEMENT\n\n\n\n\n\nTAG_ANDROID = Enum(\n ['ANDROID', 'TELEPHONY', 'SMS', 'SMSMESSAGE', 'ACCESSIBILITYSERVICE',\n 'ACCOUNTS', 'ANIMATION', 'APP', 'BLUETOOTH', 'CONTENT', 'DATABASE',\n 'DEBUG', 'DRM', 'GESTURE', 'GRAPHICS', 'HARDWARE', 'INPUTMETHODSERVICE',\n 'LOCATION', 'MEDIA', 'MTP', 'NET', 'NFC', 'OPENGL', 'OS', 'PREFERENCE',\n 'PROVIDER', 'RENDERSCRIPT', 'SAX', 'SECURITY', 'SERVICE', 'SPEECH',\n 'SUPPORT', 'TEST', 'TEXT', 'UTIL', 'VIEW', 'WEBKIT', 'WIDGET',\n 'DALVIK_BYTECODE', 'DALVIK_SYSTEM', 'JAVA_REFLECTION'])\n\nTAG_REVERSE_ANDROID = dict((i[0], i[1]) for i in TAG_ANDROID.tuples())\n\nTAGS_ANDROID = {\n TAG_ANDROID.ANDROID: [0, \"Landroid\"],\n TAG_ANDROID.TELEPHONY: [0, \"Landroid/telephony\"],\n TAG_ANDROID.SMS: [0, \"Landroid/telephony/SmsManager\"],\n TAG_ANDROID.SMSMESSAGE: [0, \"Landroid/telephony/SmsMessage\"],\n TAG_ANDROID.DEBUG: [0, \"Landroid/os/Debug\"],\n TAG_ANDROID.ACCESSIBILITYSERVICE: [0, \"Landroid/accessibilityservice\"],\n TAG_ANDROID.ACCOUNTS: [0, \"Landroid/accounts\"],\n TAG_ANDROID.ANIMATION: [0, \"Landroid/animation\"],\n TAG_ANDROID.APP: [0, \"Landroid/app\"],\n TAG_ANDROID.BLUETOOTH: [0, \"Landroid/bluetooth\"],\n TAG_ANDROID.CONTENT: [0, \"Landroid/content\"],\n TAG_ANDROID.DATABASE: [0, \"Landroid/database\"],\n TAG_ANDROID.DRM: [0, \"Landroid/drm\"],\n TAG_ANDROID.GESTURE: [0, \"Landroid/gesture\"],\n TAG_ANDROID.GRAPHICS: [0, \"Landroid/graphics\"],\n TAG_ANDROID.HARDWARE: [0, \"Landroid/hardware\"],\n TAG_ANDROID.INPUTMETHODSERVICE: [0, \"Landroid/inputmethodservice\"],\n TAG_ANDROID.LOCATION: [0, \"Landroid/location\"],\n TAG_ANDROID.MEDIA: [0, \"Landroid/media\"],\n TAG_ANDROID.MTP: [0, \"Landroid/mtp\"],\n TAG_ANDROID.NET: [0, \"Landroid/net\"],\n TAG_ANDROID.NFC: [0, \"Landroid/nfc\"],\n TAG_ANDROID.OPENGL: [0, \"Landroid/opengl\"],\n TAG_ANDROID.OS: [0, \"Landroid/os\"],\n TAG_ANDROID.PREFERENCE: [0, \"Landroid/preference\"],\n TAG_ANDROID.PROVIDER: [0, \"Landroid/provider\"],\n TAG_ANDROID.RENDERSCRIPT: [0, \"Landroid/renderscript\"],\n TAG_ANDROID.SAX: [0, \"Landroid/sax\"],\n TAG_ANDROID.SECURITY: [0, \"Landroid/security\"],\n TAG_ANDROID.SERVICE: [0, \"Landroid/service\"],\n TAG_ANDROID.SPEECH: [0, \"Landroid/speech\"],\n TAG_ANDROID.SUPPORT: [0, \"Landroid/support\"],\n TAG_ANDROID.TEST: [0, \"Landroid/test\"],\n TAG_ANDROID.TEXT: [0, \"Landroid/text\"],\n TAG_ANDROID.UTIL: [0, \"Landroid/util\"],\n TAG_ANDROID.VIEW: [0, \"Landroid/view\"],\n TAG_ANDROID.WEBKIT: [0, \"Landroid/webkit\"],\n TAG_ANDROID.WIDGET: [0, \"Landroid/widget\"],\n TAG_ANDROID.DALVIK_BYTECODE: [0, \"Ldalvik/bytecode\"],\n TAG_ANDROID.DALVIK_SYSTEM: [0, \"Ldalvik/system\"],\n TAG_ANDROID.JAVA_REFLECTION: [0, \"Ljava/lang/reflect\"],\n}\n\n\n\n\n\n\n\n\n\n\nBasicOPCODES = []\nfor i in dvm.BRANCH_DVM_OPCODES:\n BasicOPCODES.append(re.compile(i))\n\n\n\n\n\n\n\n\n\n\nREF_NEW_INSTANCE = 0\nREF_CLASS_USAGE = 1\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class DVMBasicBlock(object):\n \"\"\"\n A simple basic block of a dalvik method\n \"\"\"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.DVMBasicBlock", "header": "['module', '___EOS___']", "index": 24 }, { "content": " def __init__(self, start, vm, method, context):\n self.__vm = vm\n self.method = method\n self.context = context\n\n self.last_length = 0\n self.nb_instructions = 0\n\n self.fathers = []\n self.childs = []\n\n self.start = start\n self.end = self.start\n\n self.special_ins = {}\n\n self.name = \"%s-BB@0x%x\" % (self.method.get_name(), self.start)\n self.exception_analysis = None\n\n self.notes = []", "metadata": "root.DVMBasicBlock.__init__", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 29 }, { "content": " def get_notes(self):\n return self.notes", "metadata": "root.DVMBasicBlock.get_notes", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 50 }, { "content": " def set_notes(self, value):\n self.notes = [value]", "metadata": "root.DVMBasicBlock.set_notes", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 53 }, { "content": " def add_note(self, note):\n self.notes.append(note)", "metadata": "root.DVMBasicBlock.add_note", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 56 }, { "content": " def clear_notes(self):\n self.notes = []", "metadata": "root.DVMBasicBlock.clear_notes", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 59 }, { "content": " def get_instructions(self):\n \"\"\"\n Get all instructions from a basic block.\n\n :rtype: Return all instructions in the current basic block\n \"\"\"\n tmp_ins = []\n idx = 0\n for i in self.method.get_instructions():\n if idx >= self.start and idx < self.end:\n tmp_ins.append(i)\n\n idx += i.get_length()\n return tmp_ins", "metadata": "root.DVMBasicBlock.get_instructions", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 62 }, { "content": " def get_nb_instructions(self):\n return self.nb_instructions", "metadata": "root.DVMBasicBlock.get_nb_instructions", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 77 }, { "content": " def get_method(self):\n return self.method", "metadata": "root.DVMBasicBlock.get_method", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 80 }, { "content": " def get_name(self):\n return \"%s-BB@0x%x\" % (self.method.get_name(), self.start)", "metadata": "root.DVMBasicBlock.get_name", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 83 }, { "content": " def get_start(self):\n return self.start", "metadata": "root.DVMBasicBlock.get_start", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 86 }, { "content": " def get_end(self):\n return self.end", "metadata": "root.DVMBasicBlock.get_end", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 89 }, { "content": " def get_last(self):\n return self.get_instructions()[-1]", "metadata": "root.DVMBasicBlock.get_last", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 92 }, { "content": " def get_next(self):\n \"\"\"\n Get next basic blocks\n\n :rtype: a list of the next basic blocks\n \"\"\"\n return self.childs", "metadata": "root.DVMBasicBlock.get_next", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 95 }, { "content": " def get_prev(self):\n \"\"\"\n Get previous basic blocks\n\n :rtype: a list of the previous basic blocks\n \"\"\"\n return self.fathers", "metadata": "root.DVMBasicBlock.get_prev", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 103 }, { "content": " def set_fathers(self, f):\n self.fathers.append(f)", "metadata": "root.DVMBasicBlock.set_fathers", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 111 }, { "content": " def get_last_length(self):\n return self.last_length", "metadata": "root.DVMBasicBlock.get_last_length", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 114 }, { "content": " def set_childs(self, values):\n #print self, self.start, self.end, values\n if values == []:\n next_block = self.context.get_basic_block(self.end + 1)\n if next_block != None:\n self.childs.append((self.end - self.get_last_length(), self.end,\n next_block))\n else:\n for i in values:\n if i != -1:\n next_block = self.context.get_basic_block(i)\n if next_block != None:\n self.childs.append((self.end - self.get_last_length(),\n i, next_block))\n\n for c in self.childs:\n if c[2] != None:\n c[2].set_fathers((c[1], c[0], self))", "metadata": "root.DVMBasicBlock.set_childs", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 117 }, { "content": " def push(self, i):\n self.nb_instructions += 1\n idx = self.end\n self.last_length = i.get_length()\n self.end += self.last_length\n\n op_value = i.get_op_value()\n\n if op_value == 0x26 or (op_value >= 0x2b and op_value <= 0x2c):\n code = self.method.get_code().get_bc()\n self.special_ins[idx] = code.get_ins_off(idx + i.get_ref_off() * 2)", "metadata": "root.DVMBasicBlock.push", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 136 }, { "content": " def get_special_ins(self, idx):\n \"\"\"\n Return the associated instruction to a specific instruction (for example a packed/sparse switch)\n\n :param idx: the index of the instruction\n\n :rtype: None or an Instruction\n \"\"\"\n try:\n return self.special_ins[idx]\n except:\n return None", "metadata": "root.DVMBasicBlock.get_special_ins", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 148 }, { "content": " def get_exception_analysis(self):\n return self.exception_analysis", "metadata": "root.DVMBasicBlock.get_exception_analysis", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 161 }, { "content": " def set_exception_analysis(self, exception_analysis):\n self.exception_analysis = exception_analysis", "metadata": "root.DVMBasicBlock.set_exception_analysis", "header": "['class', 'DVMBasicBlock', '(', 'object', ')', ':', '___EOS___']", "index": 164 }, { "content": "class Enum(object):\n\n", "metadata": "root.Enum", "header": "['module', '___EOS___']", "index": 168 }, { "content": " def __init__(self, names):\n self.names = names\n for value, name in enumerate(self.names):\n setattr(self, name.upper(), value)", "metadata": "root.Enum.__init__", "header": "['class', 'Enum', '(', 'object', ')', ':', '___EOS___']", "index": 170 }, { "content": " def tuples(self):\n return tuple(enumerate(self.names))", "metadata": "root.Enum.tuples", "header": "['class', 'Enum', '(', 'object', ')', ':', '___EOS___']", "index": 175 }, { "content": "class Tags(object):\n \"\"\"\n Handle specific tags\n\n :param patterns:\n :params reverse:\n \"\"\"\n\n\n\n\n\n\n", "metadata": "root.Tags", "header": "['module', '___EOS___']", "index": 235 }, { "content": " def __init__(self, patterns=TAGS_ANDROID, reverse=TAG_REVERSE_ANDROID):\n self.tags = set()\n\n self.patterns = patterns\n self.reverse = TAG_REVERSE_ANDROID\n\n for i in self.patterns:\n self.patterns[i][1] = re.compile(self.patterns[i][1])", "metadata": "root.Tags.__init__", "header": "['class', 'Tags', '(', 'object', ')', ':', '___EOS___']", "index": 243 }, { "content": " def emit(self, method):\n for i in self.patterns:\n if self.patterns[i][0] == 0:\n if self.patterns[i][1].search(method.get_class()) != None:\n self.tags.add(i)", "metadata": "root.Tags.emit", "header": "['class', 'Tags', '(', 'object', ')', ':', '___EOS___']", "index": 252 }, { "content": " def emit_by_classname(self, classname):\n for i in self.patterns:\n if self.patterns[i][0] == 0:\n if self.patterns[i][1].search(classname) != None:\n self.tags.add(i)", "metadata": "root.Tags.emit_by_classname", "header": "['class', 'Tags', '(', 'object', ')', ':', '___EOS___']", "index": 258 }, { "content": " def get_list(self):\n return [self.reverse[i] for i in self.tags]", "metadata": "root.Tags.get_list", "header": "['class', 'Tags', '(', 'object', ')', ':', '___EOS___']", "index": 264 }, { "content": " def __contains__(self, key):\n return key in self.tags", "metadata": "root.Tags.__contains__", "header": "['class', 'Tags', '(', 'object', ')', ':', '___EOS___']", "index": 267 }, { "content": " def __str__(self):\n return str([self.reverse[i] for i in self.tags])", "metadata": "root.Tags.__str__", "header": "['class', 'Tags', '(', 'object', ')', ':', '___EOS___']", "index": 270 }, { "content": " def empty(self):\n return self.tags == set()", "metadata": "root.Tags.empty", "header": "['class', 'Tags', '(', 'object', ')', ':', '___EOS___']", "index": 273 }, { "content": "class BasicBlocks(object):\n \"\"\"\n This class represents all basic blocks of a method\n \"\"\"\n\n\n\n\n\n\n", "metadata": "root.BasicBlocks", "header": "['module', '___EOS___']", "index": 277 }, { "content": " def __init__(self, _vm):\n self.__vm = _vm\n self.bb = []", "metadata": "root.BasicBlocks.__init__", "header": "['class', 'BasicBlocks', '(', 'object', ')', ':', '___EOS___']", "index": 282 }, { "content": " def push(self, bb):\n self.bb.append(bb)", "metadata": "root.BasicBlocks.push", "header": "['class', 'BasicBlocks', '(', 'object', ')', ':', '___EOS___']", "index": 286 }, { "content": " def pop(self, idx):\n return self.bb.pop(idx)", "metadata": "root.BasicBlocks.pop", "header": "['class', 'BasicBlocks', '(', 'object', ')', ':', '___EOS___']", "index": 289 }, { "content": " def get_basic_block(self, idx):\n for i in self.bb:\n if idx >= i.get_start() and idx < i.get_end():\n return i\n return None", "metadata": "root.BasicBlocks.get_basic_block", "header": "['class', 'BasicBlocks', '(', 'object', ')', ':', '___EOS___']", "index": 292 }, { "content": " def get(self):\n \"\"\"\n :rtype: return each basic block (:class:`DVMBasicBlock` object)\n \"\"\"\n for i in self.bb:\n yield i", "metadata": "root.BasicBlocks.get", "header": "['class', 'BasicBlocks', '(', 'object', ')', ':', '___EOS___']", "index": 298 }, { "content": " def gets(self):\n \"\"\"\n :rtype: a list of basic blocks (:class:`DVMBasicBlock` objects)\n \"\"\"\n return self.bb", "metadata": "root.BasicBlocks.gets", "header": "['class', 'BasicBlocks', '(', 'object', ')', ':', '___EOS___']", "index": 305 }, { "content": " def get_basic_block_pos(self, idx):\n return self.bb[idx]", "metadata": "root.BasicBlocks.get_basic_block_pos", "header": "['class', 'BasicBlocks', '(', 'object', ')', ':', '___EOS___']", "index": 311 }, { "content": "class ExceptionAnalysis(object):\n\n\n", "metadata": "root.ExceptionAnalysis", "header": "['module', '___EOS___']", "index": 315 }, { "content": " def __init__(self, exception, bb):\n self.start = exception[0]\n self.end = exception[1]\n\n self.exceptions = exception[2:]\n\n for i in self.exceptions:\n i.append(bb.get_basic_block(i[1]))", "metadata": "root.ExceptionAnalysis.__init__", "header": "['class', 'ExceptionAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 317 }, { "content": " def show_buff(self):\n buff = \"%x:%x\\n\" % (self.start, self.end)\n\n for i in self.exceptions:\n if i[2] == None:\n buff += \"\\t(%s -> %x %s)\\n\" % (i[0], i[1], i[2])\n else:\n buff += \"\\t(%s -> %x %s)\\n\" % (i[0], i[1], i[2].get_name())\n\n return buff[:-1]", "metadata": "root.ExceptionAnalysis.show_buff", "header": "['class', 'ExceptionAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 326 }, { "content": " def get(self):\n d = {\"start\": self.start, \"end\": self.end, \"list\": []}\n\n for i in self.exceptions:\n d[\"list\"].append({\"name\": i[0], \"idx\": i[1], \"bb\": i[2].get_name()})\n\n return d", "metadata": "root.ExceptionAnalysis.get", "header": "['class', 'ExceptionAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 337 }, { "content": "class Exceptions(object):\n\n\n\n\n", "metadata": "root.Exceptions", "header": "['module', '___EOS___']", "index": 346 }, { "content": " def __init__(self, _vm):\n self.__vm = _vm\n self.exceptions = []", "metadata": "root.Exceptions.__init__", "header": "['class', 'Exceptions', '(', 'object', ')', ':', '___EOS___']", "index": 348 }, { "content": " def add(self, exceptions, basic_blocks):\n for i in exceptions:\n self.exceptions.append(ExceptionAnalysis(i, basic_blocks))", "metadata": "root.Exceptions.add", "header": "['class', 'Exceptions', '(', 'object', ')', ':', '___EOS___']", "index": 352 }, { "content": " def get_exception(self, addr_start, addr_end):\n for i in self.exceptions:\n # print hex(i.start), hex(i.end), hex(addr_start), hex(addr_end), i.start >= addr_start and i.end <= addr_end, addr_end <= i.end and addr_start >= i.start\n if i.start >= addr_start and i.end <= addr_end:\n return i\n\n elif addr_end <= i.end and addr_start >= i.start:\n return i\n\n return None", "metadata": "root.Exceptions.get_exception", "header": "['class', 'Exceptions', '(', 'object', ')', ':', '___EOS___']", "index": 356 }, { "content": " def gets(self):\n return self.exceptions", "metadata": "root.Exceptions.gets", "header": "['class', 'Exceptions', '(', 'object', ')', ':', '___EOS___']", "index": 367 }, { "content": " def get(self):\n for i in self.exceptions:\n yield i", "metadata": "root.Exceptions.get", "header": "['class', 'Exceptions', '(', 'object', ')', ':', '___EOS___']", "index": 370 }, { "content": "class MethodAnalysis(object):\n \"\"\"\n This class analyses in details a method of a class/dex file\n\n :type vm: a :class:`DalvikVMFormat` object\n :type method: a :class:`EncodedMethod` object\n \"\"\"\n\n\n\n\n\n\n\n", "metadata": "root.MethodAnalysis", "header": "['module', '___EOS___']", "index": 380 }, { "content": " def __init__(self, vm, method):\n self.__vm = vm\n self.method = method\n\n self.basic_blocks = BasicBlocks(self.__vm)\n self.exceptions = Exceptions(self.__vm)\n\n code = self.method.get_code()\n if code == None:\n return\n\n current_basic = DVMBasicBlock(0, self.__vm, self.method, self.basic_blocks)\n self.basic_blocks.push(current_basic)\n\n ##########################################################\n\n bc = code.get_bc()\n l = []\n h = {}\n idx = 0\n\n debug(\"Parsing instructions\")\n instructions = [i for i in bc.get_instructions()]\n for i in instructions:\n for j in BasicOPCODES:\n if j.match(i.get_name()) != None:\n v = dvm.determineNext(i, idx, self.method)\n h[idx] = v\n l.extend(v)\n break\n\n idx += i.get_length()\n\n debug(\"Parsing exceptions\")\n excepts = dvm.determineException(self.__vm, self.method)\n for i in excepts:\n l.extend([i[0]])\n for handler in i[2:]:\n l.append(handler[1])\n\n debug(\"Creating basic blocks in %s\" % self.method)\n idx = 0\n for i in instructions:\n # index is a destination\n if idx in l:\n if current_basic.get_nb_instructions() != 0:\n current_basic = DVMBasicBlock(current_basic.get_end(),\n self.__vm, self.method,\n self.basic_blocks)\n self.basic_blocks.push(current_basic)\n\n current_basic.push(i)\n\n # index is a branch instruction\n if idx in h:\n current_basic = DVMBasicBlock(current_basic.get_end(),\n self.__vm, self.method,\n self.basic_blocks)\n self.basic_blocks.push(current_basic)\n\n idx += i.get_length()\n\n if current_basic.get_nb_instructions() == 0:\n self.basic_blocks.pop(-1)\n\n debug(\"Settings basic blocks childs\")\n\n for i in self.basic_blocks.get():\n try:\n i.set_childs(h[i.end - i.get_last_length()])\n except KeyError:\n i.set_childs([])\n\n debug(\"Creating exceptions\")\n\n # Create exceptions\n self.exceptions.add(excepts, self.basic_blocks)\n\n for i in self.basic_blocks.get():\n # setup exception by basic block\n i.set_exception_analysis(self.exceptions.get_exception(i.start,\n i.end - 1))\n\n del instructions\n del h, l", "metadata": "root.MethodAnalysis.__init__", "header": "['class', 'MethodAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 388 }, { "content": " def get_basic_blocks(self):\n \"\"\"\n :rtype: a :class:`BasicBlocks` object\n \"\"\"\n return self.basic_blocks", "metadata": "root.MethodAnalysis.get_basic_blocks", "header": "['class', 'MethodAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 474 }, { "content": " def get_length(self):\n \"\"\"\n :rtype: an integer which is the length of the code\n \"\"\"\n return self.get_code().get_length()", "metadata": "root.MethodAnalysis.get_length", "header": "['class', 'MethodAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 480 }, { "content": " def get_vm(self):\n return self.__vm", "metadata": "root.MethodAnalysis.get_vm", "header": "['class', 'MethodAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 486 }, { "content": " def get_method(self):\n return self.method", "metadata": "root.MethodAnalysis.get_method", "header": "['class', 'MethodAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 489 }, { "content": " def show(self):\n print \"METHOD\", self.method.get_class_name(), self.method.get_name(\n ), self.method.get_descriptor()\n\n for i in self.basic_blocks.get():\n print \"\\t\", i\n i.show()\n print \"\"", "metadata": "root.MethodAnalysis.show", "header": "['class', 'MethodAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 492 }, { "content": " def show_methods(self):\n print \"\\t #METHODS :\"\n for i in self.__bb:\n methods = i.get_methods()\n for method in methods:\n print \"\\t\\t-->\", method.get_class_name(), method.get_name(\n ), method.get_descriptor()\n for context in methods[method]:\n print \"\\t\\t\\t |---|\", context.details", "metadata": "root.MethodAnalysis.show_methods", "header": "['class', 'MethodAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 501 }, { "content": " def get_tags(self):\n \"\"\"\n Return the tags of the method\n\n :rtype: a :class:`Tags` object\n \"\"\"\n return self.tags", "metadata": "root.MethodAnalysis.get_tags", "header": "['class', 'MethodAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 511 }, { "content": "class StringAnalysis(object):\n\n\n\n\n\n\n", "metadata": "root.StringAnalysis", "header": "['module', '___EOS___']", "index": 520 }, { "content": " def __init__(self, value):\n self.value = value\n self.orig_value = value\n self.xreffrom = set()", "metadata": "root.StringAnalysis.__init__", "header": "['class', 'StringAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 522 }, { "content": " def AddXrefFrom(self, classobj, methodobj):\n #debug(\"Added strings xreffrom for %s to %s\" % (self.value, methodobj))\n self.xreffrom.add((classobj, methodobj))", "metadata": "root.StringAnalysis.AddXrefFrom", "header": "['class', 'StringAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 527 }, { "content": " def get_xref_from(self):\n return self.xreffrom", "metadata": "root.StringAnalysis.get_xref_from", "header": "['class', 'StringAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 531 }, { "content": " def set_value(self, value):\n self.value = value", "metadata": "root.StringAnalysis.set_value", "header": "['class', 'StringAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 534 }, { "content": " def get_value(self):\n return self.value", "metadata": "root.StringAnalysis.get_value", "header": "['class', 'StringAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 537 }, { "content": " def get_orig_value(self):\n return self.orig_value", "metadata": "root.StringAnalysis.get_orig_value", "header": "['class', 'StringAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 540 }, { "content": " def __str__(self):\n data = \"XREFto for string %s in\\n\" % repr(self.get_value())\n for ref_class, ref_method in self.xreffrom:\n data += \"%s:%s\\n\" % (ref_class.get_vm_class().get_name(), ref_method\n )\n return data", "metadata": "root.StringAnalysis.__str__", "header": "['class', 'StringAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 543 }, { "content": "class MethodClassAnalysis(object):\n\n\n\n\n\n", "metadata": "root.MethodClassAnalysis", "header": "['module', '___EOS___']", "index": 551 }, { "content": " def __init__(self, method):\n self.method = method\n self.xrefto = set()\n self.xreffrom = set()", "metadata": "root.MethodClassAnalysis.__init__", "header": "['class', 'MethodClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 553 }, { "content": " def AddXrefTo(self, classobj, methodobj, offset):\n #debug(\"Added method xrefto for %s [%s] to %s\" % (self.method, classobj, methodobj))\n self.xrefto.add((classobj, methodobj, offset))", "metadata": "root.MethodClassAnalysis.AddXrefTo", "header": "['class', 'MethodClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 558 }, { "content": " def AddXrefFrom(self, classobj, methodobj, offset):\n #debug(\"Added method xreffrom for %s [%s] to %s\" % (self.method, classobj, methodobj))\n self.xreffrom.add((classobj, methodobj, offset))", "metadata": "root.MethodClassAnalysis.AddXrefFrom", "header": "['class', 'MethodClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 562 }, { "content": " def get_xref_from(self):\n return self.xreffrom", "metadata": "root.MethodClassAnalysis.get_xref_from", "header": "['class', 'MethodClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 566 }, { "content": " def get_xref_to(self):\n return self.xrefto", "metadata": "root.MethodClassAnalysis.get_xref_to", "header": "['class', 'MethodClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 569 }, { "content": " def __str__(self):\n data = \"XREFto for %s\\n\" % self.method\n for ref_class, ref_method, offset in self.xrefto:\n data += \"in\\n\"\n data += \"%s:%s @0x%x\\n\" % (ref_class.get_vm_class().get_name(), ref_method, offset\n )\n\n data += \"XREFFrom for %s\\n\" % self.method\n for ref_class, ref_method, offset in self.xreffrom:\n data += \"in\\n\"\n data += \"%s:%s @0x%x\\n\" % (ref_class.get_vm_class().get_name(), ref_method, offset\n )\n\n return data", "metadata": "root.MethodClassAnalysis.__str__", "header": "['class', 'MethodClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 572 }, { "content": "class FieldClassAnalysis(object):\n\n\n\n\n\n", "metadata": "root.FieldClassAnalysis", "header": "['module', '___EOS___']", "index": 588 }, { "content": " def __init__(self, field):\n self.field = field\n self.xrefread = set()\n self.xrefwrite = set()", "metadata": "root.FieldClassAnalysis.__init__", "header": "['class', 'FieldClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 590 }, { "content": " def AddXrefRead(self, classobj, methodobj):\n #debug(\"Added method xrefto for %s [%s] to %s\" % (self.method, classobj, methodobj))\n self.xrefread.add((classobj, methodobj))", "metadata": "root.FieldClassAnalysis.AddXrefRead", "header": "['class', 'FieldClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 595 }, { "content": " def AddXrefWrite(self, classobj, methodobj):\n #debug(\"Added method xreffrom for %s [%s] to %s\" % (self.method, classobj, methodobj))\n self.xrefwrite.add((classobj, methodobj))", "metadata": "root.FieldClassAnalysis.AddXrefWrite", "header": "['class', 'FieldClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 599 }, { "content": " def get_xref_read(self):\n return self.xrefread", "metadata": "root.FieldClassAnalysis.get_xref_read", "header": "['class', 'FieldClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 603 }, { "content": " def get_xref_write(self):\n return self.xrefwrite", "metadata": "root.FieldClassAnalysis.get_xref_write", "header": "['class', 'FieldClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 606 }, { "content": " def __str__(self):\n data = \"XREFRead for %s\\n\" % self.field\n for ref_class, ref_method in self.xrefread:\n data += \"in\\n\"\n data += \"%s:%s\\n\" % (ref_class.get_vm_class().get_name(), ref_method\n )\n\n data += \"XREFWrite for %s\\n\" % self.field\n for ref_class, ref_method in self.xrefwrite:\n data += \"in\\n\"\n data += \"%s:%s\\n\" % (ref_class.get_vm_class().get_name(), ref_method\n )\n\n return data", "metadata": "root.FieldClassAnalysis.__str__", "header": "['class', 'FieldClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 609 }, { "content": "class ClassAnalysis(object):\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.ClassAnalysis", "header": "['module', '___EOS___']", "index": 629 }, { "content": " def __init__(self, classobj):\n self.orig_class = classobj\n self._methods = {}\n self._fields = {}\n\n self.xrefto = collections.defaultdict(set)\n self.xreffrom = collections.defaultdict(set)", "metadata": "root.ClassAnalysis.__init__", "header": "['class', 'ClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 631 }, { "content": " def get_method_analysis(self, method):\n return self._methods.get(method)", "metadata": "root.ClassAnalysis.get_method_analysis", "header": "['class', 'ClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 639 }, { "content": " def get_field_analysis(self, field):\n return self._fields.get(field)", "metadata": "root.ClassAnalysis.get_field_analysis", "header": "['class', 'ClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 642 }, { "content": " def AddFXrefRead(self, method, classobj, field):\n if field not in self._fields:\n self._fields[field] = FieldClassAnalysis(field)\n self._fields[field].AddXrefRead(classobj, method)", "metadata": "root.ClassAnalysis.AddFXrefRead", "header": "['class', 'ClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 645 }, { "content": " def AddFXrefWrite(self, method, classobj, field):\n if field not in self._fields:\n self._fields[field] = FieldClassAnalysis(field)\n self._fields[field].AddXrefWrite(classobj, method)", "metadata": "root.ClassAnalysis.AddFXrefWrite", "header": "['class', 'ClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 650 }, { "content": " def AddMXrefTo(self, method1, classobj, method2, offset):\n if method1 not in self._methods:\n self._methods[method1] = MethodClassAnalysis(method1)\n self._methods[method1].AddXrefTo(classobj, method2, offset)", "metadata": "root.ClassAnalysis.AddMXrefTo", "header": "['class', 'ClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 655 }, { "content": " def AddMXrefFrom(self, method1, classobj, method2, offset):\n if method1 not in self._methods:\n self._methods[method1] = MethodClassAnalysis(method1)\n self._methods[method1].AddXrefFrom(classobj, method2, offset)", "metadata": "root.ClassAnalysis.AddMXrefFrom", "header": "['class', 'ClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 660 }, { "content": " def AddXrefTo(self, ref_kind, classobj, methodobj, offset):\n self.xrefto[classobj].add((ref_kind, methodobj, offset))", "metadata": "root.ClassAnalysis.AddXrefTo", "header": "['class', 'ClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 665 }, { "content": " def AddXrefFrom(self, ref_kind, classobj, methodobj, offset):\n self.xreffrom[classobj].add((ref_kind, methodobj, offset))", "metadata": "root.ClassAnalysis.AddXrefFrom", "header": "['class', 'ClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 668 }, { "content": " def get_xref_from(self):\n return self.xreffrom", "metadata": "root.ClassAnalysis.get_xref_from", "header": "['class', 'ClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 671 }, { "content": " def get_xref_to(self):\n return self.xrefto", "metadata": "root.ClassAnalysis.get_xref_to", "header": "['class', 'ClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 674 }, { "content": " def get_vm_class(self):\n return self.orig_class", "metadata": "root.ClassAnalysis.get_vm_class", "header": "['class', 'ClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 677 }, { "content": " def __str__(self):\n data = \"XREFto for %s\\n\" % self.orig_class\n for ref_class in self.xrefto:\n data += str(ref_class.get_vm_class().get_name()) + \" \"\n data += \"in\\n\"\n for ref_kind, ref_method, ref_offset in self.xrefto[ref_class]:\n data += \"%d %s 0x%x\\n\" % (ref_kind, ref_method, ref_offset)\n\n data += \"\\n\"\n\n data += \"XREFFrom for %s\\n\" % self.orig_class\n for ref_class in self.xreffrom:\n data += str(ref_class.get_vm_class().get_name()) + \" \"\n data += \"in\\n\"\n for ref_kind, ref_method, ref_offset in self.xreffrom[ref_class]:\n data += \"%d %s 0x%x\\n\" % (ref_kind, ref_method, ref_offset)\n\n data += \"\\n\"\n\n return data", "metadata": "root.ClassAnalysis.__str__", "header": "['class', 'ClassAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 680 }, { "content": "class newVMAnalysis(object):\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.newVMAnalysis", "header": "['module', '___EOS___']", "index": 702 }, { "content": " def __init__(self, vm):\n self.vms = [vm]\n self.classes = {}\n self.strings = {}\n\n for current_class in vm.get_classes():\n self.classes[current_class.get_name()] = ClassAnalysis(\n current_class)", "metadata": "root.newVMAnalysis.__init__", "header": "['class', 'newVMAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 704 }, { "content": " def create_xref(self):\n debug(\"Creating XREF/DREF\")\n\n instances_class_name = self.classes.keys()\n\n last_vm = self.vms[-1]\n for current_class in last_vm.get_classes():\n for current_method in current_class.get_methods():\n debug(\"Creating XREF for %s\" % current_method)\n\n code = current_method.get_code()\n if code == None:\n continue\n\n off = 0\n bc = code.get_bc()\n try:\n for instruction in bc.get_instructions():\n op_value = instruction.get_op_value()\n if op_value in [0x1c, 0x22]:\n idx_type = instruction.get_ref_kind()\n type_info = last_vm.get_cm_type(idx_type)\n\n # Internal xref related to class manipulation\n if type_info in instances_class_name and type_info != current_class.get_name(\n ):\n # new instance\n if op_value == 0x22:\n self.classes[current_class.get_name(\n )].AddXrefTo(REF_NEW_INSTANCE,\n self.classes[type_info],\n current_method, off)\n self.classes[type_info].AddXrefFrom(\n REF_NEW_INSTANCE,\n self.classes[current_class.get_name()],\n current_method, off)\n # class reference\n else:\n self.classes[current_class.get_name(\n )].AddXrefTo(REF_CLASS_USAGE,\n self.classes[type_info],\n current_method, off)\n self.classes[type_info].AddXrefFrom(\n REF_CLASS_USAGE,\n self.classes[current_class.get_name()],\n current_method, off)\n\n elif ((op_value >= 0x6e and op_value <= 0x72) or\n (op_value >= 0x74 and op_value <= 0x78)):\n idx_meth = instruction.get_ref_kind()\n method_info = last_vm.get_cm_method(idx_meth)\n if method_info:\n class_info = method_info[0]\n\n method_item = last_vm.get_method_descriptor(\n method_info[0], method_info[1],\n ''.join(method_info[2]))\n if method_item:\n self.classes[current_class.get_name(\n )].AddMXrefTo(current_method,\n self.classes[class_info],\n method_item,\n off)\n self.classes[class_info].AddMXrefFrom(\n method_item,\n self.classes[current_class.get_name()],\n current_method,\n off)\n\n # Internal xref related to class manipulation\n if class_info in instances_class_name and class_info != current_class.get_name(\n ):\n self.classes[current_class.get_name(\n )].AddXrefTo(REF_CLASS_USAGE,\n self.classes[class_info],\n method_item, off)\n self.classes[class_info].AddXrefFrom(\n REF_CLASS_USAGE,\n self.classes[current_class.get_name()],\n current_method, off)\n\n elif op_value >= 0x1a and op_value <= 0x1b:\n string_value = last_vm.get_cm_string(\n instruction.get_ref_kind())\n if string_value not in self.strings:\n self.strings[string_value] = StringAnalysis(\n string_value)\n self.strings[string_value].AddXrefFrom(\n self.classes[current_class.get_name()],\n current_method)\n\n elif op_value >= 0x52 and op_value <= 0x6d:\n idx_field = instruction.get_ref_kind()\n field_info = last_vm.get_cm_field(idx_field)\n field_item = last_vm.get_field_descriptor(\n field_info[0], field_info[2], field_info[1])\n if field_item:\n # read access to a field\n if (op_value >= 0x52 and op_value <= 0x58) or (\n op_value >= 0x60 and op_value <= 0x66):\n self.classes[current_class.get_name(\n )].AddFXrefRead(\n current_method,\n self.classes[current_class.get_name()],\n field_item)\n # write access to a field\n else:\n self.classes[current_class.get_name(\n )].AddFXrefWrite(\n current_method,\n self.classes[current_class.get_name()],\n field_item)\n\n off += instruction.get_length()\n except dvm.InvalidInstruction as e:\n warning(\"Invalid instruction %s\" % str(e))", "metadata": "root.newVMAnalysis.create_xref", "header": "['class', 'newVMAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 713 }, { "content": " def get_method(self, method):\n for vm in self.vms:\n if method in vm.get_methods():\n return MethodAnalysis(vm, method)\n return None", "metadata": "root.newVMAnalysis.get_method", "header": "['class', 'newVMAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 830 }, { "content": " def get_method_by_name(self, class_name, method_name, method_descriptor):\n if class_name in self.classes:\n for method in self.classes[class_name].get_vm_class().get_methods():\n if method.get_name() == method_name and method.get_descriptor(\n ) == method_descriptor:\n return method\n return None", "metadata": "root.newVMAnalysis.get_method_by_name", "header": "['class', 'newVMAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 836 }, { "content": " def get_method_analysis(self, method):\n class_analysis = self.get_class_analysis(method.get_class_name())\n if class_analysis:\n return class_analysis.get_method_analysis(method)\n return None", "metadata": "root.newVMAnalysis.get_method_analysis", "header": "['class', 'newVMAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 844 }, { "content": " def get_method_analysis_by_name(self, class_name, method_name, method_descriptor):\n method = self.get_method_by_name(class_name, method_name, method_descriptor)\n if method:\n return self.get_method_analysis(method)\n return None", "metadata": "root.newVMAnalysis.get_method_analysis_by_name", "header": "['class', 'newVMAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 850 }, { "content": " def get_field_analysis(self, field):\n class_analysis = self.get_class_analysis(field.get_class_name())\n if class_analysis:\n return class_analysis.get_field_analysis(field)\n return None", "metadata": "root.newVMAnalysis.get_field_analysis", "header": "['class', 'newVMAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 856 }, { "content": " def is_class_present(self, class_name):\n return class_name in self.classes", "metadata": "root.newVMAnalysis.is_class_present", "header": "['class', 'newVMAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 862 }, { "content": " def get_class_analysis(self, class_name):\n return self.classes.get(class_name)", "metadata": "root.newVMAnalysis.get_class_analysis", "header": "['class', 'newVMAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 865 }, { "content": " def get_strings_analysis(self):\n return self.strings", "metadata": "root.newVMAnalysis.get_strings_analysis", "header": "['class', 'newVMAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 868 }, { "content": " def add(self, vm):\n self.vms.append(vm)\n\n for current_class in vm.get_classes():\n if current_class.get_name() not in self.classes:\n self.classes[current_class.get_name()] = ClassAnalysis(\n current_class)", "metadata": "root.newVMAnalysis.add", "header": "['class', 'newVMAnalysis', '(', 'object', ')', ':', '___EOS___']", "index": 871 }, { "content": "def is_ascii_obfuscation(vm):\n for classe in vm.get_classes():\n if is_ascii_problem(classe.get_name()):\n return True\n for method in classe.get_methods():\n if is_ascii_problem(method.get_name()):\n return True\n return False", "metadata": "root.is_ascii_obfuscation", "header": "['module', '___EOS___']", "index": 879 } ]
[ { "span": "import re, random, cPickle, collections", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 39 }, { "span": "from androguard.core.androconf import error, warning, debug, is_ascii_problem,\\\n load_api_specific_resource_module", "start_line": 19, "start_column": 0, "end_line": 20, "end_column": 37 }, { "span": "from androguard.core.bytecodes.api_permissions import DVM_PERMISSIONS_BY_PERMISSION, DVM_PERMISSIONS_BY_ELEMENT", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 111 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Thi", "s", " ", "file", " ", "is", " ", "part", " ", "of", " ", "And", "rog", "uar", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2012", ",", " ", "Ant", "hon", "y", " ", "Des", "nos", " ", "<", "des", "nos", " ", "at", " ", "t0", "t0", ".", "fr", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", "-", "IS", "\"", " ", "BAS", "IS", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "re_", ",_", "random_", ",_", "c", "Pickle_", ",_", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "andr", "og", "uar", "d_", "._", "core_", "._", "andr", "oco", "nf_", "import_", "error_", ",_", "warning_", ",_", "debug_", ",_", "is", "\\u", "ascii", "\\u", "problem_", ",_", "load", "\\u", "api", "\\u", "specific", "\\u", "resource", "\\u", "module_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "andr", "og", "uar", "d_", "._", "core_", "._", "bytecode", "s_", "import_", "dv", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "andr", "og", "uar", "d_", "._", "core_", "._", "bytecode", "s_", "._", "api", "\\u", "permissions_", "import_", "DV", "M", "\\u", "PERMISSION", "S", "\\u", "BY", "\\u", "PERMISSION", "_", ",_", "DV", "M", "\\u", "PERMISSION", "S", "\\u", "BY", "\\u", "ELEMENT", "_", "\\u\\u\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "=_", "Enum_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "ANDROID", "'_", ",_", "'", "TELE", "PH", "ON", "Y", "'_", ",_", "'", "SMS", "'_", ",_", "'", "SMS", "MESSAGE", "'_", ",_", "'", "ACCESS", "IB", "ILI", "TY", "SERV", "ICE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ACCOUNT", "S", "'_", ",_", "'", "ANIM", "ATION", "'_", ",_", "'", "APP", "'_", ",_", "'", "BLUE", "TOO", "TH", "'_", ",_", "'", "CONTE", "NT", "'_", ",_", "'", "DATA", "BASE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "DEBU", "G", "'_", ",_", "'", "DR", "M", "'_", ",_", "'", "GE", "STU", "RE", "'_", ",_", "'", "GRAPHI", "CS", "'_", ",_", "'", "HARD", "WARE", "'_", ",_", "'", "INPUT", "METH", "OD", "SERV", "ICE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "LOCATION", "'_", ",_", "'", "MEDIA", "'_", ",_", "'", "MT", "P", "'_", ",_", "'", "NET", "'_", ",_", "'", "NF", "C", "'_", ",_", "'", "OPEN", "GL", "'_", ",_", "'", "OS", "'_", ",_", "'", "PREFER", "ENCE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PROVIDER", "'_", ",_", "'", "RENDER", "SCRIPT", "'_", ",_", "'", "SA", "X", "'_", ",_", "'", "SECURITY", "'_", ",_", "'", "SERV", "ICE", "'_", ",_", "'", "SPE", "EC", "H", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SUPPORT", "'_", ",_", "'", "TEST", "'_", ",_", "'", "TEXT", "'_", ",_", "'", "UTIL", "'_", ",_", "'", "VIEW", "'_", ",_", "'", "WEB", "KI", "T", "'_", ",_", "'", "WID", "GET", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "DA", "LV", "IK", "\\u", "BYTE", "CODE", "'_", ",_", "'", "DA", "LV", "IK", "\\u", "SYSTEM", "'_", ",_", "'", "JAVA", "\\u", "REF", "LE", "CTION", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "REVERSE", "\\u", "ANDROID", "_", "=_", "dict_", "(_", "(_", "i_", "[_", "0_", "]_", ",_", "i_", "[_", "1_", "]_", ")_", "for_", "i_", "in_", "TAG", "\\u", "ANDROID", "_", "._", "tuples_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "S", "\\u", "ANDROID", "_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "ANDROID", "_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "TELE", "PH", "ON", "Y_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "telep", "hon", "y", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "SMS", "_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "telep", "hon", "y", "/", "Sm", "s", "Manager", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "SMS", "MESSAGE_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "telep", "hon", "y", "/", "Sm", "s", "Messag", "e", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "DEBUG_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "os", "/", "Deb", "ug", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "ACCESS", "IB", "ILI", "TY", "SERVICE_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "accessi", "bilit", "yse", "rvice", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "ACCOUNT", "S_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "account", "s", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "ANIM", "ATION_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "animati", "on", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "APP_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "app", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "BLUE", "TOO", "TH_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "bluetooth", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "CONTENT_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "content", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "DATABASE_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "databa", "se", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "DR", "M_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "dr", "m", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "GE", "STU", "RE_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "gesture", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "GRAPHI", "CS_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "graphic", "s", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "HARD", "WARE", "_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "hard", "ware", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "INPUT", "METH", "OD", "SERVICE_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "input", "method", "service", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "LOCATION_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "location", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "MEDIA", "_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "media", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "MT", "P_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "mt", "p", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "NET", "_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "net", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "NF", "C_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "nf", "c", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "OPEN", "GL_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "opengl", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "OS_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "os", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "PREFER", "ENCE", "_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "preference", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "PROVIDER", "_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "provide", "r", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "RENDER", "SCRIPT_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "render", "script", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "SA", "X_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "sax", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "SECURITY", "_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "security", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "SERVICE_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "service", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "SPE", "EC", "H_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "spe", "ech", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "SUPPORT", "_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "support", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "TEST_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "test", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "TEXT_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "text", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "UTIL", "_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "util", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "VIEW_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "view", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "WEB", "KI", "T_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "webkit", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "WID", "GET_", ":_", "[_", "0_", ",_", "\"", "Land", "roid", "/", "widget", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "DA", "LV", "IK", "\\u", "BYTE", "CODE_", ":_", "[_", "0_", ",_", "\"", "Lda", "lv", "ik", "/", "bytecode", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "DA", "LV", "IK", "\\u", "SYSTEM", "_", ":_", "[_", "0_", ",_", "\"", "Lda", "lv", "ik", "/", "system", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TAG", "\\u", "ANDROID", "_", "._", "JAVA", "\\u", "REF", "LE", "CTION", "_", ":_", "[_", "0_", ",_", "\"", "Lj", "ava", "/", "lang", "/", "reflect", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Basic", "OPCODE", "S_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "dv", "m_", "._", "BRANCH", "\\u", "DV", "M", "\\u", "OPCODE", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Basic", "OPCODE", "S_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "REF", "\\u", "NEW", "\\u", "INSTANCE", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "REF", "\\u", "CLASS", "\\u", "USAGE", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "simple", " ", "basic", " ", "block", " ", "of", " ", "a", " ", "dal", "vi", "k", " ", "method", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "start_", ",_", "vm_", ",_", "method_", ",_", "context_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "vm_", "=_", "vm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "method_", "=_", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "context_", "=_", "context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "last", "\\u", "length_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "nb", "\\u", "instructions_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fat", "hers", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "childs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "start_", "=_", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "end_", "=_", "self_", "._", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "special", "\\u", "ins_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "name_", "=_", "\"%", "s", "-", "BB", "@", "0", "x", "%", "x", "\"_", "%_", "(_", "self_", "._", "method_", "._", "get", "\\u", "name_", "(_", ")_", ",_", "self_", "._", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "exception", "\\u", "analysis_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "notes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "notes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "notes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "notes_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "notes_", "=_", "[_", "value_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "note_", "(_", "self_", ",_", "note_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "notes_", "._", "append_", "(_", "note_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "\\u", "notes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "notes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "instructions_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "all", " ", "instruct", "ion", "s", " ", "from", " ", "a", " ", "basic", " ", "block", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "Return", " ", "all", " ", "instruct", "ion", "s", " ", "in", " ", "the", " ", "current", " ", "basic", " ", "block", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "ins_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "self_", "._", "method_", "._", "get", "\\u", "instructions_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "idx_", ">=_", "self_", "._", "start_", "and_", "idx_", "<_", "self_", "._", "end_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmp", "\\u", "ins_", "._", "append_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "idx_", "+=_", "i_", "._", "get", "\\u", "length_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "tmp", "\\u", "ins_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "nb", "\\u", "instructions_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "nb", "\\u", "instructions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "method_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"%", "s", "-", "BB", "@", "0", "x", "%", "x", "\"_", "%_", "(_", "self_", "._", "method_", "._", "get", "\\u", "name_", "(_", ")_", ",_", "self_", "._", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "start_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "end_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "end_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "last_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "\\u", "instructions_", "(_", ")_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "next_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "next", " ", "basic", " ", "blocks", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "a", " ", "list", " ", "of", " ", "the", " ", "next", " ", "basic", " ", "blocks", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "childs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "prev_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "previ", "ous", " ", "basic", " ", "blocks", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "a", " ", "list", " ", "of", " ", "the", " ", "previ", "ous", " ", "basic", " ", "blocks", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "fat", "hers", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "fat", "hers", "_", "(_", "self_", ",_", "f_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fat", "hers", "_", "._", "append_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "last", "\\u", "length_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "last", "\\u", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "childs_", "(_", "self_", ",_", "values_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "self", ",", " ", "self", ".", "start", ",", " ", "self", ".", "end", ",", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "values_", "==_", "[_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "next", "\\u", "block_", "=_", "self_", "._", "context_", "._", "get", "\\u", "basic", "\\u", "block_", "(_", "self_", "._", "end_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "next", "\\u", "block_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "childs_", "._", "append_", "(_", "(_", "self_", "._", "end_", "-_", "self_", "._", "get", "\\u", "last", "\\u", "length_", "(_", ")_", ",_", "self_", "._", "end_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "next", "\\u", "block_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "next", "\\u", "block_", "=_", "self_", "._", "context_", "._", "get", "\\u", "basic", "\\u", "block_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "next", "\\u", "block_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "childs_", "._", "append_", "(_", "(_", "self_", "._", "end_", "-_", "self_", "._", "get", "\\u", "last", "\\u", "length_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "i_", ",_", "next", "\\u", "block_", ")_", ")_", "\\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_", "for_", "c_", "in_", "self_", "._", "childs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "c_", "[_", "2_", "]_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "[_", "2_", "]_", "._", "set\\u", "fat", "hers", "_", "(_", "(_", "c_", "[_", "1_", "]_", ",_", "c_", "[_", "0_", "]_", ",_", "self_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "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_", "push_", "(_", "self_", ",_", "i_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "nb", "\\u", "instructions_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx_", "=_", "self_", "._", "end_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "\\u", "length_", "=_", "i_", "._", "get", "\\u", "length_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "end_", "+=_", "self_", "._", "last", "\\u", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "op", "\\u", "value_", "=_", "i_", "._", "get", "\\u", "op", "\\u", "value_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "op", "\\u", "value_", "==_", "0x26", "_", "or_", "(_", "op", "\\u", "value_", ">=_", "0x2", "b_", "and_", "op", "\\u", "value_", "<=_", "0x2c", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "code_", "=_", "self_", "._", "method_", "._", "get", "\\u", "code_", "(_", ")_", "._", "get", "\\u", "bc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "special", "\\u", "ins_", "[_", "idx_", "]_", "=_", "code_", "._", "get", "\\u", "ins", "\\u", "off_", "(_", "idx_", "+_", "i_", "._", "get", "\\u", "ref", "\\u", "off_", "(_", ")_", "*_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "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", "special", "\\u", "ins_", "(_", "self_", ",_", "idx_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "the", " ", "associate", "d", " ", "instruct", "ion", " ", "to", " ", "a", " ", "specific", " ", "instruct", "ion", " ", "(", "for", " ", "example", " ", "a", " ", "pack", "ed", "/", "spars", "e", " ", "switch", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "idx", ":", " ", "the", " ", "index", " ", "of", " ", "the", " ", "instruct", "ion", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "Non", "e", " ", "or", " ", "an", " ", "Instr", "ucti", "on", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "special", "\\u", "ins_", "[_", "idx_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "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", "exception", "\\u", "analysis_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "exception", "\\u", "analysis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DV", "MB", "asi", "c", "Block_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "exception", "\\u", "analysis_", "(_", "self_", ",_", "exception", "\\u", "analysis_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "exception", "\\u", "analysis_", "=_", "exception", "\\u", "analysis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Enum_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Enum_", "(_", "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_", ",_", "names_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "names_", "=_", "names_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "value_", ",_", "name_", "in_", "enumerate_", "(_", "self_", "._", "names_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "self_", ",_", "name_", "._", "upper_", "(_", ")_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enum_", "(_", "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_", "tuples_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "tuple_", "(_", "enumerate_", "(_", "self_", "._", "names_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Tags_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Handle", " ", "specific", " ", "tags", "\\", "10", ";", "\\", "10", ";", " ", " ", ":", "param", " ", "pattern", "s", ":", "\\", "10", ";", " ", " ", ":", "params", " ", "reverse", ":", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Tags_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "patterns_", "=_", "TAG", "S", "\\u", "ANDROID", "_", ",_", "reverse_", "=_", "TAG", "\\u", "REVERSE", "\\u", "ANDROID", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "tags_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "patterns_", "=_", "patterns_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "reverse_", "=_", "TAG", "\\u", "REVERSE", "\\u", "ANDROID", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "self_", "._", "patterns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "patterns_", "[_", "i_", "]_", "[_", "1_", "]_", "=_", "re_", "._", "compile_", "(_", "self_", "._", "patterns_", "[_", "i_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tags_", "(_", "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_", "emit_", "(_", "self_", ",_", "method_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "self_", "._", "patterns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "patterns_", "[_", "i_", "]_", "[_", "0_", "]_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "patterns_", "[_", "i_", "]_", "[_", "1_", "]_", "._", "search_", "(_", "method_", "._", "get", "\\u", "class_", "(_", ")_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "tags_", "._", "add_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tags_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "emit", "\\u", "by", "\\u", "classname_", "(_", "self_", ",_", "classname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "self_", "._", "patterns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "patterns_", "[_", "i_", "]_", "[_", "0_", "]_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "patterns_", "[_", "i_", "]_", "[_", "1_", "]_", "._", "search_", "(_", "classname_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "tags_", "._", "add_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tags_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "list_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "self_", "._", "reverse_", "[_", "i_", "]_", "for_", "i_", "in_", "self_", "._", "tags_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tags_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "contains\\u\\u_", "(_", "self_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "key_", "in_", "self_", "._", "tags_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tags_", "(_", "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_", "._", "reverse_", "[_", "i_", "]_", "for_", "i_", "in_", "self_", "._", "tags_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tags_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "empty_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "tags_", "==_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Basic", "Blocks_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "class", " ", "represent", "s", " ", "all", " ", "basic", " ", "blocks", " ", "of", " ", "a", " ", "method", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Blocks_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "\\u", "vm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "vm_", "=_", "\\u", "vm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bb_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Blocks_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "push_", "(_", "self_", ",_", "bb_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "bb_", "._", "append_", "(_", "bb_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Blocks_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pop_", "(_", "self_", ",_", "idx_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "bb_", "._", "pop_", "(_", "idx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Blocks_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "basic", "\\u", "block_", "(_", "self_", ",_", "idx_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "self_", "._", "bb_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "idx_", ">=_", "i_", "._", "get", "\\u", "start_", "(_", ")_", "and_", "idx_", "<_", "i_", "._", "get", "\\u", "end_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Blocks_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "return", " ", "each", " ", "basic", " ", "block", " ", "(:", "class", ":`", "DV", "MB", "asi", "c", "Block", "`", " ", "object", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "self_", "._", "bb_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Blocks_", "(_", "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_", "gets", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "a", " ", "list", " ", "of", " ", "basic", " ", "blocks", " ", "(:", "class", ":`", "DV", "MB", "asi", "c", "Block", "`", " ", "object", "s", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "bb_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Blocks_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "basic", "\\u", "block", "\\u", "pos_", "(_", "self_", ",_", "idx_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "bb_", "[_", "idx_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Except", "ion", "Analysis_", "(_", "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_", "Except", "ion", "Analysis_", "(_", "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_", ",_", "exception_", ",_", "bb_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "start_", "=_", "exception_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "end_", "=_", "exception_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "exceptions_", "=_", "exception_", "[_", "2_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "self_", "._", "exceptions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "._", "append_", "(_", "bb_", "._", "get", "\\u", "basic", "\\u", "block_", "(_", "i_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Except", "ion", "Analysis_", "(_", "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_", "show", "\\u", "buff_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "buff_", "=_", "\"%", "x", ":", "%", "x", "\\\\", "n", "\"_", "%_", "(_", "self_", "._", "start_", ",_", "self_", "._", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "self_", "._", "exceptions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", "[_", "2_", "]_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "buff_", "+=_", "\"\\\\", "t", "(%", "s", " ", "->", " ", "%", "x", " ", "%", "s", ")\\\\", "n", "\"_", "%_", "(_", "i_", "[_", "0_", "]_", ",_", "i_", "[_", "1_", "]_", ",_", "i_", "[_", "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 ", " _", "buff_", "+=_", "\"\\\\", "t", "(%", "s", " ", "->", " ", "%", "x", " ", "%", "s", ")\\\\", "n", "\"_", "%_", "(_", "i_", "[_", "0_", "]_", ",_", "i_", "[_", "1_", "]_", ",_", "i_", "[_", "2_", "]_", "._", "get", "\\u", "name_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "buff_", "[_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Except", "ion", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "{_", "\"", "start", "\"_", ":_", "self_", "._", "start_", ",_", "\"", "end", "\"_", ":_", "self_", "._", "end_", ",_", "\"", "list", "\"_", ":_", "[_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "self_", "._", "exceptions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "[_", "\"", "list", "\"_", "]_", "._", "append_", "(_", "{_", "\"", "name", "\"_", ":_", "i_", "[_", "0_", "]_", ",_", "\"", "idx", "\"_", ":_", "i_", "[_", "1_", "]_", ",_", "\"", "bb", "\"_", ":_", "i_", "[_", "2_", "]_", "._", "get", "\\u", "name_", "(_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Exceptions_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Exceptions_", "(_", "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_", ",_", "\\u", "vm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "vm_", "=_", "\\u", "vm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "exceptions_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exceptions_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add_", "(_", "self_", ",_", "exceptions_", ",_", "basic", "\\u", "blocks_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "exceptions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "exceptions_", "._", "append_", "(_", "Except", "ion", "Analysis_", "(_", "i_", ",_", "basic", "\\u", "blocks_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exceptions_", "(_", "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", "exception_", "(_", "self_", ",_", "addr", "\\u", "start_", ",_", "addr", "\\u", "end_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "self_", "._", "exceptions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", "hex", "(", "i", ".", "start", "),", " ", "hex", "(", "i", ".", "end", "),", " ", "hex", "(", "addr", "\\u", "start", "),", " ", "hex", "(", "addr", "\\u", "end", "),", " ", "i", ".", "start", " ", ">=", " ", "addr", "\\u", "start", " ", "and", " ", "i", ".", "end", " ", "<=", " ", "addr", "\\u", "end", ",", " ", "addr", "\\u", "end", " ", "<=", " ", "i", ".", "end", " ", "and", " ", "addr", "\\u", "start", " ", ">=", " ", "i", ".", "start_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", "._", "start_", ">=_", "addr", "\\u", "start_", "and_", "i_", "._", "end_", "<=_", "addr", "\\u", "end_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "addr", "\\u", "end_", "<=_", "i_", "._", "end_", "and_", "addr", "\\u", "start_", ">=_", "i_", "._", "start_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exceptions_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "gets", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "exceptions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exceptions_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "self_", "._", "exceptions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Meth", "od", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "class", " ", "analyses", " ", "in", " ", "deta", "il", "s", " ", "a", " ", "method", " ", "of", " ", "a", " ", "class", "/", "dex", " ", "file", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "vm", ":", " ", "a", " ", ":", "class", ":`", "Dal", "vi", "k", "VM", "Format", "`", " ", "object", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "method", ":", " ", "a", " ", ":", "class", ":`", "Encode", "d", "Meth", "od", "`", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Meth", "od", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "vm_", ",_", "method_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "vm_", "=_", "vm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "method_", "=_", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "basic", "\\u", "blocks_", "=_", "Basic", "Blocks_", "(_", "self_", "._", "\\u\\u", "vm_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "exceptions_", "=_", "Exceptions_", "(_", "self_", "._", "\\u\\u", "vm_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "code_", "=_", "self_", "._", "method_", "._", "get", "\\u", "code_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "code_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "current", "\\u", "basic_", "=_", "DV", "MB", "asi", "c", "Block_", "(_", "0_", ",_", "self_", "._", "\\u\\u", "vm_", ",_", "self_", "._", "method_", ",_", "self_", "._", "basic", "\\u", "blocks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "basic", "\\u", "blocks_", "._", "push_", "(_", "current", "\\u", "basic_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bc_", "=_", "code_", "._", "get", "\\u", "bc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "debug_", "(_", "\"", "Pars", "ing", " ", "instruct", "ion", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instructions_", "=_", "[_", "i_", "for_", "i_", "in_", "bc_", "._", "get", "\\u", "instructions_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "instructions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "j_", "in_", "Basic", "OPCODE", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "j_", "._", "match_", "(_", "i_", "._", "get", "\\u", "name_", "(_", ")_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v_", "=_", "dv", "m_", "._", "dete", "rmin", "e", "Next_", "(_", "i_", ",_", "idx_", ",_", "self_", "._", "method_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "[_", "idx_", "]_", "=_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "._", "extend_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "idx_", "+=_", "i_", "._", "get", "\\u", "length_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "debug_", "(_", "\"", "Pars", "ing", " ", "exception", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except", "s_", "=_", "dv", "m_", "._", "dete", "rmin", "e", "Exception_", "(_", "self_", "._", "\\u\\u", "vm_", ",_", "self_", "._", "method_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "except", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l_", "._", "extend_", "(_", "[_", "i_", "[_", "0_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "handler_", "in_", "i_", "[_", "2_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l_", "._", "append_", "(_", "handler_", "[_", "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_", "debug_", "(_", "\"", "Creat", "ing", " ", "basic", " ", "blocks", " ", "in", " ", "%", "s", "\"_", "%_", "self_", "._", "method_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "instructions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "index", " ", "is", " ", "a", " ", "destination_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "idx_", "in_", "l_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "current", "\\u", "basic_", "._", "get", "\\u", "nb", "\\u", "instructions_", "(_", ")_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "current", "\\u", "basic_", "=_", "DV", "MB", "asi", "c", "Block_", "(_", "current", "\\u", "basic_", "._", "get", "\\u", "end_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "vm_", ",_", "self_", "._", "method_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "basic", "\\u", "blocks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "basic", "\\u", "blocks_", "._", "push_", "(_", "current", "\\u", "basic_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "current", "\\u", "basic_", "._", "push_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "index", " ", "is", " ", "a", " ", "branch", " ", "instruction_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "idx_", "in_", "h_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "current", "\\u", "basic_", "=_", "DV", "MB", "asi", "c", "Block_", "(_", "current", "\\u", "basic_", "._", "get", "\\u", "end_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "vm_", ",_", "self_", "._", "method_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "basic", "\\u", "blocks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "basic", "\\u", "blocks_", "._", "push_", "(_", "current", "\\u", "basic_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "idx_", "+=_", "i_", "._", "get", "\\u", "length_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "current", "\\u", "basic_", "._", "get", "\\u", "nb", "\\u", "instructions_", "(_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "basic", "\\u", "blocks_", "._", "pop_", "(_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "debug_", "(_", "\"", "Sett", "ings", " ", "basic", " ", "blocks", " ", "child", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "self_", "._", "basic", "\\u", "blocks_", "._", "get_", "(_", ")_", ":_", "\\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 ", " _", "i_", "._", "set\\u", "childs_", "(_", "h_", "[_", "i_", "._", "end_", "-_", "i_", "._", "get", "\\u", "last", "\\u", "length_", "(_", ")_", "]_", ")_", "\\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 ", " _", "i_", "._", "set\\u", "childs_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "debug_", "(_", "\"", "Creat", "ing", " ", "exception", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "exceptions_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "exceptions_", "._", "add_", "(_", "except", "s_", ",_", "self_", "._", "basic", "\\u", "blocks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "self_", "._", "basic", "\\u", "blocks_", "._", "get_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "setup", " ", "exception", " ", "by", " ", "basic", " ", "block_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "._", "set\\u", "exception", "\\u", "analysis_", "(_", "self_", "._", "exceptions_", "._", "get", "\\u", "exception_", "(_", "i_", "._", "start_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "i_", "._", "end_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "del_", "instructions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "h_", ",_", "l_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Meth", "od", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "basic", "\\u", "blocks_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "a", " ", ":", "class", ":`", "Basic", "Block", "s", "`", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "basic", "\\u", "blocks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Meth", "od", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "length_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "an", " ", "integ", "er", " ", "whi", "ch", " ", "is", " ", "the", " ", "length", " ", "of", " ", "the", " ", "code", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "get", "\\u", "code_", "(_", ")_", "._", "get", "\\u", "length_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Meth", "od", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "vm_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u\\u", "vm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Meth", "od", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "method_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Meth", "od", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "show_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "METH", "OD", "\"_", ",_", "self_", "._", "method_", "._", "get", "\\u", "class", "\\u", "name_", "(_", ")_", ",_", "self_", "._", "method_", "._", "get", "\\u", "name_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "self_", "._", "method_", "._", "get", "\\u", "descriptor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "self_", "._", "basic", "\\u", "blocks_", "._", "get_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"\\\\", "t", "\"_", ",_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "._", "show_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Meth", "od", "Analysis_", "(_", "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_", "show", "\\u", "methods_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"\\\\", "t", " ", "#", "METH", "OD", "S", " ", ":\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "self_", "._", "\\u\\u", "bb_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "methods_", "=_", "i_", "._", "get", "\\u", "methods_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "method_", "in_", "methods_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"\\\\", "t", "\\\\", "t", "-->", "\"_", ",_", "method_", "._", "get", "\\u", "class", "\\u", "name_", "(_", ")_", ",_", "method_", "._", "get", "\\u", "name_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "method_", "._", "get", "\\u", "descriptor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "context_", "in_", "methods_", "[_", "method_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "\"\\\\", "t", "\\\\", "t", "\\\\", "t", " ", "|---", "|\"_", ",_", "context_", "._", "details_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Meth", "od", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "tags_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Return", " ", "the", " ", "tags", " ", "of", " ", "the", " ", "method", "\\", "10", ";", "\\", "10", ";", " ", " ", ":", "rty", "pe", ":", " ", "a", " ", ":", "class", ":`", "Ta", "gs", "`", " ", "object", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "tags_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "String", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "String", "Analysis_", "(_", "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_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "value_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "orig", "\\u", "value_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "xref", "from_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "String", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Add", "Xr", "ef", "From_", "(_", "self_", ",_", "class", "obj_", ",_", "method", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "debug", "(\"", "Added", " ", "string", "s", " ", "xref", "from", " ", "for", " ", "%", "s", " ", "to", " ", "%", "s", "\"", " ", "%", " ", "(", "self", ".", "value", ",", " ", "method", "obj", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "xref", "from_", "._", "add_", "(_", "(_", "class", "obj_", ",_", "method", "obj_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "String", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "xref", "\\u", "from_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "xref", "from_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "String", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "value_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "value_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "String", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "value_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "String", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "orig", "\\u", "value_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "orig", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "String", "Analysis_", "(_", "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 ", " _", "data_", "=_", "\"", "XR", "EF", "to", " ", "for", " ", "string", " ", "%", "s", " ", "in", "\\\\", "n", "\"_", "%_", "repr_", "(_", "self_", "._", "get", "\\u", "value_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ref", "\\u", "class_", ",_", "ref", "\\u", "method_", "in_", "self_", "._", "xref", "from_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "+=_", "\"%", "s", ":", "%", "s", "\\\\", "n", "\"_", "%_", "(_", "ref", "\\u", "class_", "._", "get", "\\u", "vm", "\\u", "class_", "(_", ")_", "._", "get", "\\u", "name_", "(_", ")_", ",_", "ref", "\\u", "method_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Meth", "od", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Meth", "od", "Class", "Analysis_", "(_", "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_", ",_", "method_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "method_", "=_", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "xref", "to_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "xref", "from_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Meth", "od", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Add", "Xr", "ef", "To_", "(_", "self_", ",_", "class", "obj_", ",_", "method", "obj_", ",_", "offset_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "debug", "(\"", "Added", " ", "method", " ", "xref", "to", " ", "for", " ", "%", "s", " ", "[", "%", "s", "]", " ", "to", " ", "%", "s", "\"", " ", "%", " ", "(", "self", ".", "method", ",", " ", "class", "obj", ",", " ", "method", "obj", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "xref", "to_", "._", "add_", "(_", "(_", "class", "obj_", ",_", "method", "obj_", ",_", "offset_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Meth", "od", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Add", "Xr", "ef", "From_", "(_", "self_", ",_", "class", "obj_", ",_", "method", "obj_", ",_", "offset_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "debug", "(\"", "Added", " ", "method", " ", "xref", "from", " ", "for", " ", "%", "s", " ", "[", "%", "s", "]", " ", "to", " ", "%", "s", "\"", " ", "%", " ", "(", "self", ".", "method", ",", " ", "class", "obj", ",", " ", "method", "obj", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "xref", "from_", "._", "add_", "(_", "(_", "class", "obj_", ",_", "method", "obj_", ",_", "offset_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Meth", "od", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "xref", "\\u", "from_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "xref", "from_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Meth", "od", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "xref", "\\u", "to_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "xref", "to_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Meth", "od", "Class", "Analysis_", "(_", "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 ", " _", "data_", "=_", "\"", "XR", "EF", "to", " ", "for", " ", "%", "s", "\\\\", "n", "\"_", "%_", "self_", "._", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ref", "\\u", "class_", ",_", "ref", "\\u", "method_", ",_", "offset_", "in_", "self_", "._", "xref", "to_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "+=_", "\"", "in", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "+=_", "\"%", "s", ":", "%", "s", " ", "@", "0", "x", "%", "x", "\\\\", "n", "\"_", "%_", "(_", "ref", "\\u", "class_", "._", "get", "\\u", "vm", "\\u", "class_", "(_", ")_", "._", "get", "\\u", "name_", "(_", ")_", ",_", "ref", "\\u", "method_", ",_", "offset_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "+=_", "\"", "XR", "EF", "Fro", "m", " ", "for", " ", "%", "s", "\\\\", "n", "\"_", "%_", "self_", "._", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ref", "\\u", "class_", ",_", "ref", "\\u", "method_", ",_", "offset_", "in_", "self_", "._", "xref", "from_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "+=_", "\"", "in", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "+=_", "\"%", "s", ":", "%", "s", " ", "@", "0", "x", "%", "x", "\\\\", "n", "\"_", "%_", "(_", "ref", "\\u", "class_", "._", "get", "\\u", "vm", "\\u", "class_", "(_", ")_", "._", "get", "\\u", "name_", "(_", ")_", ",_", "ref", "\\u", "method_", ",_", "offset_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Field", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Field", "Class", "Analysis_", "(_", "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_", ",_", "field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "field_", "=_", "field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "xref", "read_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "xref", "write_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Add", "Xr", "ef", "Read_", "(_", "self_", ",_", "class", "obj_", ",_", "method", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "debug", "(\"", "Added", " ", "method", " ", "xref", "to", " ", "for", " ", "%", "s", " ", "[", "%", "s", "]", " ", "to", " ", "%", "s", "\"", " ", "%", " ", "(", "self", ".", "method", ",", " ", "class", "obj", ",", " ", "method", "obj", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "xref", "read_", "._", "add_", "(_", "(_", "class", "obj_", ",_", "method", "obj_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Add", "Xr", "ef", "Write_", "(_", "self_", ",_", "class", "obj_", ",_", "method", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "debug", "(\"", "Added", " ", "method", " ", "xref", "from", " ", "for", " ", "%", "s", " ", "[", "%", "s", "]", " ", "to", " ", "%", "s", "\"", " ", "%", " ", "(", "self", ".", "method", ",", " ", "class", "obj", ",", " ", "method", "obj", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "xref", "write_", "._", "add_", "(_", "(_", "class", "obj_", ",_", "method", "obj_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "xref", "\\u", "read_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "xref", "read_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "xref", "\\u", "write_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "xref", "write_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Field", "Class", "Analysis_", "(_", "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 ", " _", "data_", "=_", "\"", "XR", "EF", "Read", " ", "for", " ", "%", "s", "\\\\", "n", "\"_", "%_", "self_", "._", "field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ref", "\\u", "class_", ",_", "ref", "\\u", "method_", "in_", "self_", "._", "xref", "read_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "+=_", "\"", "in", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "+=_", "\"%", "s", ":", "%", "s", "\\\\", "n", "\"_", "%_", "(_", "ref", "\\u", "class_", "._", "get", "\\u", "vm", "\\u", "class_", "(_", ")_", "._", "get", "\\u", "name_", "(_", ")_", ",_", "ref", "\\u", "method_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "+=_", "\"", "XR", "EF", "Write", " ", "for", " ", "%", "s", "\\\\", "n", "\"_", "%_", "self_", "._", "field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ref", "\\u", "class_", ",_", "ref", "\\u", "method_", "in_", "self_", "._", "xref", "write_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "+=_", "\"", "in", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "+=_", "\"%", "s", ":", "%", "s", "\\\\", "n", "\"_", "%_", "(_", "ref", "\\u", "class_", "._", "get", "\\u", "vm", "\\u", "class_", "(_", ")_", "._", "get", "\\u", "name_", "(_", ")_", ",_", "ref", "\\u", "method_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Class", "Analysis_", "(_", "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_", ",_", "class", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "orig", "\\u", "class_", "=_", "class", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "methods_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "fields_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "xref", "to_", "=_", "collections_", "._", "defaultdict_", "(_", "set_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "xref", "from_", "=_", "collections_", "._", "defaultdict_", "(_", "set_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "method", "\\u", "analysis_", "(_", "self_", ",_", "method_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "methods_", "._", "get_", "(_", "method_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "field", "\\u", "analysis_", "(_", "self_", ",_", "field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "fields_", "._", "get_", "(_", "field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Add", "FX", "ref", "Read_", "(_", "self_", ",_", "method_", ",_", "class", "obj_", ",_", "field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "field_", "not_", "in_", "self_", "._", "\\u", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "fields_", "[_", "field_", "]_", "=_", "Field", "Class", "Analysis_", "(_", "field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "fields_", "[_", "field_", "]_", "._", "Add", "Xr", "ef", "Read_", "(_", "class", "obj_", ",_", "method_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Add", "FX", "ref", "Write_", "(_", "self_", ",_", "method_", ",_", "class", "obj_", ",_", "field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "field_", "not_", "in_", "self_", "._", "\\u", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "fields_", "[_", "field_", "]_", "=_", "Field", "Class", "Analysis_", "(_", "field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "fields_", "[_", "field_", "]_", "._", "Add", "Xr", "ef", "Write_", "(_", "class", "obj_", ",_", "method_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Add", "MX", "ref", "To_", "(_", "self_", ",_", "method", "1_", ",_", "class", "obj_", ",_", "method", "2_", ",_", "offset_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "method", "1_", "not_", "in_", "self_", "._", "\\u", "methods_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "methods_", "[_", "method", "1_", "]_", "=_", "Meth", "od", "Class", "Analysis_", "(_", "method", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "methods_", "[_", "method", "1_", "]_", "._", "Add", "Xr", "ef", "To_", "(_", "class", "obj_", ",_", "method", "2_", ",_", "offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Add", "MX", "ref", "From_", "(_", "self_", ",_", "method", "1_", ",_", "class", "obj_", ",_", "method", "2_", ",_", "offset_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "method", "1_", "not_", "in_", "self_", "._", "\\u", "methods_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "methods_", "[_", "method", "1_", "]_", "=_", "Meth", "od", "Class", "Analysis_", "(_", "method", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "methods_", "[_", "method", "1_", "]_", "._", "Add", "Xr", "ef", "From_", "(_", "class", "obj_", ",_", "method", "2_", ",_", "offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Add", "Xr", "ef", "To_", "(_", "self_", ",_", "ref", "\\u", "kind_", ",_", "class", "obj_", ",_", "method", "obj_", ",_", "offset_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "xref", "to_", "[_", "class", "obj_", "]_", "._", "add_", "(_", "(_", "ref", "\\u", "kind_", ",_", "method", "obj_", ",_", "offset_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Add", "Xr", "ef", "From_", "(_", "self_", ",_", "ref", "\\u", "kind_", ",_", "class", "obj_", ",_", "method", "obj_", ",_", "offset_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "xref", "from_", "[_", "class", "obj_", "]_", "._", "add_", "(_", "(_", "ref", "\\u", "kind_", ",_", "method", "obj_", ",_", "offset_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "xref", "\\u", "from_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "xref", "from_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "xref", "\\u", "to_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "xref", "to_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Class", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "vm", "\\u", "class_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "orig", "\\u", "class_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Class", "Analysis_", "(_", "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 ", " _", "data_", "=_", "\"", "XR", "EF", "to", " ", "for", " ", "%", "s", "\\\\", "n", "\"_", "%_", "self_", "._", "orig", "\\u", "class_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ref", "\\u", "class_", "in_", "self_", "._", "xref", "to_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "+=_", "str_", "(_", "ref", "\\u", "class_", "._", "get", "\\u", "vm", "\\u", "class_", "(_", ")_", "._", "get", "\\u", "name_", "(_", ")_", ")_", "+_", "\"", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "+=_", "\"", "in", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ref", "\\u", "kind_", ",_", "ref", "\\u", "method_", ",_", "ref", "\\u", "offset_", "in_", "self_", "._", "xref", "to_", "[_", "ref", "\\u", "class_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "+=_", "\"%", "d", " ", "%", "s", " ", "0", "x", "%", "x", "\\\\", "n", "\"_", "%_", "(_", "ref", "\\u", "kind_", ",_", "ref", "\\u", "method_", ",_", "ref", "\\u", "offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "+=_", "\"\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "+=_", "\"", "XR", "EF", "Fro", "m", " ", "for", " ", "%", "s", "\\\\", "n", "\"_", "%_", "self_", "._", "orig", "\\u", "class_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ref", "\\u", "class_", "in_", "self_", "._", "xref", "from_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "+=_", "str_", "(_", "ref", "\\u", "class_", "._", "get", "\\u", "vm", "\\u", "class_", "(_", ")_", "._", "get", "\\u", "name_", "(_", ")_", ")_", "+_", "\"", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "+=_", "\"", "in", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ref", "\\u", "kind_", ",_", "ref", "\\u", "method_", ",_", "ref", "\\u", "offset_", "in_", "self_", "._", "xref", "from_", "[_", "ref", "\\u", "class_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "+=_", "\"%", "d", " ", "%", "s", " ", "0", "x", "%", "x", "\\\\", "n", "\"_", "%_", "(_", "ref", "\\u", "kind_", ",_", "ref", "\\u", "method_", ",_", "ref", "\\u", "offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "+=_", "\"\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "new", "VM", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "new", "VM", "Analysis_", "(_", "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_", ",_", "vm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "vms_", "=_", "[_", "vm_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "classes_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "strings_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "current", "\\u", "class_", "in_", "vm_", "._", "get", "\\u", "classes_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "classes_", "[_", "current", "\\u", "class_", "._", "get", "\\u", "name_", "(_", ")_", "]_", "=_", "Class", "Analysis_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "current", "\\u", "class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "new", "VM", "Analysis_", "(_", "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_", "create", "\\u", "xref", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "debug_", "(_", "\"", "Creat", "ing", " ", "XR", "EF", "/", "DR", "EF", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "instance", "s", "\\u", "class", "\\u", "name_", "=_", "self_", "._", "classes_", "._", "keys_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "last", "\\u", "vm_", "=_", "self_", "._", "vms_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "current", "\\u", "class_", "in_", "last", "\\u", "vm_", "._", "get", "\\u", "classes_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "current", "\\u", "method_", "in_", "current", "\\u", "class_", "._", "get", "\\u", "methods_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "debug_", "(_", "\"", "Creat", "ing", " ", "XR", "EF", " ", "for", " ", "%", "s", "\"_", "%_", "current", "\\u", "method_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "code_", "=_", "current", "\\u", "method_", "._", "get", "\\u", "code_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "code_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "off_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bc_", "=_", "code_", "._", "get", "\\u", "bc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "instruction_", "in_", "bc_", "._", "get", "\\u", "instructions_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "op", "\\u", "value_", "=_", "instruction_", "._", "get", "\\u", "op", "\\u", "value_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "op", "\\u", "value_", "in_", "[_", "0x1c_", ",_", "0x22", "_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "idx", "\\u", "type_", "=_", "instruction_", "._", "get", "\\u", "ref", "\\u", "kind_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "type", "\\u", "info_", "=_", "last", "\\u", "vm_", "._", "get", "\\u", "cm", "\\u", "type_", "(_", "idx", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Intern", "al", " ", "xref", " ", "relate", "d", " ", "to", " ", "class", " ", "manipulati", "on_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "type", "\\u", "info_", "in_", "instance", "s", "\\u", "class", "\\u", "name_", "and_", "type", "\\u", "info_", "!=_", "current", "\\u", "class_", "._", "get", "\\u", "name_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "new", " ", "instance_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "op", "\\u", "value_", "==_", "0x22", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "classes_", "[_", "current", "\\u", "class_", "._", "get", "\\u", "name_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "]_", "._", "Add", "Xr", "ef", "To_", "(_", "REF", "\\u", "NEW", "\\u", "INSTANCE", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "classes_", "[_", "type", "\\u", "info_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "current", "\\u", "method_", ",_", "off_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "classes_", "[_", "type", "\\u", "info_", "]_", "._", "Add", "Xr", "ef", "From_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "REF", "\\u", "NEW", "\\u", "INSTANCE", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "classes_", "[_", "current", "\\u", "class_", "._", "get", "\\u", "name_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "current", "\\u", "method_", ",_", "off_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "class", " ", "reference_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "classes_", "[_", "current", "\\u", "class_", "._", "get", "\\u", "name_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "]_", "._", "Add", "Xr", "ef", "To_", "(_", "REF", "\\u", "CLASS", "\\u", "USAGE", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "classes_", "[_", "type", "\\u", "info_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "current", "\\u", "method_", ",_", "off_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "classes_", "[_", "type", "\\u", "info_", "]_", "._", "Add", "Xr", "ef", "From_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "REF", "\\u", "CLASS", "\\u", "USAGE", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "classes_", "[_", "current", "\\u", "class_", "._", "get", "\\u", "name_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "current", "\\u", "method_", ",_", "off_", ")_", "\\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_", "(_", "(_", "op", "\\u", "value_", ">=_", "0x6", "e_", "and_", "op", "\\u", "value_", "<=_", "0x7", "2_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "op", "\\u", "value_", ">=_", "0x74", "_", "and_", "op", "\\u", "value_", "<=_", "0x78", "_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "idx", "\\u", "meth_", "=_", "instruction_", "._", "get", "\\u", "ref", "\\u", "kind_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "method", "\\u", "info_", "=_", "last", "\\u", "vm_", "._", "get", "\\u", "cm", "\\u", "method_", "(_", "idx", "\\u", "meth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "method", "\\u", "info_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "class", "\\u", "info_", "=_", "method", "\\u", "info_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "method", "\\u", "item_", "=_", "last", "\\u", "vm_", "._", "get", "\\u", "method", "\\u", "descriptor_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "method", "\\u", "info_", "[_", "0_", "]_", ",_", "method", "\\u", "info_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "''_", "._", "join_", "(_", "method", "\\u", "info_", "[_", "2_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "method", "\\u", "item_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "classes_", "[_", "current", "\\u", "class_", "._", "get", "\\u", "name_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "]_", "._", "Add", "MX", "ref", "To_", "(_", "current", "\\u", "method_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "classes_", "[_", "class", "\\u", "info_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "method", "\\u", "item_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "off_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "classes_", "[_", "class", "\\u", "info_", "]_", "._", "Add", "MX", "ref", "From_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "method", "\\u", "item_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "classes_", "[_", "current", "\\u", "class_", "._", "get", "\\u", "name_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "current", "\\u", "method_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "off_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Intern", "al", " ", "xref", " ", "relate", "d", " ", "to", " ", "class", " ", "manipulati", "on_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "class", "\\u", "info_", "in_", "instance", "s", "\\u", "class", "\\u", "name_", "and_", "class", "\\u", "info_", "!=_", "current", "\\u", "class_", "._", "get", "\\u", "name_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "self_", "._", "classes_", "[_", "current", "\\u", "class_", "._", "get", "\\u", "name_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "]_", "._", "Add", "Xr", "ef", "To_", "(_", "REF", "\\u", "CLASS", "\\u", "USAGE", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "classes_", "[_", "class", "\\u", "info_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "method", "\\u", "item_", ",_", "off_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "classes_", "[_", "class", "\\u", "info_", "]_", "._", "Add", "Xr", "ef", "From_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "REF", "\\u", "CLASS", "\\u", "USAGE", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "classes_", "[_", "current", "\\u", "class_", "._", "get", "\\u", "name_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "current", "\\u", "method_", ",_", "off_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "op", "\\u", "value_", ">=_", "0x1", "a_", "and_", "op", "\\u", "value_", "<=_", "0x1", "b_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "string", "\\u", "value_", "=_", "last", "\\u", "vm_", "._", "get", "\\u", "cm", "\\u", "string_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "instruction_", "._", "get", "\\u", "ref", "\\u", "kind_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "string", "\\u", "value_", "not_", "in_", "self_", "._", "strings_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "strings_", "[_", "string", "\\u", "value_", "]_", "=_", "String", "Analysis_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "string", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "strings_", "[_", "string", "\\u", "value_", "]_", "._", "Add", "Xr", "ef", "From_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "classes_", "[_", "current", "\\u", "class_", "._", "get", "\\u", "name_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "current", "\\u", "method_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "op", "\\u", "value_", ">=_", "0x5", "2_", "and_", "op", "\\u", "value_", "<=_", "0x6", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "idx", "\\u", "field_", "=_", "instruction_", "._", "get", "\\u", "ref", "\\u", "kind_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "field", "\\u", "info_", "=_", "last", "\\u", "vm_", "._", "get", "\\u", "cm", "\\u", "field_", "(_", "idx", "\\u", "field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "field", "\\u", "item_", "=_", "last", "\\u", "vm_", "._", "get", "\\u", "field", "\\u", "descriptor_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "field", "\\u", "info_", "[_", "0_", "]_", ",_", "field", "\\u", "info_", "[_", "2_", "]_", ",_", "field", "\\u", "info_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "field", "\\u", "item_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "read", " ", "access", " ", "to", " ", "a", " ", "field_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "(_", "op", "\\u", "value_", ">=_", "0x5", "2_", "and_", "op", "\\u", "value_", "<=_", "0x58", "_", ")_", "or_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "op", "\\u", "value_", ">=_", "0x60_", "and_", "op", "\\u", "value_", "<=_", "0x66", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "classes_", "[_", "current", "\\u", "class_", "._", "get", "\\u", "name_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "]_", "._", "Add", "FX", "ref", "Read_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "current", "\\u", "method_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "classes_", "[_", "current", "\\u", "class_", "._", "get", "\\u", "name_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "field", "\\u", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "write", " ", "access", " ", "to", " ", "a", " ", "field_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "classes_", "[_", "current", "\\u", "class_", "._", "get", "\\u", "name_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "]_", "._", "Add", "FX", "ref", "Write_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "current", "\\u", "method_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "classes_", "[_", "current", "\\u", "class_", "._", "get", "\\u", "name_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "field", "\\u", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "off_", "+=_", "instruction_", "._", "get", "\\u", "length_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "dv", "m_", "._", "Inva", "lid", "Instruction_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "warning_", "(_", "\"", "Inva", "lid", " ", "instruct", "ion", " ", "%", "s", "\"_", "%_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "new", "VM", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "method_", "(_", "self_", ",_", "method_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "vm_", "in_", "self_", "._", "vms_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "method_", "in_", "vm_", "._", "get", "\\u", "methods_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Meth", "od", "Analysis_", "(_", "vm_", ",_", "method_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "new", "VM", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "method", "\\u", "by", "\\u", "name_", "(_", "self_", ",_", "class", "\\u", "name_", ",_", "method", "\\u", "name_", ",_", "method", "\\u", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "class", "\\u", "name_", "in_", "self_", "._", "classes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "method_", "in_", "self_", "._", "classes_", "[_", "class", "\\u", "name_", "]_", "._", "get", "\\u", "vm", "\\u", "class_", "(_", ")_", "._", "get", "\\u", "methods_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "method_", "._", "get", "\\u", "name_", "(_", ")_", "==_", "method", "\\u", "name_", "and_", "method_", "._", "get", "\\u", "descriptor_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "==_", "method", "\\u", "descriptor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "method_", "\\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_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "new", "VM", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "method", "\\u", "analysis_", "(_", "self_", ",_", "method_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class", "\\u", "analysis_", "=_", "self_", "._", "get", "\\u", "class", "\\u", "analysis_", "(_", "method_", "._", "get", "\\u", "class", "\\u", "name_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "class", "\\u", "analysis_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "class", "\\u", "analysis_", "._", "get", "\\u", "method", "\\u", "analysis_", "(_", "method_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "new", "VM", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "method", "\\u", "analys", "is", "\\u", "by", "\\u", "name_", "(_", "self_", ",_", "class", "\\u", "name_", ",_", "method", "\\u", "name_", ",_", "method", "\\u", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "method_", "=_", "self_", "._", "get", "\\u", "method", "\\u", "by", "\\u", "name_", "(_", "class", "\\u", "name_", ",_", "method", "\\u", "name_", ",_", "method", "\\u", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "method_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "\\u", "method", "\\u", "analysis_", "(_", "method_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "new", "VM", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "field", "\\u", "analysis_", "(_", "self_", ",_", "field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class", "\\u", "analysis_", "=_", "self_", "._", "get", "\\u", "class", "\\u", "analysis_", "(_", "field_", "._", "get", "\\u", "class", "\\u", "name_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "class", "\\u", "analysis_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "class", "\\u", "analysis_", "._", "get", "\\u", "field", "\\u", "analysis_", "(_", "field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "new", "VM", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "class", "\\u", "present_", "(_", "self_", ",_", "class", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "class", "\\u", "name_", "in_", "self_", "._", "classes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "new", "VM", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "class", "\\u", "analysis_", "(_", "self_", ",_", "class", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "classes_", "._", "get_", "(_", "class", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "new", "VM", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "string", "s", "\\u", "analysis_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "strings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "new", "VM", "Analysis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add_", "(_", "self_", ",_", "vm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "vms_", "._", "append_", "(_", "vm_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "current", "\\u", "class_", "in_", "vm_", "._", "get", "\\u", "classes_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "current", "\\u", "class_", "._", "get", "\\u", "name_", "(_", ")_", "not_", "in_", "self_", "._", "classes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "classes_", "[_", "current", "\\u", "class_", "._", "get", "\\u", "name_", "(_", ")_", "]_", "=_", "Class", "Analysis_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "current", "\\u", "class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "ascii", "\\u", "obf", "usc", "ation_", "(_", "vm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "classe", "_", "in_", "vm_", "._", "get", "\\u", "classes_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "is", "\\u", "ascii", "\\u", "problem_", "(_", "classe", "_", "._", "get", "\\u", "name_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "method_", "in_", "classe", "_", "._", "get", "\\u", "methods_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "is", "\\u", "ascii", "\\u", "problem_", "(_", "method_", "._", "get", "\\u", "name_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
michaelcontento/revolver/revolver/server.py
[ { "content": "# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import, division, with_statement\n\nfrom cuisine import system_uuid as uuid\n\nfrom revolver import contextmanager as ctx\nfrom revolver import file, core\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def timezone(zone='UTC'):\n from_file = '/usr/share/zoneinfo/%s' % zone\n to_file = '/etc/localtime'\n\n with ctx.sudo():\n file.copy(from_file, to_file)", "metadata": "root.timezone", "header": "['module', '___EOS___']", "index": 10 }, { "content": "def version():\n return core.run('lsb_release --release --short').stdout", "metadata": "root.version", "header": "['module', '___EOS___']", "index": 18 }, { "content": "def codename():\n return core.run('lsb_release --codename --short').stdout", "metadata": "root.codename", "header": "['module', '___EOS___']", "index": 22 } ]
[ { "span": "from cuisine import system_uuid as uuid", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 39 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", ",_", "division_", ",_", "with", "\\u", "statement_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "cui", "sine", "_", "import_", "system", "\\u", "uuid_", "as_", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "revo", "lver", "_", "import_", "contextmanager_", "as_", "ctx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "revo", "lver", "_", "import_", "file_", ",_", "core_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "timezone_", "(_", "zone_", "=_", "'", "UT", "C", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from", "\\u", "file_", "=_", "'/", "usr", "/", "share", "/", "zonei", "nfo", "/", "%", "s", "'_", "%_", "zone_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "to", "\\u", "file_", "=_", "'/", "etc", "/", "localt", "ime", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "ctx_", "._", "sudo_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file_", "._", "copy_", "(_", "from", "\\u", "file_", ",_", "to", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "version_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "core_", "._", "run_", "(_", "'", "lsb", "\\u", "release", " ", "--", "release", " ", "--", "short", "'_", ")_", "._", "stdout_", "\\u\\u\\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_", "codename_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "core_", "._", "run_", "(_", "'", "lsb", "\\u", "release", " ", "--", "code", "name", " ", "--", "short", "'_", ")_", "._", "stdout_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
awslabs/simplebeerservice/sbsunit/utils/httpRequest.py
[ { "content": "import datetime\nimport time\nfrom sbs.tools import Tools\nimport pycurl\nimport json\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class HTTPRequest():\n\n debug = False\n logFile = 'sbs.log'\n apiKey = ''\n contentType = 'application/json'\n url = ''\n instance = None\n\n class __HTTPRequest:\n def __init__(self):\n pass\n\n def __str__(self):\n return repr(self) + self.val\n\n\n\n\n", "metadata": "root.HTTPRequest", "header": "['module', '___EOS___']", "index": 6 }, { "content": " def __init__(self):\n if not HTTPRequest.instance:\n HTTPRequest.instance = HTTPRequest.__HTTPRequest()\n else:\n pass", "metadata": "root.HTTPRequest.__init__", "header": "['class', 'HTTPRequest', '(', ')', ':', '___EOS___']", "index": 22 }, { "content": " def __getattr__(self, name):\n return getattr(self.instance, name)", "metadata": "root.HTTPRequest.__getattr__", "header": "['class', 'HTTPRequest', '(', ')', ':', '___EOS___']", "index": 28 }, { "content": " def __setattr__(self, name):\n return setattr(self.instance, name)", "metadata": "root.HTTPRequest.__setattr__", "header": "['class', 'HTTPRequest', '(', ')', ':', '___EOS___']", "index": 31 }, { "content": " @classmethod\n def init(self, apiKey, contentType, url):\n self.apiKey = apiKey\n self.contentType = contentType\n self.url = url", "metadata": "root.HTTPRequest.init", "header": "['class', 'HTTPRequest', '(', ')', ':', '___EOS___']", "index": 34 }, { "content": " @classmethod\n def send(self, data):\n\n # NOTE:\n # Depending on the version of python / OS (https://bugs.python.org/issue21246) you may\n # run in to issues making requests to HTTPS endpoint, hence we are using pycurl library here\n\n # Commented out to showcase how to make a request via urllib2\n #payload = json.dumps(data)\n #req = urllib2.Request(url, payload)\n #req.add_header('Content-Type', 'application/json')\n #try:\n # r = urllib2.urlopen(req)\n # response = r.read()\n # return response\n #except Exception, e:\n # print \"error sending data to %s\" % url, e\n # return\n\n\n #Send request using pycurl\n c = pycurl.Curl()\n c.setopt(c.URL, self.url)\n body = json.dumps(data)\n\n Tools.log('Payload: %s' % data)\n\n try:\n c.setopt(pycurl.HTTPHEADER, [('x-api-key: %s' % self.apiKey), 'Content-Type: %s' % self.contentType])\n c.setopt(c.POSTFIELDS, body)\n c.perform()\n\n response_code = c.getinfo(c.RESPONSE_CODE)\n if (response_code==200):\n Tools.log('Successful Post [%f].' % c.getinfo(c.TOTAL_TIME),2)\n else:\n Tools.log('Error writing to AWS. Response code: %i ' % response_code,2)\n\n except Exception, e:\n Tools.log('Error writing to AWS: %s' % e,1)\n pass\n\n return response_code", "metadata": "root.HTTPRequest.send", "header": "['class', 'HTTPRequest', '(', ')', ':', '___EOS___']", "index": 40 } ]
[ { "span": "import datetime", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 15 }, { "span": "import time", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sb", "s_", "._", "tools_", "import_", "Tools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pycurl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\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_", "HTTP", "Request_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "debug_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log", "File_", "=_", "'", "sb", "s", ".", "log", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "api", "Key_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content", "Type_", "=_", "'", "applica", "tion", "/", "json", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instance_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "\\u\\u", "HTTP", "Request_", ":_", "\\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_", "\\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_", "repr_", "(_", "self_", ")_", "+_", "self_", "._", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "HTTP", "Request_", "(_", ")_", ":_", "\\u\\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", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "HTTP", "Request_", "._", "instance_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "HTTP", "Request_", "._", "instance_", "=_", "HTTP", "Request_", "._", "\\u\\u", "HTTP", "Request_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "Request_", "(_", ")_", ":_", "\\u\\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", "getattr\\u\\u_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "getattr_", "(_", "self_", "._", "instance_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "Request_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "setattr\\u\\u_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "setattr_", "(_", "self_", "._", "instance_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "Request_", "(_", ")_", ":_", "\\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_", "init_", "(_", "self_", ",_", "api", "Key_", ",_", "content", "Type_", ",_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "api", "Key_", "=_", "api", "Key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "content", "Type_", "=_", "content", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "url_", "=_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "Request_", "(_", ")_", ":_", "\\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_", "send_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "NOTE", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Depend", "ing", " ", "on", " ", "the", " ", "version", " ", "of", " ", "python", " ", "/", " ", "OS", " ", "(", "https", "://", "bug", "s", ".", "python", ".", "org", "/", "issue", "212", "4", "6", ")", " ", "you", " ", "may", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "run", " ", "in", " ", "to", " ", "issue", "s", " ", "mak", "ing", " ", "request", "s", " ", "to", " ", "HTTP", "S", " ", "endpoint", ",", " ", "hen", "ce", " ", "we", " ", "are", " ", "usi", "ng", " ", "pyc", "url", " ", "librar", "y", " ", "here_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Comme", "nte", "d", " ", "out", " ", "to", " ", "show", "case", " ", "how", " ", "to", " ", "make", " ", "a", " ", "request", " ", "via", " ", "urllib2_", "\\u\\u\\uNL\\u\\u\\u_", "#", "payload", " ", "=", " ", "json", ".", "dump", "s", "(", "data", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "req", " ", "=", " ", "url", "lib", "2", ".", "Request", "(", "url", ",", " ", "payload", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "req", ".", "add", "\\u", "header", "('", "Conten", "t", "-", "Type", "',", " ", "'", "applica", "tion", "/", "json", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "r", " ", "=", " ", "url", "lib", "2", ".", "urlo", "pen", "(", "req", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "response", " ", "=", " ", "r", ".", "read", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "return", " ", "response_", "\\u\\u\\uNL\\u\\u\\u_", "#", "except", " ", "Except", "ion", ",", " ", "e", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", "\"", "error", " ", "sendin", "g", " ", "data", " ", "to", " ", "%", "s", "\"", " ", "%", " ", "url", ",", " ", "e_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "return_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Sen", "d", " ", "request", " ", "usi", "ng", " ", "pycurl_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "pycurl_", "._", "Curl", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "setopt_", "(_", "c_", "._", "URL_", ",_", "self_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "json_", "._", "dumps_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Tools_", "._", "log_", "(_", "'", "Pay", "load", ":", " ", "%", "s", "'_", "%_", "data_", ")_", "\\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 ", " _", "c_", "._", "setopt_", "(_", "pycurl_", "._", "HTTP", "HEADER_", ",_", "[_", "(_", "'", "x", "-", "api", "-", "key", ":", " ", "%", "s", "'_", "%_", "self_", "._", "api", "Key_", ")_", ",_", "'", "Conten", "t", "-", "Type", ":", " ", "%", "s", "'_", "%_", "self_", "._", "content", "Type_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "setopt_", "(_", "c_", "._", "POST", "FIELDS_", ",_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "perform_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response", "\\u", "code_", "=_", "c_", "._", "getin", "fo_", "(_", "c_", "._", "RESPONSE", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "response", "\\u", "code_", "==_", "200_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Tools_", "._", "log_", "(_", "'", "Success", "ful", " ", "Post", " ", "[", "%", "f", "].", "'_", "%_", "c_", "._", "getin", "fo_", "(_", "c_", "._", "TOTAL", "\\u", "TIME_", ")_", ",_", "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 ", " _", "Tools_", "._", "log_", "(_", "'", "Error", " ", "writ", "ing", " ", "to", " ", "AW", "S", ".", " ", "Respons", "e", " ", "code", ":", " ", "%", "i", " ", "'_", "%_", "response", "\\u", "code_", ",_", "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_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Tools_", "._", "log_", "(_", "'", "Error", " ", "writ", "ing", " ", "to", " ", "AW", "S", ":", " ", "%", "s", "'_", "%_", "e_", ",_", "1_", ")_", "\\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_", "return_", "response", "\\u", "code_" ]
[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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 ]
Unnecessary pass
iogf/ehp/ehp.py
[ { "content": " def take_with_root(self, *args):\n \"\"\"\n Like Root.take but returns the tag parent.\n \"\"\"\n\n seq = self.match_with_root(*args)\n \n try:\n item = seq.next()\n except StopIteration:\n return None\n else:\n return item\n\n\n pass", "metadata": "root.Root.take_with_root", "header": "['class', 'Root', '(', 'list', ')', ':', '___EOS___']", "index": 287 }, { "content": " def handle_starttag(self, name, attr):\n \"\"\" \n When found an opening tag then nest it onto the tree \n \"\"\"\n\n self.struct.nest(name, attr)\n pass", "metadata": "root.Html.handle_starttag", "header": "['class', 'Html', '(', 'HTMLParser', ')', ':', '___EOS___']", "index": 1012 }, { "content": " def handle_endtag(self, name):\n \"\"\" \n When found a closing tag then makes it point to the right scope \n \"\"\"\n\n self.struct.enclose(name)\n pass", "metadata": "root.Html.handle_endtag", "header": "['class', 'Html', '(', 'HTMLParser', ')', ':', '___EOS___']", "index": 1027 } ]
[ { "span": "pass", "start_line": 302, "start_column": 8, "end_line": 302, "end_column": 12 }, { "span": "pass", "start_line": 1018, "start_column": 8, "end_line": 1018, "end_column": 12 }, { "span": "pass", "start_line": 1033, "start_column": 8, "end_line": 1033, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "class_", "Root_", "(_", "list_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "take", "\\u", "with", "\\u", "root_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Lik", "e", " ", "Roo", "t", ".", "take", " ", "but", " ", "return", "s", " ", "the", " ", "tag", " ", "parent", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "seq_", "=_", "self_", "._", "match", "\\u", "with", "\\u", "root_", "(_", "*_", "args_", ")_", "\\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 ", " _", "item_", "=_", "seq_", "._", "next_", "(_", ")_", "\\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 ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "item_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Html_", "(_", "HTM", "LP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "startt", "ag_", "(_", "self_", ",_", "name_", ",_", "attr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "\\", "10", ";", " ", " ", " ", " ", "Whe", "n", " ", "found", " ", "an", " ", "opening", " ", "tag", " ", "then", " ", "nest", " ", "it", " ", "onto", " ", "the", " ", "tree", " ", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "struct_", "._", "nest_", "(_", "name_", ",_", "attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Html_", "(_", "HTM", "LP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "endt", "ag_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "\\", "10", ";", " ", " ", " ", " ", "Whe", "n", " ", "found", " ", "a", " ", "clos", "ing", " ", "tag", " ", "then", " ", "make", "s", " ", "it", " ", "point", " ", "to", " ", "the", " ", "right", " ", "scope", " ", "\\", "10", ";", " ", " ", " ", "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 2, 2, 2, 2, 0, 2 ]
Unused local variable
rasher/reddit-modbot/modbot.py
[ { "content": "def performaction(thing, action, rule, matches):\n origaction = action.strip()\n action = action.strip().lower()\n logging.info(\"Perform %s on %s from %s\" % (action, thing.permalink,\n rule['_filename']))\n\n # Compose message. All these are made the same way\n if action in ('respond', 'messagemods', 'messageauthor') or action.startswith('messagemods'):\n subject = \"Modbot rule matched\"\n try:\n if 'subject' in rule:\n subject = rule['subject'].format(thing=thing, rule=rule, matches=matches)\n text = rule['content'].format(thing=thing, rule=rule,\n matches=matches)\n except Exception:\n # We'll just use a default message then\n text = \"\"\"\nThe following post/comment by /u/{thing.author.name} matched the rule\n{rule._filename}: {thing.permalink}\n\"\"\".strip()\n text = text.format(thing=thing, rule=rule, matches=matches)\n pass\n\n if action == 'upvote':\n thing.upvote()\n elif action == 'log':\n rulelogger = logging.getLogger('rulelogger')\n rulelogger.info(\"%s - %s\", thing.permalink, rule['_filename'])\n elif action == 'spam':\n thing.remove(True)\n elif action == 'remove':\n thing.remove(False)\n elif action == 'approve':\n thing.approve()\n elif action == 'respond':\n if isinstance(thing, Submission):\n comment = thing.add_comment(text)\n else:\n comment = thing.reply(text)\n comment.distinguish()\n elif action.startswith('messagemods'):\n if ':' in action:\n sub = origaction.split(':', 1)[1]\n target = thing.reddit_session.get_subreddit(sub)\n else:\n target = thing.subreddit\n target.send_message(subject, text)\n elif action in ('beep', 'bell'):\n sys.stdout.write(\"\\x07\")\n elif action == 'messageauthor':\n thing.author.send_message(subject, text)\n elif action == 'report':\n thing.report()\n elif action.startswith('linkflair') and ':' in action:\n linkflair = origaction.split(':', 1)[1]\n values = linkflair.split(':', 1)\n if len(values) == 1:\n s = thing.set_flair(flair_text=values[0])\n else:\n css_class, text = values\n s = thing.set_flair(flair_text=text, flair_css_class=css_class)\n elif action in ('none', 'null', 'ignore'):\n pass\n else:\n logging.warning(\"Unknown action: %s from %s\" % (action,\n rule['_filename']))", "metadata": "root.performaction", "header": "['module', '___EOS___']", "index": 55 } ]
[ { "span": "s ", "start_line": 112, "start_column": 12, "end_line": 112, "end_column": 13 }, { "span": "s ", "start_line": 115, "start_column": 12, "end_line": 115, "end_column": 13 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "perform", "action_", "(_", "thing_", ",_", "action_", ",_", "rule_", ",_", "matches_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "orig", "action_", "=_", "action_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "action_", "=_", "action_", "._", "strip_", "(_", ")_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"", "Perform", " ", "%", "s", " ", "on", " ", "%", "s", " ", "from", " ", "%", "s", "\"_", "%_", "(_", "action_", ",_", "thing_", "._", "permalink", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rule_", "[_", "'\\u", "filename", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Compose", " ", "message", ".", " ", "All", " ", "these", " ", "are", " ", "made", " ", "the", " ", "same", " ", "way_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "action_", "in_", "(_", "'", "respond", "'_", ",_", "'", "message", "mod", "s", "'_", ",_", "'", "message", "author", "'_", ")_", "or_", "action_", "._", "startswith_", "(_", "'", "message", "mod", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subject_", "=_", "\"", "Mod", "bot", " ", "rule", " ", "matche", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "subject", "'_", "in_", "rule_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subject_", "=_", "rule_", "[_", "'", "subject", "'_", "]_", "._", "format_", "(_", "thing_", "=_", "thing_", ",_", "rule_", "=_", "rule_", ",_", "matches_", "=_", "matches_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "=_", "rule_", "[_", "'", "content", "'_", "]_", "._", "format_", "(_", "thing_", "=_", "thing_", ",_", "rule_", "=_", "rule_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "matches_", "=_", "matches_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", "'", "ll", " ", "just", " ", "use", " ", "a", " ", "default", " ", "message", " ", "then_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "\"\"\"", "\\", "10", ";", "The", " ", "follow", "ing", " ", "post", "/", "comment", " ", "by", " ", "/", "u", "/{", "thing", ".", "author", ".", "name", "}", " ", "matche", "d", " ", "the", " ", "rule", "\\", "10", ";", "{", "rule", ".\\u", "filename", "}:", " ", "{", "thing", ".", "permalink", "}", "\\", "10", ";\"\"\"_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "text_", "._", "format_", "(_", "thing_", "=_", "thing_", ",_", "rule_", "=_", "rule_", ",_", "matches_", "=_", "matches_", ")_", "\\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_", "if_", "action_", "==_", "'", "upv", "ote", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thing_", "._", "upv", "ote", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "==_", "'", "log", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rule", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "rule", "logg", "er", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "logger_", "._", "info_", "(_", "\"%", "s", " ", "-", " ", "%", "s", "\"_", ",_", "thing_", "._", "permalink", "_", ",_", "rule_", "[_", "'\\u", "filename", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "==_", "'", "spam", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thing_", "._", "remove_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "==_", "'", "remove", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thing_", "._", "remove_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "==_", "'", "approve", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thing_", "._", "approve", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "==_", "'", "respond", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "thing_", ",_", "Submission_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "comment_", "=_", "thing_", "._", "add", "\\u", "comment_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "comment_", "=_", "thing_", "._", "reply_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "comment_", "._", "distinguish", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "._", "startswith_", "(_", "'", "message", "mod", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "':'_", "in_", "action_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sub_", "=_", "orig", "action_", "._", "split_", "(_", "':'_", ",_", "1_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "thing_", "._", "reddit", "\\u", "session_", "._", "get", "\\u", "subreddit_", "(_", "sub_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target_", "=_", "thing_", "._", "subreddit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "target_", "._", "send", "\\u", "message_", "(_", "subject_", ",_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "in_", "(_", "'", "beep", "'_", ",_", "'", "bell", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stdout_", "._", "write_", "(_", "\"\\\\", "x0", "7", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "==_", "'", "message", "author", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thing_", "._", "author_", "._", "send", "\\u", "message_", "(_", "subject_", ",_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "==_", "'", "report", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thing_", "._", "report_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "._", "startswith_", "(_", "'", "link", "flair", "'_", ")_", "and_", "':'_", "in_", "action_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "link", "flair", "_", "=_", "orig", "action_", "._", "split_", "(_", "':'_", ",_", "1_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "=_", "link", "flair", "_", "._", "split_", "(_", "':'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "values_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "thing_", "._", "set\\u", "flair", "_", "(_", "flair", "\\u", "text_", "=_", "values_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "css", "\\u", "class_", ",_", "text_", "=_", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "thing_", "._", "set\\u", "flair", "_", "(_", "flair", "\\u", "text_", "=_", "text_", ",_", "flair", "\\u", "css", "\\u", "class_", "=_", "css", "\\u", "class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "in_", "(_", "'", "none", "'_", ",_", "'", "null", "'_", ",_", "'", "ignore", "'_", ")_", ":_", "\\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 ", " _", "logging_", "._", "warning_", "(_", "\"", "Un", "know", "n", " ", "action", ":", " ", "%", "s", " ", "from", " ", "%", "s", "\"_", "%_", "(_", "action_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rule_", "[_", "'\\u", "filename", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
django-leonardo/django-leonardo/leonardo/module/web/models/__init__.py
[ { "content": "\nfrom leonardo.module.web.models.page import *\nfrom leonardo.module.web.models.widget import *\n\nfrom leonardo.module.web.widget.icon.models import IconWidget\nfrom leonardo.module.web.widget.application.models import ApplicationWidget\nfrom leonardo.module.web.widget.markuptext.models import MarkupTextWidget\nfrom leonardo.module.web.widget.feedreader.models import FeedReaderWidget\nfrom leonardo.module.web.widget.pagetitle.models import PageTitleWidget\nfrom leonardo.module.web.widget.table.models import TableWidget\nfrom leonardo.module.web.widget.siteheading.models import SiteHeadingWidget\nfrom leonardo.module.web.widget.htmltext.models import HtmlTextWidget\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from leonardo.module.web.widget.icon.models import IconWidget", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 61 }, { "span": "from leonardo.module.web.widget.application.models import ApplicationWidget", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 75 }, { "span": "from leonardo.module.web.widget.markuptext.models import MarkupTextWidget", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 73 }, { "span": "from leonardo.module.web.widget.feedreader.models import FeedReaderWidget", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 73 }, { "span": "from leonardo.module.web.widget.pagetitle.models import PageTitleWidget", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 71 }, { "span": "from leonardo.module.web.widget.table.models import TableWidget", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 63 }, { "span": "from leonardo.module.web.widget.siteheading.models import SiteHeadingWidget", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 75 }, { "span": "from leonardo.module.web.widget.htmltext.models import HtmlTextWidget", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 69 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "leo", "nar", "do_", "._", "module_", "._", "web_", "._", "models_", "._", "page_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "leo", "nar", "do_", "._", "module_", "._", "web_", "._", "models_", "._", "widget_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "leo", "nar", "do_", "._", "module_", "._", "web_", "._", "widget_", "._", "icon_", "._", "models_", "import_", "Ico", "n", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "leo", "nar", "do_", "._", "module_", "._", "web_", "._", "widget_", "._", "application_", "._", "models_", "import_", "Applica", "tion", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "leo", "nar", "do_", "._", "module_", "._", "web_", "._", "widget_", "._", "markup", "text_", "._", "models_", "import_", "Mark", "up", "Text", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "leo", "nar", "do_", "._", "module_", "._", "web_", "._", "widget_", "._", "feed", "reader_", "._", "models_", "import_", "Feed", "Read", "er", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "leo", "nar", "do_", "._", "module_", "._", "web_", "._", "widget_", "._", "page", "title_", "._", "models_", "import_", "Page", "Tit", "le", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "leo", "nar", "do_", "._", "module_", "._", "web_", "._", "widget_", "._", "table_", "._", "models_", "import_", "Table", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "leo", "nar", "do_", "._", "module_", "._", "web_", "._", "widget_", "._", "site", "heading_", "._", "models_", "import_", "Site", "Head", "ing", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "leo", "nar", "do_", "._", "module_", "._", "web_", "._", "widget_", "._", "htmltext_", "._", "models_", "import_", "Ht", "ml", "Text", "Widget_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
Except block handles 'BaseException'
corbt/pypeline/pypeline/DB.py
[ { "content": " def __init__(self, database_path, **kwargs): \n self.db=plyvel.DB(database_path, **kwargs)\n\n self.collections_set=self.db.prefixed_db(b'collections/')\n self.collection_items_set=self.db.prefixed_db(b'collection-items/')\n self.collections_cache = {}\n\n try:\n self.schema_version = decode(self.db.get(b'pypeline-schema-version'))\n except:\n self.schema_version = schema_version\n self.db.put(b'pypeline-schema-version', encode(schema_version))", "metadata": "root.DB.__init__", "header": "['class', 'DB', ':', '___EOS___']", "index": 20 } ]
[ { "span": "except:", "start_line": 29, "start_column": 8, "end_line": 29, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "DB_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "databa", "se", "\\u", "path_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "db_", "=_", "ply", "vel_", "._", "DB_", "(_", "databa", "se", "\\u", "path_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "collection", "s", "\\u", "set_", "=_", "self_", "._", "db_", "._", "prefixed", "\\u", "db_", "(_", "b", "'", "collection", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "collection", "\\u", "items", "\\u", "set_", "=_", "self_", "._", "db_", "._", "prefixed", "\\u", "db_", "(_", "b", "'", "collection", "-", "items", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "collection", "s", "\\u", "cache_", "=_", "{_", "}_", "\\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_", "._", "schema", "\\u", "version_", "=_", "decode_", "(_", "self_", "._", "db_", "._", "get_", "(_", "b", "'", "pype", "line", "-", "schema", "-", "version", "'_", ")_", ")_", "\\u\\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_", "._", "schema", "\\u", "version_", "=_", "schema", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db_", "._", "put_", "(_", "b", "'", "pype", "line", "-", "schema", "-", "version", "'_", ",_", "encode_", "(_", "schema", "\\u", "version_", ")_", ")_", "\\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, 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 ]
Imprecise assert
JetBrains/youtrack-rest-python-library/python/tests/connection_test.py
[ { "content": " def test_getSubsystems(self):\n subsystems = self.con.getSubsystems('SB')\n default = [s for s in subsystems if s.isDefault][0]\n self.assertTrue(default is not None) ", "metadata": "root.ConnectionTest.test_getSubsystems", "header": "['class', 'ConnectionTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 16 }, { "content": " def test_01_createBundle(self):\n enum_bundle = EnumBundle()\n enum_bundle.name = \"TestEnumBundle\"\n enum_bundle.values = []\n value_names = [\"first\", \"second\", \"third\"]\n for vn in value_names :\n element = EnumField()\n element.name = vn\n element.description = vn + \" description\"\n enum_bundle.values.append(element)\n response = self.con.createBundle(enum_bundle)\n self.assertTrue(response.find(\"http://unit-258.labs.intellij.net:8080/charisma/rest/admin/customfield/bundle/\" + enum_bundle.name) != -1)", "metadata": "root.EnumBundleTests.test_01_createBundle", "header": "['class', 'EnumBundleTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 65 }, { "content": " def test_02_getBundle(self):\n enum_bundle = self.con.getBundle(\"enum\", \"TestEnumBundle\")\n self.assertEquals(enum_bundle.name, \"TestEnumBundle\")\n values = dict({})\n for elem in enum_bundle.values :\n values[elem.name] = elem.description\n self.assertTrue(len(values.keys()) == 3)\n for name in [\"first\", \"second\", \"third\"] :\n self.assertEquals(values[name], name + \" description\")", "metadata": "root.EnumBundleTests.test_02_getBundle", "header": "['class', 'EnumBundleTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 78 }, { "content": " def test_03_getAllBundles(self):\n bundles = self.con.getAllBundles(\"enum\")\n names = [bundle.name for bundle in bundles]\n self.assertTrue(len(names) == 4)\n for name in names :\n self.assertTrue(name in [\"DefaultPriorities\", \"DefaultTypes\", \"enum\", \"TestEnumBundle\"])", "metadata": "root.EnumBundleTests.test_03_getAllBundles", "header": "['class', 'EnumBundleTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 88 }, { "content": " def test_05_addDeleteValue(self):\n enum_bundle = self.con.getBundle(\"enum\", \"TestEnumBundleNew\")\n value = EnumField()\n value.name = \"Added\"\n value.description = \"description\"\n self.con.addValueToBundle(enum_bundle, value)\n enum_bundle = self.con.getBundle(\"enum\", \"TestEnumBundleNew\")\n self.assertEquals(len(enum_bundle.values), 4)\n new_value = \"\"\n for v in enum_bundle.values :\n if v.name == \"Added\" :\n new_value = v\n self.assertEquals(new_value.description, \"description\")\n self.con.removeValueFromBundle(enum_bundle, new_value)\n enum_bundle = self.con.getBundle(\"enum\", \"TestEnumBundleNew\")\n self.assertFalse(\"Added\" in [elem.name for elem in enum_bundle.values])", "metadata": "root.EnumBundleTests.test_05_addDeleteValue", "header": "['class', 'EnumBundleTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 102 }, { "content": " def test_01_createBundle(self):\n user_bundle = UserBundle()\n user_bundle.name = \"TestUserBundle\"\n user_bundle.users = [self.con.getUser(\"alexey.pegov\")]\n user_bundle.groups = [self.con.getGroup(\"scala-developers\"), self.con.getGroup(\"jira-users\")]\n response = self.con.createBundle(user_bundle)\n self.assertTrue(response.find(\n \"http://unit-258.labs.intellij.net:8080/charisma/rest/admin/customfield/userBundle/\" +\n user_bundle.name) != -1)", "metadata": "root.UserBundleTests.test_01_createBundle", "header": "['class', 'UserBundleTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 128 }, { "content": " def test_02_getBundle(self):\n user_bundle = self.con.getBundle(\"user\", \"TestUserBundle\")\n self.assertEquals(user_bundle.name, \"TestUserBundle\")\n user_names = [u.login for u in user_bundle.users]\n group_names = [u.name for u in user_bundle.groups]\n self.assertTrue(len(user_names) == 1)\n self.assertTrue(len(group_names) == 2)\n self.assertTrue(\"alexey.pegov\" in user_names)\n self.assertTrue(\"scala-developers\" in group_names)\n self.assertTrue(\"jira-users\" in group_names)", "metadata": "root.UserBundleTests.test_02_getBundle", "header": "['class', 'UserBundleTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 138 }, { "content": " def test_03_getAllBundles(self):\n bundles = self.con.getAllBundles(\"user\")\n names = [bundle.name for bundle in bundles]\n self.assertTrue(len(names) == 3)\n for name in names :\n self.assertTrue(name in [\"HBR-Assignee\", \"SP-Assignee\", \"TestUserBundle\"])", "metadata": "root.UserBundleTests.test_03_getAllBundles", "header": "['class', 'UserBundleTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 149 }, { "content": " def test_05_addDeleteValue(self):\n user_bundle = self.con.getBundle(\"user\", \"TestUserBundleNew\")\n new_user = self.con.getUser(\"alexander.doroshko\")\n self.con.addValueToBundle(user_bundle, new_user)\n user_bundle = self.con.getBundle(\"user\", \"TestUserBundleNew\")\n self.assertEquals(len(user_bundle.users), 2)\n user_names = [u.login for u in user_bundle.users]\n self.assertTrue(\"alexander.doroshko\" in user_names)\n self.assertTrue(\"alexey.pegov\" in user_names)\n self.con.removeValueFromBundle(user_bundle, new_user)\n user_names = [u.login for u in self.con.getBundle(\"user\", \"TestUserBundleNew\").users]\n self.assertFalse(\"alexander.doroshko\" in user_names)", "metadata": "root.UserBundleTests.test_05_addDeleteValue", "header": "['class', 'UserBundleTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 162 } ]
[ { "span": "self.assertTrue(default is not None) ", "start_line": 19, "start_column": 8, "end_line": 19, "end_column": 44 }, { "span": "self.assertTrue(response.find(\"http://unit-258.labs.intellij.net:8080/charisma/rest/admin/customfield/bundle/\" + enum_bundle.name) != -1)", "start_line": 76, "start_column": 8, "end_line": 76, "end_column": 145 }, { "span": "self.assertTrue(len(values.keys()) == 3)", "start_line": 84, "start_column": 8, "end_line": 84, "end_column": 48 }, { "span": "self.assertTrue(len(names) == 4)", "start_line": 91, "start_column": 8, "end_line": 91, "end_column": 40 }, { "span": "self.assertTrue(name in [\"DefaultPriorities\", \"DefaultTypes\", \"enum\", \"TestEnumBundle\"])", "start_line": 93, "start_column": 12, "end_line": 93, "end_column": 100 }, { "span": "self.assertFalse(\"Added\" in [elem.name for elem in enum_bundle.values])", "start_line": 117, "start_column": 8, "end_line": 117, "end_column": 79 }, { "span": "self.assertTrue(response.find(\n \"http://unit-258.labs.intellij.net:8080/charisma/rest/admin/customfield/userBundle/\" +\n user_bundle.name) != -1)", "start_line": 134, "start_column": 8, "end_line": 136, "end_column": 36 }, { "span": "self.assertTrue(len(user_names) == 1)", "start_line": 143, "start_column": 8, "end_line": 143, "end_column": 45 }, { "span": "self.assertTrue(len(group_names) == 2)", "start_line": 144, "start_column": 8, "end_line": 144, "end_column": 46 }, { "span": "self.assertTrue(\"alexey.pegov\" in user_names)", "start_line": 145, "start_column": 8, "end_line": 145, "end_column": 53 }, { "span": "self.assertTrue(\"scala-developers\" in group_names)", "start_line": 146, "start_column": 8, "end_line": 146, "end_column": 58 }, { "span": "self.assertTrue(\"jira-users\" in group_names)", "start_line": 147, "start_column": 8, "end_line": 147, "end_column": 52 }, { "span": "self.assertTrue(len(names) == 3)", "start_line": 152, "start_column": 8, "end_line": 152, "end_column": 40 }, { "span": "self.assertTrue(name in [\"HBR-Assignee\", \"SP-Assignee\", \"TestUserBundle\"])", "start_line": 154, "start_column": 12, "end_line": 154, "end_column": 86 }, { "span": "self.assertTrue(\"alexander.doroshko\" in user_names)", "start_line": 169, "start_column": 8, "end_line": 169, "end_column": 59 }, { "span": "self.assertTrue(\"alexey.pegov\" in user_names)", "start_line": 170, "start_column": 8, "end_line": 170, "end_column": 53 }, { "span": "self.assertFalse(\"alexander.doroshko\" in user_names)", "start_line": 173, "start_column": 8, "end_line": 173, "end_column": 60 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Connect", "ion", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "Subs", "yste", "ms_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subsystem", "s_", "=_", "self_", "._", "con_", "._", "get", "Subs", "yste", "ms_", "(_", "'", "SB", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default_", "=_", "[_", "s_", "for_", "s_", "in_", "subsystem", "s_", "if_", "s_", "._", "is", "Default_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "default_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enum", "Bun", "dle", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "01", "\\u", "create", "Bundle_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "enum", "\\u", "bundle_", "=_", "Enum", "Bundle_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enum", "\\u", "bundle_", "._", "name_", "=_", "\"", "Test", "Enum", "Bun", "dle", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enum", "\\u", "bundle_", "._", "values_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "\\u", "names_", "=_", "[_", "\"", "first", "\"_", ",_", "\"", "second", "\"_", ",_", "\"", "third", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "vn_", "in_", "value", "\\u", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "element_", "=_", "Enum", "Field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "element_", "._", "name_", "=_", "vn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "element_", "._", "description_", "=_", "vn_", "+_", "\"", " ", "description", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enum", "\\u", "bundle_", "._", "values_", "._", "append_", "(_", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "=_", "self_", "._", "con_", "._", "create", "Bundle_", "(_", "enum", "\\u", "bundle_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "._", "find_", "(_", "\"", "http", "://", "unit", "-", "258", ".", "labs", ".", "intel", "li", "j", ".", "net", ":", "808", "0", "/", "char", "isma", "/", "rest", "/", "admin", "/", "custom", "field", "/", "bundle", "/\"_", "+_", "enum", "\\u", "bundle_", "._", "name_", ")_", "!=_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enum", "Bun", "dle", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "02", "\\u", "get", "Bundle_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "enum", "\\u", "bundle_", "=_", "self_", "._", "con_", "._", "get", "Bundle_", "(_", "\"", "enum", "\"_", ",_", "\"", "Test", "Enum", "Bun", "dle", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "enum", "\\u", "bundle_", "._", "name_", ",_", "\"", "Test", "Enum", "Bun", "dle", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "=_", "dict_", "(_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "elem_", "in_", "enum", "\\u", "bundle_", "._", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "[_", "elem_", "._", "name_", "]_", "=_", "elem_", "._", "description_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "values_", "._", "keys_", "(_", ")_", ")_", "==_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", "in_", "[_", "\"", "first", "\"_", ",_", "\"", "second", "\"_", ",_", "\"", "third", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "values_", "[_", "name_", "]_", ",_", "name_", "+_", "\"", " ", "description", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enum", "Bun", "dle", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "03", "\\u", "get", "All", "Bun", "dle", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bundles_", "=_", "self_", "._", "con_", "._", "get", "All", "Bun", "dle", "s_", "(_", "\"", "enum", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "names_", "=_", "[_", "bundle_", "._", "name_", "for_", "bundle_", "in_", "bundles_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "names_", ")_", "==_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", "in_", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "name_", "in_", "[_", "\"", "Default", "Prior", "iti", "es", "\"_", ",_", "\"", "Default", "Type", "s", "\"_", ",_", "\"", "enum", "\"_", ",_", "\"", "Test", "Enum", "Bun", "dle", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enum", "Bun", "dle", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "05", "\\u", "add", "Delete", "Value_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "enum", "\\u", "bundle_", "=_", "self_", "._", "con_", "._", "get", "Bundle_", "(_", "\"", "enum", "\"_", ",_", "\"", "Test", "Enum", "Bun", "dle", "New", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "Enum", "Field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "._", "name_", "=_", "\"", "Added", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "._", "description_", "=_", "\"", "description", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "con_", "._", "add", "Value", "To", "Bundle_", "(_", "enum", "\\u", "bundle_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enum", "\\u", "bundle_", "=_", "self_", "._", "con_", "._", "get", "Bundle_", "(_", "\"", "enum", "\"_", ",_", "\"", "Test", "Enum", "Bun", "dle", "New", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "enum", "\\u", "bundle_", "._", "values_", ")_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "value_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "v_", "in_", "enum", "\\u", "bundle_", "._", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "v_", "._", "name_", "==_", "\"", "Added", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "value_", "=_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "new", "\\u", "value_", "._", "description_", ",_", "\"", "description", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "con_", "._", "remove", "Value", "Fro", "m", "Bundle_", "(_", "enum", "\\u", "bundle_", ",_", "new", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enum", "\\u", "bundle_", "=_", "self_", "._", "con_", "._", "get", "Bundle_", "(_", "\"", "enum", "\"_", ",_", "\"", "Test", "Enum", "Bun", "dle", "New", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "\"", "Added", "\"_", "in_", "[_", "elem_", "._", "name_", "for_", "elem_", "in_", "enum", "\\u", "bundle_", "._", "values_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Bun", "dle", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "01", "\\u", "create", "Bundle_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "bundle_", "=_", "User", "Bundle_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "bundle_", "._", "name_", "=_", "\"", "Test", "User", "Bun", "dle", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "bundle_", "._", "users_", "=_", "[_", "self_", "._", "con_", "._", "get", "User_", "(_", "\"", "alex", "ey", ".", "peg", "ov", "\"_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "bundle_", "._", "groups_", "=_", "[_", "self_", "._", "con_", "._", "get", "Group_", "(_", "\"", "scala", "-", "developer", "s", "\"_", ")_", ",_", "self_", "._", "con_", "._", "get", "Group_", "(_", "\"", "jira", "-", "users", "\"_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "con_", "._", "create", "Bundle_", "(_", "user", "\\u", "bundle_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "._", "find_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "http", "://", "unit", "-", "258", ".", "labs", ".", "intel", "li", "j", ".", "net", ":", "808", "0", "/", "char", "isma", "/", "rest", "/", "admin", "/", "custom", "field", "/", "user", "Bun", "dle", "/\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "bundle_", "._", "name_", ")_", "!=_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Bun", "dle", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "02", "\\u", "get", "Bundle_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "bundle_", "=_", "self_", "._", "con_", "._", "get", "Bundle_", "(_", "\"", "user", "\"_", ",_", "\"", "Test", "User", "Bun", "dle", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "user", "\\u", "bundle_", "._", "name_", ",_", "\"", "Test", "User", "Bun", "dle", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "names_", "=_", "[_", "u_", "._", "login_", "for_", "u_", "in_", "user", "\\u", "bundle_", "._", "users_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "group", "\\u", "names_", "=_", "[_", "u_", "._", "name_", "for_", "u_", "in_", "user", "\\u", "bundle_", "._", "groups_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "user", "\\u", "names_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "group", "\\u", "names_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "alex", "ey", ".", "peg", "ov", "\"_", "in_", "user", "\\u", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "scala", "-", "developer", "s", "\"_", "in_", "group", "\\u", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "jira", "-", "users", "\"_", "in_", "group", "\\u", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Bun", "dle", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "03", "\\u", "get", "All", "Bun", "dle", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bundles_", "=_", "self_", "._", "con_", "._", "get", "All", "Bun", "dle", "s_", "(_", "\"", "user", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "names_", "=_", "[_", "bundle_", "._", "name_", "for_", "bundle_", "in_", "bundles_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "names_", ")_", "==_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", "in_", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "name_", "in_", "[_", "\"", "HB", "R", "-", "Assign", "ee", "\"_", ",_", "\"", "SP", "-", "Assign", "ee", "\"_", ",_", "\"", "Test", "User", "Bun", "dle", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Bun", "dle", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "05", "\\u", "add", "Delete", "Value_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "bundle_", "=_", "self_", "._", "con_", "._", "get", "Bundle_", "(_", "\"", "user", "\"_", ",_", "\"", "Test", "User", "Bun", "dle", "New", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "user_", "=_", "self_", "._", "con_", "._", "get", "User_", "(_", "\"", "alex", "ander", ".", "dor", "osh", "ko", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "con_", "._", "add", "Value", "To", "Bundle_", "(_", "user", "\\u", "bundle_", ",_", "new", "\\u", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "bundle_", "=_", "self_", "._", "con_", "._", "get", "Bundle_", "(_", "\"", "user", "\"_", ",_", "\"", "Test", "User", "Bun", "dle", "New", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "user", "\\u", "bundle_", "._", "users_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "names_", "=_", "[_", "u_", "._", "login_", "for_", "u_", "in_", "user", "\\u", "bundle_", "._", "users_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "alex", "ander", ".", "dor", "osh", "ko", "\"_", "in_", "user", "\\u", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "alex", "ey", ".", "peg", "ov", "\"_", "in_", "user", "\\u", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "con_", "._", "remove", "Value", "Fro", "m", "Bundle_", "(_", "user", "\\u", "bundle_", ",_", "new", "\\u", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "names_", "=_", "[_", "u_", "._", "login_", "for_", "u_", "in_", "self_", "._", "con_", "._", "get", "Bundle_", "(_", "\"", "user", "\"_", ",_", "\"", "Test", "User", "Bun", "dle", "New", "\"_", ")_", "._", "users_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "\"", "alex", "ander", ".", "dor", "osh", "ko", "\"_", "in_", "user", "\\u", "names_", ")_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 1, 1, 2 ]
Deprecated slice method
petrvanblokland/Xierpa3/xierpa3/toolbox/coloring.py
[ { "content": " def __getslice__(self, i, j):\n return repr(self)[max(0, i):max(0, j):]\n # return None", "metadata": "root.Color.__getslice__", "header": "['class', 'Color', ':', '___EOS___']", "index": 302 } ]
[ { "span": "def __getslice__(self, i, j):", "start_line": 302, "start_column": 4, "end_line": 302, "end_column": 33 } ]
[]
1
true
[ "[CLS]_", "Dep", "reca", "ted_", "slice_", "method_", "[SEP]_", "class_", "Color_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "gets", "lice", "\\u\\u_", "(_", "self_", ",_", "i_", ",_", "j_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "repr_", "(_", "self_", ")_", "[_", "max_", "(_", "0_", ",_", "i_", ")_", ":_", "max_", "(_", "0_", ",_", "j_", ")_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "return", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
ardekantur/pyglet/tests/resource/RES_LOAD.py
[ { "content": " def check_file(self, path, file, result):\n loader = resource.Loader(path, script_home=self.script_home)\n self.assertTrue(loader.file(file).read() == '%s\\n' % result)", "metadata": "root.TestCase.check_file", "header": "['class', 'TestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 43 } ]
[ { "span": "self.assertTrue(loader.file(file).read() == '%s\\n' % result)", "start_line": 45, "start_column": 8, "end_line": 45, "end_column": 68 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "file_", "(_", "self_", ",_", "path_", ",_", "file_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "resource_", "._", "Loader_", "(_", "path_", ",_", "script", "\\u", "home_", "=_", "self_", "._", "script", "\\u", "home_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "loader_", "._", "file_", "(_", "file_", ")_", "._", "read_", "(_", ")_", "==_", "'%", "s", "\\\\", "n", "'_", "%_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Comparison of identical values
HubSpot/sanetime/sanetime/test/test_tztime.py
[ { "content": " def test_equality(self):\n t1 = tztime(JAN_MICROS, tz='UTC')\n t2 = tztime(JAN_MICROS, tz='America/New_York')\n t3 = tztime(JAN_MICROS+1)\n self.assertTrue(t1==t1)\n self.assertTrue(t2==t2)\n self.assertTrue(t3==t3)\n self.assertFalse(t1!=t1)\n self.assertFalse(t2!=t2)\n self.assertFalse(t3!=t3)\n\n self.assertTrue(t1!=t2)\n self.assertTrue(t2!=t1)\n self.assertTrue(t1!=t3)\n self.assertTrue(t3!=t1)\n self.assertTrue(t2!=t3)\n self.assertTrue(t3!=t2)\n\n self.assertFalse(t1==t2)\n self.assertFalse(t2==t1)\n self.assertFalse(t1==t3)\n self.assertFalse(t3==t1)\n self.assertFalse(t2==t3)\n self.assertFalse(t3==t2)\n\n self.assertTrue(t1!=None)\n self.assertFalse(t1==None)\n self.assertTrue(None!=t1)\n self.assertFalse(None==t1)\n\n self.assertTrue(t1==t1.us)", "metadata": "root.SaneTzTimeTest.test_equality", "header": "['class', 'SaneTzTimeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 24 }, { "content": " def test_comparisons(self):\n t1 = tztime(JAN_MICROS,'UTC')\n t2 = tztime(JAN_MICROS,'America/New_York')\n t3 = tztime(JAN_MICROS+1,'UTC')\n\n self.assertFalse(t1 > t1)\n self.assertFalse(t2 > t2)\n self.assertFalse(t3 > t3)\n self.assertTrue(t1 > t2)\n self.assertFalse(t2 > t1)\n self.assertFalse(t1 > t3)\n self.assertTrue(t3 > t1)\n self.assertFalse(t2 > t3)\n self.assertTrue(t3 > t2)\n\n self.assertTrue(t1 >= t1)\n self.assertTrue(t2 >= t2)\n self.assertTrue(t3 >= t3)\n self.assertTrue(t1 >= t2)\n self.assertFalse(t2 >= t1)\n self.assertFalse(t1 >= t3)\n self.assertTrue(t3 >= t1)\n self.assertFalse(t2 >= t3)\n self.assertTrue(t3 >= t2)\n\n self.assertTrue(t1 <= t1)\n self.assertTrue(t2 <= t2)\n self.assertTrue(t3 <= t3)\n self.assertFalse(t1 <= t2)\n self.assertTrue(t2 <= t1)\n self.assertTrue(t1 <= t3)\n self.assertFalse(t3 <= t1)\n self.assertTrue(t2 <= t3)\n self.assertFalse(t3 <= t2)\n\n self.assertFalse(t1 < t1)\n self.assertFalse(t2 < t2)\n self.assertFalse(t3 < t3)\n self.assertFalse(t1 < t2)\n self.assertTrue(t2 < t1)\n self.assertTrue(t1 < t3)\n self.assertFalse(t3 < t1)\n self.assertTrue(t2 < t3)\n self.assertFalse(t3 < t2)", "metadata": "root.SaneTzTimeTest.test_comparisons", "header": "['class', 'SaneTzTimeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 56 } ]
[ { "span": "t1==t1)", "start_line": 28, "start_column": 24, "end_line": 28, "end_column": 30 }, { "span": "t2==t2)", "start_line": 29, "start_column": 24, "end_line": 29, "end_column": 30 }, { "span": "t3==t3)", "start_line": 30, "start_column": 24, "end_line": 30, "end_column": 30 }, { "span": "t1!=t1)", "start_line": 31, "start_column": 25, "end_line": 31, "end_column": 31 }, { "span": "t2!=t2)", "start_line": 32, "start_column": 25, "end_line": 32, "end_column": 31 }, { "span": "t3!=t3)", "start_line": 33, "start_column": 25, "end_line": 33, "end_column": 31 }, { "span": "t1 > t1)", "start_line": 61, "start_column": 25, "end_line": 61, "end_column": 32 }, { "span": "t2 > t2)", "start_line": 62, "start_column": 25, "end_line": 62, "end_column": 32 }, { "span": "t3 > t3)", "start_line": 63, "start_column": 25, "end_line": 63, "end_column": 32 }, { "span": "t1 >= t1)", "start_line": 71, "start_column": 24, "end_line": 71, "end_column": 32 }, { "span": "t2 >= t2)", "start_line": 72, "start_column": 24, "end_line": 72, "end_column": 32 }, { "span": "t3 >= t3)", "start_line": 73, "start_column": 24, "end_line": 73, "end_column": 32 }, { "span": "t1 <= t1)", "start_line": 81, "start_column": 24, "end_line": 81, "end_column": 32 }, { "span": "t2 <= t2)", "start_line": 82, "start_column": 24, "end_line": 82, "end_column": 32 }, { "span": "t3 <= t3)", "start_line": 83, "start_column": 24, "end_line": 83, "end_column": 32 }, { "span": "t1 < t1)", "start_line": 91, "start_column": 25, "end_line": 91, "end_column": 32 }, { "span": "t2 < t2)", "start_line": 92, "start_column": 25, "end_line": 92, "end_column": 32 }, { "span": "t3 < t3)", "start_line": 93, "start_column": 25, "end_line": 93, "end_column": 32 } ]
[]
1
true
[ "[CLS]_", "Compari", "son_", "of_", "identical_", "values_", "[SEP]_", "class_", "San", "e", "T", "z", "Time", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "equality", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t1_", "=_", "tz", "time_", "(_", "JA", "N", "\\u", "MICRO", "S_", ",_", "tz_", "=_", "'", "UT", "C", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "tz", "time_", "(_", "JA", "N", "\\u", "MICRO", "S_", ",_", "tz_", "=_", "'", "Ame", "rica", "/", "New", "\\u", "Yo", "rk", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t3_", "=_", "tz", "time_", "(_", "JA", "N", "\\u", "MICRO", "S_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", "==_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t2_", "==_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t3_", "==_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t1_", "!=_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t2_", "!=_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t3_", "!=_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", "!=_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t2_", "!=_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", "!=_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t3_", "!=_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t2_", "!=_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t3_", "!=_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t1_", "==_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t2_", "==_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t1_", "==_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t3_", "==_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t2_", "==_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t3_", "==_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", "!=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t1_", "==_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "None_", "!=_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "None_", "==_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", "==_", "t1_", "._", "us_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "San", "e", "T", "z", "Time", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "comparisons", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t1_", "=_", "tz", "time_", "(_", "JA", "N", "\\u", "MICRO", "S_", ",_", "'", "UT", "C", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "tz", "time_", "(_", "JA", "N", "\\u", "MICRO", "S_", ",_", "'", "Ame", "rica", "/", "New", "\\u", "Yo", "rk", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t3_", "=_", "tz", "time_", "(_", "JA", "N", "\\u", "MICRO", "S_", "+_", "1_", ",_", "'", "UT", "C", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t1_", ">_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t2_", ">_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t3_", ">_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", ">_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t2_", ">_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t1_", ">_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t3_", ">_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t2_", ">_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t3_", ">_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", ">=_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t2_", ">=_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t3_", ">=_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", ">=_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t2_", ">=_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t1_", ">=_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t3_", ">=_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t2_", ">=_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t3_", ">=_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", "<=_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t2_", "<=_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t3_", "<=_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t1_", "<=_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t2_", "<=_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", "<=_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t3_", "<=_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t2_", "<=_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t3_", "<=_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t1_", "<_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t2_", "<_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t3_", "<_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t1_", "<_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t2_", "<_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t1_", "<_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t3_", "<_", "t1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t2_", "<_", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "t3_", "<_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
j-towns/iprofiler/iprofiler.py
[ { "content": "from IPython.utils import openpy\nfrom IPython.utils import ulinecache\nfrom IPython.core.magic import (Magics, magics_class, line_magic,\n cell_magic, line_cell_magic)\n\nfrom ipywidgets import DOMWidget\nfrom traitlets import Unicode, Int\nfrom ipywidgets.widgets.widget import CallbackDispatcher, register\n\nfrom pygments import highlight\nfrom pygments.lexers import PythonLexer\nfrom pygments.formatters import HtmlFormatter\n\nimport zipfile\nimport sys\n\nfrom bokeh.charts import Bar\nfrom bokeh.embed import notebook_div\nfrom bokeh.charts.attributes import CatAttr\nimport bokeh.models.widgets.tables as bokeh_tables\nfrom bokeh.models import ColumnDataSource\nfrom bokeh.util.notebook import load_notebook\nfrom bokeh.io import show, vform\n\n# Python 2/3 compatibility utils\n# ===========================================================\nPY3 = sys.version_info[0] == 3\n\n# exec (from https://bitbucket.org/gutworth/six/):\nif PY3:\n import builtins\n exec_ = getattr(builtins, \"exec\")\n del builtins\n from html import escape as html_escape\nelse:\n from cgi import escape as html_escape\n\n# ============================================================\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": " def exec_(_code_, _globs_=None, _locs_=None):\n \"\"\"Execute code in a namespace.\"\"\"\n if _globs_ is None:\n frame = sys._getframe(1)\n _globs_ = frame.f_globals\n if _locs_ is None:\n _locs_ = frame.f_locals\n del frame\n elif _locs_ is None:\n _locs_ = _globs_\n exec(\"\"\"exec _code_ in _globs_, _locs_\"\"\")", "metadata": "root.exec_", "header": "['module', '___EOS___']", "index": 35 }, { "content": "class IProfile(DOMWidget):\n\n\n\n _view_name = Unicode('IProfileView').tag(sync=True)\n\n # The following two traits are used to send data to the front end.\n # This trait is the actual html displayed in the widget\n value = Unicode().tag(sync=True)\n\n # Number of elements in table (used by front end to generate click events)\n n_table_elements = Int(0).tag(sync=True)\n\n\n\n\n\n", "metadata": "root.IProfile", "header": "['module', '___EOS___']", "index": 51 }, { "content": " def __init__(self, cprofile, lprofile=None, context=None, *args, **kwargs):\n self.generate_cprofile_tree(cprofile, context)\n self.lprofile = lprofile\n\n # Two lists used for the back and forward buttons. Backward includes\n # the currently displayed function.\n self.backward = []\n self.forward = []\n\n # Dictionary mapping html id's to function names\n self.id_dict = {}\n\n self.backward.append(None)\n\n self.generate_content()\n\n self.on_msg(self.handle_on_msg)\n\n super(IProfile, self).__init__(value=self.value)", "metadata": "root.IProfile.__init__", "header": "['class', 'IProfile', '(', 'DOMWidget', ')', ':', '___EOS___']", "index": 52 }, { "content": " def generate_cprofile_tree(self, cprofile, context=None):\n \"\"\"\n Generate a dict based on the output of the cProfiler.\n \"\"\"\n self.cprofile_tree = {}\n for entry in cprofile:\n function = entry[0]\n calls_raw = entry[5]\n calls = {}\n if calls_raw is not None:\n for call in calls_raw:\n calls[call[0]] = {'callcount': call[1],\n 'reccallcount': call[2],\n 'totaltime': call[3],\n 'inlinetime': call[4]}\n\n self.cprofile_tree[function] = {'callcount': entry[1],\n 'reccallcount': entry[2],\n 'totaltime': entry[3],\n 'inlinetime': entry[4],\n 'calls': calls}\n\n # Find root nodes\n callcounts = dict([(function, 0) for function in self.cprofile_tree])\n for function in self.cprofile_tree:\n for call in self.cprofile_tree[function]['calls']:\n callcounts[call] += 1\n\n self.roots = []\n for i in callcounts:\n if callcounts[i] == 0:\n self.roots.append(i)\n\n self.delete_top_level(context)", "metadata": "root.IProfile.generate_cprofile_tree", "header": "['class', 'IProfile', '(', 'DOMWidget', ')', ':', '___EOS___']", "index": 72 }, { "content": " def delete_top_level(self, context=None):\n \"\"\"\n Delete the top level calls which are not part of the user's code.\n\n TODO: If CELL_MAGIC then also merge the entries for the cell (which are\n seperated by line into individual code objects...)\n \"\"\"\n if context == \"LINE_MAGIC\":\n # Find the root nodes that we want\n new_roots = []\n for function in self.cprofile_tree:\n try:\n if function.co_name == \"<module>\":\n new_roots += self.cprofile_tree[function]['calls']\n except AttributeError:\n pass\n\n # Remove function from new_roots if its child is already in\n # new_roots\n new_roots = [r for r in new_roots if (type(r) == str or\n r.co_name != \"<module>\")]\n for i in range(len(new_roots)):\n function = new_roots[i]\n try:\n if function.co_name == \"<module>\":\n del new_roots[i]\n except AttributeError:\n pass\n\n if context == \"CELL_MAGIC\":\n # Find the root nodes that we want\n new_roots = []\n for function in self.cprofile_tree:\n try:\n if \"<ipython-input\" in function.co_filename:\n new_roots += self.cprofile_tree[function]['calls']\n except AttributeError:\n pass\n\n # Populate a new tree with everything below roots in the original\n # tree.\n new_cprofile_tree = {}\n\n def populate_new_tree(roots):\n for root in roots:\n if root not in new_cprofile_tree:\n new_cprofile_tree[root] = self.cprofile_tree[root]\n populate_new_tree(self.cprofile_tree[root]['calls'])\n\n populate_new_tree(new_roots)\n self.cprofile_tree = new_cprofile_tree\n self.roots = new_roots", "metadata": "root.IProfile.delete_top_level", "header": "['class', 'IProfile', '(', 'DOMWidget', ')', ':', '___EOS___']", "index": 107 }, { "content": " def generate_content(self, fun=None):\n \"\"\"Generate profile page for function fun. If fun=None then generate\n a summary page.\"\"\"\n self.value_cache = \"\"\n self.generate_nav(fun)\n self.generate_heading(fun)\n self.generate_table(fun)\n if self.lprofile is not None and fun is not None:\n self.generate_lprofile(fun)\n self.value = self.value_cache", "metadata": "root.IProfile.generate_content", "header": "['class', 'IProfile', '(', 'DOMWidget', ')', ':', '___EOS___']", "index": 169 }, { "content": " def generate_nav(self, fun=None):\n self.value_cache += '<p>'\n if fun is None:\n self.value_cache += '<img src=\"/nbextensions/iprofiler/home.png\">'\n else:\n self.value_cache += ('<a id=\"iprofile_home\" '\n 'style=\"cursor:pointer\">'\n '<img src=\"/nbextensions/iprofiler/home.png\">'\n '</a>')\n if len(self.backward) > 1:\n self.value_cache += ('<a id=\"iprofile_back\" '\n 'style=\"cursor:pointer\">'\n '<img src=\"/nbextensions/iprofiler/back.png\">'\n '</a>')\n else:\n self.value_cache += ('<img src=\"/nbextensions/iprofiler/back_'\n 'grey.png\">')\n if len(self.forward) > 0:\n self.value_cache += ('<a id=\"iprofile_forward\" '\n 'style=\"cursor:pointer\"><img' 'src=\"/nbextensions/iprofiler/forward.png\">'\n '</a></p>')\n else:\n self.value_cache += ('<img src=\"/nbextensions/iprofiler/forward_'\n 'grey.png\"></p>')", "metadata": "root.IProfile.generate_nav", "header": "['class', 'IProfile', '(', 'DOMWidget', ')', ':', '___EOS___']", "index": 180 }, { "content": " def generate_heading(self, fun):\n \"\"\"Generate a heading for the top of the iprofile.\"\"\"\n if fun is None:\n self.value_cache += \"<h3>Summary</h3>\"\n return\n\n try:\n heading = \"{} (Calls: {}, Time: {})\"\n heading = heading.format(fun.co_name,\n self.cprofile_tree[fun]['callcount'],\n self.cprofile_tree[fun]['totaltime'])\n heading = html_escape(heading)\n self.value_cache += \"<h3>\" + heading + \"</h3>\"\n self.value_cache += (\"<p>From file: \" +\n html_escape(fun.co_filename) + \"</p>\")\n except AttributeError:\n self.value_cache += \"<h3>\" + html_escape(fun) + \"</h3>\"\n\n self.value_cache += '<p>'", "metadata": "root.IProfile.generate_heading", "header": "['class', 'IProfile', '(', 'DOMWidget', ')', ':', '___EOS___']", "index": 205 }, { "content": " def generate_table(self, fun):\n \"\"\"\n Generate a table displaying the functions called by fun and their\n respective running times. This is done using Bokeh's DataTable widget,\n which is based on SlickGrid.\n \"\"\"\n if fun is None:\n # Generate summary page\n calls = self.cprofile_tree.keys()\n else:\n calls = [function for function in self.cprofile_tree[fun]['calls']]\n\n self.n_table_elements = len(calls)\n\n names = [call if type(call) == str else call.co_name for call in calls]\n\n # List of tuples containing:\n # (id number, name, totaltime, inlinetime, cprofile_key)\n calls = list(zip(range(len(calls)), names,\n (self.cprofile_tree[x]['totaltime'] for x in calls),\n (self.cprofile_tree[x]['inlinetime'] for x in calls),\n calls))\n\n self.id_dict = {\"function\" + str(id): cprofile_key for\n (id, name, time, inlinetime, cprofile_key) in calls}\n\n # Sort by total time (descending)\n calls.sort(key=lambda x: x[2])\n calls.reverse()\n\n # Generate bokeh table\n try:\n ids, names, times, inlinetimes = list(zip(*calls))[:-1]\n except ValueError:\n return\n\n time_plot_multiplier = 100 / max(times)\n plot_inline_times = [time_plot_multiplier * time for time in\n inlinetimes]\n plot_extra_times = [time_plot_multiplier * (totaltime - inlinetime)\n for totaltime, inlinetime in zip(times,\n inlinetimes)]\n\n table_data = dict(ids=ids, names=names, times=times,\n inlinetimes=inlinetimes,\n plot_inline_times=plot_inline_times,\n plot_extra_times=plot_extra_times)\n\n table_data = ColumnDataSource(table_data)\n\n time_format = bokeh_tables.NumberFormatter(format='0,0.00000')\n\n name_template = '<a id=\"function<%= ids %>\"><%- names %></a>'\n name_format = (bokeh_tables.\n HTMLTemplateFormatter(template=name_template))\n\n time_plot_template = ('<img src=\"/nbextensions/iprofiler/red.gif\"' +\n 'height=\"10\" width=\"<%= plot_inline_times%>\">' +\n '<img src=\"/nbextensions/iprofiler/pink.gif\"' +\n 'height=\"10\" width=\"<%= plot_extra_times %>\">')\n time_plot_format = (bokeh_tables.\n HTMLTemplateFormatter(template=time_plot_template))\n\n columns = [bokeh_tables.TableColumn(title=\"Function\",\n field=\"names\",\n formatter=name_format),\n bokeh_tables.TableColumn(title=\"Total time (s)\",\n field=\"times\",\n formatter=time_format,\n default_sort=\"descending\"),\n bokeh_tables.TableColumn(title=\"Inline time (s)\",\n field=\"inlinetimes\",\n formatter=time_format,\n default_sort=\"descending\"),\n bokeh_tables.TableColumn(title=\"Time plot\",\n sortable=False,\n formatter=time_plot_format)]\n\n bokeh_table = bokeh_tables.DataTable(source=table_data,\n columns=columns,\n # Would be nice if width could\n # be automatic but this appears\n # to be broken in firefox and\n # chrome.\n width=620,\n height='auto',\n selectable=False)\n\n self.value_cache += notebook_div(bokeh_table)", "metadata": "root.IProfile.generate_table", "header": "['class', 'IProfile', '(', 'DOMWidget', ')', ':', '___EOS___']", "index": 225 }, { "content": " def generate_lprofile(self, fun):\n \"\"\"\n Generate div containing profiled source code with timings of each line,\n taken from iline_profiler.\n \"\"\"\n try:\n filename = fun.co_filename\n firstlineno = fun.co_firstlineno\n name = fun.co_name\n except AttributeError:\n return\n\n ltimings_key = (filename, firstlineno, name)\n\n try:\n ltimings = self.lprofile.timings[ltimings_key]\n except KeyError:\n return\n\n # Currently the correct filename is stored at the end of ltimings.\n # This is a work-around to fix cProfiler giving useless filenames for\n # zipped packages.\n filename = ltimings[-1]\n\n if filename.endswith(('.pyc', '.pyo')):\n filename = openpy.source_from_cache(filename)\n if \".egg/\" in filename:\n add_zipped_file_to_linecache(filename)\n\n raw_code = \"\"\n linenos = range(firstlineno, ltimings[-2][0] + 1)\n\n for lineno in linenos:\n raw_code += ulinecache.getline(filename, lineno)\n\n formatter = LProfileFormatter(firstlineno, ltimings, noclasses=True)\n self.value_cache += highlight(raw_code, PythonLexer(), formatter)", "metadata": "root.IProfile.generate_lprofile", "header": "['class', 'IProfile', '(', 'DOMWidget', ')', ':', '___EOS___']", "index": 315 }, { "content": " def handle_on_msg(self, _, content, buffers):\n \"\"\"\n Handler for click (and potentially other) events from the user.\n \"\"\"\n if content == \"home\":\n self.backward.append(None)\n self.forward = []\n self.generate_content()\n elif content == \"back\":\n self.forward.append(self.backward.pop())\n self.generate_content(self.backward[-1])\n elif content == \"forward\":\n self.backward.append(self.forward.pop())\n self.generate_content(self.backward[-1])\n else:\n clicked_fun = self.id_dict[content]\n self.backward.append(clicked_fun)\n self.forward = []\n self.generate_content(clicked_fun)", "metadata": "root.IProfile.handle_on_msg", "header": "['class', 'IProfile', '(', 'DOMWidget', ')', ':', '___EOS___']", "index": 353 }, { "content": "def add_zipped_file_to_linecache(filename):\n (zipped_filename, extension, inner) = filename.partition('.egg/')\n zipped_filename += extension[:-1]\n assert zipfile.is_zipfile(zipped_filename)\n zipped_file = zipfile.ZipFile(zipped_filename)\n ulinecache.linecache.cache[filename] = (None, None,\n zipped_file.open(inner, 'r').\n readlines())\n zipped_file.close()", "metadata": "root.add_zipped_file_to_linecache", "header": "['module', '___EOS___']", "index": 374 }, { "content": "class LProfileFormatter(HtmlFormatter):\n\n\n", "metadata": "root.LProfileFormatter", "header": "['module', '___EOS___']", "index": 385 }, { "content": " def __init__(self, firstlineno, ltimings, *args, **kwargs):\n self.lineno = firstlineno\n self.ltimings = ltimings\n super(LProfileFormatter, self).__init__(*args, **kwargs)", "metadata": "root.LProfileFormatter.__init__", "header": "['class', 'LProfileFormatter', '(', 'HtmlFormatter', ')', ':', '___EOS___']", "index": 387 }, { "content": " def wrap(self, source, outfile):\n return super(LProfileFormatter,\n self).wrap(self._wrap_code(source), outfile)", "metadata": "root.LProfileFormatter.wrap", "header": "['class', 'LProfileFormatter', '(', 'HtmlFormatter', ')', ':', '___EOS___']", "index": 392 }, { "content": " def _wrap_code(self, source):\n head_template = '{} {} {}'\n no_time_template = '{:6} {:7} {:>4} {}'\n template = '<span style=\\'color: Red\\'>{:06.2f}</span> {:>7} {:>4} {}'\n time = '<span style=\\'color: Red; font-weight: bold\\'>Time</span> '\n yield 0, head_template.format(time, ' Calls',\n ' <strong>Code</strong>\\n')\n # j keeps track of position within ltimings\n j = 0\n for i, line in source:\n lineno = self.lineno\n if j < len(self.ltimings) and lineno == self.ltimings[j][0]:\n lcalls = self.ltimings[j][1]\n ltime = self.ltimings[j][2] * 1e-6\n yield i, template.format(ltime, lcalls, lineno, line)\n j += 1\n else:\n yield i, no_time_template.format('', '', lineno, line)\n self.lineno += 1", "metadata": "root.LProfileFormatter._wrap_code", "header": "['class', 'LProfileFormatter', '(', 'HtmlFormatter', ')', ':', '___EOS___']", "index": 396 }, { "content": "@magics_class\nclass IProfilerMagics(Magics):", "metadata": "root.IProfilerMagics", "header": "['module', '___EOS___']", "index": 417 }, { "content": " @line_cell_magic\n def iprofile(self, line, cell=None):\n import _iline_profiler\n import cProfile\n cprofiler = cProfile.Profile()\n lprofiler = _iline_profiler.LineProfiler()\n\n if cell is None:\n # LINE MAGIC\n global_ns = self.shell.user_global_ns\n local_ns = self.shell.user_ns\n\n lprofiler.enable()\n cprofiler.enable()\n exec_(line, global_ns, local_ns)\n cprofiler.disable()\n lprofiler.disable()\n\n lprofile = lprofiler.get_stats()\n cprofile = cprofiler.getstats()\n\n iprofile = IProfile(cprofile, lprofile, context=\"LINE_MAGIC\")\n\n # Note this name *could* clash with a user defined name...\n # Should find a better solution\n self.shell.user_ns['_IPROFILE'] = iprofile\n self.shell.run_cell('_IPROFILE')\n else:\n lprofiler.enable()\n cprofiler.enable()\n self.shell.run_cell(cell)\n cprofiler.disable()\n lprofiler.disable()\n\n lprofile = lprofiler.get_stats()\n cprofile = cprofiler.getstats()\n\n iprofile = IProfile(cprofile, lprofile, context='CELL_MAGIC')\n\n # Note this name *could* clash with a user defined name...\n # Should find a better solution\n self.shell.user_ns['_IPROFILE'] = iprofile\n self.shell.run_cell('_IPROFILE')", "metadata": "root.IProfilerMagics.iprofile", "header": "['class', 'IProfilerMagics', '(', 'Magics', ')', ':', '___EOS___']", "index": 419 }, { "content": "def load_ipython_extension(shell):\n # Initiate bokeh\n load_notebook(hide_banner=True)\n shell.register_magics(IProfilerMagics)\n cell = \"\"\"%%javascript\nrequire([\"base/js/utils\"], function(utils){\n utils.load_extensions('iprofiler/iprofiler');\n});\"\"\"\n shell.run_cell(cell)", "metadata": "root.load_ipython_extension", "header": "['module', '___EOS___']", "index": 464 } ]
[ { "span": "from IPython.core.magic import (Magics, magics_class, line_magic,\n cell_magic, line_cell_magic)", "start_line": 2, "start_column": 0, "end_line": 3, "end_column": 60 }, { "span": "from ipywidgets.widgets.widget import CallbackDispatcher, register", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 66 }, { "span": "from bokeh.charts import Bar", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 28 }, { "span": "from bokeh.charts.attributes import CatAttr", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 43 }, { "span": "from bokeh.io import show, vform", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 32 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "IP", "ython_", "._", "utils_", "import_", "openp", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "IP", "ython_", "._", "utils_", "import_", "ulin", "eca", "che_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "IP", "ython_", "._", "core_", "._", "magic_", "import_", "(_", "Mag", "ics_", ",_", "magic", "s", "\\u", "class_", ",_", "line", "\\u", "magic_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cell", "\\u", "magic_", ",_", "line", "\\u", "cell", "\\u", "magic_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "ipy", "widgets_", "import_", "DOM", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tra", "itle", "ts_", "import_", "Unicode_", ",_", "Int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ipy", "widgets_", "._", "widgets_", "._", "widget_", "import_", "Call", "back", "Dispatcher_", ",_", "register_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pygments_", "import_", "highlight_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pygments_", "._", "lexer", "s_", "import_", "Pyth", "on", "Lexer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pygments_", "._", "formatters_", "import_", "Ht", "ml", "Formatter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "zipfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "bokeh", "_", "._", "charts", "_", "import_", "Bar_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bokeh", "_", "._", "embed_", "import_", "notebook", "\\u", "div_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bokeh", "_", "._", "charts", "_", "._", "attributes_", "import_", "Cat", "Attr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "bokeh", "_", "._", "models_", "._", "widgets_", "._", "tables_", "as_", "bokeh", "\\u", "tables_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bokeh", "_", "._", "models_", "import_", "Colum", "n", "Data", "Source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bokeh", "_", "._", "util_", "._", "notebook_", "import_", "load", "\\u", "notebook_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bokeh", "_", "._", "io_", "import_", "show_", ",_", "vf", "orm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2", "/", "3", " ", "compatibility", " ", "utils_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "==============", "==============", "==============", "==============", "===", "_", "\\u\\u\\uNL\\u\\u\\u_", "PY", "3_", "=_", "sys_", "._", "version", "\\u", "info_", "[_", "0_", "]_", "==_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "exec", " ", "(", "from", " ", "https", "://", "bitb", "ucket", ".", "org", "/", "gut", "worth", "/", "si", "x", "/)", ":_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "PY", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "builtins_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exec\\u_", "=_", "getattr_", "(_", "builtins_", ",_", "\"", "exec", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "builtins_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "html_", "import_", "escape_", "as_", "html", "\\u", "escape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "cgi_", "import_", "escape_", "as_", "html", "\\u", "escape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "==============", "==============", "==============", "==============", "====", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "exec\\u_", "(_", "\\u", "code", "\\u_", ",_", "\\u", "glob", "s\\u_", "=_", "None_", ",_", "\\u", "locs", "\\u_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Execut", "e", " ", "code", " ", "in", " ", "a", " ", "namespace", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\\u", "glob", "s\\u_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "frame_", "=_", "sys_", "._", "\\u", "getframe_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "glob", "s\\u_", "=_", "frame_", "._", "f", "\\u", "globals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\\u", "locs", "\\u_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "locs", "\\u_", "=_", "frame_", "._", "f", "\\u", "locals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "del_", "frame_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "\\u", "locs", "\\u_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "locs", "\\u_", "=_", "\\u", "glob", "s\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "exec_", "(_", "\"\"\"", "exec", " ", "\\u", "code", "\\u", " ", "in", " ", "\\u", "glob", "s", "\\u", ",", " ", "\\u", "locs", "\\u\"", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "IP", "rofile", "_", "(_", "DOM", "Widget_", ")_", ":_", "\\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\\uDEDENT\\u\\u\\u_", "\\u", "view", "\\u", "name_", "=_", "Unicode_", "(_", "'", "IP", "rofile", "View", "'_", ")_", "._", "tag_", "(_", "sync_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "follow", "ing", " ", "two", " ", "traits", " ", "are", " ", "used", " ", "to", " ", "send", " ", "data", " ", "to", " ", "the", " ", "front", " ", "end", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "tra", "it", " ", "is", " ", "the", " ", "actual", " ", "html", " ", "displaye", "d", " ", "in", " ", "the", " ", "widget_", "\\u\\u\\uNL\\u\\u\\u_", "value_", "=_", "Unicode_", "(_", ")_", "._", "tag_", "(_", "sync_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Number", " ", "of", " ", "element", "s", " ", "in", " ", "table", " ", "(", "used", " ", "by", " ", "front", " ", "end", " ", "to", " ", "generat", "e", " ", "click", " ", "events", ")_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "table", "\\u", "elements_", "=_", "Int_", "(_", "0_", ")_", "._", "tag_", "(_", "sync_", "=_", "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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "IP", "rofile", "_", "(_", "DOM", "Widget_", ")_", ":_", "\\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_", ",_", "cpro", "file_", ",_", "lpr", "ofile_", "=_", "None_", ",_", "context_", "=_", "None_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "generat", "e\\u", "cpro", "file", "\\u", "tree_", "(_", "cpro", "file_", ",_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lpr", "ofile_", "=_", "lpr", "ofile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tw", "o", " ", "lists", " ", "used", " ", "for", " ", "the", " ", "back", " ", "and", " ", "forward", " ", "buttons", ".", " ", "Backward", " ", "includes_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "currentl", "y", " ", "displaye", "d", " ", "function", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "backward_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "forward_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Dict", "ionar", "y", " ", "mapping", " ", "html", " ", "id", "'", "s", " ", "to", " ", "function", " ", "names_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "id", "\\u", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "backward_", "._", "append_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "generat", "e\\u", "content_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "on", "\\u", "msg_", "(_", "self_", "._", "handle", "\\u", "on", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "super_", "(_", "IP", "rofile", "_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "value_", "=_", "self_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IP", "rofile", "_", "(_", "DOM", "Widget_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "generat", "e\\u", "cpro", "file", "\\u", "tree_", "(_", "self_", ",_", "cpro", "file_", ",_", "context_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Generate", " ", "a", " ", "dict", " ", "based", " ", "on", " ", "the", " ", "output", " ", "of", " ", "the", " ", "c", "Profiler", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cpro", "file", "\\u", "tree_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "entry_", "in_", "cpro", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "function_", "=_", "entry_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "calls", "\\u", "raw_", "=_", "entry_", "[_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "calls_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "calls", "\\u", "raw_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "call_", "in_", "calls", "\\u", "raw_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "calls_", "[_", "call_", "[_", "0_", "]_", "]_", "=_", "{_", "'", "call", "count", "'_", ":_", "call_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rec", "call", "count", "'_", ":_", "call_", "[_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "total", "time", "'_", ":_", "call_", "[_", "3_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "inline", "time", "'_", ":_", "call_", "[_", "4_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "cpro", "file", "\\u", "tree_", "[_", "function_", "]_", "=_", "{_", "'", "call", "count", "'_", ":_", "entry_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rec", "call", "count", "'_", ":_", "entry_", "[_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "total", "time", "'_", ":_", "entry_", "[_", "3_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "inline", "time", "'_", ":_", "entry_", "[_", "4_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "calls", "'_", ":_", "calls_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fin", "d", " ", "root", " ", "nodes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "call", "counts_", "=_", "dict_", "(_", "[_", "(_", "function_", ",_", "0_", ")_", "for_", "function_", "in_", "self_", "._", "cpro", "file", "\\u", "tree_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "function_", "in_", "self_", "._", "cpro", "file", "\\u", "tree_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "call_", "in_", "self_", "._", "cpro", "file", "\\u", "tree_", "[_", "function_", "]_", "[_", "'", "calls", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "call", "counts_", "[_", "call_", "]_", "+=_", "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_", "self_", "._", "roots_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "call", "counts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "call", "counts_", "[_", "i_", "]_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "roots_", "._", "append_", "(_", "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_", "self_", "._", "delete", "\\u", "top", "\\u", "level_", "(_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IP", "rofile", "_", "(_", "DOM", "Widget_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "top", "\\u", "level_", "(_", "self_", ",_", "context_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Delete", " ", "the", " ", "top", " ", "level", " ", "calls", " ", "whi", "ch", " ", "are", " ", "not", " ", "part", " ", "of", " ", "the", " ", "user", "'", "s", " ", "code", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "TOD", "O", ":", " ", "If", " ", "CELL", "\\u", "MAGIC", " ", "then", " ", "als", "o", " ", "merge", " ", "the", " ", "entri", "es", " ", "for", " ", "the", " ", "cell", " ", "(", "whi", "ch", " ", "are", "\\", "10", ";", " ", " ", " ", " ", "seperat", "ed", " ", "by", " ", "line", " ", "int", "o", " ", "individual", " ", "code", " ", "object", "s", "...)", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "context_", "==_", "\"", "LINE", "\\u", "MAGIC", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fin", "d", " ", "the", " ", "root", " ", "nodes", " ", "tha", "t", " ", "we", " ", "want_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "roots_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "function_", "in_", "self_", "._", "cpro", "file", "\\u", "tree_", ":_", "\\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_", "function_", "._", "co", "\\u", "name_", "==_", "\"<", "module", ">\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "new", "\\u", "roots_", "+=_", "self_", "._", "cpro", "file", "\\u", "tree_", "[_", "function_", "]_", "[_", "'", "calls", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remove", " ", "function", " ", "from", " ", "new", "\\u", "root", "s", " ", "if", " ", "its", " ", "child", " ", "is", " ", "alr", "ead", "y", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "roots_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "\\u", "roots_", "=_", "[_", "r_", "for_", "r_", "in_", "new", "\\u", "roots_", "if_", "(_", "type_", "(_", "r_", ")_", "==_", "str_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "._", "co", "\\u", "name_", "!=_", "\"<", "module", ">\"_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "new", "\\u", "roots_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "function_", "=_", "new", "\\u", "roots_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "function_", "._", "co", "\\u", "name_", "==_", "\"<", "module", ">\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "del_", "new", "\\u", "roots_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "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_", "if_", "context_", "==_", "\"", "CELL", "\\u", "MAGIC", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fin", "d", " ", "the", " ", "root", " ", "nodes", " ", "tha", "t", " ", "we", " ", "want_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "roots_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "function_", "in_", "self_", "._", "cpro", "file", "\\u", "tree_", ":_", "\\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_", "\"<", "ipython", "-", "input", "\"_", "in_", "function_", "._", "co", "\\u", "filename_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "new", "\\u", "roots_", "+=_", "self_", "._", "cpro", "file", "\\u", "tree_", "[_", "function_", "]_", "[_", "'", "calls", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Populate", " ", "a", " ", "new", " ", "tree", " ", "with", " ", "every", "thing", " ", "belo", "w", " ", "root", "s", " ", "in", " ", "the", " ", "original_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tree", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "\\u", "cpro", "file", "\\u", "tree_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "populate", "\\u", "new", "\\u", "tree_", "(_", "roots_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "root_", "in_", "roots_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "root_", "not_", "in_", "new", "\\u", "cpro", "file", "\\u", "tree_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "new", "\\u", "cpro", "file", "\\u", "tree_", "[_", "root_", "]_", "=_", "self_", "._", "cpro", "file", "\\u", "tree_", "[_", "root_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "populate", "\\u", "new", "\\u", "tree_", "(_", "self_", "._", "cpro", "file", "\\u", "tree_", "[_", "root_", "]_", "[_", "'", "calls", "'_", "]_", ")_", "\\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_", "populate", "\\u", "new", "\\u", "tree_", "(_", "new", "\\u", "roots_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cpro", "file", "\\u", "tree_", "=_", "new", "\\u", "cpro", "file", "\\u", "tree_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "roots_", "=_", "new", "\\u", "roots_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IP", "rofile", "_", "(_", "DOM", "Widget_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "generat", "e\\u", "content_", "(_", "self_", ",_", "fun_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Generate", " ", "profile", " ", "page", " ", "for", " ", "function", " ", "fun", ".", " ", "If", " ", "fun", "=", "Non", "e", " ", "then", " ", "generat", "e", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "summar", "y", " ", "page", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "value", "\\u", "cache_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "generat", "e\\u", "nav_", "(_", "fun_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "generat", "e\\u", "heading_", "(_", "fun_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "generat", "e\\u", "table_", "(_", "fun_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "lpr", "ofile_", "is_", "not_", "None_", "and_", "fun_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "generat", "e\\u", "lpr", "ofile_", "(_", "fun_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "value_", "=_", "self_", "._", "value", "\\u", "cache_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IP", "rofile", "_", "(_", "DOM", "Widget_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "generat", "e\\u", "nav_", "(_", "self_", ",_", "fun_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "value", "\\u", "cache_", "+=_", "'<", "p", ">'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "fun_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "value", "\\u", "cache_", "+=_", "'<", "img", " ", "src", "=\"", "/", "nbe", "xte", "nsion", "s", "/", "ipr", "ofi", "ler", "/", "home", ".", "png", "\">'_", "\\u\\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_", "._", "value", "\\u", "cache_", "+=_", "(_", "'<", "a", " ", "id", "=\"", "ipr", "ofi", "le", "\\u", "home", "\"", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "style", "=\"", "cursor", ":", "point", "er", "\">'_", "\\u\\u\\uNL\\u\\u\\u_", "'<", "img", " ", "src", "=\"", "/", "nbe", "xte", "nsion", "s", "/", "ipr", "ofi", "ler", "/", "home", ".", "png", "\">'_", "\\u\\u\\uNL\\u\\u\\u_", "'<", "/", "a", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "self_", "._", "backward_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "value", "\\u", "cache_", "+=_", "(_", "'<", "a", " ", "id", "=\"", "ipr", "ofi", "le", "\\u", "back", "\"", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "style", "=\"", "cursor", ":", "point", "er", "\">'_", "\\u\\u\\uNL\\u\\u\\u_", "'<", "img", " ", "src", "=\"", "/", "nbe", "xte", "nsion", "s", "/", "ipr", "ofi", "ler", "/", "back", ".", "png", "\">'_", "\\u\\u\\uNL\\u\\u\\u_", "'<", "/", "a", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "value", "\\u", "cache_", "+=_", "(_", "'<", "img", " ", "src", "=\"", "/", "nbe", "xte", "nsion", "s", "/", "ipr", "ofi", "ler", "/", "back", "\\u'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", ".", "png", "\">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "self_", "._", "forward_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "value", "\\u", "cache_", "+=_", "(_", "'<", "a", " ", "id", "=\"", "ipr", "ofi", "le", "\\u", "forward", "\"", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "style", "=\"", "cursor", ":", "point", "er", "\">", "<", "img", "'_", "'", "src", "=\"", "/", "nbe", "xte", "nsion", "s", "/", "ipr", "ofi", "ler", "/", "forward", ".", "png", "\">'_", "\\u\\u\\uNL\\u\\u\\u_", "'<", "/", "a", "><", "/", "p", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "value", "\\u", "cache_", "+=_", "(_", "'<", "img", " ", "src", "=\"", "/", "nbe", "xte", "nsion", "s", "/", "ipr", "ofi", "ler", "/", "forward", "\\u'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", ".", "png", "\">", "</", "p", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IP", "rofile", "_", "(_", "DOM", "Widget_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "generat", "e\\u", "heading_", "(_", "self_", ",_", "fun_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Generate", " ", "a", " ", "heading", " ", "for", " ", "the", " ", "top", " ", "of", " ", "the", " ", "ipr", "ofi", "le", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "fun_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "value", "\\u", "cache_", "+=_", "\"<", "h", "3", ">", "Summ", "ary", "</", "h", "3", ">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "heading_", "=_", "\"{}", " ", "(", "Calls", ":", " ", "{}", ",", " ", "Time", ":", " ", "{})\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "heading_", "=_", "heading_", "._", "format_", "(_", "fun_", "._", "co", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cpro", "file", "\\u", "tree_", "[_", "fun_", "]_", "[_", "'", "call", "count", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cpro", "file", "\\u", "tree_", "[_", "fun_", "]_", "[_", "'", "total", "time", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "heading_", "=_", "html", "\\u", "escape_", "(_", "heading_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "value", "\\u", "cache_", "+=_", "\"<", "h", "3", ">\"_", "+_", "heading_", "+_", "\"<", "/", "h", "3", ">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "value", "\\u", "cache_", "+=_", "(_", "\"<", "p", ">", "Fro", "m", " ", "file", ":", " ", "\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "escape_", "(_", "fun_", "._", "co", "\\u", "filename_", ")_", "+_", "\"<", "/", "p", ">\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "value", "\\u", "cache_", "+=_", "\"<", "h", "3", ">\"_", "+_", "html", "\\u", "escape_", "(_", "fun_", ")_", "+_", "\"<", "/", "h", "3", ">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "value", "\\u", "cache_", "+=_", "'<", "p", ">'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IP", "rofile", "_", "(_", "DOM", "Widget_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "generat", "e\\u", "table_", "(_", "self_", ",_", "fun_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Generate", " ", "a", " ", "table", " ", "display", "ing", " ", "the", " ", "function", "s", " ", "call", "ed", " ", "by", " ", "fun", " ", "and", " ", "thei", "r", "\\", "10", ";", " ", " ", " ", " ", "respec", "tiv", "e", " ", "runn", "ing", " ", "times", ".", " ", "Thi", "s", " ", "is", " ", "don", "e", " ", "usi", "ng", " ", "Bo", "ke", "h", "'", "s", " ", "Data", "Table", " ", "widget", ",", "\\", "10", ";", " ", " ", " ", " ", "whi", "ch", " ", "is", " ", "based", " ", "on", " ", "Sli", "ck", "Grid", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "fun_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Generate", " ", "summar", "y", " ", "page_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "calls_", "=_", "self_", "._", "cpro", "file", "\\u", "tree_", "._", "keys_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "calls_", "=_", "[_", "function_", "for_", "function_", "in_", "self_", "._", "cpro", "file", "\\u", "tree_", "[_", "fun_", "]_", "[_", "'", "calls", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "n", "\\u", "table", "\\u", "elements_", "=_", "len_", "(_", "calls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "names_", "=_", "[_", "call_", "if_", "type_", "(_", "call_", ")_", "==_", "str_", "else_", "call_", "._", "co", "\\u", "name_", "for_", "call_", "in_", "calls_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "List", " ", "of", " ", "tuple", "s", " ", "contain", "ing", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "id", " ", "number", ",", " ", "name", ",", " ", "total", "time", ",", " ", "inline", "time", ",", " ", "cpro", "file", "\\u", "key", ")_", "\\u\\u\\uNL\\u\\u\\u_", "calls_", "=_", "list_", "(_", "zip_", "(_", "range_", "(_", "len_", "(_", "calls_", ")_", ")_", ",_", "names_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "cpro", "file", "\\u", "tree_", "[_", "x_", "]_", "[_", "'", "total", "time", "'_", "]_", "for_", "x_", "in_", "calls_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "cpro", "file", "\\u", "tree_", "[_", "x_", "]_", "[_", "'", "inline", "time", "'_", "]_", "for_", "x_", "in_", "calls_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "calls_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "id", "\\u", "dict_", "=_", "{_", "\"", "function", "\"_", "+_", "str_", "(_", "id_", ")_", ":_", "cpro", "file", "\\u", "key_", "for_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "id_", ",_", "name_", ",_", "time_", ",_", "inline", "time_", ",_", "cpro", "file", "\\u", "key_", ")_", "in_", "calls_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sort", " ", "by", " ", "total", " ", "time", " ", "(", "descend", "ing", ")_", "\\u\\u\\uNL\\u\\u\\u_", "calls_", "._", "sort_", "(_", "key_", "=_", "lambda_", "x_", ":_", "x_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "calls_", "._", "reverse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Generate", " ", "bokeh", " ", "table_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ids_", ",_", "names_", ",_", "times_", ",_", "inline", "times_", "=_", "list_", "(_", "zip_", "(_", "*_", "calls_", ")_", ")_", "[_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time", "\\u", "plot", "\\u", "multiplier_", "=_", "100_", "/_", "max_", "(_", "times_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plot", "\\u", "inline", "\\u", "times_", "=_", "[_", "time", "\\u", "plot", "\\u", "multiplier_", "*_", "time_", "for_", "time_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "inline", "times_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plot", "\\u", "extra", "\\u", "times_", "=_", "[_", "time", "\\u", "plot", "\\u", "multiplier_", "*_", "(_", "total", "time_", "-_", "inline", "time_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "total", "time_", ",_", "inline", "time_", "in_", "zip_", "(_", "times_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "inline", "times_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "table", "\\u", "data_", "=_", "dict_", "(_", "ids_", "=_", "ids_", ",_", "names_", "=_", "names_", ",_", "times_", "=_", "times_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "inline", "times_", "=_", "inline", "times_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "plot", "\\u", "inline", "\\u", "times_", "=_", "plot", "\\u", "inline", "\\u", "times_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "plot", "\\u", "extra", "\\u", "times_", "=_", "plot", "\\u", "extra", "\\u", "times_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "table", "\\u", "data_", "=_", "Colum", "n", "Data", "Source_", "(_", "table", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "time", "\\u", "format_", "=_", "bokeh", "\\u", "tables_", "._", "Number", "Formatter_", "(_", "format_", "=_", "'", "0", ",", "0.00000", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "name", "\\u", "template_", "=_", "'<", "a", " ", "id", "=\"", "function", "<", "%", "=", " ", "ids", " ", "%", ">\"", "><", "%", "-", " ", "names", " ", "%", "><", "/", "a", ">'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "\\u", "format_", "=_", "(_", "bokeh", "\\u", "tables_", "._", "\\u\\u\\uNL\\u\\u\\u_", "HTM", "LT", "empla", "te", "Formatter_", "(_", "template_", "=_", "name", "\\u", "template_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "time", "\\u", "plot", "\\u", "template_", "=_", "(_", "'<", "img", " ", "src", "=\"", "/", "nbe", "xte", "nsion", "s", "/", "ipr", "ofi", "ler", "/", "red", ".", "gif", "\"'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "'", "height", "=\"", "10", "\"", " ", "widt", "h", "=\"", "<", "%", "=", " ", "plot", "\\u", "inline", "\\u", "times", "%", ">\"", ">'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "'<", "img", " ", "src", "=\"", "/", "nbe", "xte", "nsion", "s", "/", "ipr", "ofi", "ler", "/", "pin", "k", ".", "gif", "\"'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "'", "height", "=\"", "10", "\"", " ", "widt", "h", "=\"", "<", "%", "=", " ", "plot", "\\u", "extra", "\\u", "times", " ", "%", ">\"", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time", "\\u", "plot", "\\u", "format_", "=_", "(_", "bokeh", "\\u", "tables_", "._", "\\u\\u\\uNL\\u\\u\\u_", "HTM", "LT", "empla", "te", "Formatter_", "(_", "template_", "=_", "time", "\\u", "plot", "\\u", "template_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "columns_", "=_", "[_", "bokeh", "\\u", "tables_", "._", "Table", "Column_", "(_", "title_", "=_", "\"", "Function", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "field_", "=_", "\"", "names", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "formatter_", "=_", "name", "\\u", "format_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bokeh", "\\u", "tables_", "._", "Table", "Column_", "(_", "title_", "=_", "\"", "Total", " ", "time", " ", "(", "s", ")\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "field_", "=_", "\"", "times", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "formatter_", "=_", "time", "\\u", "format_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "sort_", "=_", "\"", "descend", "ing", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bokeh", "\\u", "tables_", "._", "Table", "Column_", "(_", "title_", "=_", "\"", "In", "line", " ", "time", " ", "(", "s", ")\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "field_", "=_", "\"", "inline", "times", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "formatter_", "=_", "time", "\\u", "format_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "sort_", "=_", "\"", "descend", "ing", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bokeh", "\\u", "tables_", "._", "Table", "Column_", "(_", "title_", "=_", "\"", "Time", " ", "plot", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sortable", "_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "formatter_", "=_", "time", "\\u", "plot", "\\u", "format_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bokeh", "\\u", "table_", "=_", "bokeh", "\\u", "tables_", "._", "Data", "Table_", "(_", "source_", "=_", "table", "\\u", "data_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "columns_", "=_", "columns_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Wo", "ul", "d", " ", "be", " ", "nice", " ", "if", " ", "widt", "h", " ", "coul", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "be", " ", "automati", "c", " ", "but", " ", "this", " ", "appear", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "be", " ", "broken", " ", "in", " ", "firefox", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "chrome", "._", "\\u\\u\\uNL\\u\\u\\u_", "width_", "=_", "620", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "height_", "=_", "'", "auto", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "selectable", "_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "value", "\\u", "cache_", "+=_", "notebook", "\\u", "div_", "(_", "bokeh", "\\u", "table_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IP", "rofile", "_", "(_", "DOM", "Widget_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "generat", "e\\u", "lpr", "ofile_", "(_", "self_", ",_", "fun_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Generate", " ", "div", " ", "contain", "ing", " ", "profile", "d", " ", "source", " ", "code", " ", "with", " ", "timings", " ", "of", " ", "each", " ", "line", ",", "\\", "10", ";", " ", " ", " ", " ", "take", "n", " ", "from", " ", "ilin", "e\\u", "profiler", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "fun_", "._", "co", "\\u", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "firstl", "inen", "o_", "=_", "fun_", "._", "co", "\\u", "firstl", "inen", "o_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "fun_", "._", "co", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lti", "ming", "s", "\\u", "key_", "=_", "(_", "filename_", ",_", "firstl", "inen", "o_", ",_", "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 ", " _", "lti", "ming", "s_", "=_", "self_", "._", "lpr", "ofile_", "._", "timings", "_", "[_", "lti", "ming", "s", "\\u", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Curr", "ent", "ly", " ", "the", " ", "correct", " ", "filename", " ", "is", " ", "store", "d", " ", "at", " ", "the", " ", "end", " ", "of", " ", "lti", "ming", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "work", "-", "aro", "und", " ", "to", " ", "fix", " ", "c", "Profiler", " ", "gi", "ving", " ", "usel", "ess", " ", "filename", "s", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "zipped", " ", "package", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "filename_", "=_", "lti", "ming", "s_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "filename_", "._", "endswith_", "(_", "(_", "'.", "pyc", "'_", ",_", "'.", "pyo", "'_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "openp", "y_", "._", "source", "\\u", "from", "\\u", "cache_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\".", "egg", "/\"_", "in_", "filename_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "add", "\\u", "zipped", "\\u", "file", "\\u", "to", "\\u", "linec", "ache_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raw", "\\u", "code_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "linen", "os_", "=_", "range_", "(_", "firstl", "inen", "o_", ",_", "lti", "ming", "s_", "[_", "-_", "2_", "]_", "[_", "0_", "]_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "lineno_", "in_", "linen", "os_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raw", "\\u", "code_", "+=_", "ulin", "eca", "che_", "._", "getl", "ine_", "(_", "filename_", ",_", "lineno_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "formatter_", "=_", "LP", "rofile", "Formatter_", "(_", "firstl", "inen", "o_", ",_", "lti", "ming", "s_", ",_", "noc", "lasse", "s_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "value", "\\u", "cache_", "+=_", "highlight_", "(_", "raw", "\\u", "code_", ",_", "Pyth", "on", "Lexer_", "(_", ")_", ",_", "formatter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IP", "rofile", "_", "(_", "DOM", "Widget_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "on", "\\u", "msg_", "(_", "self_", ",_", "\\u_", ",_", "content_", ",_", "buffers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Handle", "r", " ", "for", " ", "click", " ", "(", "and", " ", "potenti", "ally", " ", "other", ")", " ", "events", " ", "from", " ", "the", " ", "user", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "content_", "==_", "\"", "home", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "backward_", "._", "append_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "forward_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "generat", "e\\u", "content_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "content_", "==_", "\"", "back", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "forward_", "._", "append_", "(_", "self_", "._", "backward_", "._", "pop_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "generat", "e\\u", "content_", "(_", "self_", "._", "backward_", "[_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "content_", "==_", "\"", "forward", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "backward_", "._", "append_", "(_", "self_", "._", "forward_", "._", "pop_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "generat", "e\\u", "content_", "(_", "self_", "._", "backward_", "[_", "-_", "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 ", " _", "click", "ed", "\\u", "fun_", "=_", "self_", "._", "id", "\\u", "dict_", "[_", "content_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "backward_", "._", "append_", "(_", "click", "ed", "\\u", "fun_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "forward_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "generat", "e\\u", "content_", "(_", "click", "ed", "\\u", "fun_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "add", "\\u", "zipped", "\\u", "file", "\\u", "to", "\\u", "linec", "ache_", "(_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "zipped", "\\u", "filename_", ",_", "extension_", ",_", "inner_", ")_", "=_", "filename_", "._", "partition_", "(_", "'.", "egg", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zipped", "\\u", "filename_", "+=_", "extension_", "[_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "zipfile_", "._", "is", "\\u", "zipfile_", "(_", "zipped", "\\u", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zipped", "\\u", "file_", "=_", "zipfile_", "._", "Zip", "File_", "(_", "zipped", "\\u", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ulin", "eca", "che_", "._", "linec", "ache_", "._", "cache_", "[_", "filename_", "]_", "=_", "(_", "None_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "zipped", "\\u", "file_", "._", "open_", "(_", "inner_", ",_", "'", "r", "'_", ")_", "._", "\\u\\u\\uNL\\u\\u\\u_", "readlines_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zipped", "\\u", "file_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "LP", "rofile", "Formatter_", "(_", "Ht", "ml", "Formatter_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "LP", "rofile", "Formatter_", "(_", "Ht", "ml", "Formatter_", ")_", ":_", "\\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_", ",_", "firstl", "inen", "o_", ",_", "lti", "ming", "s_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "lineno_", "=_", "firstl", "inen", "o_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lti", "ming", "s_", "=_", "lti", "ming", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "LP", "rofile", "Formatter_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LP", "rofile", "Formatter_", "(_", "Ht", "ml", "Formatter_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wrap_", "(_", "self_", ",_", "source_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "super_", "(_", "LP", "rofile", "Formatter_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ")_", "._", "wrap_", "(_", "self_", "._", "\\u", "wrap", "\\u", "code_", "(_", "source_", ")_", ",_", "outfile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LP", "rofile", "Formatter_", "(_", "Ht", "ml", "Formatter_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "wrap", "\\u", "code_", "(_", "self_", ",_", "source_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "head", "\\u", "template_", "=_", "'{}", " ", "{}", " ", "{}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "no", "\\u", "time", "\\u", "template_", "=_", "'{:", "6", "}", " ", "{:", "7", "}", " ", "{:", ">", "4", "}", " ", "{}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "'<", "span", " ", "style", "=\\\\", "'", "color", ":", " ", "Red", "\\\\'", ">", "{:", "0", "6.2", "f", "}", "</", "span", ">", " ", "{:", ">", "7", "}", " ", "{:", ">", "4", "}", " ", "{}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "=_", "'<", "span", " ", "style", "=\\\\", "'", "color", ":", " ", "Red", ";", " ", "font", "-", "weight", ":", " ", "bold", "\\\\'", ">", "Time", "</", "span", ">", " ", " ", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "0_", ",_", "head", "\\u", "template_", "._", "format_", "(_", "time_", ",_", "'", " ", "Calls", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", " ", "<", "strong", ">", "Code", "</", "strong", ">\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "j", " ", "keep", "s", " ", "track", " ", "of", " ", "position", " ", "within", " ", "lti", "ming", "s_", "\\u\\u\\uNL\\u\\u\\u_", "j_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "line_", "in_", "source_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lineno_", "=_", "self_", "._", "lineno_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "j_", "<_", "len_", "(_", "self_", "._", "lti", "ming", "s_", ")_", "and_", "lineno_", "==_", "self_", "._", "lti", "ming", "s_", "[_", "j_", "]_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lca", "lls_", "=_", "self_", "._", "lti", "ming", "s_", "[_", "j_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lti", "me_", "=_", "self_", "._", "lti", "ming", "s_", "[_", "j_", "]_", "[_", "2_", "]_", "*_", "1e-6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "i_", ",_", "template_", "._", "format_", "(_", "lti", "me_", ",_", "lca", "lls_", ",_", "lineno_", ",_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "j_", "+=_", "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 ", " _", "yield_", "i_", ",_", "no", "\\u", "time", "\\u", "template_", "._", "format_", "(_", "''_", ",_", "''_", ",_", "lineno_", ",_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "lineno_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "magic", "s", "\\u", "class_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "IP", "rofile", "r", "Mag", "ics_", "(_", "Mag", "ics_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IP", "rofile", "r", "Mag", "ics_", "(_", "Mag", "ics_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "line", "\\u", "cell", "\\u", "magic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "ipr", "ofile_", "(_", "self_", ",_", "line_", ",_", "cell_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "\\u", "ilin", "e\\u", "profiler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "c", "Profile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cpro", "filer", "_", "=_", "c", "Profile_", "._", "Profile_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lpr", "ofi", "ler_", "=_", "\\u", "ilin", "e\\u", "profiler_", "._", "Line", "Profiler", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "cell_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "LINE", " ", "MAGIC", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global", "\\u", "ns_", "=_", "self_", "._", "shell_", "._", "user", "\\u", "global", "\\u", "ns_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "local", "\\u", "ns_", "=_", "self_", "._", "shell_", "._", "user", "\\u", "ns_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lpr", "ofi", "ler_", "._", "enable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cpro", "filer", "_", "._", "enable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exec\\u_", "(_", "line_", ",_", "global", "\\u", "ns_", ",_", "local", "\\u", "ns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cpro", "filer", "_", "._", "disable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lpr", "ofi", "ler_", "._", "disable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lpr", "ofile_", "=_", "lpr", "ofi", "ler_", "._", "get", "\\u", "stats_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cpro", "file_", "=_", "cpro", "filer", "_", "._", "gets", "tats_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ipr", "ofile_", "=_", "IP", "rofile", "_", "(_", "cpro", "file_", ",_", "lpr", "ofile_", ",_", "context_", "=_", "\"", "LINE", "\\u", "MAGIC", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", " ", "this", " ", "name", " ", "*", "coul", "d", "*", " ", "clas", "h", " ", "with", " ", "a", " ", "user", " ", "defin", "ed", " ", "name", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sho", "ul", "d", " ", "find", " ", "a", " ", "bett", "er", " ", "solution_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "shell_", "._", "user", "\\u", "ns_", "[_", "'\\u", "IP", "RO", "FILE", "'_", "]_", "=_", "ipr", "ofile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "shell_", "._", "run", "\\u", "cell_", "(_", "'\\u", "IP", "RO", "FILE", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lpr", "ofi", "ler_", "._", "enable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cpro", "filer", "_", "._", "enable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "shell_", "._", "run", "\\u", "cell_", "(_", "cell_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cpro", "filer", "_", "._", "disable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lpr", "ofi", "ler_", "._", "disable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lpr", "ofile_", "=_", "lpr", "ofi", "ler_", "._", "get", "\\u", "stats_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cpro", "file_", "=_", "cpro", "filer", "_", "._", "gets", "tats_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ipr", "ofile_", "=_", "IP", "rofile", "_", "(_", "cpro", "file_", ",_", "lpr", "ofile_", ",_", "context_", "=_", "'", "CELL", "\\u", "MAGIC", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", " ", "this", " ", "name", " ", "*", "coul", "d", "*", " ", "clas", "h", " ", "with", " ", "a", " ", "user", " ", "defin", "ed", " ", "name", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sho", "ul", "d", " ", "find", " ", "a", " ", "bett", "er", " ", "solution_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "shell_", "._", "user", "\\u", "ns_", "[_", "'\\u", "IP", "RO", "FILE", "'_", "]_", "=_", "ipr", "ofile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "shell_", "._", "run", "\\u", "cell_", "(_", "'\\u", "IP", "RO", "FILE", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "load", "\\u", "ipython", "\\u", "extension_", "(_", "shell_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Initiat", "e", " ", "bokeh", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "load", "\\u", "notebook_", "(_", "hide", "\\u", "banner_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shell_", "._", "register", "\\u", "magic", "s_", "(_", "IP", "rofile", "r", "Mag", "ics_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cell_", "=_", "\"\"\"", "%%", "javascript", "\\", "10", ";", "require", "([", "\"", "base", "/", "js", "/", "util", "s", "\"]", ",", " ", "function", "(", "util", "s", "){", "\\", "10", ";", " ", " ", " ", " ", "util", "s", ".", "load", "\\u", "extensi", "ons", "('", "ipr", "ofi", "ler", "/", "ipr", "ofi", "ler", "');", "\\", "10", ";}", ");", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shell_", "._", "run", "\\u", "cell_", "(_", "cell_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 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, 0, 1, 1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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
pydata/pandas/pandas/tests/series/test_repr.py
[ { "content": " def test_repr(self):\n str(self.ts)\n str(self.series)\n str(self.series.astype(int))\n str(self.objSeries)\n\n str(Series(tm.randn(1000), index=np.arange(1000)))\n str(Series(tm.randn(1000), index=np.arange(1000, 0, step=-1)))\n\n # empty\n str(self.empty)\n\n # with NaNs\n self.series[5:7] = np.NaN\n str(self.series)\n\n # with Nones\n ots = self.ts.astype('O')\n ots[::2] = None\n repr(ots)\n\n # various names\n for name in ['', 1, 1.2, 'foo', u('\\u03B1\\u03B2\\u03B3'),\n 'loooooooooooooooooooooooooooooooooooooooooooooooooooong',\n ('foo', 'bar', 'baz'), (1, 2), ('foo', 1, 2.3),\n (u('\\u03B1'), u('\\u03B2'), u('\\u03B3')),\n (u('\\u03B1'), 'bar')]:\n self.series.name = name\n repr(self.series)\n\n biggie = Series(tm.randn(1000), index=np.arange(1000),\n name=('foo', 'bar', 'baz'))\n repr(biggie)\n\n # 0 as name\n ser = Series(np.random.randn(100), name=0)\n rep_str = repr(ser)\n self.assertIn(\"Name: 0\", rep_str)\n\n # tidy repr\n ser = Series(np.random.randn(1001), name=0)\n rep_str = repr(ser)\n self.assertIn(\"Name: 0\", rep_str)\n\n ser = Series([\"a\\n\\r\\tb\"], name=\"a\\n\\r\\td\", index=[\"a\\n\\r\\tf\"])\n self.assertFalse(\"\\t\" in repr(ser))\n self.assertFalse(\"\\r\" in repr(ser))\n self.assertFalse(\"a\\n\" in repr(ser))\n\n # with empty series (#4651)\n s = Series([], dtype=np.int64, name='foo')\n self.assertEqual(repr(s), 'Series([], Name: foo, dtype: int64)')\n\n s = Series([], dtype=np.int64, name=None)\n self.assertEqual(repr(s), 'Series([], dtype: int64)')", "metadata": "root.TestSeriesRepr.test_repr", "header": "['class', 'TestSeriesRepr', '(', 'TestData', ',', 'tm', '.', 'TestCase', ')', ':', '___EOS___']", "index": 55 } ]
[ { "span": "self.assertFalse(\"\\t\" in repr(ser))", "start_line": 100, "start_column": 8, "end_line": 100, "end_column": 43 }, { "span": "self.assertFalse(\"\\r\" in repr(ser))", "start_line": 101, "start_column": 8, "end_line": 101, "end_column": 43 }, { "span": "self.assertFalse(\"a\\n\" in repr(ser))", "start_line": 102, "start_column": 8, "end_line": 102, "end_column": 44 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Serie", "s", "Repr", "_", "(_", "Test", "Data_", ",_", "tm_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "repr_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "str_", "(_", "self_", "._", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "(_", "self_", "._", "series_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "(_", "self_", "._", "series_", "._", "astype_", "(_", "int_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "(_", "self_", "._", "obj", "Series_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "Series_", "(_", "tm_", "._", "randn_", "(_", "1000_", ")_", ",_", "index_", "=_", "np_", "._", "arange_", "(_", "1000_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "(_", "Series_", "(_", "tm_", "._", "randn_", "(_", "1000_", ")_", ",_", "index_", "=_", "np_", "._", "arange_", "(_", "1000_", ",_", "0_", ",_", "step_", "=_", "-_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "empty_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "self_", "._", "empty_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "Na", "Ns_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "series_", "[_", "5_", ":_", "7_", "]_", "=_", "np_", "._", "Na", "N_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "(_", "self_", "._", "series_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "Non", "es_", "\\u\\u\\uNL\\u\\u\\u_", "ots_", "=_", "self_", "._", "ts_", "._", "astype_", "(_", "'", "O", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ots_", "[_", ":_", ":_", "2_", "]_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repr_", "(_", "ots_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "vari", "ous", " ", "names_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "name_", "in_", "[_", "''_", ",_", "1_", ",_", "1.2_", ",_", "'", "foo", "'_", ",_", "u_", "(_", "'\\\\", "u0", "3", "B1", "\\\\", "u0", "3", "B2", "\\\\", "u0", "3", "B3", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "loo", "oooo", "oooo", "oooo", "oooo", "oooo", "oooo", "oooo", "oooo", "oooo", "oooo", "oooo", "oooo", "oon", "g", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "foo", "'_", ",_", "'", "bar", "'_", ",_", "'", "ba", "z", "'_", ")_", ",_", "(_", "1_", ",_", "2_", ")_", ",_", "(_", "'", "foo", "'_", ",_", "1_", ",_", "2.3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "u_", "(_", "'\\\\", "u0", "3", "B1", "'_", ")_", ",_", "u_", "(_", "'\\\\", "u0", "3", "B2", "'_", ")_", ",_", "u_", "(_", "'\\\\", "u0", "3", "B3", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "u_", "(_", "'\\\\", "u0", "3", "B1", "'_", ")_", ",_", "'", "bar", "'_", ")_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "series_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repr_", "(_", "self_", "._", "series_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "big", "gie", "_", "=_", "Series_", "(_", "tm_", "._", "randn_", "(_", "1000_", ")_", ",_", "index_", "=_", "np_", "._", "arange_", "(_", "1000_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "(_", "'", "foo", "'_", ",_", "'", "bar", "'_", ",_", "'", "ba", "z", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repr_", "(_", "big", "gie", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "0", " ", "as", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "ser_", "=_", "Series_", "(_", "np_", "._", "random_", "._", "randn_", "(_", "100_", ")_", ",_", "name_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rep", "\\u", "str_", "=_", "repr_", "(_", "ser_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "\"", "Name", ":", " ", "0", "\"_", ",_", "rep", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tidy", " ", "repr_", "\\u\\u\\uNL\\u\\u\\u_", "ser_", "=_", "Series_", "(_", "np_", "._", "random_", "._", "randn_", "(_", "1001_", ")_", ",_", "name_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rep", "\\u", "str_", "=_", "repr_", "(_", "ser_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "\"", "Name", ":", " ", "0", "\"_", ",_", "rep", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ser_", "=_", "Series_", "(_", "[_", "\"", "a", "\\\\", "n", "\\\\", "r", "\\\\", "tb", "\"_", "]_", ",_", "name_", "=_", "\"", "a", "\\\\", "n", "\\\\", "r", "\\\\", "td", "\"_", ",_", "index_", "=_", "[_", "\"", "a", "\\\\", "n", "\\\\", "r", "\\\\", "tf", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "\"\\\\", "t", "\"_", "in_", "repr_", "(_", "ser_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "\"\\\\", "r", "\"_", "in_", "repr_", "(_", "ser_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "\"", "a", "\\\\", "n", "\"_", "in_", "repr_", "(_", "ser_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "empty", " ", "series", " ", "(", "#", "465", "1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "Series_", "(_", "[_", "]_", ",_", "dtype_", "=_", "np_", "._", "int64_", ",_", "name_", "=_", "'", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "repr_", "(_", "s_", ")_", ",_", "'", "Serie", "s", "([", "],", " ", "Name", ":", " ", "foo", ",", " ", "dt", "ype", ":", " ", "int", "64", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "Series_", "(_", "[_", "]_", ",_", "dtype_", "=_", "np_", "._", "int64_", ",_", "name_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "repr_", "(_", "s_", ")_", ",_", "'", "Serie", "s", "([", "],", " ", "dt", "ype", ":", " ", "int", "64", ")'_", ")_", "\\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,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1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
android/tools_repo/color.py
[ { "content": "#\n# Copyright (C) 2008 The Android Open Source Project\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\n\nimport pager\nfrom git_config import GitConfig\n\nCOLORS = {None :-1,\n 'normal' :-1,\n 'black' : 0,\n 'red' : 1,\n 'green' : 2,\n 'yellow' : 3,\n 'blue' : 4,\n 'magenta': 5,\n 'cyan' : 6,\n 'white' : 7}\n\nATTRS = {None :-1,\n 'bold' : 1,\n 'dim' : 2,\n 'ul' : 4,\n 'blink' : 5,\n 'reverse': 7}\n\nRESET = \"\\033[m\"\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def is_color(s): return s in COLORS", "metadata": "root.is_color", "header": "['module', '___EOS___']", "index": 41 }, { "content": "def is_attr(s): return s in ATTRS", "metadata": "root.is_attr", "header": "['module', '___EOS___']", "index": 42 }, { "content": "def _Color(fg = None, bg = None, attr = None):\n fg = COLORS[fg]\n bg = COLORS[bg]\n attr = ATTRS[attr]\n\n if attr >= 0 or fg >= 0 or bg >= 0:\n need_sep = False\n code = \"\\033[\"\n\n if attr >= 0:\n code += chr(ord('0') + attr)\n need_sep = True\n\n if fg >= 0:\n if need_sep:\n code += ';'\n need_sep = True\n\n if fg < 8:\n code += '3%c' % (ord('0') + fg)\n else:\n code += '38;5;%d' % fg\n\n if bg >= 0:\n if need_sep:\n code += ';'\n need_sep = True\n\n if bg < 8:\n code += '4%c' % (ord('0') + bg)\n else:\n code += '48;5;%d' % bg\n code += 'm'\n else:\n code = ''\n return code", "metadata": "root._Color", "header": "['module', '___EOS___']", "index": 44 }, { "content": "class Coloring(object):\n\n\n\n\n\n\n\n", "metadata": "root.Coloring", "header": "['module', '___EOS___']", "index": 82 }, { "content": " def __init__(self, config, type):\n self._section = 'color.%s' % type\n self._config = config\n self._out = sys.stdout\n\n on = self._config.GetString(self._section)\n if on is None:\n on = self._config.GetString('color.ui')\n\n if on == 'auto':\n if pager.active or os.isatty(1):\n self._on = True\n else:\n self._on = False\n elif on in ('true', 'always'):\n self._on = True\n else:\n self._on = False", "metadata": "root.Coloring.__init__", "header": "['class', 'Coloring', '(', 'object', ')', ':', '___EOS___']", "index": 83 }, { "content": " def redirect(self, out):\n self._out = out", "metadata": "root.Coloring.redirect", "header": "['class', 'Coloring', '(', 'object', ')', ':', '___EOS___']", "index": 102 }, { "content": " @property\n def is_on(self):\n return self._on", "metadata": "root.Coloring.is_on", "header": "['class', 'Coloring', '(', 'object', ')', ':', '___EOS___']", "index": 105 }, { "content": " def write(self, fmt, *args):\n self._out.write(fmt % args)", "metadata": "root.Coloring.write", "header": "['class', 'Coloring', '(', 'object', ')', ':', '___EOS___']", "index": 109 }, { "content": " def flush(self):\n self._out.flush()", "metadata": "root.Coloring.flush", "header": "['class', 'Coloring', '(', 'object', ')', ':', '___EOS___']", "index": 112 }, { "content": " def nl(self):\n self._out.write('\\n')", "metadata": "root.Coloring.nl", "header": "['class', 'Coloring', '(', 'object', ')', ':', '___EOS___']", "index": 115 }, { "content": " def printer(self, opt=None, fg=None, bg=None, attr=None):\n s = self\n c = self.colorer(opt, fg, bg, attr)\n def f(fmt, *args):\n s._out.write(c(fmt, *args))\n return f", "metadata": "root.Coloring.printer", "header": "['class', 'Coloring', '(', 'object', ')', ':', '___EOS___']", "index": 118 }, { "content": " def colorer(self, opt=None, fg=None, bg=None, attr=None):\n if self._on:\n c = self._parse(opt, fg, bg, attr)\n def f(fmt, *args):\n str = fmt % args\n return ''.join([c, str, RESET])\n return f\n else:\n def f(fmt, *args):\n return fmt % args\n return f", "metadata": "root.Coloring.colorer", "header": "['class', 'Coloring', '(', 'object', ')', ':', '___EOS___']", "index": 125 }, { "content": " def _parse(self, opt, fg, bg, attr):\n if not opt:\n return _Color(fg, bg, attr)\n\n v = self._config.GetString('%s.%s' % (self._section, opt))\n if v is None:\n return _Color(fg, bg, attr)\n\n v = v.strip().lower()\n if v == \"reset\":\n return RESET\n elif v == '':\n return _Color(fg, bg, attr)\n\n have_fg = False\n for a in v.split(' '):\n if is_color(a):\n if have_fg: bg = a\n else: fg = a\n elif is_attr(a):\n attr = a\n\n return _Color(fg, bg, attr)", "metadata": "root.Coloring._parse", "header": "['class', 'Coloring', '(', 'object', ')', ':', '___EOS___']", "index": 137 } ]
[ { "span": "from git_config import GitConfig", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 32 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2008", " ", "The", " ", "And", "roid", " ", "Open", " ", "Sou", "rce", " ", "Project_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "pager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "git", "\\u", "config_", "import_", "Git", "Config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "COLORS_", "=_", "{_", "None_", ":_", "-_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "normal", "'_", ":_", "-_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "black", "'_", ":_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "red", "'_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "green", "'_", ":_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "yell", "ow", "'_", ":_", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "blue", "'_", ":_", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mage", "nta", "'_", ":_", "5_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cya", "n", "'_", ":_", "6_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "white", "'_", ":_", "7_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ATTRS", "_", "=_", "{_", "None_", ":_", "-_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bold", "'_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dim", "'_", ":_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ul", "'_", ":_", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "blink", "'_", ":_", "5_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reverse", "'_", ":_", "7_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "RESET_", "=_", "\"\\\\", "033", "[", "m", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "is", "\\u", "color_", "(_", "s_", ")_", ":_", "return_", "s_", "in_", "COLORS_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "is", "\\u", "attr_", "(_", "s_", ")_", ":_", "return_", "s_", "in_", "ATTRS", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "Color_", "(_", "fg_", "=_", "None_", ",_", "bg_", "=_", "None_", ",_", "attr_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fg_", "=_", "COLORS_", "[_", "fg_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bg_", "=_", "COLORS_", "[_", "bg_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "attr_", "=_", "ATTRS", "_", "[_", "attr_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "attr_", ">=_", "0_", "or_", "fg_", ">=_", "0_", "or_", "bg_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "need", "\\u", "sep_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "code_", "=_", "\"\\\\", "033", "[\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "attr_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "code_", "+=_", "chr_", "(_", "ord_", "(_", "'", "0", "'_", ")_", "+_", "attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "need", "\\u", "sep_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "fg_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "need", "\\u", "sep_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "code_", "+=_", "';'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "need", "\\u", "sep_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "fg_", "<_", "8_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "code_", "+=_", "'", "3", "%", "c", "'_", "%_", "(_", "ord_", "(_", "'", "0", "'_", ")_", "+_", "fg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "code_", "+=_", "'", "3", "8", ";", "5", ";", "%", "d", "'_", "%_", "fg_", "\\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_", "bg_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "need", "\\u", "sep_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "code_", "+=_", "';'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "need", "\\u", "sep_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "bg_", "<_", "8_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "code_", "+=_", "'", "4", "%", "c", "'_", "%_", "(_", "ord_", "(_", "'", "0", "'_", ")_", "+_", "bg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "code_", "+=_", "'", "4", "8", ";", "5", ";", "%", "d", "'_", "%_", "bg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "code_", "+=_", "'", "m", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "code_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Color", "ing_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Color", "ing_", "(_", "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_", ",_", "config_", ",_", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "section_", "=_", "'", "color", ".", "%", "s", "'_", "%_", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "config_", "=_", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "out_", "=_", "sys_", "._", "stdout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "on_", "=_", "self_", "._", "\\u", "config_", "._", "Get", "String_", "(_", "self_", "._", "\\u", "section_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "on_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "on_", "=_", "self_", "._", "\\u", "config_", "._", "Get", "String_", "(_", "'", "color", ".", "ui", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "on_", "==_", "'", "auto", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "pager_", "._", "active_", "or_", "os_", "._", "isatty_", "(_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "on_", "=_", "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_", "._", "\\u", "on_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "on_", "in_", "(_", "'", "true", "'_", ",_", "'", "alw", "ay", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "on_", "=_", "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_", "._", "\\u", "on_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Color", "ing_", "(_", "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_", "redirect_", "(_", "self_", ",_", "out_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "out_", "=_", "out_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Color", "ing_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "is", "\\u", "on_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "on_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Color", "ing_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "fmt_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "out_", "._", "write_", "(_", "fmt_", "%_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Color", "ing_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "flush_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "out_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Color", "ing_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "nl_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "out_", "._", "write_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Color", "ing_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "printer_", "(_", "self_", ",_", "opt_", "=_", "None_", ",_", "fg_", "=_", "None_", ",_", "bg_", "=_", "None_", ",_", "attr_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "self_", "._", "colore", "r_", "(_", "opt_", ",_", "fg_", ",_", "bg_", ",_", "attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "f_", "(_", "fmt_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "\\u", "out_", "._", "write_", "(_", "c_", "(_", "fmt_", ",_", "*_", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Color", "ing_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "colore", "r_", "(_", "self_", ",_", "opt_", "=_", "None_", ",_", "fg_", "=_", "None_", ",_", "bg_", "=_", "None_", ",_", "attr_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "on_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "self_", "._", "\\u", "parse_", "(_", "opt_", ",_", "fg_", ",_", "bg_", ",_", "attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "f_", "(_", "fmt_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "str_", "=_", "fmt_", "%_", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "''_", "._", "join_", "(_", "[_", "c_", ",_", "str_", ",_", "RESET_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "f_", "(_", "fmt_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "fmt_", "%_", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Color", "ing_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "parse_", "(_", "self_", ",_", "opt_", ",_", "fg_", ",_", "bg_", ",_", "attr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "opt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u", "Color_", "(_", "fg_", ",_", "bg_", ",_", "attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "v_", "=_", "self_", "._", "\\u", "config_", "._", "Get", "String_", "(_", "'%", "s", ".", "%", "s", "'_", "%_", "(_", "self_", "._", "\\u", "section_", ",_", "opt_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "v_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u", "Color_", "(_", "fg_", ",_", "bg_", ",_", "attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "v_", "=_", "v_", "._", "strip_", "(_", ")_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "v_", "==_", "\"", "reset", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "RESET_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "v_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u", "Color_", "(_", "fg_", ",_", "bg_", ",_", "attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "have", "\\u", "fg_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "a_", "in_", "v_", "._", "split_", "(_", "'", " ", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "is", "\\u", "color_", "(_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "have", "\\u", "fg_", ":_", "bg_", "=_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "fg_", "=_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "is", "\\u", "attr_", "(_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "attr_", "=_", "a_", "\\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_", "\\u", "Color_", "(_", "fg_", ",_", "bg_", ",_", "attr_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
ImageEngine/gaffer/python/GafferUITest/__init__.py
[ { "content": "##########################################################################\n#\n# Copyright (c) 2011-2012, John Haddon. All rights reserved.\n# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are\n# met:\n#\n# * Redistributions of source code must retain the above\n# copyright notice, this list of conditions and the following\n# disclaimer.\n#\n# * Redistributions in binary form must reproduce the above\n# copyright notice, this list of conditions and the following\n# disclaimer in the documentation and/or other materials provided with\n# the distribution.\n#\n# * Neither the name of John Haddon nor the names of\n# any other contributors to this software may be used to endorse or\n# promote products derived from this software without specific prior\n# written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\n# IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\n# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#\n##########################################################################\n\nfrom TestCase import TestCase\nfrom WidgetTest import WidgetTest\nfrom MenuTest import MenuTest\nfrom SplitContainerTest import SplitContainerTest\nfrom WindowTest import WindowTest\nfrom ListContainerTest import ListContainerTest\nfrom EventSignalCombinerTest import EventSignalCombinerTest\nfrom FrameTest import FrameTest\nfrom NameGadgetTest import NameGadgetTest\nfrom LinearContainerTest import LinearContainerTest\nfrom NodeGadgetTest import NodeGadgetTest\nfrom GadgetTest import GadgetTest\nfrom TabbedContainerTest import TabbedContainerTest\nfrom NodeGraphTest import NodeGraphTest\nfrom WidgetSignalTest import WidgetSignalTest\nfrom EventLoopTest import EventLoopTest\nfrom SplinePlugGadgetTest import SplinePlugGadgetTest\nfrom TextWidgetTest import TextWidgetTest\nfrom BoolWidgetTest import BoolWidgetTest\nfrom ImageTest import ImageTest\nfrom ButtonTest import ButtonTest\nfrom CollapsibleTest import CollapsibleTest\nfrom ImageGadgetTest import ImageGadgetTest\nfrom StandardNodeGadgetTest import StandardNodeGadgetTest\nfrom ColorSwatchTest import ColorSwatchTest\nfrom VariantTest import VariantTest\nfrom GridContainerTest import GridContainerTest\nfrom NoduleTest import NoduleTest\nfrom ProgressBarTest import ProgressBarTest\nfrom ContainerWidgetTest import ContainerWidgetTest\nfrom SelectionMenuTest import SelectionMenuTest\nfrom StandardStyleTest import StandardStyleTest\nfrom EditorWidgetTest import EditorWidgetTest\nfrom NumericSliderTest import NumericSliderTest\nfrom RenderableGadgetTest import RenderableGadgetTest\nfrom PlugValueWidgetTest import PlugValueWidgetTest\nfrom PathListingWidgetTest import PathListingWidgetTest\nfrom MultiLineTextWidgetTest import MultiLineTextWidgetTest\nfrom LabelTest import LabelTest\nfrom ScrolledContainerTest import ScrolledContainerTest\nfrom NodeEditorTest import NodeEditorTest\nfrom ScriptWindowTest import ScriptWindowTest\nfrom CompoundPlugValueWidgetTest import CompoundPlugValueWidgetTest\nfrom CompoundEditorTest import CompoundEditorTest\nfrom MultiSelectionMenuTest import MultiSelectionMenuTest\nfrom StandardGraphLayoutTest import StandardGraphLayoutTest\nfrom StandardNodeUITest import StandardNodeUITest\nfrom ViewTest import ViewTest\nfrom SliderTest import SliderTest\nfrom NumericPlugValueWidgetTest import NumericPlugValueWidgetTest\nfrom CompoundNumericPlugValueWidgetTest import CompoundNumericPlugValueWidgetTest\nfrom NameLabelTest import NameLabelTest\nfrom NameWidgetTest import NameWidgetTest\nfrom GLWidgetTest import GLWidgetTest\nfrom BookmarksTest import BookmarksTest\nfrom PlaybackTest import PlaybackTest\nfrom SpacerGadgetTest import SpacerGadgetTest\nfrom BoxUITest import BoxUITest\nfrom ConnectionGadgetTest import ConnectionGadgetTest\nfrom MessageWidgetTest import MessageWidgetTest\nfrom ModuleTest import ModuleTest\nfrom PlugLayoutTest import PlugLayoutTest\nfrom ViewportGadgetTest import ViewportGadgetTest\nfrom VectorDataWidgetTest import VectorDataWidgetTest\nfrom DotNodeGadgetTest import DotNodeGadgetTest\nfrom DocumentationTest import DocumentationTest\nfrom LazyMethodTest import LazyMethodTest\nfrom ReferenceUITest import ReferenceUITest\nfrom CompoundDataPlugValueWidgetTest import CompoundDataPlugValueWidgetTest\nfrom GraphGadgetTest import GraphGadgetTest\nfrom MenuBarTest import MenuBarTest\n\nif __name__ == \"__main__\":\n\tunittest.main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from TestCase import TestCase", "start_line": 37, "start_column": 0, "end_line": 37, "end_column": 29 }, { "span": "from WidgetTest import WidgetTest", "start_line": 38, "start_column": 0, "end_line": 38, "end_column": 33 }, { "span": "from MenuTest import MenuTest", "start_line": 39, "start_column": 0, "end_line": 39, "end_column": 29 }, { "span": "from SplitContainerTest import SplitContainerTest", "start_line": 40, "start_column": 0, "end_line": 40, "end_column": 49 }, { "span": "from WindowTest import WindowTest", "start_line": 41, "start_column": 0, "end_line": 41, "end_column": 33 }, { "span": "from ListContainerTest import ListContainerTest", "start_line": 42, "start_column": 0, "end_line": 42, "end_column": 47 }, { "span": "from EventSignalCombinerTest import EventSignalCombinerTest", "start_line": 43, "start_column": 0, "end_line": 43, "end_column": 59 }, { "span": "from FrameTest import FrameTest", "start_line": 44, "start_column": 0, "end_line": 44, "end_column": 31 }, { "span": "from NameGadgetTest import NameGadgetTest", "start_line": 45, "start_column": 0, "end_line": 45, "end_column": 41 }, { "span": "from LinearContainerTest import LinearContainerTest", "start_line": 46, "start_column": 0, "end_line": 46, "end_column": 51 }, { "span": "from NodeGadgetTest import NodeGadgetTest", "start_line": 47, "start_column": 0, "end_line": 47, "end_column": 41 }, { "span": "from GadgetTest import GadgetTest", "start_line": 48, "start_column": 0, "end_line": 48, "end_column": 33 }, { "span": "from TabbedContainerTest import TabbedContainerTest", "start_line": 49, "start_column": 0, "end_line": 49, "end_column": 51 }, { "span": "from NodeGraphTest import NodeGraphTest", "start_line": 50, "start_column": 0, "end_line": 50, "end_column": 39 }, { "span": "from WidgetSignalTest import WidgetSignalTest", "start_line": 51, "start_column": 0, "end_line": 51, "end_column": 45 }, { "span": "from EventLoopTest import EventLoopTest", "start_line": 52, "start_column": 0, "end_line": 52, "end_column": 39 }, { "span": "from SplinePlugGadgetTest import SplinePlugGadgetTest", "start_line": 53, "start_column": 0, "end_line": 53, "end_column": 53 }, { "span": "from TextWidgetTest import TextWidgetTest", "start_line": 54, "start_column": 0, "end_line": 54, "end_column": 41 }, { "span": "from BoolWidgetTest import BoolWidgetTest", "start_line": 55, "start_column": 0, "end_line": 55, "end_column": 41 }, { "span": "from ImageTest import ImageTest", "start_line": 56, "start_column": 0, "end_line": 56, "end_column": 31 }, { "span": "from ButtonTest import ButtonTest", "start_line": 57, "start_column": 0, "end_line": 57, "end_column": 33 }, { "span": "from CollapsibleTest import CollapsibleTest", "start_line": 58, "start_column": 0, "end_line": 58, "end_column": 43 }, { "span": "from ImageGadgetTest import ImageGadgetTest", "start_line": 59, "start_column": 0, "end_line": 59, "end_column": 43 }, { "span": "from StandardNodeGadgetTest import StandardNodeGadgetTest", "start_line": 60, "start_column": 0, "end_line": 60, "end_column": 57 }, { "span": "from ColorSwatchTest import ColorSwatchTest", "start_line": 61, "start_column": 0, "end_line": 61, "end_column": 43 }, { "span": "from VariantTest import VariantTest", "start_line": 62, "start_column": 0, "end_line": 62, "end_column": 35 }, { "span": "from GridContainerTest import GridContainerTest", "start_line": 63, "start_column": 0, "end_line": 63, "end_column": 47 }, { "span": "from NoduleTest import NoduleTest", "start_line": 64, "start_column": 0, "end_line": 64, "end_column": 33 }, { "span": "from ProgressBarTest import ProgressBarTest", "start_line": 65, "start_column": 0, "end_line": 65, "end_column": 43 }, { "span": "from ContainerWidgetTest import ContainerWidgetTest", "start_line": 66, "start_column": 0, "end_line": 66, "end_column": 51 }, { "span": "from SelectionMenuTest import SelectionMenuTest", "start_line": 67, "start_column": 0, "end_line": 67, "end_column": 47 }, { "span": "from StandardStyleTest import StandardStyleTest", "start_line": 68, "start_column": 0, "end_line": 68, "end_column": 47 }, { "span": "from EditorWidgetTest import EditorWidgetTest", "start_line": 69, "start_column": 0, "end_line": 69, "end_column": 45 }, { "span": "from NumericSliderTest import NumericSliderTest", "start_line": 70, "start_column": 0, "end_line": 70, "end_column": 47 }, { "span": "from RenderableGadgetTest import RenderableGadgetTest", "start_line": 71, "start_column": 0, "end_line": 71, "end_column": 53 }, { "span": "from PlugValueWidgetTest import PlugValueWidgetTest", "start_line": 72, "start_column": 0, "end_line": 72, "end_column": 51 }, { "span": "from PathListingWidgetTest import PathListingWidgetTest", "start_line": 73, "start_column": 0, "end_line": 73, "end_column": 55 }, { "span": "from MultiLineTextWidgetTest import MultiLineTextWidgetTest", "start_line": 74, "start_column": 0, "end_line": 74, "end_column": 59 }, { "span": "from LabelTest import LabelTest", "start_line": 75, "start_column": 0, "end_line": 75, "end_column": 31 }, { "span": "from ScrolledContainerTest import ScrolledContainerTest", "start_line": 76, "start_column": 0, "end_line": 76, "end_column": 55 }, { "span": "from NodeEditorTest import NodeEditorTest", "start_line": 77, "start_column": 0, "end_line": 77, "end_column": 41 }, { "span": "from ScriptWindowTest import ScriptWindowTest", "start_line": 78, "start_column": 0, "end_line": 78, "end_column": 45 }, { "span": "from CompoundPlugValueWidgetTest import CompoundPlugValueWidgetTest", "start_line": 79, "start_column": 0, "end_line": 79, "end_column": 67 }, { "span": "from CompoundEditorTest import CompoundEditorTest", "start_line": 80, "start_column": 0, "end_line": 80, "end_column": 49 }, { "span": "from MultiSelectionMenuTest import MultiSelectionMenuTest", "start_line": 81, "start_column": 0, "end_line": 81, "end_column": 57 }, { "span": "from StandardGraphLayoutTest import StandardGraphLayoutTest", "start_line": 82, "start_column": 0, "end_line": 82, "end_column": 59 }, { "span": "from StandardNodeUITest import StandardNodeUITest", "start_line": 83, "start_column": 0, "end_line": 83, "end_column": 49 }, { "span": "from ViewTest import ViewTest", "start_line": 84, "start_column": 0, "end_line": 84, "end_column": 29 }, { "span": "from SliderTest import SliderTest", "start_line": 85, "start_column": 0, "end_line": 85, "end_column": 33 }, { "span": "from NumericPlugValueWidgetTest import NumericPlugValueWidgetTest", "start_line": 86, "start_column": 0, "end_line": 86, "end_column": 65 }, { "span": "from CompoundNumericPlugValueWidgetTest import CompoundNumericPlugValueWidgetTest", "start_line": 87, "start_column": 0, "end_line": 87, "end_column": 81 }, { "span": "from NameLabelTest import NameLabelTest", "start_line": 88, "start_column": 0, "end_line": 88, "end_column": 39 }, { "span": "from NameWidgetTest import NameWidgetTest", "start_line": 89, "start_column": 0, "end_line": 89, "end_column": 41 }, { "span": "from GLWidgetTest import GLWidgetTest", "start_line": 90, "start_column": 0, "end_line": 90, "end_column": 37 }, { "span": "from BookmarksTest import BookmarksTest", "start_line": 91, "start_column": 0, "end_line": 91, "end_column": 39 }, { "span": "from PlaybackTest import PlaybackTest", "start_line": 92, "start_column": 0, "end_line": 92, "end_column": 37 }, { "span": "from SpacerGadgetTest import SpacerGadgetTest", "start_line": 93, "start_column": 0, "end_line": 93, "end_column": 45 }, { "span": "from BoxUITest import BoxUITest", "start_line": 94, "start_column": 0, "end_line": 94, "end_column": 31 }, { "span": "from ConnectionGadgetTest import ConnectionGadgetTest", "start_line": 95, "start_column": 0, "end_line": 95, "end_column": 53 }, { "span": "from MessageWidgetTest import MessageWidgetTest", "start_line": 96, "start_column": 0, "end_line": 96, "end_column": 47 }, { "span": "from ModuleTest import ModuleTest", "start_line": 97, "start_column": 0, "end_line": 97, "end_column": 33 }, { "span": "from PlugLayoutTest import PlugLayoutTest", "start_line": 98, "start_column": 0, "end_line": 98, "end_column": 41 }, { "span": "from ViewportGadgetTest import ViewportGadgetTest", "start_line": 99, "start_column": 0, "end_line": 99, "end_column": 49 }, { "span": "from VectorDataWidgetTest import VectorDataWidgetTest", "start_line": 100, "start_column": 0, "end_line": 100, "end_column": 53 }, { "span": "from DotNodeGadgetTest import DotNodeGadgetTest", "start_line": 101, "start_column": 0, "end_line": 101, "end_column": 47 }, { "span": "from DocumentationTest import DocumentationTest", "start_line": 102, "start_column": 0, "end_line": 102, "end_column": 47 }, { "span": "from LazyMethodTest import LazyMethodTest", "start_line": 103, "start_column": 0, "end_line": 103, "end_column": 41 }, { "span": "from ReferenceUITest import ReferenceUITest", "start_line": 104, "start_column": 0, "end_line": 104, "end_column": 43 }, { "span": "from CompoundDataPlugValueWidgetTest import CompoundDataPlugValueWidgetTest", "start_line": 105, "start_column": 0, "end_line": 105, "end_column": 75 }, { "span": "from GraphGadgetTest import GraphGadgetTest", "start_line": 106, "start_column": 0, "end_line": 106, "end_column": 43 }, { "span": "from MenuBarTest import MenuBarTest", "start_line": 107, "start_column": 0, "end_line": 107, "end_column": 35 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Copy", "right", " ", "(", "c", ")", " ", "2011", "-", "2012", ",", " ", "Joh", "n", " ", "Had", "don", ".", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Copy", "right", " ", "(", "c", ")", " ", "2011", "-", "2013", ",", " ", "Image", " ", "Engine", " ", "Desig", "n", " ", "Inc", ".", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Redistributi", "on", " ", "and", " ", "use", " ", "in", " ", "source", " ", "and", " ", "binar", "y", " ", "forms", ",", " ", "with", " ", "or", " ", "with", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "modification", ",", " ", "are", " ", "permit", "ted", " ", "provided", " ", "tha", "t", " ", "the", " ", "follow", "ing", " ", "condition", "s", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "met", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "*", " ", "Redistributi", "ons", " ", "of", " ", "source", " ", "code", " ", "must", " ", "retain", " ", "the", " ", "above_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "copyr", "ight", " ", "notice", ",", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "following_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "discl", "aime", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "*", " ", "Redistributi", "ons", " ", "in", " ", "binar", "y", " ", "form", " ", "must", " ", "reproduce", " ", "the", " ", "above_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "copyr", "ight", " ", "notice", ",", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "following_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "discl", "aime", "r", " ", "in", " ", "the", " ", "documentation", " ", "and", "/", "or", " ", "other", " ", "material", "s", " ", "provided", " ", "with_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "the", " ", "distribu", "tion", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "*", " ", "Nei", "ther", " ", "the", " ", "name", " ", "of", " ", "Joh", "n", " ", "Had", "don", " ", "nor", " ", "the", " ", "names", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "any", " ", "other", " ", "contributor", "s", " ", "to", " ", "this", " ", "software", " ", "may", " ", "be", " ", "used", " ", "to", " ", "endo", "rse", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "promote", " ", "products", " ", "derive", "d", " ", "from", " ", "this", " ", "software", " ", "with", "out", " ", "specific", " ", "prior_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "writt", "en", " ", "permissi", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "THIS", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "BY", " ", "THE", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "AND", " ", "CONTRIB", "UTO", "RS", " ", "\"", "AS_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "IS", "\"", " ", "AND", " ", "ANY", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", ",", " ", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "THE", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "AND", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "PUR", "POS", "E", " ", "ARE", " ", "DISC", "LAI", "MED", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", " ", "COPY", "RIG", "HT", " ", "OWNER", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "CONTRIB", "UTO", "RS", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "DIRECT", ",", " ", "INDI", "RECT", ",", " ", "INC", "IDENT", "AL", ",", " ", "SPECIAL", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "EXE", "MPL", "ARY", ",", " ", "OR", " ", "CONS", "EQU", "ENTI", "AL", " ", "DA", "MAGE", "S", " ", "(", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "PROC", "URE", "MENT", " ", "OF", " ", "SUBST", "ITU", "TE", " ", "GOOD", "S", " ", "OR", " ", "SERVICES", ";", " ", "LOSS", " ", "OF", " ", "USE", ",", " ", "DATA", ",", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "PROF", "IT", "S", ";", " ", "OR", " ", "BUS", "INE", "SS", " ", "INTER", "RU", "PTION", ")", " ", "HO", "WE", "VER", " ", "CAU", "SED", " ", "AND", " ", "ON", " ", "ANY", " ", "THE", "ORY", " ", "OF_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "CONTR", "ACT", ",", " ", "STRI", "CT", " ", "LI", "ABI", "LIT", "Y", ",", " ", "OR", " ", "TOR", "T", " ", "(", "INC", "LU", "DING", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "NEG", "LIG", "ENCE", " ", "OR", " ", "OTHER", "WI", "SE", ")", " ", "ARI", "SIN", "G", " ", "IN", " ", "ANY", " ", "WAY", " ", "OUT", " ", "OF", " ", "THE", " ", "USE", " ", "OF", " ", "THIS", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "SOFT", "WARE", ",", " ", "EVE", "N", " ", "IF", " ", "ADV", "ISE", "D", " ", "OF", " ", "THE", " ", "POS", "SIB", "ILI", "TY", " ", "OF", " ", "SUC", "H", " ", "DA", "MAGE", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Test", "Case_", "import_", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Wid", "get", "Test_", "import_", "Wid", "get", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Menu", "Test_", "import_", "Menu", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Split", "Containe", "r", "Test_", "import_", "Split", "Containe", "r", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Window", "Test_", "import_", "Window", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "List", "Containe", "r", "Test_", "import_", "List", "Containe", "r", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Event", "Signal", "Combine", "r", "Test_", "import_", "Event", "Signal", "Combine", "r", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Frame", "Test_", "import_", "Frame", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Name", "Ga", "dget", "Test_", "import_", "Name", "Ga", "dget", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Linea", "r", "Containe", "r", "Test_", "import_", "Linea", "r", "Containe", "r", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Node", "Ga", "dget", "Test_", "import_", "Node", "Ga", "dget", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Ga", "dget", "Test_", "import_", "Ga", "dget", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Tab", "bed", "Containe", "r", "Test_", "import_", "Tab", "bed", "Containe", "r", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Node", "Graph", "Test_", "import_", "Node", "Graph", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Wid", "get", "Signal", "Test_", "import_", "Wid", "get", "Signal", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Event", "Loop", "Test_", "import_", "Event", "Loop", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Spline", "Plug", "Ga", "dget", "Test_", "import_", "Spline", "Plug", "Ga", "dget", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Text", "Wid", "get", "Test_", "import_", "Text", "Wid", "get", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Boo", "l", "Wid", "get", "Test_", "import_", "Boo", "l", "Wid", "get", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Image", "Test_", "import_", "Image", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Butt", "on", "Test_", "import_", "Butt", "on", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Collaps", "ibl", "e", "Test_", "import_", "Collaps", "ibl", "e", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Image", "Ga", "dget", "Test_", "import_", "Image", "Ga", "dget", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Standard", "Node", "Ga", "dget", "Test_", "import_", "Standard", "Node", "Ga", "dget", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Color", "Swa", "tch", "Test_", "import_", "Color", "Swa", "tch", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Varia", "nt", "Test_", "import_", "Varia", "nt", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Grid", "Containe", "r", "Test_", "import_", "Grid", "Containe", "r", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "No", "dul", "e", "Test_", "import_", "No", "dul", "e", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Progres", "s", "Bar", "Test_", "import_", "Progres", "s", "Bar", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Containe", "r", "Wid", "get", "Test_", "import_", "Containe", "r", "Wid", "get", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Selecti", "on", "Menu", "Test_", "import_", "Selecti", "on", "Menu", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Standard", "Style", "Test_", "import_", "Standard", "Style", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Edit", "or", "Wid", "get", "Test_", "import_", "Edit", "or", "Wid", "get", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Numer", "ic", "Slide", "r", "Test_", "import_", "Numer", "ic", "Slide", "r", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Render", "able", "Ga", "dget", "Test_", "import_", "Render", "able", "Ga", "dget", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Plug", "Value", "Wid", "get", "Test_", "import_", "Plug", "Value", "Wid", "get", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Path", "Listi", "ng", "Wid", "get", "Test_", "import_", "Path", "Listi", "ng", "Wid", "get", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Multi", "Line", "Text", "Wid", "get", "Test_", "import_", "Multi", "Line", "Text", "Wid", "get", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Label", "Test_", "import_", "Label", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Scroll", "ed", "Containe", "r", "Test_", "import_", "Scroll", "ed", "Containe", "r", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Node", "Edit", "or", "Test_", "import_", "Node", "Edit", "or", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Script", "Window", "Test_", "import_", "Script", "Window", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Compo", "und", "Plug", "Value", "Wid", "get", "Test_", "import_", "Compo", "und", "Plug", "Value", "Wid", "get", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Compo", "und", "Edit", "or", "Test_", "import_", "Compo", "und", "Edit", "or", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Multi", "Selecti", "on", "Menu", "Test_", "import_", "Multi", "Selecti", "on", "Menu", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Standard", "Graph", "Lay", "out", "Test_", "import_", "Standard", "Graph", "Lay", "out", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Standard", "Node", "UI", "Test_", "import_", "Standard", "Node", "UI", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "View", "Test_", "import_", "View", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Slide", "r", "Test_", "import_", "Slide", "r", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Numer", "ic", "Plug", "Value", "Wid", "get", "Test_", "import_", "Numer", "ic", "Plug", "Value", "Wid", "get", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Compo", "und", "Numer", "ic", "Plug", "Value", "Wid", "get", "Test_", "import_", "Compo", "und", "Numer", "ic", "Plug", "Value", "Wid", "get", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Name", "Label", "Test_", "import_", "Name", "Label", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Name", "Wid", "get", "Test_", "import_", "Name", "Wid", "get", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "GL", "Wid", "get", "Test_", "import_", "GL", "Wid", "get", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Bookmark", "s", "Test_", "import_", "Bookmark", "s", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Playb", "ack", "Test_", "import_", "Playb", "ack", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Spac", "er", "Ga", "dget", "Test_", "import_", "Spac", "er", "Ga", "dget", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Box", "UI", "Test_", "import_", "Box", "UI", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Connect", "ion", "Ga", "dget", "Test_", "import_", "Connect", "ion", "Ga", "dget", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Messag", "e", "Wid", "get", "Test_", "import_", "Messag", "e", "Wid", "get", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Modul", "e", "Test_", "import_", "Modul", "e", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Plug", "Lay", "out", "Test_", "import_", "Plug", "Lay", "out", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Viewport", "Ga", "dget", "Test_", "import_", "Viewport", "Ga", "dget", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Vector", "Data", "Wid", "get", "Test_", "import_", "Vector", "Data", "Wid", "get", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Dot", "Node", "Ga", "dget", "Test_", "import_", "Dot", "Node", "Ga", "dget", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Document", "ation", "Test_", "import_", "Document", "ation", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "La", "zy", "Meth", "od", "Test_", "import_", "La", "zy", "Meth", "od", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Reference", "UI", "Test_", "import_", "Reference", "UI", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Compo", "und", "Data", "Plug", "Value", "Wid", "get", "Test_", "import_", "Compo", "und", "Data", "Plug", "Value", "Wid", "get", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Graph", "Ga", "dget", "Test_", "import_", "Graph", "Ga", "dget", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Menu", "Bar", "Test_", "import_", "Menu", "Bar", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "unittest_", "._", "main_", "(_", ")_", "\\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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 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 ]
Unused import
ngageoint/cocreate/ccl-cookbook/files/default/cocreatelite/cocreate/createvm/createvm.py
[ { "content": "#createvm.py\n#\n#\n#\n#\n#\n#\n\nimport sys\nprint (\"\\n\".join(sys.path))\n\nfrom pyVmomi import vim\nfrom pyVim.connect import SmartConnect, Disconnect\nimport time\nimport vmutils\nimport subprocess\nimport configparser\nimport json\nfrom passlib.hash import md5_crypt\nimport os\nimport re\n\n#checkHostname()\n#checks that the hostname is a valid hostname, and that the hostname is not already in use\n#current rules: a VM name must be 5 to 20 characters in length, and VM names can contain letters, numbers, underscores and dashes.\n \n#checkRecipe()\n#checks that the recipe is defined (i.e., in the list derived from the comma-separated \"recipes\" string in the config file)\n\n#cloneVM()\n#provides routine for cloning the base VM\n\n#getIP()\n#provides routine for getting the IP address of the new VM\n\n#bootstrapVM()\n#provides routine for bootstrapping the new VM using knife bootstrap\n\n#createVM()\n#creates the VM using the broken down functions\n#Returns the VM IP and FQDN if successful or None values (and an error message) if not. Also returns progress value.", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def checkHostname(hostname):\n validString = re.search(r'^(?i)[A-Za-z0-9_-]{%s,%s}$' %(5, 20), hostname)\n #print(validString)\n if (validString == None):\n return False\n else:\n return True", "metadata": "root.checkHostname", "header": "['module', '___EOS___']", "index": 25 }, { "content": "def checkRecipe(configParser, recipe):\n recipes = configParser.get('cocreate_config', 'recipes').split(',')\n if (recipe in recipes):\n return True\n else:\n return False", "metadata": "root.checkRecipe", "header": "['module', '___EOS___']", "index": 35 }, { "content": "def cloneVM(configParser, hostname):\n folder = configParser.get('knife_parameters', 'folder')\n template = configParser.get('knife_parameters', 'template')\n cspec = configParser.get('knife_parameters', 'cspec')\n domain = configParser.get('knife_parameters','domain')\n config = configParser.get('knife_parameters','config')\n knifeargcreate = 'knife vsphere vm clone ' + hostname + ' --config '+ config+ ' --template '+ template + ' --folder '+folder+' --cspec '+cspec+' --chostname '+hostname+' --cdomain '+domain+' --start'\n subprocess.check_call(knifeargcreate, shell=True)", "metadata": "root.cloneVM", "header": "['module', '___EOS___']", "index": 44 }, { "content": "def getIP(configParser, hostname):\n vchost = configParser.get('pyvmomi_config', 'vchost')\n vcuser = configParser.get('pyvmomi_config', 'vcuser')\n vcpassword = configParser.get('pyvmomi_config', 'vcpassword')\n vcport = configParser.get('pyvmomi_config', 'vcport')\n si = SmartConnect(host=vchost, user=vcuser,pwd=vcpassword, port=vcport)\n vm = vmutils.get_vm_by_name(si, hostname)\n ipAddress= vm.summary.guest.ipAddress\n while(not isinstance(ipAddress, str)):\n ipAddress= vm.summary.guest.ipAddress\n return ipAddress", "metadata": "root.getIP", "header": "['module', '___EOS___']", "index": 55 }, { "content": "def bootstrapVM(configParser, ipAddress, hostname, recipe):\n recipes = \"recipe[\" + recipe + \"]\"\n sshuser = configParser.get('knife_parameters', 'sshuser')\n sshpassword = configParser.get('knife_parameters', 'sshpassword')\n config = configParser.get('knife_parameters','config')\n secretkeyfile = configParser.get('knife_parameters', 'secretkey')\n bootstrapargcreate = 'knife bootstrap '+ ipAddress+' --config '+ config+ ' --node-name '+ hostname +' --ssh-user '+sshuser+ ' --ssh-password '+sshpassword+ ' --secret-file '+ secretkeyfile+ ' --sudo --use-sudo-password -r '+ recipes\n subprocess.check_call(bootstrapargcreate, shell=True)", "metadata": "root.bootstrapVM", "header": "['module', '___EOS___']", "index": 69 }, { "content": "def createVM(request_id, hostname, recipe, updateProgress):\n configParser = configparser.RawConfigParser()\n configFilePath = r'/opt/chef-tools/createvm/createvm.config'\n configParser.read(configFilePath)\n \n subdomain = configParser.get('cocreate_config', 'subdomain')\n progress = 0\n \n validHostname = checkHostname(hostname)\n if(validHostname == False):\n return None, None, 'Invalid hostname', progress\n \n fqdn = hostname + \".\" + subdomain\n \n validRecipe = checkRecipe(configParser, recipe)\n if(validRecipe == False):\n return None, None, 'Unsupported template', progress\n \n updateProgress(request_id, progress, \"Beginning VM template cloning\")\n try:\n cloneVM(configParser, hostname)\n except subprocess.CalledProcessError:\n print(\"A cloning error occurred\")\n return None, None, 'VM cloning failed', progress\n \n progress = 33\n \n updateProgress(request_id, progress, \"Waiting for new VM IP address\")\n ipAddress = None\n try:\n ipAddress = getIP(configParser, hostname)\n except:\n print(\"Could not get IP Address\")\n return None, None, 'Could not obtain VM IP address', progress\n \n progress = 67\n \n updateProgress(request_id, progress, \"Beginning VM bootstrap\")\n try:\n bootstrapVM(configParser, ipAddress, hostname, recipe)\n except subprocess.CalledProcessError:\n print(\"An error occurred during bootstrap\")\n return None, None, 'VM bootstrap failed', progress\n \n # The URL may not be relevant for bare VM sandboxes (which are not yet supported).\n url = \"http://\" + fqdn + \"/\" + recipe\n \n progress = 100\n \n updateProgress(request_id, progress, \"VM creation complete\", url)\n return ipAddress, fqdn, None, progress\n \n #Code snippets for adding databags\n #Create the databag for the user by creating a json with their information and running a knife command\n #hashPass = md5_crypt.encrypt(\"password\")\n #filename = dnsName + \".json\"\n #with open(filename, 'w+') as outfile:\n #json.dump({\"id\": dnsName, \"username\": \"username\", \"password\": hashPass}, outfile)\n\n #configParser = configparser.RawConfigParser()\n #configFilePath = r'/opt/chef-tools/createvm/createvm.config'\n #configParser.read(configFilePath)\n\n #userInfo = configParser.get('knife_parameters','databag')\n #secretkeyfile = configParser.get('knife_parameters', 'secretkey')\n #config = configParser.get('knife_parameters','config')\n #knifeAddDatabag = 'knife data bag from file ' + userInfo+ ' '+ filename+ ' --secret-file '+ secretkeyfile + ' -d --config '+ config \n #sts1 = os.system(knifeAddDatabag)", "metadata": "root.createVM", "header": "['module', '___EOS___']", "index": 81 } ]
[ { "span": "from pyVmomi import vim", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 23 }, { "span": "from pyVim.connect import SmartConnect, Disconnect", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 50 }, { "span": "import time", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 11 }, { "span": "import json", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 11 }, { "span": "from passlib.hash import md5_crypt", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 34 }, { "span": "import os", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "create", "vm", ".", "py_", "\\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_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"\\\\", "n", "\"_", "._", "join_", "(_", "sys_", "._", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "py", "Vm", "omi", "_", "import_", "vim_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "py", "Vi", "m_", "._", "connect_", "import_", "Sma", "rt", "Connect_", ",_", "Disconnect", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "vm", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "configparser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pass", "lib_", "._", "hash_", "import_", "md5", "\\u", "crypt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "check", "Host", "name", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "checks", " ", "tha", "t", " ", "the", " ", "host", "name", " ", "is", " ", "a", " ", "valid", " ", "host", "name", ",", " ", "and", " ", "tha", "t", " ", "the", " ", "host", "name", " ", "is", " ", "not", " ", "alr", "ead", "y", " ", "in", " ", "use_", "\\u\\u\\uNL\\u\\u\\u_", "#", "current", " ", "rule", "s", ":", " ", "a", " ", "VM", " ", "name", " ", "must", " ", "be", " ", "5", " ", "to", " ", "20", " ", "character", "s", " ", "in", " ", "length", ",", " ", "and", " ", "VM", " ", "names", " ", "can", " ", "contain", " ", "letter", "s", ",", " ", "numbers", ",", " ", "underscore", "s", " ", "and", " ", "dashes", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "check", "Recip", "e", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "checks", " ", "tha", "t", " ", "the", " ", "recip", "e", " ", "is", " ", "defin", "ed", " ", "(", "i", ".", "e", ".,", " ", "in", " ", "the", " ", "list", " ", "derive", "d", " ", "from", " ", "the", " ", "comma", "-", "separate", "d", " ", "\"", "recip", "es", "\"", " ", "string", " ", "in", " ", "the", " ", "config", " ", "file", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "clone", "VM", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "provide", "s", " ", "routin", "e", " ", "for", " ", "clo", "ning", " ", "the", " ", "base", " ", "VM_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "get", "IP", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "provide", "s", " ", "routin", "e", " ", "for", " ", "getti", "ng", " ", "the", " ", "IP", " ", "address", " ", "of", " ", "the", " ", "new", " ", "VM_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "boots", "trap", "VM", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "provide", "s", " ", "routin", "e", " ", "for", " ", "bootstrapp", "ing", " ", "the", " ", "new", " ", "VM", " ", "usi", "ng", " ", "kni", "fe", " ", "bootstrap_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "create", "VM", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "create", "s", " ", "the", " ", "VM", " ", "usi", "ng", " ", "the", " ", "broken", " ", "down", " ", "functions_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Return", "s", " ", "the", " ", "VM", " ", "IP", " ", "and", " ", "FQ", "DN", " ", "if", " ", "success", "ful", " ", "or", " ", "Non", "e", " ", "values", " ", "(", "and", " ", "an", " ", "error", " ", "message", ")", " ", "if", " ", "not", ".", " ", "Al", "so", " ", "return", "s", " ", "progress", " ", "value", "._", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "check", "Host", "name_", "(_", "hostname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "valid", "String_", "=_", "re_", "._", "search_", "(_", "r", "'", "^", "(?", "i", ")[", "A", "-", "Za", "-", "z", "0", "-", "9", "\\u-]", "{%", "s", ",%", "s", "}$'_", "%_", "(_", "5_", ",_", "20_", ")_", ",_", "hostname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", "(", "valid", "String", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "valid", "String_", "==_", "None_", ")_", ":_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "Recipe_", "(_", "config", "Parser_", ",_", "recipe_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "recipes_", "=_", "config", "Parser_", "._", "get_", "(_", "'", "coc", "reate", "\\u", "config", "'_", ",_", "'", "recip", "es", "'_", ")_", "._", "split_", "(_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "recipe_", "in_", "recipes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clone", "VM_", "(_", "config", "Parser_", ",_", "hostname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "folder_", "=_", "config", "Parser_", "._", "get_", "(_", "'", "kni", "fe", "\\u", "parameter", "s", "'_", ",_", "'", "folder", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "config", "Parser_", "._", "get_", "(_", "'", "kni", "fe", "\\u", "parameter", "s", "'_", ",_", "'", "template", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "csp", "ec_", "=_", "config", "Parser_", "._", "get_", "(_", "'", "kni", "fe", "\\u", "parameter", "s", "'_", ",_", "'", "csp", "ec", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "domain_", "=_", "config", "Parser_", "._", "get_", "(_", "'", "kni", "fe", "\\u", "parameter", "s", "'_", ",_", "'", "domain", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config_", "=_", "config", "Parser_", "._", "get_", "(_", "'", "kni", "fe", "\\u", "parameter", "s", "'_", ",_", "'", "config", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kni", "fea", "rg", "create_", "=_", "'", "kni", "fe", " ", "vsp", "here", " ", "vm", " ", "clone", " ", "'_", "+_", "hostname_", "+_", "'", " ", "--", "config", " ", "'_", "+_", "config_", "+_", "'", " ", "--", "template", " ", "'_", "+_", "template_", "+_", "'", " ", "--", "folder", " ", "'_", "+_", "folder_", "+_", "'", " ", "--", "csp", "ec", " ", "'_", "+_", "csp", "ec_", "+_", "'", " ", "--", "chos", "tname", " ", "'_", "+_", "hostname_", "+_", "'", " ", "--", "cdo", "main", " ", "'_", "+_", "domain_", "+_", "'", " ", "--", "start", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "kni", "fea", "rg", "create_", ",_", "shell_", "=_", "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_", "get", "IP_", "(_", "config", "Parser_", ",_", "hostname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vc", "host_", "=_", "config", "Parser_", "._", "get_", "(_", "'", "pyv", "mom", "i", "\\u", "config", "'_", ",_", "'", "vc", "host", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vc", "user_", "=_", "config", "Parser_", "._", "get_", "(_", "'", "pyv", "mom", "i", "\\u", "config", "'_", ",_", "'", "vc", "user", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vc", "password_", "=_", "config", "Parser_", "._", "get_", "(_", "'", "pyv", "mom", "i", "\\u", "config", "'_", ",_", "'", "vc", "password", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vc", "port_", "=_", "config", "Parser_", "._", "get_", "(_", "'", "pyv", "mom", "i", "\\u", "config", "'_", ",_", "'", "vc", "port", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "si_", "=_", "Sma", "rt", "Connect_", "(_", "host_", "=_", "vc", "host_", ",_", "user_", "=_", "vc", "user_", ",_", "pwd_", "=_", "vc", "password_", ",_", "port_", "=_", "vc", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vm_", "=_", "vm", "utils_", "._", "get", "\\u", "vm", "\\u", "by", "\\u", "name_", "(_", "si_", ",_", "hostname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip", "Address_", "=_", "vm_", "._", "summary_", "._", "guest_", "._", "ip", "Address_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "(_", "not_", "isinstance_", "(_", "ip", "Address_", ",_", "str_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ip", "Address_", "=_", "vm_", "._", "summary_", "._", "guest_", "._", "ip", "Address_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ip", "Address_", "\\u\\u\\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_", "boots", "trap", "VM_", "(_", "config", "Parser_", ",_", "ip", "Address_", ",_", "hostname_", ",_", "recipe_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "recipes_", "=_", "\"", "recip", "e", "[\"_", "+_", "recipe_", "+_", "\"]\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ssh", "user_", "=_", "config", "Parser_", "._", "get_", "(_", "'", "kni", "fe", "\\u", "parameter", "s", "'_", ",_", "'", "ssh", "user", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ssh", "password_", "=_", "config", "Parser_", "._", "get_", "(_", "'", "kni", "fe", "\\u", "parameter", "s", "'_", ",_", "'", "ssh", "password", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config_", "=_", "config", "Parser_", "._", "get_", "(_", "'", "kni", "fe", "\\u", "parameter", "s", "'_", ",_", "'", "config", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "secret", "keyfile_", "=_", "config", "Parser_", "._", "get_", "(_", "'", "kni", "fe", "\\u", "parameter", "s", "'_", ",_", "'", "secret", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "boots", "trap", "argc", "reate", "_", "=_", "'", "kni", "fe", " ", "boots", "trap", " ", "'_", "+_", "ip", "Address_", "+_", "'", " ", "--", "config", " ", "'_", "+_", "config_", "+_", "'", " ", "--", "node", "-", "name", " ", "'_", "+_", "hostname_", "+_", "'", " ", "--", "ssh", "-", "user", " ", "'_", "+_", "ssh", "user_", "+_", "'", " ", "--", "ssh", "-", "password", " ", "'_", "+_", "ssh", "password_", "+_", "'", " ", "--", "secret", "-", "file", " ", "'_", "+_", "secret", "keyfile_", "+_", "'", " ", "--", "sudo", " ", "--", "use", "-", "sudo", "-", "password", " ", "-", "r", " ", "'_", "+_", "recipes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "boots", "trap", "argc", "reate", "_", ",_", "shell_", "=_", "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_", "create", "VM_", "(_", "request", "\\u", "id_", ",_", "hostname_", ",_", "recipe_", ",_", "update", "Progress_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "config", "Parser_", "=_", "configparser_", "._", "Ra", "w", "Config", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config", "File", "Path_", "=_", "r", "'/", "opt", "/", "chef", "-", "tool", "s", "/", "create", "vm", "/", "create", "vm", ".", "config", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config", "Parser_", "._", "read_", "(_", "config", "File", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "subdomain_", "=_", "config", "Parser_", "._", "get_", "(_", "'", "coc", "reate", "\\u", "config", "'_", ",_", "'", "subdomain", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "progress_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "valid", "Host", "name_", "=_", "check", "Host", "name_", "(_", "hostname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "valid", "Host", "name_", "==_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", ",_", "None_", ",_", "'", "Inva", "lid", " ", "host", "name", "'_", ",_", "progress_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fqdn_", "=_", "hostname_", "+_", "\".\"_", "+_", "subdomain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "valid", "Recipe_", "=_", "check", "Recipe_", "(_", "config", "Parser_", ",_", "recipe_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "valid", "Recipe_", "==_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", ",_", "None_", ",_", "'", "Unsu", "ppo", "rted", " ", "template", "'_", ",_", "progress_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "update", "Progress_", "(_", "request", "\\u", "id_", ",_", "progress_", ",_", "\"", "Begin", "ning", " ", "VM", " ", "template", " ", "clo", "ning", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "clone", "VM_", "(_", "config", "Parser_", ",_", "hostname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "subprocess_", "._", "Call", "ed", "Process", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "A", " ", "clo", "ning", " ", "error", " ", "occur", "red", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", ",_", "None_", ",_", "'", "VM", " ", "clo", "ning", " ", "fail", "ed", "'_", ",_", "progress_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "progress_", "=_", "33_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "update", "Progress_", "(_", "request", "\\u", "id_", ",_", "progress_", ",_", "\"", "Wait", "ing", " ", "for", " ", "new", " ", "VM", " ", "IP", " ", "address", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip", "Address_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ip", "Address_", "=_", "get", "IP_", "(_", "config", "Parser_", ",_", "hostname_", ")_", "\\u\\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_", "(_", "\"", "Cou", "ld", " ", "not", " ", "get", " ", "IP", " ", "Address", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", ",_", "None_", ",_", "'", "Cou", "ld", " ", "not", " ", "obtain", " ", "VM", " ", "IP", " ", "address", "'_", ",_", "progress_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "progress_", "=_", "67_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "update", "Progress_", "(_", "request", "\\u", "id_", ",_", "progress_", ",_", "\"", "Begin", "ning", " ", "VM", " ", "boots", "trap", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "boots", "trap", "VM_", "(_", "config", "Parser_", ",_", "ip", "Address_", ",_", "hostname_", ",_", "recipe_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "subprocess_", "._", "Call", "ed", "Process", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "An", " ", "error", " ", "occur", "red", " ", "dur", "ing", " ", "boots", "trap", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", ",_", "None_", ",_", "'", "VM", " ", "boots", "trap", " ", "fail", "ed", "'_", ",_", "progress_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "URL", " ", "may", " ", "not", " ", "be", " ", "rele", "van", "t", " ", "for", " ", "bare", " ", "VM", " ", "sand", "box", "es", " ", "(", "whi", "ch", " ", "are", " ", "not", " ", "ye", "t", " ", "support", "ed", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "url_", "=_", "\"", "http", "://\"_", "+_", "fqdn_", "+_", "\"/\"_", "+_", "recipe_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "progress_", "=_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "update", "Progress_", "(_", "request", "\\u", "id_", ",_", "progress_", ",_", "\"", "VM", " ", "creati", "on", " ", "complete", "\"_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ip", "Address_", ",_", "fqdn_", ",_", "None_", ",_", "progress_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Code", " ", "snippet", "s", " ", "for", " ", "addin", "g", " ", "databa", "gs_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Creat", "e", " ", "the", " ", "databa", "g", " ", "for", " ", "the", " ", "user", " ", "by", " ", "creati", "ng", " ", "a", " ", "json", " ", "with", " ", "thei", "r", " ", "informati", "on", " ", "and", " ", "runn", "ing", " ", "a", " ", "kni", "fe", " ", "command_", "\\u\\u\\uNL\\u\\u\\u_", "#", "hash", "Pass", " ", "=", " ", "md5", "\\u", "crypt", ".", "encrypt", "(\"", "password", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "filename", " ", "=", " ", "dns", "Name", " ", "+", " ", "\".", "json", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "with", " ", "open", "(", "filename", ",", " ", "'", "w", "+'", ")", " ", "as", " ", "outfile", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "json", ".", "dump", "({", "\"", "id", "\":", " ", "dns", "Name", ",", " ", "\"", "user", "name", "\":", " ", "\"", "user", "name", "\",", " ", "\"", "password", "\":", " ", "hash", "Pass", "},", " ", "outfile", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "config", "Parser", " ", "=", " ", "config", "parser", ".", "Ra", "w", "Config", "Parser", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "config", "File", "Path", " ", "=", " ", "r", "'/", "opt", "/", "chef", "-", "tool", "s", "/", "create", "vm", "/", "create", "vm", ".", "config", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", "config", "Parser", ".", "read", "(", "config", "File", "Path", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "user", "Info", " ", "=", " ", "config", "Parser", ".", "get", "('", "kni", "fe", "\\u", "parameter", "s", "','", "databa", "g", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "secret", "keyfile", " ", "=", " ", "config", "Parser", ".", "get", "('", "kni", "fe", "\\u", "parameter", "s", "',", " ", "'", "secret", "key", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "config", " ", "=", " ", "config", "Parser", ".", "get", "('", "kni", "fe", "\\u", "parameter", "s", "','", "config", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "kni", "fe", "Add", "Databa", "g", " ", "=", " ", "'", "kni", "fe", " ", "data", " ", "bag", " ", "from", " ", "file", " ", "'", " ", "+", " ", "user", "Info", "+", " ", "'", " ", "'+", " ", "filename", "+", " ", "'", " ", "--", "secret", "-", "file", " ", "'+", " ", "secret", "keyfile", " ", "+", " ", "'", " ", "-", "d", " ", " ", "--", "config", " ", "'+", " ", "config", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "sts", "1", " ", "=", " ", " ", "os", ".", "system", "(", "kni", "fe", "Add", "Databa", "g", ")_", "\\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, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
jookies/jasmin/jasmin/vendor/smpp/pdu/pdu_encoding.py
[ { "content": "\"\"\"\nCopyright 2009-2010 Mozes, 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 expressed or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\"\"\"\n\n\"\"\"\nUpdated code parts are marked with \"Jasmin update\" comment\n\"\"\"\nimport struct, string, binascii\nfrom jasmin.vendor.smpp.pdu import smpp_time\nfrom jasmin.vendor.smpp.pdu import constants, pdu_types, operations\nfrom jasmin.vendor.smpp.pdu.error import PDUParseError, PDUCorruptError\nfrom jasmin.vendor.smpp.pdu.pdu_types import CommandId\nfrom jasmin.vendor.smpp.pdu.pdu_types import DataCodingDefault\n# Jasmin update:\nfrom jasmin.vendor.messaging.sms.gsm0338 import encode\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n# Jasmin update:\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class IEncoder(object):\n\n\n", "metadata": "root.IEncoder", "header": "['module', '___EOS___']", "index": 28 }, { "content": " def encode(self, value):\n \"\"\"Takes an object representing the type and returns a byte string\"\"\"\n raise NotImplementedError()", "metadata": "root.IEncoder.encode", "header": "['class', 'IEncoder', '(', 'object', ')', ':', '___EOS___']", "index": 30 }, { "content": " def decode(self, file):\n \"\"\"Takes file stream in and returns an object representing the type\"\"\"\n raise NotImplementedError()", "metadata": "root.IEncoder.decode", "header": "['class', 'IEncoder', '(', 'object', ')', ':', '___EOS___']", "index": 34 }, { "content": " def read(self, file, size):\n bytesRead = file.read(size)\n length = len(bytesRead)\n if length == 0:\n raise PDUCorruptError(\"Unexpected EOF\", pdu_types.CommandStatus.ESME_RINVMSGLEN)\n if length != size:\n raise PDUCorruptError(\"Length mismatch. Expecting %d bytes. Read %d\" % (size, length), pdu_types.CommandStatus.ESME_RINVMSGLEN)\n return bytesRead", "metadata": "root.IEncoder.read", "header": "['class', 'IEncoder', '(', 'object', ')', ':', '___EOS___']", "index": 38 }, { "content": "class EmptyEncoder(IEncoder):\n\n", "metadata": "root.EmptyEncoder", "header": "['module', '___EOS___']", "index": 47 }, { "content": " def encode(self, value):\n return ''", "metadata": "root.EmptyEncoder.encode", "header": "['class', 'EmptyEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 49 }, { "content": " def decode(self, file):\n return None", "metadata": "root.EmptyEncoder.decode", "header": "['class', 'EmptyEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 52 }, { "content": "class PDUNullableFieldEncoder(IEncoder):\n nullHex = None\n nullable = True\n decodeNull = False\n requireNull = False\n\n\n\n\n\n\n", "metadata": "root.PDUNullableFieldEncoder", "header": "['module', '___EOS___']", "index": 55 }, { "content": " def __init__(self, **kwargs):\n self.nullable = kwargs.get('nullable', self.nullable)\n self.decodeNull = kwargs.get('decodeNull', self.decodeNull)\n self.requireNull = kwargs.get('requireNull', self.requireNull)\n self._validateParams()", "metadata": "root.PDUNullableFieldEncoder.__init__", "header": "['class', 'PDUNullableFieldEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 61 }, { "content": " def _validateParams(self):\n if self.decodeNull:\n if not self.nullable:\n raise ValueError(\"nullable must be set if decodeNull is set\")\n if self.requireNull:\n if not self.decodeNull:\n raise ValueError(\"decodeNull must be set if requireNull is set\")", "metadata": "root.PDUNullableFieldEncoder._validateParams", "header": "['class', 'PDUNullableFieldEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 67 }, { "content": " def encode(self, value):\n if value is None:\n if not self.nullable:\n raise ValueError(\"Field is not nullable\")\n if self.nullHex is None:\n raise NotImplementedError(\"No value for null\")\n return binascii.a2b_hex(self.nullHex)\n if self.requireNull:\n raise ValueError(\"Field must be null\")\n return self._encode(value)", "metadata": "root.PDUNullableFieldEncoder.encode", "header": "['class', 'PDUNullableFieldEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 75 }, { "content": " def decode(self, file):\n bytes = self._read(file)\n if self.decodeNull:\n if self.nullHex is None:\n raise NotImplementedError(\"No value for null\")\n if self.nullHex == binascii.b2a_hex(bytes):\n return None\n if self.requireNull:\n raise PDUParseError(\"Field must be null\", pdu_types.CommandStatus.ESME_RUNKNOWNERR)\n return self._decode(bytes)", "metadata": "root.PDUNullableFieldEncoder.decode", "header": "['class', 'PDUNullableFieldEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 86 }, { "content": " def _encode(self, value):\n \"\"\"Takes an object representing the type and returns a byte string\"\"\"\n raise NotImplementedError()", "metadata": "root.PDUNullableFieldEncoder._encode", "header": "['class', 'PDUNullableFieldEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 97 }, { "content": " def _read(self, file):\n \"\"\"Takes file stream in and returns raw bytes\"\"\"\n raise NotImplementedError()", "metadata": "root.PDUNullableFieldEncoder._read", "header": "['class', 'PDUNullableFieldEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 101 }, { "content": " def _decode(self, bytes):\n \"\"\"Takes bytes in and returns an object representing the type\"\"\"\n raise NotImplementedError()", "metadata": "root.PDUNullableFieldEncoder._decode", "header": "['class', 'PDUNullableFieldEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 105 }, { "content": "class IntegerBaseEncoder(PDUNullableFieldEncoder):\n size = None\n sizeFmtMap = {\n 1: '!B',\n 2: '!H',\n 4: '!L',\n }\n\n #pylint: disable-msg=E0213\n\n #Verify platform sizes match protocol\n assertFmtSizes(sizeFmtMap)\n\n\n\n", "metadata": "root.IntegerBaseEncoder", "header": "['module', '___EOS___']", "index": 109 }, { "content": " def assertFmtSizes(sizeFmtMap):\n for (size, fmt) in sizeFmtMap.items():\n assert struct.calcsize(fmt) == size", "metadata": "root.IntegerBaseEncoder.assertFmtSizes", "header": "['class', 'IntegerBaseEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 118 }, { "content": " def __init__(self, **kwargs):\n PDUNullableFieldEncoder.__init__(self, **kwargs)\n\n self.nullHex = '00' * self.size\n\n self.max = 2 ** (8 * self.size) - 1\n self.min = 0\n if 'max' in kwargs:\n if kwargs['max'] > self.max:\n raise ValueError(\"Illegal value for max %d\" % kwargs['max'])\n self.max = kwargs['max']\n if 'min' in kwargs:\n if kwargs['min'] < self.min:\n raise ValueError(\"Illegal value for min %d\" % kwargs['min'])\n self.min = kwargs['min']\n if self.nullable and self.min > 0:\n self.decodeNull = True", "metadata": "root.IntegerBaseEncoder.__init__", "header": "['class', 'IntegerBaseEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 125 }, { "content": " def _encode(self, value):\n if value > self.max:\n raise ValueError(\"Value %d exceeds max %d\" % (value, self.max))\n if value < self.min:\n raise ValueError(\"Value %d is less than min %d\" % (value, self.min))\n return struct.pack(self.sizeFmtMap[self.size], value)", "metadata": "root.IntegerBaseEncoder._encode", "header": "['class', 'IntegerBaseEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 143 }, { "content": " def _read(self, file):\n return self.read(file, self.size)", "metadata": "root.IntegerBaseEncoder._read", "header": "['class', 'IntegerBaseEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 150 }, { "content": " def _decode(self, bytes):\n return struct.unpack(self.sizeFmtMap[self.size], bytes)[0]", "metadata": "root.IntegerBaseEncoder._decode", "header": "['class', 'IntegerBaseEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 153 }, { "content": "class Int4Encoder(IntegerBaseEncoder):\n size = 4", "metadata": "root.Int4Encoder", "header": "['module', '___EOS___']", "index": 156 }, { "content": "class Int1Encoder(IntegerBaseEncoder):\n size = 1", "metadata": "root.Int1Encoder", "header": "['module', '___EOS___']", "index": 159 }, { "content": "class Int2Encoder(IntegerBaseEncoder):\n size = 2", "metadata": "root.Int2Encoder", "header": "['module', '___EOS___']", "index": 162 }, { "content": "class OctetStringEncoder(PDUNullableFieldEncoder):\n nullable = False\n\n\n\n\n", "metadata": "root.OctetStringEncoder", "header": "['module', '___EOS___']", "index": 165 }, { "content": " def __init__(self, size=None, **kwargs):\n PDUNullableFieldEncoder.__init__(self, **kwargs)\n self.size = size", "metadata": "root.OctetStringEncoder.__init__", "header": "['class', 'OctetStringEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 168 }, { "content": " def getSize(self):\n if callable(self.size):\n return self.size()\n return self.size", "metadata": "root.OctetStringEncoder.getSize", "header": "['class', 'OctetStringEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 172 }, { "content": " def _encode(self, value):\n length = len(value)\n if self.getSize() is not None:\n if length != self.getSize():\n raise ValueError(\"Value (%s) size %d does not match expected %d\" % (value, length, self.getSize()))\n\n return value", "metadata": "root.OctetStringEncoder._encode", "header": "['class', 'OctetStringEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 177 }, { "content": " def _read(self, file):\n if self.getSize() is None:\n raise AssertionError(\"Missing size to decode\")\n if self.getSize() == 0:\n return ''\n return self.read(file, self.getSize())", "metadata": "root.OctetStringEncoder._read", "header": "['class', 'OctetStringEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 185 }, { "content": " def _decode(self, bytes):\n return bytes", "metadata": "root.OctetStringEncoder._decode", "header": "['class', 'OctetStringEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 192 }, { "content": "class COctetStringEncoder(PDUNullableFieldEncoder):\n nullHex = '00'\n decodeErrorClass = PDUParseError\n decodeErrorStatus = pdu_types.CommandStatus.ESME_RUNKNOWNERR\n\n\n\n", "metadata": "root.COctetStringEncoder", "header": "['module', '___EOS___']", "index": 195 }, { "content": " def __init__(self, maxSize=None, **kwargs):\n PDUNullableFieldEncoder.__init__(self, **kwargs)\n if maxSize is not None and maxSize < 1:\n raise ValueError(\"maxSize must be > 0\")\n self.maxSize = maxSize\n self.decodeErrorClass = kwargs.get('decodeErrorClass', self.decodeErrorClass)\n self.decodeErrorStatus = kwargs.get('decodeErrorStatus', self.decodeErrorStatus)", "metadata": "root.COctetStringEncoder.__init__", "header": "['class', 'COctetStringEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 200 }, { "content": " def _encode(self, value):\n asciiVal = value.encode('ascii')\n length = len(asciiVal)\n if self.maxSize is not None:\n if length + 1 > self.maxSize:\n raise ValueError(\"COctetString is longer than allowed maximum size (%d): %s\" % (self.maxSize, asciiVal))\n encoded = struct.pack(\"%ds\" % length, asciiVal) + '\\0'\n assert len(encoded) == length + 1\n return encoded", "metadata": "root.COctetStringEncoder._encode", "header": "['class', 'COctetStringEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 208 }, { "content": " def _read(self, file):\n result = ''\n while True:\n c = self.read(file, 1)\n result += c\n if c == '\\0':\n break\n return result", "metadata": "root.COctetStringEncoder._read", "header": "['class', 'COctetStringEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 218 }, { "content": " def _decode(self, bytes):\n if self.maxSize is not None:\n if len(bytes) > self.maxSize:\n errStr = \"COctetString is longer than allowed maximum size (%d)\" % (self.maxSize)\n raise self.decodeErrorClass(errStr, self.decodeErrorStatus)\n return bytes[:-1]", "metadata": "root.COctetStringEncoder._decode", "header": "['class', 'COctetStringEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 227 }, { "content": "class IntegerWrapperEncoder(PDUNullableFieldEncoder):\n fieldName = None\n nameMap = None\n valueMap = None\n encoder = None\n pduType = None\n decodeErrorClass = PDUParseError\n decodeErrorStatus = pdu_types.CommandStatus.ESME_RUNKNOWNERR\n\n\n\n", "metadata": "root.IntegerWrapperEncoder", "header": "['module', '___EOS___']", "index": 234 }, { "content": " def __init__(self, **kwargs):\n PDUNullableFieldEncoder.__init__(self, **kwargs)\n self.nullHex = self.encoder.nullHex\n self.fieldName = kwargs.get('fieldName', self.fieldName)\n self.decodeErrorClass = kwargs.get('decodeErrorClass', self.decodeErrorClass)\n self.decodeErrorStatus = kwargs.get('decodeErrorStatus', self.decodeErrorStatus)", "metadata": "root.IntegerWrapperEncoder.__init__", "header": "['class', 'IntegerWrapperEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 243 }, { "content": " def _encode(self, value):\n name = str(value)\n if name not in self.nameMap:\n raise ValueError(\"Unknown %s name %s\" % (self.fieldName, name))\n intVal = self.nameMap[name]\n return self.encoder.encode(intVal)", "metadata": "root.IntegerWrapperEncoder._encode", "header": "['class', 'IntegerWrapperEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 250 }, { "content": " def _read(self, file):\n return self.encoder._read(file)", "metadata": "root.IntegerWrapperEncoder._read", "header": "['class', 'IntegerWrapperEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 257 }, { "content": " def _decode(self, bytes):\n intVal = self.encoder._decode(bytes)\n\n # Jasmin update: bypass vendor specific tags\n # Vendor specific tag is not supported by Jasmin but must\n # not raise an error\n if self.fieldName == 'tag' and intVal == 0:\n # Tag in range: \"Reserved\"\n return self.pduType.vendor_specific_bypass\n elif self.fieldName == 'tag' and intVal >= 0x0100 and intVal <= 0x01FF:\n # Tag in range: \"Reserved\"\n return self.pduType.vendor_specific_bypass\n elif self.fieldName == 'tag' and intVal >= 0x0600 and intVal <= 0x10FF:\n # Tag in range: \"Reserved for SMPP Protocol Extension\"\n return self.pduType.vendor_specific_bypass\n elif self.fieldName == 'tag' and intVal >= 0x1100 and intVal <= 0x11FF:\n # Tag in range: \"Reserved\"\n return self.pduType.vendor_specific_bypass\n elif self.fieldName == 'tag' and intVal >= 0x1400 and intVal <= 0x3FFF:\n # Tag in range: \"Reserved for SMSC Vendor specific optional parameters\"\n return self.pduType.vendor_specific_bypass\n elif self.fieldName == 'tag' and intVal >= 0x4000 and intVal <= 0xFFFF:\n # Tag in range: \"Reserved\"\n return self.pduType.vendor_specific_bypass\n elif intVal not in self.valueMap:\n errStr = \"Unknown %s value %s\" % (self.fieldName, hex(intVal))\n raise self.decodeErrorClass(errStr, self.decodeErrorStatus)\n\n name = self.valueMap[intVal]\n return getattr(self.pduType, name)", "metadata": "root.IntegerWrapperEncoder._decode", "header": "['class', 'IntegerWrapperEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 260 }, { "content": "class CommandIdEncoder(IntegerWrapperEncoder):\n fieldName = 'command_id'\n nameMap = constants.command_id_name_map\n valueMap = constants.command_id_value_map\n encoder = Int4Encoder()\n pduType = pdu_types.CommandId\n decodeErrorClass = PDUCorruptError\n decodeErrorStatus = pdu_types.CommandStatus.ESME_RINVCMDID", "metadata": "root.CommandIdEncoder", "header": "['module', '___EOS___']", "index": 291 }, { "content": "class CommandStatusEncoder(Int4Encoder):\n nullable = False\n\n", "metadata": "root.CommandStatusEncoder", "header": "['module', '___EOS___']", "index": 300 }, { "content": " def _encode(self, value):\n name = str(value)\n if name not in constants.command_status_name_map:\n raise ValueError(\"Unknown command_status name %s\" % name)\n intval = constants.command_status_name_map[name]\n return Int4Encoder().encode(intval)", "metadata": "root.CommandStatusEncoder._encode", "header": "['class', 'CommandStatusEncoder', '(', 'Int4Encoder', ')', ':', '___EOS___']", "index": 303 }, { "content": " def _decode(self, bytes):\n intval = Int4Encoder()._decode(bytes)\n if intval not in constants.command_status_value_map:\n # Jasmin update:\n # as of Table 5-2: SMPP Error Codes\n # (256 .. 1023) 0x00000100 .. 0x000003FF = Reserved for SMPP extension\n # (1024 .. 1279) 0x00000400 .. 0x000004FF = Reserved for SMSC vendor specific errors\n # (1280 ...) 0x00000500 ... = Reserved\n #\n # In order to avoid raising a PDUParseError on one of these reserved error codes,\n # jasmin will return a general status indicating a reserved field\n if 256 <= intval:\n if 256 <= intval <= 1023:\n name = constants.command_status_value_map[-1]['name']\n elif 1024 <= intval <= 1279:\n name = constants.command_status_value_map[-2]['name']\n elif 1280 <= intval:\n name = constants.command_status_value_map[-3]['name']\n else:\n raise PDUParseError(\"Unknown command_status %s\" % intval, pdu_types.CommandStatus.ESME_RUNKNOWNERR)\n else:\n name = constants.command_status_value_map[intval]['name']\n\n return getattr(pdu_types.CommandStatus, name)", "metadata": "root.CommandStatusEncoder._decode", "header": "['class', 'CommandStatusEncoder', '(', 'Int4Encoder', ')', ':', '___EOS___']", "index": 310 }, { "content": "class TagEncoder(IntegerWrapperEncoder):\n fieldName = 'tag'\n nameMap = constants.tag_name_map\n valueMap = constants.tag_value_map\n encoder = Int2Encoder()\n pduType = pdu_types.Tag\n decodeErrorStatus = pdu_types.CommandStatus.ESME_RINVOPTPARSTREAM", "metadata": "root.TagEncoder", "header": "['module', '___EOS___']", "index": 335 }, { "content": "class EsmClassEncoder(Int1Encoder):\n modeMask = 0x03\n typeMask = 0x3c\n gsmFeaturesMask = 0xc0\n\n", "metadata": "root.EsmClassEncoder", "header": "['module', '___EOS___']", "index": 343 }, { "content": " def _encode(self, esmClass):\n modeName = str(esmClass.mode)\n typeName = str(esmClass.type)\n gsmFeatureNames = [str(f) for f in esmClass.gsmFeatures]\n\n if modeName not in constants.esm_class_mode_name_map:\n raise ValueError(\"Unknown esm_class mode name %s\" % modeName)\n if typeName not in constants.esm_class_type_name_map:\n raise ValueError(\"Unknown esm_class type name %s\" % typeName)\n for featureName in gsmFeatureNames:\n if featureName not in constants.esm_class_gsm_features_name_map:\n raise ValueError(\"Unknown esm_class GSM feature name %s\" % featureName)\n\n modeVal = constants.esm_class_mode_name_map[modeName]\n typeVal = constants.esm_class_type_name_map[typeName]\n gsmFeatureVals = [constants.esm_class_gsm_features_name_map[fName] for fName in gsmFeatureNames]\n\n intVal = modeVal | typeVal\n for fVal in gsmFeatureVals:\n intVal |= fVal\n\n return Int1Encoder().encode(intVal)", "metadata": "root.EsmClassEncoder._encode", "header": "['class', 'EsmClassEncoder', '(', 'Int1Encoder', ')', ':', '___EOS___']", "index": 348 }, { "content": " def _decode(self, bytes):\n intVal = Int1Encoder()._decode(bytes)\n modeVal = intVal & self.modeMask\n typeVal = intVal & self.typeMask\n gsmFeaturesVal = intVal & self.gsmFeaturesMask\n\n if modeVal not in constants.esm_class_mode_value_map:\n raise PDUParseError(\"Unknown esm_class mode %s\" % modeVal, pdu_types.CommandStatus.ESME_RINVESMCLASS)\n if typeVal not in constants.esm_class_type_value_map:\n raise PDUParseError(\"Unknown esm_class type %s\" % typeVal, pdu_types.CommandStatus.ESME_RINVESMCLASS)\n\n modeName = constants.esm_class_mode_value_map[modeVal]\n typeName = constants.esm_class_type_value_map[typeVal]\n gsmFeatureNames = [constants.esm_class_gsm_features_value_map[fVal] for fVal in constants.esm_class_gsm_features_value_map.keys() if fVal & gsmFeaturesVal]\n\n mode = getattr(pdu_types.EsmClassMode, modeName)\n type = getattr(pdu_types.EsmClassType, typeName)\n gsmFeatures = [getattr(pdu_types.EsmClassGsmFeatures, fName) for fName in gsmFeatureNames]\n\n return pdu_types.EsmClass(mode, type, gsmFeatures)", "metadata": "root.EsmClassEncoder._decode", "header": "['class', 'EsmClassEncoder', '(', 'Int1Encoder', ')', ':', '___EOS___']", "index": 371 }, { "content": "class RegisteredDeliveryEncoder(Int1Encoder):\n receiptMask = 0x03\n smeOriginatedAcksMask = 0x0c\n intermediateNotificationMask = 0x10\n\n", "metadata": "root.RegisteredDeliveryEncoder", "header": "['module', '___EOS___']", "index": 392 }, { "content": " def _encode(self, registeredDelivery):\n receiptName = str(registeredDelivery.receipt)\n smeOriginatedAckNames = [str(a) for a in registeredDelivery.smeOriginatedAcks]\n\n if receiptName not in constants.registered_delivery_receipt_name_map:\n raise ValueError(\"Unknown registered_delivery receipt name %s\" % receiptName)\n for ackName in smeOriginatedAckNames:\n if ackName not in constants.registered_delivery_sme_originated_acks_name_map:\n raise ValueError(\"Unknown registered_delivery SME orginated ack name %s\" % ackName)\n\n receiptVal = constants.registered_delivery_receipt_name_map[receiptName]\n smeOriginatedAckVals = [constants.registered_delivery_sme_originated_acks_name_map[ackName] for ackName in smeOriginatedAckNames]\n intermediateNotificationVal = 0\n if registeredDelivery.intermediateNotification:\n intermediateNotificationVal = self.intermediateNotificationMask\n\n intVal = receiptVal | intermediateNotificationVal\n for aVal in smeOriginatedAckVals:\n intVal |= aVal\n\n return Int1Encoder().encode(intVal)", "metadata": "root.RegisteredDeliveryEncoder._encode", "header": "['class', 'RegisteredDeliveryEncoder', '(', 'Int1Encoder', ')', ':', '___EOS___']", "index": 397 }, { "content": " def _decode(self, bytes):\n intVal = Int1Encoder()._decode(bytes)\n receiptVal = intVal & self.receiptMask\n smeOriginatedAcksVal = intVal & self.smeOriginatedAcksMask\n intermediateNotificationVal = intVal & self.intermediateNotificationMask\n\n if receiptVal not in constants.registered_delivery_receipt_value_map:\n raise PDUParseError(\"Unknown registered_delivery receipt %s\" % receiptVal, pdu_types.CommandStatus.ESME_RINVREGDLVFLG)\n\n receiptName = constants.registered_delivery_receipt_value_map[receiptVal]\n smeOriginatedAckNames = [constants.registered_delivery_sme_originated_acks_value_map[aVal] for aVal in constants.registered_delivery_sme_originated_acks_value_map.keys() if aVal & smeOriginatedAcksVal]\n\n receipt = getattr(pdu_types.RegisteredDeliveryReceipt, receiptName)\n smeOriginatedAcks = [getattr(pdu_types.RegisteredDeliverySmeOriginatedAcks, aName) for aName in smeOriginatedAckNames]\n intermediateNotification = False\n if intermediateNotificationVal:\n intermediateNotification = True\n\n return pdu_types.RegisteredDelivery(receipt, smeOriginatedAcks, intermediateNotification)", "metadata": "root.RegisteredDeliveryEncoder._decode", "header": "['class', 'RegisteredDeliveryEncoder', '(', 'Int1Encoder', ')', ':', '___EOS___']", "index": 419 }, { "content": "class DataCodingEncoder(Int1Encoder):\n schemeMask = 0xf0\n schemeDataMask = 0x0f\n gsmMsgCodingMask = 0x04\n gsmMsgClassMask = 0x03\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.DataCodingEncoder", "header": "['module', '___EOS___']", "index": 439 }, { "content": " def _encode(self, dataCoding):\n return Int1Encoder().encode(self._encodeAsInt(dataCoding))", "metadata": "root.DataCodingEncoder._encode", "header": "['class', 'DataCodingEncoder', '(', 'Int1Encoder', ')', ':', '___EOS___']", "index": 445 }, { "content": " def _encodeAsInt(self, dataCoding):\n # Jasmin update:\n # Comparing dataCoding.scheme to pdu_types.DataCodingScheme.RAW would result\n # to False even if the values are the same, this is because Enum object have\n # no right __eq__ to compare values\n # Fix: compare Enum indexes (.index)\n if dataCoding.scheme.index == pdu_types.DataCodingScheme.RAW.index:\n return dataCoding.schemeData\n if dataCoding.scheme.index == pdu_types.DataCodingScheme.DEFAULT.index:\n return self._encodeDefaultSchemeAsInt(dataCoding)\n return self._encodeSchemeAsInt(dataCoding)", "metadata": "root.DataCodingEncoder._encodeAsInt", "header": "['class', 'DataCodingEncoder', '(', 'Int1Encoder', ')', ':', '___EOS___']", "index": 448 }, { "content": " def _encodeDefaultSchemeAsInt(self, dataCoding):\n defaultName = str(dataCoding.schemeData)\n if defaultName not in constants.data_coding_default_name_map:\n raise ValueError(\"Unknown data_coding default name %s\" % defaultName)\n return constants.data_coding_default_name_map[defaultName]", "metadata": "root.DataCodingEncoder._encodeDefaultSchemeAsInt", "header": "['class', 'DataCodingEncoder', '(', 'Int1Encoder', ')', ':', '___EOS___']", "index": 460 }, { "content": " def _encodeSchemeAsInt(self, dataCoding):\n schemeVal = self._encodeSchemeNameAsInt(dataCoding)\n schemeDataVal = self._encodeSchemeDataAsInt(dataCoding)\n return schemeVal | schemeDataVal", "metadata": "root.DataCodingEncoder._encodeSchemeAsInt", "header": "['class', 'DataCodingEncoder', '(', 'Int1Encoder', ')', ':', '___EOS___']", "index": 466 }, { "content": " def _encodeSchemeNameAsInt(self, dataCoding):\n schemeName = str(dataCoding.scheme)\n if schemeName not in constants.data_coding_scheme_name_map:\n raise ValueError(\"Unknown data_coding scheme name %s\" % schemeName)\n return constants.data_coding_scheme_name_map[schemeName]", "metadata": "root.DataCodingEncoder._encodeSchemeNameAsInt", "header": "['class', 'DataCodingEncoder', '(', 'Int1Encoder', ')', ':', '___EOS___']", "index": 471 }, { "content": " def _encodeSchemeDataAsInt(self, dataCoding):\n # Jasmin update:\n # Related to #182\n # When pdu is unpickled (from smpps or http api), the comparison below will always\n # be False since memory addresses of both objects are different.\n # Using str() will get the comparison on the 'GSM_MESSAGE_CLASS' string value\n if str(dataCoding.scheme) == str(pdu_types.DataCodingScheme.GSM_MESSAGE_CLASS):\n return self._encodeGsmMsgSchemeDataAsInt(dataCoding)\n # Jasmin update:\n # As reported in https://github.com/mozes/smpp.pdu/issues/12\n # raise ValueError(\"Unknown data coding scheme %s\" % dataCoding.scheme)\n # ~~~~~~~~~~~\n raise ValueError(\"Unknown data coding scheme %s\" % dataCoding.scheme)", "metadata": "root.DataCodingEncoder._encodeSchemeDataAsInt", "header": "['class', 'DataCodingEncoder', '(', 'Int1Encoder', ')', ':', '___EOS___']", "index": 477 }, { "content": " def _encodeGsmMsgSchemeDataAsInt(self, dataCoding):\n msgCodingName = str(dataCoding.schemeData.msgCoding)\n msgClassName = str(dataCoding.schemeData.msgClass)\n\n if msgCodingName not in constants.data_coding_gsm_message_coding_name_map:\n raise ValueError(\"Unknown data_coding gsm msg coding name %s\" % msgCodingName)\n if msgClassName not in constants.data_coding_gsm_message_class_name_map:\n raise ValueError(\"Unknown data_coding gsm msg class name %s\" % msgClassName)\n\n msgCodingVal = constants.data_coding_gsm_message_coding_name_map[msgCodingName]\n msgClassVal = constants.data_coding_gsm_message_class_name_map[msgClassName]\n return msgCodingVal | msgClassVal", "metadata": "root.DataCodingEncoder._encodeGsmMsgSchemeDataAsInt", "header": "['class', 'DataCodingEncoder', '(', 'Int1Encoder', ')', ':', '___EOS___']", "index": 491 }, { "content": " def _decode(self, bytes):\n intVal = Int1Encoder()._decode(bytes)\n scheme = self._decodeScheme(intVal)\n schemeData = self._decodeSchemeData(scheme, intVal)\n return pdu_types.DataCoding(scheme, schemeData)", "metadata": "root.DataCodingEncoder._decode", "header": "['class', 'DataCodingEncoder', '(', 'Int1Encoder', ')', ':', '___EOS___']", "index": 504 }, { "content": " def _decodeScheme(self, intVal):\n schemeVal = intVal & self.schemeMask\n if schemeVal in constants.data_coding_scheme_value_map:\n schemeName = constants.data_coding_scheme_value_map[schemeVal]\n return getattr(pdu_types.DataCodingScheme, schemeName)\n\n if intVal in constants.data_coding_default_value_map:\n return pdu_types.DataCodingScheme.DEFAULT\n\n return pdu_types.DataCodingScheme.RAW", "metadata": "root.DataCodingEncoder._decodeScheme", "header": "['class', 'DataCodingEncoder', '(', 'Int1Encoder', ')', ':', '___EOS___']", "index": 510 }, { "content": " def _decodeSchemeData(self, scheme, intVal):\n if scheme == pdu_types.DataCodingScheme.RAW:\n return intVal\n if scheme == pdu_types.DataCodingScheme.DEFAULT:\n return self._decodeDefaultSchemeData(intVal)\n if scheme == pdu_types.DataCodingScheme.GSM_MESSAGE_CLASS:\n schemeDataVal = intVal & self.schemeDataMask\n return self._decodeGsmMsgSchemeData(schemeDataVal)\n raise ValueError(\"Unexpected data coding scheme %s\" % scheme)", "metadata": "root.DataCodingEncoder._decodeSchemeData", "header": "['class', 'DataCodingEncoder', '(', 'Int1Encoder', ')', ':', '___EOS___']", "index": 521 }, { "content": " def _decodeDefaultSchemeData(self, intVal):\n if intVal not in constants.data_coding_default_value_map:\n raise ValueError(\"Unknown data_coding default value %s\" % intVal)\n defaultName = constants.data_coding_default_value_map[intVal]\n return getattr(pdu_types.DataCodingDefault, defaultName)", "metadata": "root.DataCodingEncoder._decodeDefaultSchemeData", "header": "['class', 'DataCodingEncoder', '(', 'Int1Encoder', ')', ':', '___EOS___']", "index": 531 }, { "content": " def _decodeGsmMsgSchemeData(self, schemeDataVal):\n msgCodingVal = schemeDataVal & self.gsmMsgCodingMask\n msgClassVal = schemeDataVal & self.gsmMsgClassMask\n\n if msgCodingVal not in constants.data_coding_gsm_message_coding_value_map:\n raise ValueError(\"Unknown data_coding gsm msg coding value %s\" % msgCodingVal)\n if msgClassVal not in constants.data_coding_gsm_message_class_value_map:\n raise ValueError(\"Unknown data_coding gsm msg class value %s\" % msgClassVal)\n\n msgCodingName = constants.data_coding_gsm_message_coding_value_map[msgCodingVal]\n msgClassName = constants.data_coding_gsm_message_class_value_map[msgClassVal]\n\n msgCoding = getattr(pdu_types.DataCodingGsmMsgCoding, msgCodingName)\n msgClass = getattr(pdu_types.DataCodingGsmMsgClass, msgClassName)\n return pdu_types.DataCodingGsmMsg(msgCoding, msgClass)", "metadata": "root.DataCodingEncoder._decodeGsmMsgSchemeData", "header": "['class', 'DataCodingEncoder', '(', 'Int1Encoder', ')', ':', '___EOS___']", "index": 537 }, { "content": "class AddrTonEncoder(IntegerWrapperEncoder):\n fieldName = 'addr_ton'\n nameMap = constants.addr_ton_name_map\n valueMap = constants.addr_ton_value_map\n encoder = Int1Encoder()\n pduType = pdu_types.AddrTon", "metadata": "root.AddrTonEncoder", "header": "['module', '___EOS___']", "index": 553 }, { "content": "class AddrNpiEncoder(IntegerWrapperEncoder):\n fieldName = 'addr_npi'\n nameMap = constants.addr_npi_name_map\n valueMap = constants.addr_npi_value_map\n encoder = Int1Encoder()\n pduType = pdu_types.AddrNpi", "metadata": "root.AddrNpiEncoder", "header": "['module', '___EOS___']", "index": 560 }, { "content": "class PriorityFlagEncoder(IntegerWrapperEncoder):\n fieldName = 'priority_flag'\n nameMap = constants.priority_flag_name_map\n valueMap = constants.priority_flag_value_map\n encoder = Int1Encoder()\n pduType = pdu_types.PriorityFlag\n decodeErrorStatus = pdu_types.CommandStatus.ESME_RINVPRTFLG", "metadata": "root.PriorityFlagEncoder", "header": "['module', '___EOS___']", "index": 567 }, { "content": "class ReplaceIfPresentFlagEncoder(IntegerWrapperEncoder):\n fieldName = 'replace_if_present_flag'\n nameMap = constants.replace_if_present_flap_name_map\n valueMap = constants.replace_if_present_flap_value_map\n encoder = Int1Encoder()\n pduType = pdu_types.ReplaceIfPresentFlag", "metadata": "root.ReplaceIfPresentFlagEncoder", "header": "['module', '___EOS___']", "index": 575 }, { "content": "class DestFlagEncoder(IntegerWrapperEncoder):\n nullable = False\n fieldName = 'dest_flag'\n nameMap = constants.dest_flag_name_map\n valueMap = constants.dest_flag_value_map\n encoder = Int1Encoder()\n pduType = pdu_types.DestFlag", "metadata": "root.DestFlagEncoder", "header": "['module', '___EOS___']", "index": 582 }, { "content": "class MessageStateEncoder(IntegerWrapperEncoder):\n nullable = False\n fieldName = 'message_state'\n nameMap = constants.message_state_name_map\n valueMap = constants.message_state_value_map\n encoder = Int1Encoder()\n pduType = pdu_types.MessageState", "metadata": "root.MessageStateEncoder", "header": "['module', '___EOS___']", "index": 590 }, { "content": "class CallbackNumDigitModeIndicatorEncoder(IntegerWrapperEncoder):\n nullable = False\n fieldName = 'callback_num_digit_mode_indicator'\n nameMap = constants.callback_num_digit_mode_indicator_name_map\n valueMap = constants.callback_num_digit_mode_indicator_value_map\n encoder = Int1Encoder()\n pduType = pdu_types.CallbackNumDigitModeIndicator\n decodeErrorStatus = pdu_types.CommandStatus.ESME_RINVOPTPARAMVAL", "metadata": "root.CallbackNumDigitModeIndicatorEncoder", "header": "['module', '___EOS___']", "index": 598 }, { "content": "class CallbackNumEncoder(OctetStringEncoder):\n digitModeIndicatorEncoder = CallbackNumDigitModeIndicatorEncoder()\n tonEncoder = AddrTonEncoder()\n npiEncoder = AddrNpiEncoder()\n\n", "metadata": "root.CallbackNumEncoder", "header": "['module', '___EOS___']", "index": 607 }, { "content": " def _encode(self, callbackNum):\n encoded = ''\n encoded += self.digitModeIndicatorEncoder._encode(callbackNum.digitModeIndicator)\n encoded += self.tonEncoder._encode(callbackNum.ton)\n encoded += self.npiEncoder._encode(callbackNum.npi)\n encoded += callbackNum.digits\n return encoded", "metadata": "root.CallbackNumEncoder._encode", "header": "['class', 'CallbackNumEncoder', '(', 'OctetStringEncoder', ')', ':', '___EOS___']", "index": 612 }, { "content": " def _decode(self, bytes):\n if len(bytes) < 3:\n raise PDUParseError(\"Invalid callback_num size %s\" % len(bytes), pdu_types.CommandStatus.ESME_RINVOPTPARAMVAL)\n\n digitModeIndicator = self.digitModeIndicatorEncoder._decode(bytes[0])\n ton = self.tonEncoder._decode(bytes[1])\n npi = self.npiEncoder._decode(bytes[2])\n digits = bytes[3:]\n return pdu_types.CallbackNum(digitModeIndicator, ton, npi, digits)", "metadata": "root.CallbackNumEncoder._decode", "header": "['class', 'CallbackNumEncoder', '(', 'OctetStringEncoder', ')', ':', '___EOS___']", "index": 620 }, { "content": "class SubaddressTypeTagEncoder(IntegerWrapperEncoder):\n nullable = False\n fieldName = 'subaddress_type_tag'\n nameMap = constants.subaddress_type_tag_name_map\n valueMap = constants.subaddress_type_tag_value_map\n encoder = Int1Encoder()\n pduType = pdu_types.SubaddressTypeTag\n decodeErrorStatus = pdu_types.CommandStatus.ESME_RINVOPTPARAMVAL", "metadata": "root.SubaddressTypeTagEncoder", "header": "['module', '___EOS___']", "index": 630 }, { "content": "class SubaddressEncoder(OctetStringEncoder):\n typeTagEncoder = SubaddressTypeTagEncoder()\n\n", "metadata": "root.SubaddressEncoder", "header": "['module', '___EOS___']", "index": 639 }, { "content": " def _encode(self, subaddress):\n encoded = ''\n encoded += self.typeTagEncoder._encode(subaddress.typeTag)\n valSize = self.getSize() - 1 if self.getSize() is not None else None\n encoded += OctetStringEncoder(valSize)._encode(subaddress.value)\n return encoded", "metadata": "root.SubaddressEncoder._encode", "header": "['class', 'SubaddressEncoder', '(', 'OctetStringEncoder', ')', ':', '___EOS___']", "index": 642 }, { "content": " def _decode(self, bytes):\n if len(bytes) < 2:\n raise PDUParseError(\"Invalid subaddress size %s\" % len(bytes), pdu_types.CommandStatus.ESME_RINVOPTPARAMVAL)\n\n typeTag = self.typeTagEncoder._decode(bytes[0])\n value = OctetStringEncoder(self.getSize() - 1)._decode(bytes[1:])\n return pdu_types.Subaddress(typeTag, value)", "metadata": "root.SubaddressEncoder._decode", "header": "['class', 'SubaddressEncoder', '(', 'OctetStringEncoder', ')', ':', '___EOS___']", "index": 649 }, { "content": "class AddrSubunitEncoder(IntegerWrapperEncoder):\n fieldName = 'addr_subunit'\n nameMap = constants.addr_subunit_name_map\n valueMap = constants.addr_subunit_value_map\n encoder = Int1Encoder()\n pduType = pdu_types.AddrSubunit", "metadata": "root.AddrSubunitEncoder", "header": "['module', '___EOS___']", "index": 657 }, { "content": "class NetworkTypeEncoder(IntegerWrapperEncoder):\n fieldName = 'network_type'\n nameMap = constants.network_type_name_map\n valueMap = constants.network_type_value_map\n encoder = Int1Encoder()\n pduType = pdu_types.NetworkType", "metadata": "root.NetworkTypeEncoder", "header": "['module', '___EOS___']", "index": 664 }, { "content": "class BearerTypeEncoder(IntegerWrapperEncoder):\n fieldName = 'bearer_type'\n nameMap = constants.bearer_type_name_map\n valueMap = constants.bearer_type_value_map\n encoder = Int1Encoder()\n pduType = pdu_types.BearerType", "metadata": "root.BearerTypeEncoder", "header": "['module', '___EOS___']", "index": 671 }, { "content": "class PayloadTypeEncoder(IntegerWrapperEncoder):\n fieldName = 'payload_type'\n nameMap = constants.payload_type_name_map\n valueMap = constants.payload_type_value_map\n encoder = Int1Encoder()\n pduType = pdu_types.PayloadType", "metadata": "root.PayloadTypeEncoder", "header": "['module', '___EOS___']", "index": 678 }, { "content": "class PrivacyIndicatorEncoder(IntegerWrapperEncoder):\n fieldName = 'privacy_indicator'\n nameMap = constants.privacy_indicator_name_map\n valueMap = constants.privacy_indicator_value_map\n encoder = Int1Encoder()\n pduType = pdu_types.PrivacyIndicator", "metadata": "root.PrivacyIndicatorEncoder", "header": "['module', '___EOS___']", "index": 685 }, { "content": "class LanguageIndicatorEncoder(IntegerWrapperEncoder):\n fieldName = 'language_indicator'\n nameMap = constants.language_indicator_name_map\n valueMap = constants.language_indicator_value_map\n encoder = Int1Encoder()\n pduType = pdu_types.LanguageIndicator", "metadata": "root.LanguageIndicatorEncoder", "header": "['module', '___EOS___']", "index": 692 }, { "content": "class DisplayTimeEncoder(IntegerWrapperEncoder):\n fieldName = 'display_time'\n nameMap = constants.display_time_name_map\n valueMap = constants.display_time_value_map\n encoder = Int1Encoder()\n pduType = pdu_types.DisplayTime", "metadata": "root.DisplayTimeEncoder", "header": "['module', '___EOS___']", "index": 699 }, { "content": "class MsAvailabilityStatusEncoder(IntegerWrapperEncoder):\n fieldName = 'ms_availability_status'\n nameMap = constants.ms_availability_status_name_map\n valueMap = constants.ms_availability_status_value_map\n encoder = Int1Encoder()\n pduType = pdu_types.MsAvailabilityStatus", "metadata": "root.MsAvailabilityStatusEncoder", "header": "['module', '___EOS___']", "index": 706 }, { "content": "class NetworkErrorCodeEncoder(OctetStringEncoder):\n fieldName = 'network_error_code'\n nameMap = constants.network_error_code_name_map\n valueMap = constants.network_error_code_value_map\n pduType = pdu_types.NetworkErrorCode", "metadata": "root.NetworkErrorCodeEncoder", "header": "['module', '___EOS___']", "index": 714 }, { "content": "class DeliveryFailureReasonEncoder(IntegerWrapperEncoder):\n fieldName = 'delivery_failure_reason'\n nameMap = constants.delivery_failure_reason_name_map\n valueMap = constants.delivery_failure_reason_value_map\n encoder = Int1Encoder()\n pduType = pdu_types.DeliveryFailureReason", "metadata": "root.DeliveryFailureReasonEncoder", "header": "['module', '___EOS___']", "index": 720 }, { "content": "class MoreMessagesToSendEncoder(IntegerWrapperEncoder):\n fieldName = 'more_messages_to_send'\n nameMap = constants.more_messages_to_send_name_map\n valueMap = constants.more_messages_to_send_value_map\n encoder = Int1Encoder()\n pduType = pdu_types.MoreMessagesToSend", "metadata": "root.MoreMessagesToSendEncoder", "header": "['module', '___EOS___']", "index": 727 }, { "content": "class TimeEncoder(PDUNullableFieldEncoder):\n nullHex = '00'\n decodeNull = True\n encoder = COctetStringEncoder(17)\n decodeErrorClass = PDUParseError\n decodeErrorStatus = pdu_types.CommandStatus.ESME_RUNKNOWNERR\n\n\n\n", "metadata": "root.TimeEncoder", "header": "['module', '___EOS___']", "index": 734 }, { "content": " def __init__(self, **kwargs):\n PDUNullableFieldEncoder.__init__(self, **kwargs)\n self.decodeErrorClass = kwargs.get('decodeErrorClass', self.decodeErrorClass)\n self.decodeErrorStatus = kwargs.get('decodeErrorStatus', self.decodeErrorStatus)\n self.encoder.decodeErrorStatus = self.decodeErrorStatus", "metadata": "root.TimeEncoder.__init__", "header": "['class', 'TimeEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 741 }, { "content": " def _encode(self, time):\n str = smpp_time.unparse(time)\n return self.encoder._encode(str)", "metadata": "root.TimeEncoder._encode", "header": "['class', 'TimeEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 747 }, { "content": " def _read(self, file):\n return self.encoder._read(file)", "metadata": "root.TimeEncoder._read", "header": "['class', 'TimeEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 751 }, { "content": " def _decode(self, bytes):\n timeStr = self.encoder._decode(bytes)\n try:\n return smpp_time.parse(timeStr)\n except Exception, e:\n errStr = str(e)\n raise self.decodeErrorClass(errStr, self.decodeErrorStatus)", "metadata": "root.TimeEncoder._decode", "header": "['class', 'TimeEncoder', '(', 'PDUNullableFieldEncoder', ')', ':', '___EOS___']", "index": 754 }, { "content": "class ShortMessageEncoder(IEncoder):\n smLengthEncoder = Int1Encoder(max=254)\n\n", "metadata": "root.ShortMessageEncoder", "header": "['module', '___EOS___']", "index": 762 }, { "content": " def encode(self, shortMessage):\n if shortMessage is None:\n shortMessage = ''\n smLength = len(shortMessage)\n\n return self.smLengthEncoder.encode(smLength) + OctetStringEncoder(smLength).encode(shortMessage)", "metadata": "root.ShortMessageEncoder.encode", "header": "['class', 'ShortMessageEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 765 }, { "content": " def decode(self, file):\n smLength = self.smLengthEncoder.decode(file)\n return OctetStringEncoder(smLength).decode(file)", "metadata": "root.ShortMessageEncoder.decode", "header": "['class', 'ShortMessageEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 772 }, { "content": "class MessagePayloadEncoder(OctetStringEncoder):\n pass", "metadata": "root.MessagePayloadEncoder", "header": "['module', '___EOS___']", "index": 776 }, { "content": "class OptionEncoder(IEncoder):\n\n\n\n", "metadata": "root.OptionEncoder", "header": "['module', '___EOS___']", "index": 779 }, { "content": " def __init__(self):\n from jasmin.vendor.smpp.pdu.pdu_types import Tag as T\n self.length = None\n self.options = {\n T.dest_addr_subunit: AddrSubunitEncoder(),\n T.source_addr_subunit: AddrSubunitEncoder(),\n T.dest_network_type: NetworkTypeEncoder(),\n T.source_network_type: NetworkTypeEncoder(),\n T.dest_bearer_type: BearerTypeEncoder(),\n T.source_bearer_type: BearerTypeEncoder(),\n T.dest_telematics_id: Int2Encoder(),\n T.source_telematics_id: Int2Encoder(),\n T.qos_time_to_live: Int4Encoder(),\n T.payload_type: PayloadTypeEncoder(),\n T.additional_status_info_text: COctetStringEncoder(256),\n T.receipted_message_id: COctetStringEncoder(65),\n # T.ms_msg_wait_facilities: TODO(),\n T.privacy_indicator: PrivacyIndicatorEncoder(),\n T.source_subaddress: SubaddressEncoder(self.getLength),\n T.dest_subaddress: SubaddressEncoder(self.getLength),\n T.user_message_reference: Int2Encoder(),\n T.user_response_code: Int1Encoder(),\n T.language_indicator: LanguageIndicatorEncoder(),\n T.source_port: Int2Encoder(),\n T.destination_port: Int2Encoder(),\n T.sar_msg_ref_num: Int2Encoder(),\n T.sar_total_segments: Int1Encoder(),\n T.sar_segment_seqnum: Int1Encoder(),\n T.sc_interface_version: Int1Encoder(),\n T.display_time: DisplayTimeEncoder(),\n #T.ms_validity: MsValidityEncoder(),\n #T.dpf_result: DpfResultEncoder(),\n #T.set_dpf: SetDpfEncoder(),\n T.ms_availability_status: MsAvailabilityStatusEncoder(),\n # Jasmin update:\n T.network_error_code: NetworkErrorCodeEncoder(self.getLength),\n T.message_payload: MessagePayloadEncoder(self.getLength),\n T.delivery_failure_reason: DeliveryFailureReasonEncoder(),\n T.more_messages_to_send: MoreMessagesToSendEncoder(),\n T.message_state: MessageStateEncoder(),\n T.callback_num: CallbackNumEncoder(self.getLength),\n #T.callback_num_pres_ind: CallbackNumPresIndEncoder(),\n # T.callback_num_atag: CallbackNumAtag(),\n T.number_of_messages: Int1Encoder(max=99),\n T.sms_signal: OctetStringEncoder(self.getLength),\n T.alert_on_message_delivery: EmptyEncoder(),\n #T.its_reply_type: ItsReplyTypeEncoder(),\n # T.its_session_info: ItsSessionInfoEncoder(),\n # T.ussd_service_op: UssdServiceOpEncoder(),\n # Jasmin update: bypass vendor specific tags\n T.vendor_specific_bypass: OctetStringEncoder(self.getLength),\n }", "metadata": "root.OptionEncoder.__init__", "header": "['class', 'OptionEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 781 }, { "content": " def getLength(self):\n return self.length", "metadata": "root.OptionEncoder.getLength", "header": "['class', 'OptionEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 834 }, { "content": " def encode(self, option):\n if option.tag not in self.options:\n raise ValueError(\"Unknown option %s\" % str(option))\n encoder = self.options[option.tag]\n encodedValue = encoder.encode(option.value)\n length = len(encodedValue)\n return string.join([\n TagEncoder().encode(option.tag),\n Int2Encoder().encode(length),\n encodedValue,\n ], '')", "metadata": "root.OptionEncoder.encode", "header": "['class', 'OptionEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 837 }, { "content": " def decode(self, file):\n # Jasmin update: bypass vendor specific tags\n tag = TagEncoder().decode(file)\n self.length = Int2Encoder().decode(file)\n if tag not in self.options:\n raise PDUParseError(\"Optional param %s unknown\" % tag, pdu_types.CommandStatus.ESME_ROPTPARNOTALLWD)\n encoder = self.options[tag]\n iBeforeDecode = file.tell()\n value = None\n try:\n value = encoder.decode(file)\n except PDUParseError, e:\n e.status = pdu_types.CommandStatus.ESME_RINVOPTPARAMVAL\n raise e\n\n iAfterDecode = file.tell()\n parseLen = iAfterDecode - iBeforeDecode\n if parseLen != self.length:\n raise PDUParseError(\"Invalid option length: labeled [%d] but parsed [%d]\" % (self.length, parseLen), pdu_types.CommandStatus.ESME_RINVPARLEN)\n return pdu_types.Option(tag, value)", "metadata": "root.OptionEncoder.decode", "header": "['class', 'OptionEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 849 }, { "content": "class PDUEncoder(IEncoder):\n HEADER_LEN = 16\n\n HeaderEncoders = {\n 'command_length': Int4Encoder(),\n 'command_id': CommandIdEncoder(),\n 'command_status': CommandStatusEncoder(),\n #the spec says max=0x7FFFFFFF but vendors don't respect this\n 'sequence_number': Int4Encoder(min=0x00000001),\n }\n HeaderParams = [\n 'command_length',\n 'command_id',\n 'command_status',\n 'sequence_number',\n ]\n\n DefaultRequiredParamEncoders = {\n 'system_id': COctetStringEncoder(16, decodeErrorStatus=pdu_types.CommandStatus.ESME_RINVSYSID),\n 'password': COctetStringEncoder(9, decodeErrorStatus=pdu_types.CommandStatus.ESME_RINVPASWD),\n 'system_type': COctetStringEncoder(13),\n 'interface_version': Int1Encoder(),\n 'addr_ton': AddrTonEncoder(),\n 'addr_npi': AddrNpiEncoder(),\n 'address_range': COctetStringEncoder(41),\n 'service_type': COctetStringEncoder(6, decodeErrorStatus=pdu_types.CommandStatus.ESME_RINVSERTYP),\n 'source_addr_ton': AddrTonEncoder(fieldName='source_addr_ton', decodeErrorStatus=pdu_types.CommandStatus.ESME_RINVSRCTON),\n 'source_addr_npi': AddrNpiEncoder(fieldName='source_addr_npi', decodeErrorStatus=pdu_types.CommandStatus.ESME_RINVSRCNPI),\n 'source_addr': COctetStringEncoder(21, decodeErrorStatus=pdu_types.CommandStatus.ESME_RINVSRCADR),\n 'dest_addr_ton': AddrTonEncoder(fieldName='dest_addr_ton', decodeErrorStatus=pdu_types.CommandStatus.ESME_RINVDSTTON),\n 'dest_addr_npi': AddrNpiEncoder(fieldName='dest_addr_npi', decodeErrorStatus=pdu_types.CommandStatus.ESME_RINVDSTNPI),\n 'destination_addr': COctetStringEncoder(21, decodeErrorStatus=pdu_types.CommandStatus.ESME_RINVDSTADR),\n 'esm_class': EsmClassEncoder(),\n 'esme_addr_ton': AddrTonEncoder(fieldName='esme_addr_ton'),\n 'esme_addr_npi': AddrNpiEncoder(fieldName='esme_addr_npi'),\n 'esme_addr': COctetStringEncoder(65),\n 'protocol_id': Int1Encoder(),\n 'priority_flag': PriorityFlagEncoder(),\n 'schedule_delivery_time': TimeEncoder(decodeErrorStatus=pdu_types.CommandStatus.ESME_RINVSCHED),\n 'validity_period': TimeEncoder(decodeErrorStatus=pdu_types.CommandStatus.ESME_RINVEXPIRY),\n 'registered_delivery': RegisteredDeliveryEncoder(),\n 'replace_if_present_flag': ReplaceIfPresentFlagEncoder(),\n 'data_coding': DataCodingEncoder(),\n # Jasmin update:\n # Minimum for sm_default_msg_id can be 0 (reserved value)\n 'sm_default_msg_id': Int1Encoder(min=0, max=254, decodeErrorStatus=pdu_types.CommandStatus.ESME_RINVDFTMSGID),\n 'short_message': ShortMessageEncoder(),\n 'message_id': COctetStringEncoder(65, decodeErrorStatus=pdu_types.CommandStatus.ESME_RINVMSGID),\n # 'number_of_dests': Int1Encoder(max=254),\n # 'no_unsuccess': Int1Encoder(),\n # 'dl_name': COctetStringEncoder(21),\n 'message_state': MessageStateEncoder(),\n 'final_date': TimeEncoder(),\n 'error_code':Int1Encoder(decodeNull=True),\n }\n\n CustomRequiredParamEncoders = {\n pdu_types.CommandId.alert_notification: {\n 'source_addr': COctetStringEncoder(65, decodeErrorStatus=pdu_types.CommandStatus.ESME_RINVSRCADR),\n },\n pdu_types.CommandId.data_sm: {\n 'source_addr': COctetStringEncoder(65, decodeErrorStatus=pdu_types.CommandStatus.ESME_RINVSRCADR),\n 'destination_addr': COctetStringEncoder(65, decodeErrorStatus=pdu_types.CommandStatus.ESME_RINVDSTADR),\n },\n pdu_types.CommandId.deliver_sm: {\n 'schedule_delivery_time': TimeEncoder(requireNull=True, decodeErrorStatus=pdu_types.CommandStatus.ESME_RINVSCHED),\n 'validity_period': TimeEncoder(requireNull=True, decodeErrorStatus=pdu_types.CommandStatus.ESME_RINVEXPIRY),\n },\n pdu_types.CommandId.deliver_sm_resp: {\n 'message_id': COctetStringEncoder(decodeNull=True, requireNull=True, decodeErrorStatus=pdu_types.CommandStatus.ESME_RINVMSGID),\n }\n }\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.PDUEncoder", "header": "['module', '___EOS___']", "index": 870 }, { "content": " def __init__(self):\n self.optionEncoder = OptionEncoder()", "metadata": "root.PDUEncoder.__init__", "header": "['class', 'PDUEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 943 }, { "content": " def getRequiredParamEncoders(self, pdu):\n if pdu.id in self.CustomRequiredParamEncoders:\n return dict(self.DefaultRequiredParamEncoders.items() + self.CustomRequiredParamEncoders[pdu.id].items())\n return self.DefaultRequiredParamEncoders", "metadata": "root.PDUEncoder.getRequiredParamEncoders", "header": "['class', 'PDUEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 946 }, { "content": " def encode(self, pdu):\n body = self.encodeBody(pdu)\n return self.encodeHeader(pdu, body) + body", "metadata": "root.PDUEncoder.encode", "header": "['class', 'PDUEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 951 }, { "content": " def decode(self, file):\n iBeforeDecode = file.tell()\n headerParams = self.decodeHeader(file)\n pduKlass = operations.getPDUClass(headerParams['command_id'])\n pdu = pduKlass(headerParams['sequence_number'], headerParams['command_status'])\n self.decodeBody(file, pdu, headerParams['command_length'] - self.HEADER_LEN)\n\n iAfterDecode = file.tell()\n parsedLen = iAfterDecode - iBeforeDecode\n # Jasmin update:\n # Related to #124, don't error if parsedLen is greater than command_length,\n # there can be some padding in PDUs, this is a fix to be confirmed for stability\n if headerParams['command_length'] > parsedLen:\n padBytes = file.read(headerParams['command_length'] - parsedLen)\n if len(padBytes) != headerParams['command_length'] - parsedLen:\n raise PDUCorruptError(\"Invalid command length: expected %d, parsed %d, padding bytes not found\" % (headerParams['command_length'], parsedLen), pdu_types.CommandStatus.ESME_RINVCMDLEN)\n elif parsedLen < headerParams['command_length']:\n raise PDUCorruptError(\"Invalid command length: expected %d, parsed %d\" % (headerParams['command_length'], parsedLen), pdu_types.CommandStatus.ESME_RINVCMDLEN)\n\n return pdu", "metadata": "root.PDUEncoder.decode", "header": "['class', 'PDUEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 955 }, { "content": " def decodeHeader(self, file):\n headerParams = self.decodeRequiredParams(self.HeaderParams, self.HeaderEncoders, file)\n if headerParams['command_length'] < self.HEADER_LEN:\n raise PDUCorruptError(\"Invalid command_length %d\" % headerParams['command_length'], pdu_types.CommandStatus.ESME_RINVCMDLEN)\n return headerParams", "metadata": "root.PDUEncoder.decodeHeader", "header": "['class', 'PDUEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 976 }, { "content": " def decodeBody(self, file, pdu, bodyLength):\n mandatoryParams = {}\n optionalParams = {}\n\n #Some PDU responses have no defined body when the status is not 0\n # c.f. 4.1.2. \"BIND_TRANSMITTER_RESP\"\n # c.f. 4.1.4. \"BIND_RECEIVER_RESP\"\n # c.f. 4.4.2. SMPP PDU Definition \"SUBMIT_SM_RESP\"\n if pdu.commandId in (CommandId.bind_receiver_resp, CommandId.bind_transmitter_resp, CommandId.bind_transceiver_resp, CommandId.submit_sm_resp):\n if pdu.status != pdu_types.CommandStatus.ESME_ROK and pdu.noBodyOnError:\n return\n\n iBeforeMParams = file.tell()\n if len(pdu.mandatoryParams) > 0:\n mandatoryParams = self.decodeRequiredParams(pdu.mandatoryParams, self.getRequiredParamEncoders(pdu), file)\n iAfterMParams = file.tell()\n mParamsLen = iAfterMParams - iBeforeMParams\n if len(pdu.optionalParams) > 0:\n optionalParams = self.decodeOptionalParams(pdu.optionalParams, file, bodyLength - mParamsLen)\n pdu.params = dict(mandatoryParams.items() + optionalParams.items())", "metadata": "root.PDUEncoder.decodeBody", "header": "['class', 'PDUEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 982 }, { "content": " def encodeBody(self, pdu):\n body = ''\n\n #Some PDU responses have no defined body when the status is not 0\n # c.f. 4.1.2. \"BIND_TRANSMITTER_RESP\"\n # c.f. 4.1.4. \"BIND_RECEIVER_RESP\"\n # c.f. 4.4.2. SMPP PDU Definition \"SUBMIT_SM_RESP\"\n if pdu.commandId in (CommandId.bind_receiver_resp, CommandId.bind_transmitter_resp, CommandId.bind_transceiver_resp, CommandId.submit_sm_resp):\n if pdu.status != pdu_types.CommandStatus.ESME_ROK and pdu.noBodyOnError:\n return body\n\n for paramName in pdu.mandatoryParams:\n if paramName not in pdu.params:\n raise ValueError(\"Missing required parameter: %s\" % paramName)\n\n body += self.encodeRequiredParams(pdu.mandatoryParams, self.getRequiredParamEncoders(pdu), pdu.params)\n body += self.encodeOptionalParams(pdu.optionalParams, pdu.params)\n return body", "metadata": "root.PDUEncoder.encodeBody", "header": "['class', 'PDUEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 1003 }, { "content": " def encodeHeader(self, pdu, body):\n cmdLength = len(body) + self.HEADER_LEN\n headerParams = {\n 'command_length': cmdLength,\n 'command_id': pdu.id,\n 'command_status': pdu.status,\n 'sequence_number': pdu.seqNum,\n }\n header = self.encodeRequiredParams(self.HeaderParams, self.HeaderEncoders, headerParams)\n assert len(header) == self.HEADER_LEN\n return header", "metadata": "root.PDUEncoder.encodeHeader", "header": "['class', 'PDUEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 1022 }, { "content": " def encodeOptionalParams(self, optionalParams, params):\n result = ''\n for paramName in optionalParams:\n if paramName in params:\n tag = getattr(pdu_types.Tag, paramName)\n value = params[paramName]\n result += self.optionEncoder.encode(pdu_types.Option(tag, value))\n return result", "metadata": "root.PDUEncoder.encodeOptionalParams", "header": "['class', 'PDUEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 1034 }, { "content": " def decodeOptionalParams(self, paramList, file, optionsLength):\n optionalParams = {}\n iBefore = file.tell()\n while file.tell() - iBefore < optionsLength:\n option = self.optionEncoder.decode(file)\n optionName = str(option.tag)\n if optionName not in paramList:\n raise PDUParseError(\"Invalid option %s\" % optionName, pdu_types.CommandStatus.ESME_ROPTPARNOTALLWD)\n optionalParams[optionName] = option.value\n return optionalParams", "metadata": "root.PDUEncoder.decodeOptionalParams", "header": "['class', 'PDUEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 1043 }, { "content": " def encodeRequiredParams(self, paramList, encoderMap, params):\n return string.join([encoderMap[paramName].encode(params[paramName]) for paramName in paramList], '')", "metadata": "root.PDUEncoder.encodeRequiredParams", "header": "['class', 'PDUEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 1054 }, { "content": " def decodeRequiredParams(self, paramList, encoderMap, file):\n params = {}\n for paramName in paramList:\n params[paramName] = encoderMap[paramName].decode(file)\n return params", "metadata": "root.PDUEncoder.decodeRequiredParams", "header": "['class', 'PDUEncoder', '(', 'IEncoder', ')', ':', '___EOS___']", "index": 1057 } ]
[ { "span": "from jasmin.vendor.smpp.pdu.pdu_types import DataCodingDefault", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 62 }, { "span": "from jasmin.vendor.messaging.sms.gsm0338 import encode", "start_line": 26, "start_column": 0, "end_line": 26, "end_column": 54 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Copy", "right", " ", "200", "9", "-", "2010", " ", "Mo", "zes", ",", " ", "Inc", ".", "\\", "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", "ed", " ", "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_", "\"\"\"", "\\", "10", ";", "Update", "d", " ", "code", " ", "part", "s", " ", "are", " ", "marked", " ", "with", " ", "\"", "Ja", "smi", "n", " ", "update", "\"", " ", "comment", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "struct_", ",_", "string_", ",_", "binascii_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "jas", "min_", "._", "vendor_", "._", "smp", "p_", "._", "pdu_", "import_", "smp", "p", "\\u", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "jas", "min_", "._", "vendor_", "._", "smp", "p_", "._", "pdu_", "import_", "constants_", ",_", "pdu", "\\u", "types_", ",_", "operations_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "jas", "min_", "._", "vendor_", "._", "smp", "p_", "._", "pdu_", "._", "error_", "import_", "PD", "UP", "arse", "Error_", ",_", "PD", "UC", "orr", "upt", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "jas", "min_", "._", "vendor_", "._", "smp", "p_", "._", "pdu_", "._", "pdu", "\\u", "types_", "import_", "Command", "Id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "jas", "min_", "._", "vendor_", "._", "smp", "p_", "._", "pdu_", "._", "pdu", "\\u", "types_", "import_", "Data", "Codi", "ng", "Default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ja", "smi", "n", " ", "update", ":_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "jas", "min_", "._", "vendor_", "._", "messaging_", "._", "sms_", "._", "gsm", "033", "8_", "import_", "encode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ja", "smi", "n", " ", "update", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "IE", "ncode", "r_", "(_", "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_", "IE", "ncode", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "encode_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Tak", "es", " ", "an", " ", "object", " ", "represent", "ing", " ", "the", " ", "type", " ", "and", " ", "return", "s", " ", "a", " ", "byte", " ", "string", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IE", "ncode", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Tak", "es", " ", "file", " ", "stream", " ", "in", " ", "and", " ", "return", "s", " ", "an", " ", "object", " ", "represent", "ing", " ", "the", " ", "type", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IE", "ncode", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "file_", ",_", "size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bytes", "Read_", "=_", "file_", "._", "read_", "(_", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "=_", "len_", "(_", "bytes", "Read_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "length_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "PD", "UC", "orr", "upt", "Error_", "(_", "\"", "Une", "xpe", "cte", "d", " ", "EO", "F", "\"_", ",_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VM", "SG", "LEN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "length_", "!=_", "size_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "PD", "UC", "orr", "upt", "Error_", "(_", "\"", "Length", " ", "mism", "atch", ".", " ", "Expecti", "ng", " ", "%", "d", " ", "bytes", ".", " ", "Read", " ", "%", "d", "\"_", "%_", "(_", "size_", ",_", "length_", ")_", ",_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VM", "SG", "LEN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "bytes", "Read_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Emp", "ty", "Encoder_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\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_", "Emp", "ty", "Encoder_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "encode_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Emp", "ty", "Encoder_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "file_", ")_", ":_", "\\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_", "PD", "UN", "ull", "able", "Field", "Encoder_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "null", "Hex_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nullable_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decode", "Null_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "require", "Null_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "PD", "UN", "ull", "able", "Field", "Encoder_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\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 ", " _", "self_", "._", "nullable_", "=_", "kwargs_", "._", "get_", "(_", "'", "null", "able", "'_", ",_", "self_", "._", "nullable_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "decode", "Null_", "=_", "kwargs_", "._", "get_", "(_", "'", "decode", "Null", "'_", ",_", "self_", "._", "decode", "Null_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "require", "Null_", "=_", "kwargs_", "._", "get_", "(_", "'", "require", "Null", "'_", ",_", "self_", "._", "require", "Null_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "validat", "e", "Params_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "PD", "UN", "ull", "able", "Field", "Encoder_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "validat", "e", "Params_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "decode", "Null_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "nullable_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "null", "able", " ", "must", " ", "be", " ", "set", " ", "if", " ", "decode", "Null", " ", "is", " ", "set", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "require", "Null_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "decode", "Null_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "decode", "Null", " ", "must", " ", "be", " ", "set", " ", "if", " ", "require", "Null", " ", "is", " ", "set", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "PD", "UN", "ull", "able", "Field", "Encoder_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\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_", "encode_", "(_", "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 ", " _", "if_", "not_", "self_", "._", "nullable_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Field", " ", "is", " ", "not", " ", "null", "able", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "null", "Hex_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "\"", "No", " ", "value", " ", "for", " ", "null", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "binascii_", "._", "a2", "b", "\\u", "hex_", "(_", "self_", "._", "null", "Hex_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "require", "Null_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Field", " ", "must", " ", "be", " ", "null", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "encode_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "PD", "UN", "ull", "able", "Field", "Encoder_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bytes_", "=_", "self_", "._", "\\u", "read_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "decode", "Null_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "null", "Hex_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "\"", "No", " ", "value", " ", "for", " ", "null", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "null", "Hex_", "==_", "binascii_", "._", "b2", "a", "\\u", "hex_", "(_", "bytes_", ")_", ":_", "\\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_", "self_", "._", "require", "Null_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "PD", "UP", "arse", "Error_", "(_", "\"", "Field", " ", "must", " ", "be", " ", "null", "\"_", ",_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RUN", "KNOWN", "ERR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "decode_", "(_", "bytes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "PD", "UN", "ull", "able", "Field", "Encoder_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "encode_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Tak", "es", " ", "an", " ", "object", " ", "represent", "ing", " ", "the", " ", "type", " ", "and", " ", "return", "s", " ", "a", " ", "byte", " ", "string", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "PD", "UN", "ull", "able", "Field", "Encoder_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "read_", "(_", "self_", ",_", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Tak", "es", " ", "file", " ", "stream", " ", "in", " ", "and", " ", "return", "s", " ", "raw", " ", "bytes", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "PD", "UN", "ull", "able", "Field", "Encoder_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "decode_", "(_", "self_", ",_", "bytes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Tak", "es", " ", "bytes", " ", "in", " ", "and", " ", "return", "s", " ", "an", " ", "object", " ", "represent", "ing", " ", "the", " ", "type", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Integer", "Base", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "size_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "size", "Fmt", "Map_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "1_", ":_", "'!", "B", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "2_", ":_", "'!", "H", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "4_", ":_", "'!", "L", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "pylint", ":", " ", "disable", "-", "msg", "=", "E0", "213_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Verify", " ", "platform", " ", "size", "s", " ", "match", " ", "protocol_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert", "Fmt", "Sizes_", "(_", "size", "Fmt", "Map_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "Base", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "assert", "Fmt", "Sizes_", "(_", "size", "Fmt", "Map_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "(_", "size_", ",_", "fmt_", ")_", "in_", "size", "Fmt", "Map_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "struct_", "._", "calcsize_", "(_", "fmt_", ")_", "==_", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Integer", "Base", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\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 ", " _", "PD", "UN", "ull", "able", "Field", "Encoder_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "null", "Hex_", "=_", "'", "00", "'_", "*_", "self_", "._", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "max_", "=_", "2_", "**_", "(_", "8_", "*_", "self_", "._", "size_", ")_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "min_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "max", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "kwargs_", "[_", "'", "max", "'_", "]_", ">_", "self_", "._", "max_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Il", "lega", "l", " ", "value", " ", "for", " ", "max", " ", "%", "d", "\"_", "%_", "kwargs_", "[_", "'", "max", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "max_", "=_", "kwargs_", "[_", "'", "max", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "min", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "kwargs_", "[_", "'", "min", "'_", "]_", "<_", "self_", "._", "min_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Il", "lega", "l", " ", "value", " ", "for", " ", "min", " ", "%", "d", "\"_", "%_", "kwargs_", "[_", "'", "min", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "min_", "=_", "kwargs_", "[_", "'", "min", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "nullable_", "and_", "self_", "._", "min_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "decode", "Null_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Integer", "Base", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\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", "encode_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", ">_", "self_", "._", "max_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Value", " ", "%", "d", " ", "exceed", "s", " ", "max", " ", "%", "d", "\"_", "%_", "(_", "value_", ",_", "self_", "._", "max_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "value_", "<_", "self_", "._", "min_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Value", " ", "%", "d", " ", "is", " ", "less", " ", "than", " ", "min", " ", "%", "d", "\"_", "%_", "(_", "value_", ",_", "self_", "._", "min_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "struct_", "._", "pack_", "(_", "self_", "._", "size", "Fmt", "Map_", "[_", "self_", "._", "size_", "]_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Integer", "Base", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "read_", "(_", "self_", ",_", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "read_", "(_", "file_", ",_", "self_", "._", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Integer", "Base", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "decode_", "(_", "self_", ",_", "bytes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "struct_", "._", "unpack_", "(_", "self_", "._", "size", "Fmt", "Map_", "[_", "self_", "._", "size_", "]_", ",_", "bytes_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Int", "4", "Encoder_", "(_", "Integer", "Base", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "size_", "=_", "4_", "\\u\\u\\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_", "Int", "1E", "ncode", "r_", "(_", "Integer", "Base", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "size_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Int", "2E", "ncode", "r_", "(_", "Integer", "Base", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "size_", "=_", "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_", "class_", "Octet", "String", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nullable_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Octet", "String", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "size_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "PD", "UN", "ull", "able", "Field", "Encoder_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "size_", "=_", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Octet", "String", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "callable_", "(_", "self_", "._", "size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "size_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Octet", "String", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "encode_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "length_", "=_", "len_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "get", "Size_", "(_", ")_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "length_", "!=_", "self_", "._", "get", "Size_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Value", " ", "(%", "s", ")", " ", "size", " ", "%", "d", " ", "doe", "s", " ", "not", " ", "match", " ", "expected", " ", "%", "d", "\"_", "%_", "(_", "value_", ",_", "length_", ",_", "self_", "._", "get", "Size_", "(_", ")_", ")_", ")_", "\\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_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Octet", "String", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "read_", "(_", "self_", ",_", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "get", "Size_", "(_", ")_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Assert", "ion", "Error_", "(_", "\"", "Missing", " ", "size", " ", "to", " ", "decode", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "get", "Size_", "(_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "read_", "(_", "file_", ",_", "self_", "._", "get", "Size_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Octet", "String", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "decode_", "(_", "self_", ",_", "bytes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "CO", "cte", "t", "String", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "null", "Hex_", "=_", "'", "00", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decode", "Error", "Class_", "=_", "PD", "UP", "arse", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RUN", "KNOWN", "ERR_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "CO", "cte", "t", "String", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "max", "Size_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "PD", "UN", "ull", "able", "Field", "Encoder_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "max", "Size_", "is_", "not_", "None_", "and_", "max", "Size_", "<_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "max", "Size", " ", "must", " ", "be", " ", ">", " ", "0", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "max", "Size_", "=_", "max", "Size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "decode", "Error", "Class_", "=_", "kwargs_", "._", "get_", "(_", "'", "decode", "Error", "Class", "'_", ",_", "self_", "._", "decode", "Error", "Class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "decode", "Error", "Status_", "=_", "kwargs_", "._", "get_", "(_", "'", "decode", "Error", "Status", "'_", ",_", "self_", "._", "decode", "Error", "Status_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CO", "cte", "t", "String", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "encode_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ascii", "Val_", "=_", "value_", "._", "encode_", "(_", "'", "ascii", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "=_", "len_", "(_", "ascii", "Val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "max", "Size_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "length_", "+_", "1_", ">_", "self_", "._", "max", "Size_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "CO", "cte", "t", "String", " ", "is", " ", "long", "er", " ", "than", " ", "allow", "ed", " ", "maxim", "um", " ", "size", " ", "(%", "d", "):", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "max", "Size_", ",_", "ascii", "Val_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "encoded_", "=_", "struct_", "._", "pack_", "(_", "\"%", "ds", "\"_", "%_", "length_", ",_", "ascii", "Val_", ")_", "+_", "'\\\\", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "encoded_", ")_", "==_", "length_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "encoded_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CO", "cte", "t", "String", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "read_", "(_", "self_", ",_", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "self_", "._", "read_", "(_", "file_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "+=_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "c_", "==_", "'\\\\", "0", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CO", "cte", "t", "String", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "decode_", "(_", "self_", ",_", "bytes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "max", "Size_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "bytes_", ")_", ">_", "self_", "._", "max", "Size_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "Str_", "=_", "\"", "CO", "cte", "t", "String", " ", "is", " ", "long", "er", " ", "than", " ", "allow", "ed", " ", "maxim", "um", " ", "size", " ", "(%", "d", ")\"_", "%_", "(_", "self_", "._", "max", "Size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "self_", "._", "decode", "Error", "Class_", "(_", "err", "Str_", ",_", "self_", "._", "decode", "Error", "Status_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "bytes_", "[_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Integer", "Wrapper", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "Name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decode", "Error", "Class_", "=_", "PD", "UP", "arse", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RUN", "KNOWN", "ERR_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "Wrapper", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\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 ", " _", "PD", "UN", "ull", "able", "Field", "Encoder_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "null", "Hex_", "=_", "self_", "._", "encoder_", "._", "null", "Hex_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "field", "Name_", "=_", "kwargs_", "._", "get_", "(_", "'", "field", "Name", "'_", ",_", "self_", "._", "field", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "decode", "Error", "Class_", "=_", "kwargs_", "._", "get_", "(_", "'", "decode", "Error", "Class", "'_", ",_", "self_", "._", "decode", "Error", "Class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "decode", "Error", "Status_", "=_", "kwargs_", "._", "get_", "(_", "'", "decode", "Error", "Status", "'_", ",_", "self_", "._", "decode", "Error", "Status_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Integer", "Wrapper", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "encode_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "str_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "name_", "not_", "in_", "self_", "._", "name", "Map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Un", "know", "n", " ", "%", "s", " ", "name", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "field", "Name_", ",_", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "int", "Val_", "=_", "self_", "._", "name", "Map_", "[_", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "encoder_", "._", "encode_", "(_", "int", "Val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Integer", "Wrapper", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "read_", "(_", "self_", ",_", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "encoder_", "._", "\\u", "read_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Integer", "Wrapper", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "decode_", "(_", "self_", ",_", "bytes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "int", "Val_", "=_", "self_", "._", "encoder_", "._", "\\u", "decode_", "(_", "bytes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ja", "smi", "n", " ", "update", ":", " ", "bypass", " ", "vendor", " ", "specific", " ", "tags_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Vend", "or", " ", "specific", " ", "tag", " ", "is", " ", "not", " ", "support", "ed", " ", "by", " ", "Ja", "smi", "n", " ", "but", " ", "must", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "not", " ", "raise", " ", "an", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "field", "Name_", "==_", "'", "tag", "'_", "and_", "int", "Val_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ta", "g", " ", "in", " ", "range", ":", " ", "\"", "Reserve", "d", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "pdu", "Type_", "._", "vendor", "\\u", "specific", "\\u", "bypass", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "field", "Name_", "==_", "'", "tag", "'_", "and_", "int", "Val_", ">=_", "0x010", "0_", "and_", "int", "Val_", "<=_", "0x01", "FF_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ta", "g", " ", "in", " ", "range", ":", " ", "\"", "Reserve", "d", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "pdu", "Type_", "._", "vendor", "\\u", "specific", "\\u", "bypass", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "field", "Name_", "==_", "'", "tag", "'_", "and_", "int", "Val_", ">=_", "0x06", "00_", "and_", "int", "Val_", "<=_", "0x10", "FF_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ta", "g", " ", "in", " ", "range", ":", " ", "\"", "Reserve", "d", " ", "for", " ", "SM", "PP", " ", "Proto", "col", " ", "Ext", "ensi", "on", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "pdu", "Type_", "._", "vendor", "\\u", "specific", "\\u", "bypass", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "field", "Name_", "==_", "'", "tag", "'_", "and_", "int", "Val_", ">=_", "0x11", "00_", "and_", "int", "Val_", "<=_", "0x11", "FF_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ta", "g", " ", "in", " ", "range", ":", " ", "\"", "Reserve", "d", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "pdu", "Type_", "._", "vendor", "\\u", "specific", "\\u", "bypass", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "field", "Name_", "==_", "'", "tag", "'_", "and_", "int", "Val_", ">=_", "0x14", "00_", "and_", "int", "Val_", "<=_", "0x3", "FFF", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ta", "g", " ", "in", " ", "range", ":", " ", "\"", "Reserve", "d", " ", "for", " ", "SMS", "C", " ", "Vend", "or", " ", "specific", " ", "option", "al", " ", "parameter", "s", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "pdu", "Type_", "._", "vendor", "\\u", "specific", "\\u", "bypass", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "field", "Name_", "==_", "'", "tag", "'_", "and_", "int", "Val_", ">=_", "0x400", "0_", "and_", "int", "Val_", "<=_", "0xFFFF", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ta", "g", " ", "in", " ", "range", ":", " ", "\"", "Reserve", "d", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "pdu", "Type_", "._", "vendor", "\\u", "specific", "\\u", "bypass", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "int", "Val_", "not_", "in_", "self_", "._", "value", "Map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "Str_", "=_", "\"", "Un", "know", "n", " ", "%", "s", " ", "value", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "field", "Name_", ",_", "hex_", "(_", "int", "Val_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "self_", "._", "decode", "Error", "Class_", "(_", "err", "Str_", ",_", "self_", "._", "decode", "Error", "Status_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "name_", "=_", "self_", "._", "value", "Map_", "[_", "int", "Val_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "getattr_", "(_", "self_", "._", "pdu", "Type_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Command", "Id", "Encoder_", "(_", "Integer", "Wrapper", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "Name_", "=_", "'", "command", "\\u", "id", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "command", "\\u", "id", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "command", "\\u", "id", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "Int", "4", "Encoder_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Command", "Id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decode", "Error", "Class_", "=_", "PD", "UC", "orr", "upt", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VC", "MD", "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_", "class_", "Command", "Status", "Encoder_", "(_", "Int", "4", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nullable_", "=_", "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_", "[SEP]_", "class_", "Command", "Status", "Encoder_", "(_", "Int", "4", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "encode_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "str_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "name_", "not_", "in_", "constants_", "._", "command", "\\u", "status", "\\u", "name", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Un", "know", "n", " ", "command", "\\u", "status", " ", "name", " ", "%", "s", "\"_", "%_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "intv", "al_", "=_", "constants_", "._", "command", "\\u", "status", "\\u", "name", "\\u", "map_", "[_", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Int", "4", "Encoder_", "(_", ")_", "._", "encode_", "(_", "intv", "al_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Status", "Encoder_", "(_", "Int", "4", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "decode_", "(_", "self_", ",_", "bytes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "intv", "al_", "=_", "Int", "4", "Encoder_", "(_", ")_", "._", "\\u", "decode_", "(_", "bytes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "intv", "al_", "not_", "in_", "constants_", "._", "command", "\\u", "status", "\\u", "value", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ja", "smi", "n", " ", "update", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "as", " ", "of", " ", "Table", " ", "5", "-", "2", ":", " ", "SM", "PP", " ", "Error", " ", "Codes_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "256", " ", " ", "..", " ", "1023", ")", " ", " ", " ", "0x00000", "100", " ", "..", " ", "0x00000", "3", "FF", " ", "=", " ", "Reserve", "d", " ", "for", " ", "SM", "PP", " ", "extension_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "1024", " ", "..", " ", "127", "9", ")", " ", " ", " ", "0x00000", "400", " ", "..", " ", "0x00000", "4", "FF", " ", "=", " ", "Reserve", "d", " ", "for", " ", "SMS", "C", " ", "vendor", " ", "specific", " ", "errors_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "1280", " ", "...)", " ", " ", " ", "0x00000", "500", " ", "...", " ", " ", " ", "=", " ", "Reserve", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "In", " ", "order", " ", "to", " ", "avoid", " ", "rais", "ing", " ", "a", " ", "PD", "UP", "arse", "Error", " ", "on", " ", "one", " ", "of", " ", "these", " ", "reserve", "d", " ", "error", " ", "codes", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "jas", "min", " ", "will", " ", "return", " ", "a", " ", "genera", "l", " ", "status", " ", "indicati", "ng", " ", "a", " ", "reserve", "d", " ", "field_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "256_", "<=_", "intv", "al_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "256_", "<=_", "intv", "al_", "<=_", "1023", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "name_", "=_", "constants_", "._", "command", "\\u", "status", "\\u", "value", "\\u", "map_", "[_", "-_", "1_", "]_", "[_", "'", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "1024_", "<=_", "intv", "al_", "<=_", "127", "9_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "name_", "=_", "constants_", "._", "command", "\\u", "status", "\\u", "value", "\\u", "map_", "[_", "-_", "2_", "]_", "[_", "'", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "1280_", "<=_", "intv", "al_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "name_", "=_", "constants_", "._", "command", "\\u", "status", "\\u", "value", "\\u", "map_", "[_", "-_", "3_", "]_", "[_", "'", "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 ", " _", "raise_", "PD", "UP", "arse", "Error_", "(_", "\"", "Un", "know", "n", " ", "command", "\\u", "status", " ", "%", "s", "\"_", "%_", "intv", "al_", ",_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RUN", "KNOWN", "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 ", " _", "name_", "=_", "constants_", "._", "command", "\\u", "status", "\\u", "value", "\\u", "map_", "[_", "intv", "al_", "]_", "[_", "'", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "getattr_", "(_", "pdu", "\\u", "types_", "._", "Command", "Status_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Ta", "g", "Encoder_", "(_", "Integer", "Wrapper", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "Name_", "=_", "'", "tag", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "tag", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "tag", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "Int", "2E", "ncode", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Tag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VO", "PT", "PAR", "STREAM_", "\\u\\u\\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_", "Es", "m", "Class", "Encoder_", "(_", "Int", "1E", "ncode", "r_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mode", "Mask_", "=_", "0x03_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "type", "Mask_", "=_", "0x3", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gsm", "Feature", "s", "Mask_", "=_", "0xc0", "_", "\\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_", "Es", "m", "Class", "Encoder_", "(_", "Int", "1E", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "encode_", "(_", "self_", ",_", "es", "m", "Class_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mode", "Name_", "=_", "str_", "(_", "es", "m", "Class_", "._", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "type", "Name_", "=_", "str_", "(_", "es", "m", "Class_", "._", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gsm", "Feature", "Names_", "=_", "[_", "str_", "(_", "f_", ")_", "for_", "f_", "in_", "es", "m", "Class_", "._", "gsm", "Features_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "mode", "Name_", "not_", "in_", "constants_", "._", "es", "m", "\\u", "class", "\\u", "mode", "\\u", "name", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Un", "know", "n", " ", "es", "m", "\\u", "class", " ", "mode", " ", "name", " ", "%", "s", "\"_", "%_", "mode", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type", "Name_", "not_", "in_", "constants_", "._", "es", "m", "\\u", "class", "\\u", "type", "\\u", "name", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Un", "know", "n", " ", "es", "m", "\\u", "class", " ", "type", " ", "name", " ", "%", "s", "\"_", "%_", "type", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "feature", "Name_", "in_", "gsm", "Feature", "Names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "feature", "Name_", "not_", "in_", "constants_", "._", "es", "m", "\\u", "class", "\\u", "gsm", "\\u", "features", "\\u", "name", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Un", "know", "n", " ", "es", "m", "\\u", "class", " ", "GS", "M", " ", "feature", " ", "name", " ", "%", "s", "\"_", "%_", "feature", "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_", "mode", "Val_", "=_", "constants_", "._", "es", "m", "\\u", "class", "\\u", "mode", "\\u", "name", "\\u", "map_", "[_", "mode", "Name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "type", "Val_", "=_", "constants_", "._", "es", "m", "\\u", "class", "\\u", "type", "\\u", "name", "\\u", "map_", "[_", "type", "Name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gsm", "Feature", "Vals_", "=_", "[_", "constants_", "._", "es", "m", "\\u", "class", "\\u", "gsm", "\\u", "features", "\\u", "name", "\\u", "map_", "[_", "f", "Name_", "]_", "for_", "f", "Name_", "in_", "gsm", "Feature", "Names_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "int", "Val_", "=_", "mode", "Val_", "|_", "type", "Val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "f", "Val_", "in_", "gsm", "Feature", "Vals_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "int", "Val_", "|=_", "f", "Val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Int", "1E", "ncode", "r_", "(_", ")_", "._", "encode_", "(_", "int", "Val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Es", "m", "Class", "Encoder_", "(_", "Int", "1E", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "decode_", "(_", "self_", ",_", "bytes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "int", "Val_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "._", "\\u", "decode_", "(_", "bytes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mode", "Val_", "=_", "int", "Val_", "&_", "self_", "._", "mode", "Mask_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "type", "Val_", "=_", "int", "Val_", "&_", "self_", "._", "type", "Mask_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gsm", "Feature", "s", "Val_", "=_", "int", "Val_", "&_", "self_", "._", "gsm", "Feature", "s", "Mask_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "mode", "Val_", "not_", "in_", "constants_", "._", "es", "m", "\\u", "class", "\\u", "mode", "\\u", "value", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "PD", "UP", "arse", "Error_", "(_", "\"", "Un", "know", "n", " ", "es", "m", "\\u", "class", " ", "mode", " ", "%", "s", "\"_", "%_", "mode", "Val_", ",_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VE", "SM", "CLASS_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type", "Val_", "not_", "in_", "constants_", "._", "es", "m", "\\u", "class", "\\u", "type", "\\u", "value", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "PD", "UP", "arse", "Error_", "(_", "\"", "Un", "know", "n", " ", "es", "m", "\\u", "class", " ", "type", " ", "%", "s", "\"_", "%_", "type", "Val_", ",_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VE", "SM", "CLASS_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mode", "Name_", "=_", "constants_", "._", "es", "m", "\\u", "class", "\\u", "mode", "\\u", "value", "\\u", "map_", "[_", "mode", "Val_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "type", "Name_", "=_", "constants_", "._", "es", "m", "\\u", "class", "\\u", "type", "\\u", "value", "\\u", "map_", "[_", "type", "Val_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gsm", "Feature", "Names_", "=_", "[_", "constants_", "._", "es", "m", "\\u", "class", "\\u", "gsm", "\\u", "features", "\\u", "value", "\\u", "map_", "[_", "f", "Val_", "]_", "for_", "f", "Val_", "in_", "constants_", "._", "es", "m", "\\u", "class", "\\u", "gsm", "\\u", "features", "\\u", "value", "\\u", "map_", "._", "keys_", "(_", ")_", "if_", "f", "Val_", "&_", "gsm", "Feature", "s", "Val_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "getattr_", "(_", "pdu", "\\u", "types_", "._", "Es", "m", "Class", "Mode_", ",_", "mode", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "type_", "=_", "getattr_", "(_", "pdu", "\\u", "types_", "._", "Es", "m", "Class", "Type_", ",_", "type", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gsm", "Features_", "=_", "[_", "getattr_", "(_", "pdu", "\\u", "types_", "._", "Es", "m", "Class", "Gs", "m", "Features_", ",_", "f", "Name_", ")_", "for_", "f", "Name_", "in_", "gsm", "Feature", "Names_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "pdu", "\\u", "types_", "._", "Es", "m", "Class_", "(_", "mode_", ",_", "type_", ",_", "gsm", "Features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Register", "ed", "Deliver", "y", "Encoder_", "(_", "Int", "1E", "ncode", "r_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "receipt", "Mask_", "=_", "0x03_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sme", "Origina", "ted", "Ack", "s", "Mask_", "=_", "0x0", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "intermediate", "Notifi", "cation", "Mask_", "=_", "0x10_", "\\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_", "Register", "ed", "Deliver", "y", "Encoder_", "(_", "Int", "1E", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "encode_", "(_", "self_", ",_", "register", "ed", "Deliver", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "receipt", "Name_", "=_", "str_", "(_", "register", "ed", "Deliver", "y_", "._", "receipt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sme", "Origina", "ted", "Ack", "Names_", "=_", "[_", "str_", "(_", "a_", ")_", "for_", "a_", "in_", "register", "ed", "Deliver", "y_", "._", "sme", "Origina", "ted", "Ack", "s_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "receipt", "Name_", "not_", "in_", "constants_", "._", "register", "ed", "\\u", "delivery", "\\u", "receipt", "\\u", "name", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Un", "know", "n", " ", "register", "ed", "\\u", "delivery", " ", "receipt", " ", "name", " ", "%", "s", "\"_", "%_", "receipt", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "ack", "Name_", "in_", "sme", "Origina", "ted", "Ack", "Names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ack", "Name_", "not_", "in_", "constants_", "._", "register", "ed", "\\u", "delivery", "\\u", "sme", "\\u", "originat", "ed", "\\u", "ack", "s", "\\u", "name", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Un", "know", "n", " ", "register", "ed", "\\u", "delivery", " ", "SM", "E", " ", "org", "inat", "ed", " ", "ack", " ", "name", " ", "%", "s", "\"_", "%_", "ack", "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_", "receipt", "Val_", "=_", "constants_", "._", "register", "ed", "\\u", "delivery", "\\u", "receipt", "\\u", "name", "\\u", "map_", "[_", "receipt", "Name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sme", "Origina", "ted", "Ack", "Vals_", "=_", "[_", "constants_", "._", "register", "ed", "\\u", "delivery", "\\u", "sme", "\\u", "originat", "ed", "\\u", "ack", "s", "\\u", "name", "\\u", "map_", "[_", "ack", "Name_", "]_", "for_", "ack", "Name_", "in_", "sme", "Origina", "ted", "Ack", "Names_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "intermediate", "Notifi", "cation", "Val_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "register", "ed", "Deliver", "y_", "._", "intermediate", "Notification_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "intermediate", "Notifi", "cation", "Val_", "=_", "self_", "._", "intermediate", "Notifi", "cation", "Mask_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "int", "Val_", "=_", "receipt", "Val_", "|_", "intermediate", "Notifi", "cation", "Val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "a", "Val_", "in_", "sme", "Origina", "ted", "Ack", "Vals_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "int", "Val_", "|=_", "a", "Val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Int", "1E", "ncode", "r_", "(_", ")_", "._", "encode_", "(_", "int", "Val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Register", "ed", "Deliver", "y", "Encoder_", "(_", "Int", "1E", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "decode_", "(_", "self_", ",_", "bytes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "int", "Val_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "._", "\\u", "decode_", "(_", "bytes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "receipt", "Val_", "=_", "int", "Val_", "&_", "self_", "._", "receipt", "Mask_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sme", "Origina", "ted", "Ack", "s", "Val_", "=_", "int", "Val_", "&_", "self_", "._", "sme", "Origina", "ted", "Ack", "s", "Mask_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "intermediate", "Notifi", "cation", "Val_", "=_", "int", "Val_", "&_", "self_", "._", "intermediate", "Notifi", "cation", "Mask_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "receipt", "Val_", "not_", "in_", "constants_", "._", "register", "ed", "\\u", "delivery", "\\u", "receipt", "\\u", "value", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "PD", "UP", "arse", "Error_", "(_", "\"", "Un", "know", "n", " ", "register", "ed", "\\u", "delivery", " ", "receipt", " ", "%", "s", "\"_", "%_", "receipt", "Val_", ",_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VR", "EG", "DL", "VF", "LG", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "receipt", "Name_", "=_", "constants_", "._", "register", "ed", "\\u", "delivery", "\\u", "receipt", "\\u", "value", "\\u", "map_", "[_", "receipt", "Val_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sme", "Origina", "ted", "Ack", "Names_", "=_", "[_", "constants_", "._", "register", "ed", "\\u", "delivery", "\\u", "sme", "\\u", "originat", "ed", "\\u", "ack", "s", "\\u", "value", "\\u", "map_", "[_", "a", "Val_", "]_", "for_", "a", "Val_", "in_", "constants_", "._", "register", "ed", "\\u", "delivery", "\\u", "sme", "\\u", "originat", "ed", "\\u", "ack", "s", "\\u", "value", "\\u", "map_", "._", "keys_", "(_", ")_", "if_", "a", "Val_", "&_", "sme", "Origina", "ted", "Ack", "s", "Val_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "receipt_", "=_", "getattr_", "(_", "pdu", "\\u", "types_", "._", "Register", "ed", "Deliver", "y", "Recei", "pt_", ",_", "receipt", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sme", "Origina", "ted", "Ack", "s_", "=_", "[_", "getattr_", "(_", "pdu", "\\u", "types_", "._", "Register", "ed", "Deliver", "y", "Sm", "e", "Origina", "ted", "Ack", "s_", ",_", "a", "Name_", ")_", "for_", "a", "Name_", "in_", "sme", "Origina", "ted", "Ack", "Names_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "intermediate", "Notification_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "intermediate", "Notifi", "cation", "Val_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "intermediate", "Notification_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "pdu", "\\u", "types_", "._", "Register", "ed", "Deliver", "y_", "(_", "receipt_", ",_", "sme", "Origina", "ted", "Ack", "s_", ",_", "intermediate", "Notification_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Data", "Codi", "ng", "Encoder_", "(_", "Int", "1E", "ncode", "r_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sche", "me", "Mask_", "=_", "0xf0", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sche", "me", "Data", "Mask_", "=_", "0x0f", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gsm", "Msg", "Codi", "ng", "Mask_", "=_", "0x04_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gsm", "Msg", "Class", "Mask_", "=_", "0x03_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "Codi", "ng", "Encoder_", "(_", "Int", "1E", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "encode_", "(_", "self_", ",_", "data", "Codi", "ng_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Int", "1E", "ncode", "r_", "(_", ")_", "._", "encode_", "(_", "self_", "._", "\\u", "encode", "As", "Int_", "(_", "data", "Codi", "ng_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Data", "Codi", "ng", "Encoder_", "(_", "Int", "1E", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "encode", "As", "Int_", "(_", "self_", ",_", "data", "Codi", "ng_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ja", "smi", "n", " ", "update", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Compari", "ng", " ", "data", "Codi", "ng", ".", "sche", "me", " ", "to", " ", "pdu", "\\u", "types", ".", "Data", "Codi", "ng", "Sche", "me", ".", "RA", "W", " ", "wou", "ld", " ", "result_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "Fal", "se", " ", "even", " ", "if", " ", "the", " ", "values", " ", "are", " ", "the", " ", "same", ",", " ", "this", " ", "is", " ", "bec", "aus", "e", " ", "Enum", " ", "object", " ", "have_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "no", " ", "right", " ", "\\u\\u", "eq", "\\u\\u", " ", "to", " ", "compare", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", ":", " ", "compare", " ", "Enum", " ", "indexe", "s", " ", "(.", "index", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "data", "Codi", "ng_", "._", "scheme_", "._", "index_", "==_", "pdu", "\\u", "types_", "._", "Data", "Codi", "ng", "Scheme_", "._", "RAW_", "._", "index_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "data", "Codi", "ng_", "._", "sche", "me", "Data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "data", "Codi", "ng_", "._", "scheme_", "._", "index_", "==_", "pdu", "\\u", "types_", "._", "Data", "Codi", "ng", "Scheme_", "._", "DEFAULT_", "._", "index_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "encode", "Default", "Sche", "me", "As", "Int_", "(_", "data", "Codi", "ng_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "encode", "Sche", "me", "As", "Int_", "(_", "data", "Codi", "ng_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Data", "Codi", "ng", "Encoder_", "(_", "Int", "1E", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "encode", "Default", "Sche", "me", "As", "Int_", "(_", "self_", ",_", "data", "Codi", "ng_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "default", "Name_", "=_", "str_", "(_", "data", "Codi", "ng_", "._", "sche", "me", "Data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "default", "Name_", "not_", "in_", "constants_", "._", "data\\u", "codi", "ng", "\\u", "default", "\\u", "name", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Un", "know", "n", " ", "data\\u", "codi", "ng", " ", "default", " ", "name", " ", "%", "s", "\"_", "%_", "default", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "constants_", "._", "data\\u", "codi", "ng", "\\u", "default", "\\u", "name", "\\u", "map_", "[_", "default", "Name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Data", "Codi", "ng", "Encoder_", "(_", "Int", "1E", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "encode", "Sche", "me", "As", "Int_", "(_", "self_", ",_", "data", "Codi", "ng_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sche", "me", "Val_", "=_", "self_", "._", "\\u", "encode", "Sche", "me", "Name", "As", "Int_", "(_", "data", "Codi", "ng_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sche", "me", "Data", "Val_", "=_", "self_", "._", "\\u", "encode", "Sche", "me", "Data", "As", "Int_", "(_", "data", "Codi", "ng_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "sche", "me", "Val_", "|_", "sche", "me", "Data", "Val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Data", "Codi", "ng", "Encoder_", "(_", "Int", "1E", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "encode", "Sche", "me", "Name", "As", "Int_", "(_", "self_", ",_", "data", "Codi", "ng_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sche", "me", "Name_", "=_", "str_", "(_", "data", "Codi", "ng_", "._", "scheme_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sche", "me", "Name_", "not_", "in_", "constants_", "._", "data\\u", "codi", "ng", "\\u", "sche", "me", "\\u", "name", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Un", "know", "n", " ", "data\\u", "codi", "ng", " ", "sche", "me", " ", "name", " ", "%", "s", "\"_", "%_", "sche", "me", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "constants_", "._", "data\\u", "codi", "ng", "\\u", "sche", "me", "\\u", "name", "\\u", "map_", "[_", "sche", "me", "Name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Data", "Codi", "ng", "Encoder_", "(_", "Int", "1E", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "encode", "Sche", "me", "Data", "As", "Int_", "(_", "self_", ",_", "data", "Codi", "ng_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ja", "smi", "n", " ", "update", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Rela", "ted", " ", "to", " ", "#", "182_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Whe", "n", " ", "pdu", " ", "is", " ", "unpickle", "d", " ", "(", "from", " ", "smp", "ps", " ", "or", " ", "http", " ", "api", "),", " ", "the", " ", "compa", "ris", "on", " ", "belo", "w", " ", "will", " ", "alw", "ays_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "be", " ", "Fal", "se", " ", "sinc", "e", " ", "memory", " ", "addresse", "s", " ", "of", " ", "bot", "h", " ", "object", "s", " ", "are", " ", "different", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ing", " ", "str", "()", " ", "will", " ", "get", " ", "the", " ", "compa", "ris", "on", " ", "on", " ", "the", " ", "'", "GS", "M", "\\u", "MESSAGE", "\\u", "CLASS", "'", " ", "string", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "str_", "(_", "data", "Codi", "ng_", "._", "scheme_", ")_", "==_", "str_", "(_", "pdu", "\\u", "types_", "._", "Data", "Codi", "ng", "Scheme_", "._", "GS", "M", "\\u", "MESSAGE", "\\u", "CLASS_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "encode", "Gs", "m", "Msg", "Sche", "me", "Data", "As", "Int_", "(_", "data", "Codi", "ng_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ja", "smi", "n", " ", "update", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "As", " ", "reporte", "d", " ", "in", " ", "https", "://", "git", "hub", ".", "com", "/", "moz", "es", "/", "smp", "p", ".", "pdu", "/", "issue", "s", "/", "12_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "raise", " ", "Value", "Error", "(\"", "Un", "know", "n", " ", "data", " ", "codi", "ng", " ", "sche", "me", " ", "%", "s", "\"", " ", "%", " ", "data", "Codi", "ng", ".", "sche", "me", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", " ", " ", "~~~~~~~~~~~", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "\"", "Un", "know", "n", " ", "data", " ", "codi", "ng", " ", "sche", "me", " ", "%", "s", "\"_", "%_", "data", "Codi", "ng_", "._", "scheme_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Data", "Codi", "ng", "Encoder_", "(_", "Int", "1E", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "encode", "Gs", "m", "Msg", "Sche", "me", "Data", "As", "Int_", "(_", "self_", ",_", "data", "Codi", "ng_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg", "Codi", "ng", "Name_", "=_", "str_", "(_", "data", "Codi", "ng_", "._", "sche", "me", "Data_", "._", "msg", "Codi", "ng_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg", "Class", "Name_", "=_", "str_", "(_", "data", "Codi", "ng_", "._", "sche", "me", "Data_", "._", "msg", "Class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "msg", "Codi", "ng", "Name_", "not_", "in_", "constants_", "._", "data\\u", "codi", "ng", "\\u", "gsm", "\\u", "message", "\\u", "codi", "ng", "\\u", "name", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Un", "know", "n", " ", "data\\u", "codi", "ng", " ", "gsm", " ", "msg", " ", "codi", "ng", " ", "name", " ", "%", "s", "\"_", "%_", "msg", "Codi", "ng", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "msg", "Class", "Name_", "not_", "in_", "constants_", "._", "data\\u", "codi", "ng", "\\u", "gsm", "\\u", "message", "\\u", "class", "\\u", "name", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Un", "know", "n", " ", "data\\u", "codi", "ng", " ", "gsm", " ", "msg", " ", "class", " ", "name", " ", "%", "s", "\"_", "%_", "msg", "Class", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg", "Codi", "ng", "Val_", "=_", "constants_", "._", "data\\u", "codi", "ng", "\\u", "gsm", "\\u", "message", "\\u", "codi", "ng", "\\u", "name", "\\u", "map_", "[_", "msg", "Codi", "ng", "Name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg", "Class", "Val_", "=_", "constants_", "._", "data\\u", "codi", "ng", "\\u", "gsm", "\\u", "message", "\\u", "class", "\\u", "name", "\\u", "map_", "[_", "msg", "Class", "Name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "msg", "Codi", "ng", "Val_", "|_", "msg", "Class", "Val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Data", "Codi", "ng", "Encoder_", "(_", "Int", "1E", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "decode_", "(_", "self_", ",_", "bytes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "int", "Val_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "._", "\\u", "decode_", "(_", "bytes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scheme_", "=_", "self_", "._", "\\u", "decode", "Scheme_", "(_", "int", "Val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sche", "me", "Data_", "=_", "self_", "._", "\\u", "decode", "Sche", "me", "Data_", "(_", "scheme_", ",_", "int", "Val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "pdu", "\\u", "types_", "._", "Data", "Codi", "ng_", "(_", "scheme_", ",_", "sche", "me", "Data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Data", "Codi", "ng", "Encoder_", "(_", "Int", "1E", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "decode", "Scheme_", "(_", "self_", ",_", "int", "Val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sche", "me", "Val_", "=_", "int", "Val_", "&_", "self_", "._", "sche", "me", "Mask_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sche", "me", "Val_", "in_", "constants_", "._", "data\\u", "codi", "ng", "\\u", "sche", "me", "\\u", "value", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sche", "me", "Name_", "=_", "constants_", "._", "data\\u", "codi", "ng", "\\u", "sche", "me", "\\u", "value", "\\u", "map_", "[_", "sche", "me", "Val_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "getattr_", "(_", "pdu", "\\u", "types_", "._", "Data", "Codi", "ng", "Scheme_", ",_", "sche", "me", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "int", "Val_", "in_", "constants_", "._", "data\\u", "codi", "ng", "\\u", "default", "\\u", "value", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "pdu", "\\u", "types_", "._", "Data", "Codi", "ng", "Scheme_", "._", "DEFAULT_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "pdu", "\\u", "types_", "._", "Data", "Codi", "ng", "Scheme_", "._", "RAW_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Data", "Codi", "ng", "Encoder_", "(_", "Int", "1E", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "decode", "Sche", "me", "Data_", "(_", "self_", ",_", "scheme_", ",_", "int", "Val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "scheme_", "==_", "pdu", "\\u", "types_", "._", "Data", "Codi", "ng", "Scheme_", "._", "RAW_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "int", "Val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "scheme_", "==_", "pdu", "\\u", "types_", "._", "Data", "Codi", "ng", "Scheme_", "._", "DEFAULT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "decode", "Default", "Sche", "me", "Data_", "(_", "int", "Val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "scheme_", "==_", "pdu", "\\u", "types_", "._", "Data", "Codi", "ng", "Scheme_", "._", "GS", "M", "\\u", "MESSAGE", "\\u", "CLASS_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sche", "me", "Data", "Val_", "=_", "int", "Val_", "&_", "self_", "._", "sche", "me", "Data", "Mask_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "decode", "Gs", "m", "Msg", "Sche", "me", "Data_", "(_", "sche", "me", "Data", "Val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "\"", "Une", "xpe", "cte", "d", " ", "data", " ", "codi", "ng", " ", "sche", "me", " ", "%", "s", "\"_", "%_", "scheme_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Data", "Codi", "ng", "Encoder_", "(_", "Int", "1E", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "decode", "Default", "Sche", "me", "Data_", "(_", "self_", ",_", "int", "Val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "int", "Val_", "not_", "in_", "constants_", "._", "data\\u", "codi", "ng", "\\u", "default", "\\u", "value", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Un", "know", "n", " ", "data\\u", "codi", "ng", " ", "default", " ", "value", " ", "%", "s", "\"_", "%_", "int", "Val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "default", "Name_", "=_", "constants_", "._", "data\\u", "codi", "ng", "\\u", "default", "\\u", "value", "\\u", "map_", "[_", "int", "Val_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "getattr_", "(_", "pdu", "\\u", "types_", "._", "Data", "Codi", "ng", "Default_", ",_", "default", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Data", "Codi", "ng", "Encoder_", "(_", "Int", "1E", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "decode", "Gs", "m", "Msg", "Sche", "me", "Data_", "(_", "self_", ",_", "sche", "me", "Data", "Val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg", "Codi", "ng", "Val_", "=_", "sche", "me", "Data", "Val_", "&_", "self_", "._", "gsm", "Msg", "Codi", "ng", "Mask_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg", "Class", "Val_", "=_", "sche", "me", "Data", "Val_", "&_", "self_", "._", "gsm", "Msg", "Class", "Mask_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "msg", "Codi", "ng", "Val_", "not_", "in_", "constants_", "._", "data\\u", "codi", "ng", "\\u", "gsm", "\\u", "message", "\\u", "codi", "ng", "\\u", "value", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Un", "know", "n", " ", "data\\u", "codi", "ng", " ", "gsm", " ", "msg", " ", "codi", "ng", " ", "value", " ", "%", "s", "\"_", "%_", "msg", "Codi", "ng", "Val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "msg", "Class", "Val_", "not_", "in_", "constants_", "._", "data\\u", "codi", "ng", "\\u", "gsm", "\\u", "message", "\\u", "class", "\\u", "value", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Un", "know", "n", " ", "data\\u", "codi", "ng", " ", "gsm", " ", "msg", " ", "class", " ", "value", " ", "%", "s", "\"_", "%_", "msg", "Class", "Val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg", "Codi", "ng", "Name_", "=_", "constants_", "._", "data\\u", "codi", "ng", "\\u", "gsm", "\\u", "message", "\\u", "codi", "ng", "\\u", "value", "\\u", "map_", "[_", "msg", "Codi", "ng", "Val_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg", "Class", "Name_", "=_", "constants_", "._", "data\\u", "codi", "ng", "\\u", "gsm", "\\u", "message", "\\u", "class", "\\u", "value", "\\u", "map_", "[_", "msg", "Class", "Val_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "msg", "Codi", "ng_", "=_", "getattr_", "(_", "pdu", "\\u", "types_", "._", "Data", "Codi", "ng", "Gs", "m", "Msg", "Codi", "ng_", ",_", "msg", "Codi", "ng", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg", "Class_", "=_", "getattr_", "(_", "pdu", "\\u", "types_", "._", "Data", "Codi", "ng", "Gs", "m", "Msg", "Class_", ",_", "msg", "Class", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "pdu", "\\u", "types_", "._", "Data", "Codi", "ng", "Gs", "m", "Msg_", "(_", "msg", "Codi", "ng_", ",_", "msg", "Class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Add", "r", "Ton", "Encoder_", "(_", "Integer", "Wrapper", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "Name_", "=_", "'", "addr", "\\u", "ton", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "addr", "\\u", "ton", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "addr", "\\u", "ton", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Add", "r", "Ton", "_", "\\u\\u\\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_", "Add", "r", "Np", "i", "Encoder_", "(_", "Integer", "Wrapper", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "Name_", "=_", "'", "addr", "\\u", "npi", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "addr", "\\u", "npi", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "addr", "\\u", "npi", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Add", "r", "Np", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Prior", "it", "y", "Fla", "g", "Encoder_", "(_", "Integer", "Wrapper", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "Name_", "=_", "'", "priorit", "y", "\\u", "flag", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "priorit", "y", "\\u", "flag", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "priorit", "y", "\\u", "flag", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Prior", "it", "y", "Flag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VP", "RT", "FL", "G_", "\\u\\u\\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_", "Replace", "If", "Present", "Fla", "g", "Encoder_", "(_", "Integer", "Wrapper", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "Name_", "=_", "'", "replace", "\\u", "if", "\\u", "presen", "t", "\\u", "flag", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "replace", "\\u", "if", "\\u", "presen", "t", "\\u", "fla", "p", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "replace", "\\u", "if", "\\u", "presen", "t", "\\u", "fla", "p", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Replace", "If", "Present", "Flag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Dest", "Fla", "g", "Encoder_", "(_", "Integer", "Wrapper", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nullable_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "field", "Name_", "=_", "'", "dest", "\\u", "flag", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "dest", "\\u", "flag", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "dest", "\\u", "flag", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Dest", "Flag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Messag", "e", "State", "Encoder_", "(_", "Integer", "Wrapper", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nullable_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "field", "Name_", "=_", "'", "message", "\\u", "state", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "message", "\\u", "state", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "message", "\\u", "state", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Messag", "e", "State_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Call", "back", "Num", "Digit", "Mode", "Indicat", "or", "Encoder_", "(_", "Integer", "Wrapper", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nullable_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "field", "Name_", "=_", "'", "callback", "\\u", "num", "\\u", "digit", "\\u", "mode", "\\u", "indicat", "or", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "callback", "\\u", "num", "\\u", "digit", "\\u", "mode", "\\u", "indicat", "or", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "callback", "\\u", "num", "\\u", "digit", "\\u", "mode", "\\u", "indicat", "or", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Call", "back", "Num", "Digit", "Mode", "Indicator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VO", "PT", "PARAM", "VAL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Call", "back", "Num", "Encoder_", "(_", "Octet", "String", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "digit", "Mode", "Indicat", "or", "Encoder_", "=_", "Call", "back", "Num", "Digit", "Mode", "Indicat", "or", "Encoder_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ton", "Encoder_", "=_", "Add", "r", "Ton", "Encoder_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "npi", "Encoder_", "=_", "Add", "r", "Np", "i", "Encoder_", "(_", ")_", "\\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_", "Call", "back", "Num", "Encoder_", "(_", "Octet", "String", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "encode_", "(_", "self_", ",_", "callback", "Num_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "encoded_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoded_", "+=_", "self_", "._", "digit", "Mode", "Indicat", "or", "Encoder_", "._", "\\u", "encode_", "(_", "callback", "Num_", "._", "digit", "Mode", "Indicator_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoded_", "+=_", "self_", "._", "ton", "Encoder_", "._", "\\u", "encode_", "(_", "callback", "Num_", "._", "ton_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoded_", "+=_", "self_", "._", "npi", "Encoder_", "._", "\\u", "encode_", "(_", "callback", "Num_", "._", "npi", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoded_", "+=_", "callback", "Num_", "._", "digits_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "encoded_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Call", "back", "Num", "Encoder_", "(_", "Octet", "String", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "decode_", "(_", "self_", ",_", "bytes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "bytes_", ")_", "<_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "PD", "UP", "arse", "Error_", "(_", "\"", "Inva", "lid", " ", "callback", "\\u", "num", " ", "size", " ", "%", "s", "\"_", "%_", "len_", "(_", "bytes_", ")_", ",_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VO", "PT", "PARAM", "VAL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "digit", "Mode", "Indicator_", "=_", "self_", "._", "digit", "Mode", "Indicat", "or", "Encoder_", "._", "\\u", "decode_", "(_", "bytes_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ton_", "=_", "self_", "._", "ton", "Encoder_", "._", "\\u", "decode_", "(_", "bytes_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "npi", "_", "=_", "self_", "._", "npi", "Encoder_", "._", "\\u", "decode_", "(_", "bytes_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "digits_", "=_", "bytes_", "[_", "3_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "pdu", "\\u", "types_", "._", "Call", "back", "Num_", "(_", "digit", "Mode", "Indicator_", ",_", "ton_", ",_", "npi", "_", ",_", "digits_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Sub", "address", "Type", "Ta", "g", "Encoder_", "(_", "Integer", "Wrapper", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nullable_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "field", "Name_", "=_", "'", "suba", "ddress", "\\u", "type", "\\u", "tag", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "suba", "ddress", "\\u", "type", "\\u", "tag", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "suba", "ddress", "\\u", "type", "\\u", "tag", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Sub", "address", "Type", "Tag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VO", "PT", "PARAM", "VAL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Sub", "address", "Encoder_", "(_", "Octet", "String", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "type", "Ta", "g", "Encoder_", "=_", "Sub", "address", "Type", "Ta", "g", "Encoder_", "(_", ")_", "\\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_", "Sub", "address", "Encoder_", "(_", "Octet", "String", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "encode_", "(_", "self_", ",_", "suba", "ddress", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "encoded_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoded_", "+=_", "self_", "._", "type", "Ta", "g", "Encoder_", "._", "\\u", "encode_", "(_", "suba", "ddress", "_", "._", "type", "Tag_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "val", "Size_", "=_", "self_", "._", "get", "Size_", "(_", ")_", "-_", "1_", "if_", "self_", "._", "get", "Size_", "(_", ")_", "is_", "not_", "None_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoded_", "+=_", "Octet", "String", "Encoder_", "(_", "val", "Size_", ")_", "._", "\\u", "encode_", "(_", "suba", "ddress", "_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "encoded_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sub", "address", "Encoder_", "(_", "Octet", "String", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "decode_", "(_", "self_", ",_", "bytes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "bytes_", ")_", "<_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "PD", "UP", "arse", "Error_", "(_", "\"", "Inva", "lid", " ", "suba", "ddress", " ", "size", " ", "%", "s", "\"_", "%_", "len_", "(_", "bytes_", ")_", ",_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VO", "PT", "PARAM", "VAL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "type", "Tag_", "=_", "self_", "._", "type", "Ta", "g", "Encoder_", "._", "\\u", "decode_", "(_", "bytes_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "Octet", "String", "Encoder_", "(_", "self_", "._", "get", "Size_", "(_", ")_", "-_", "1_", ")_", "._", "\\u", "decode_", "(_", "bytes_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "pdu", "\\u", "types_", "._", "Sub", "address_", "(_", "type", "Tag_", ",_", "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_", "Add", "r", "Sub", "unit", "Encoder_", "(_", "Integer", "Wrapper", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "Name_", "=_", "'", "addr", "\\u", "subu", "nit", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "addr", "\\u", "subu", "nit", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "addr", "\\u", "subu", "nit", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Add", "r", "Sub", "unit_", "\\u\\u\\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_", "Network", "Type", "Encoder_", "(_", "Integer", "Wrapper", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "Name_", "=_", "'", "network", "\\u", "type", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "network", "\\u", "type", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "network", "\\u", "type", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Network", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Bear", "er", "Type", "Encoder_", "(_", "Integer", "Wrapper", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "Name_", "=_", "'", "bear", "er", "\\u", "type", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "bear", "er", "\\u", "type", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "bear", "er", "\\u", "type", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Bear", "er", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Pay", "load", "Type", "Encoder_", "(_", "Integer", "Wrapper", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "Name_", "=_", "'", "payload", "\\u", "type", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "payload", "\\u", "type", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "payload", "\\u", "type", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Pay", "load", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Priva", "cy", "Indicat", "or", "Encoder_", "(_", "Integer", "Wrapper", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "Name_", "=_", "'", "privacy", "\\u", "indicat", "or", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "privacy", "\\u", "indicat", "or", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "privacy", "\\u", "indicat", "or", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Priva", "cy", "Indicator_", "\\u\\u\\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_", "Lang", "ua", "ge", "Indicat", "or", "Encoder_", "(_", "Integer", "Wrapper", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "Name_", "=_", "'", "language", "\\u", "indicat", "or", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "language", "\\u", "indicat", "or", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "language", "\\u", "indicat", "or", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Lang", "ua", "ge", "Indicator_", "\\u\\u\\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_", "Display", "Time", "Encoder_", "(_", "Integer", "Wrapper", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "Name_", "=_", "'", "display", "\\u", "time", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "display", "\\u", "time", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "display", "\\u", "time", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Display", "Time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Ms", "Avail", "abilit", "y", "Status", "Encoder_", "(_", "Integer", "Wrapper", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "Name_", "=_", "'", "ms", "\\u", "avail", "abilit", "y", "\\u", "status", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "ms", "\\u", "avail", "abilit", "y", "\\u", "status", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "ms", "\\u", "avail", "abilit", "y", "\\u", "status", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Ms", "Avail", "abilit", "y", "Status_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Network", "Error", "Code", "Encoder_", "(_", "Octet", "String", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "Name_", "=_", "'", "network", "\\u", "error", "\\u", "code", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "network", "\\u", "error", "\\u", "code", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "network", "\\u", "error", "\\u", "code", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Network", "Error", "Code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Deliver", "y", "Fail", "ure", "Rea", "son", "Encoder_", "(_", "Integer", "Wrapper", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "Name_", "=_", "'", "delivery", "\\u", "fail", "ure", "\\u", "reason", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "delivery", "\\u", "fail", "ure", "\\u", "reason", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "delivery", "\\u", "fail", "ure", "\\u", "reason", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Deliver", "y", "Fail", "ure", "Reason_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Mor", "e", "Messag", "es", "To", "Sen", "d", "Encoder_", "(_", "Integer", "Wrapper", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "Name_", "=_", "'", "more", "\\u", "message", "s", "\\u", "to", "\\u", "send", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Map_", "=_", "constants_", "._", "more", "\\u", "message", "s", "\\u", "to", "\\u", "send", "\\u", "name", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Map_", "=_", "constants_", "._", "more", "\\u", "message", "s", "\\u", "to", "\\u", "send", "\\u", "value", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "Int", "1E", "ncode", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Type_", "=_", "pdu", "\\u", "types_", "._", "Mor", "e", "Messag", "es", "To", "Send_", "\\u\\u\\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_", "Time", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "null", "Hex_", "=_", "'", "00", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decode", "Null_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoder_", "=_", "CO", "cte", "t", "String", "Encoder_", "(_", "17_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decode", "Error", "Class_", "=_", "PD", "UP", "arse", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RUN", "KNOWN", "ERR_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\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 ", " _", "PD", "UN", "ull", "able", "Field", "Encoder_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "decode", "Error", "Class_", "=_", "kwargs_", "._", "get_", "(_", "'", "decode", "Error", "Class", "'_", ",_", "self_", "._", "decode", "Error", "Class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "decode", "Error", "Status_", "=_", "kwargs_", "._", "get_", "(_", "'", "decode", "Error", "Status", "'_", ",_", "self_", "._", "decode", "Error", "Status_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "encoder_", "._", "decode", "Error", "Status_", "=_", "self_", "._", "decode", "Error", "Status_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "encode_", "(_", "self_", ",_", "time_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "str_", "=_", "smp", "p", "\\u", "time_", "._", "unparse", "_", "(_", "time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "encoder_", "._", "\\u", "encode_", "(_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "read_", "(_", "self_", ",_", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "encoder_", "._", "\\u", "read_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "Encoder_", "(_", "PD", "UN", "ull", "able", "Field", "Encoder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "decode_", "(_", "self_", ",_", "bytes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time", "Str_", "=_", "self_", "._", "encoder_", "._", "\\u", "decode_", "(_", "bytes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "smp", "p", "\\u", "time_", "._", "parse_", "(_", "time", "Str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "Str_", "=_", "str_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "self_", "._", "decode", "Error", "Class_", "(_", "err", "Str_", ",_", "self_", "._", "decode", "Error", "Status_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Short", "Messag", "e", "Encoder_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sm", "Length", "Encoder_", "=_", "Int", "1E", "ncode", "r_", "(_", "max_", "=_", "254_", ")_", "\\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_", "Short", "Messag", "e", "Encoder_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "short", "Message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "short", "Message_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "short", "Message_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sm", "Length_", "=_", "len_", "(_", "short", "Message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "sm", "Length", "Encoder_", "._", "encode_", "(_", "sm", "Length_", ")_", "+_", "Octet", "String", "Encoder_", "(_", "sm", "Length_", ")_", "._", "encode_", "(_", "short", "Message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Short", "Messag", "e", "Encoder_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sm", "Length_", "=_", "self_", "._", "sm", "Length", "Encoder_", "._", "decode_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Octet", "String", "Encoder_", "(_", "sm", "Length_", ")_", "._", "decode_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Messag", "e", "Pay", "load", "Encoder_", "(_", "Octet", "String", "Encoder_", ")_", ":_", "\\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_", "Optio", "n", "Encoder_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Optio", "n", "Encoder_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "jas", "min_", "._", "vendor_", "._", "smp", "p_", "._", "pdu_", "._", "pdu", "\\u", "types_", "import_", "Tag_", "as_", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "length_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "options_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "dest", "\\u", "addr", "\\u", "subu", "nit_", ":_", "Add", "r", "Sub", "unit", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "source", "\\u", "addr", "\\u", "subu", "nit_", ":_", "Add", "r", "Sub", "unit", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "dest", "\\u", "network", "\\u", "type_", ":_", "Network", "Type", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "source", "\\u", "network", "\\u", "type_", ":_", "Network", "Type", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "dest", "\\u", "bear", "er", "\\u", "type_", ":_", "Bear", "er", "Type", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "source", "\\u", "bear", "er", "\\u", "type_", ":_", "Bear", "er", "Type", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "dest", "\\u", "tele", "matics", "\\u", "id_", ":_", "Int", "2E", "ncode", "r_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "source", "\\u", "tele", "matics", "\\u", "id_", ":_", "Int", "2E", "ncode", "r_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "qo", "s", "\\u", "time", "\\u", "to", "\\u", "live_", ":_", "Int", "4", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "payload", "\\u", "type_", ":_", "Pay", "load", "Type", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "addition", "al", "\\u", "status", "\\u", "info", "\\u", "text_", ":_", "CO", "cte", "t", "String", "Encoder_", "(_", "256_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "receipt", "ed", "\\u", "message", "\\u", "id_", ":_", "CO", "cte", "t", "String", "Encoder_", "(_", "65_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "T", ".", "ms", "\\u", "msg", "\\u", "wait", "\\u", "facilit", "ies", ":", " ", "TOD", "O", "()", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "privacy", "\\u", "indicator_", ":_", "Priva", "cy", "Indicat", "or", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "source", "\\u", "suba", "ddress", "_", ":_", "Sub", "address", "Encoder_", "(_", "self_", "._", "get", "Length_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "dest", "\\u", "suba", "ddress", "_", ":_", "Sub", "address", "Encoder_", "(_", "self_", "._", "get", "Length_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "user", "\\u", "message", "\\u", "reference_", ":_", "Int", "2E", "ncode", "r_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "user", "\\u", "response", "\\u", "code_", ":_", "Int", "1E", "ncode", "r_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "language", "\\u", "indicator_", ":_", "Lang", "ua", "ge", "Indicat", "or", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "source", "\\u", "port_", ":_", "Int", "2E", "ncode", "r_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "destinat", "ion", "\\u", "port_", ":_", "Int", "2E", "ncode", "r_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "sar", "\\u", "msg", "\\u", "ref", "\\u", "num_", ":_", "Int", "2E", "ncode", "r_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "sar", "\\u", "total", "\\u", "segments_", ":_", "Int", "1E", "ncode", "r_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "sar", "\\u", "segment", "\\u", "seqn", "um_", ":_", "Int", "1E", "ncode", "r_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "sc", "\\u", "interface", "\\u", "version_", ":_", "Int", "1E", "ncode", "r_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "display", "\\u", "time_", ":_", "Display", "Time", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", "T", ".", "ms", "\\u", "valid", "it", "y", ":", " ", "Ms", "Valid", "it", "y", "Encode", "r", "()", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", "T", ".", "dp", "f", "\\u", "result", ":", " ", "Dp", "f", "Result", "Encode", "r", "()", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", "T", ".", "set\\u", "dp", "f", ":", " ", "Set", "Dp", "f", "Encode", "r", "()", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "ms", "\\u", "avail", "abilit", "y", "\\u", "status_", ":_", "Ms", "Avail", "abilit", "y", "Status", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ja", "smi", "n", " ", "update", ":_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "network", "\\u", "error", "\\u", "code_", ":_", "Network", "Error", "Code", "Encoder_", "(_", "self_", "._", "get", "Length_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "message", "\\u", "payload_", ":_", "Messag", "e", "Pay", "load", "Encoder_", "(_", "self_", "._", "get", "Length_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "delivery", "\\u", "fail", "ure", "\\u", "reason_", ":_", "Deliver", "y", "Fail", "ure", "Rea", "son", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "more", "\\u", "message", "s", "\\u", "to", "\\u", "send_", ":_", "Mor", "e", "Messag", "es", "To", "Sen", "d", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "message", "\\u", "state_", ":_", "Messag", "e", "State", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "callback", "\\u", "num_", ":_", "Call", "back", "Num", "Encoder_", "(_", "self_", "._", "get", "Length_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", "T", ".", "callback", "\\u", "num", "\\u", "pres", "\\u", "ind", ":", " ", "Call", "back", "Num", "Pres", "Ind", "Encode", "r", "()", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "T", ".", "callback", "\\u", "num", "\\u", "ata", "g", ":", " ", "Call", "back", "Num", "At", "ag", "()", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "number", "\\u", "of", "\\u", "messages_", ":_", "Int", "1E", "ncode", "r_", "(_", "max_", "=_", "99_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "sms", "\\u", "signal_", ":_", "Octet", "String", "Encoder_", "(_", "self_", "._", "get", "Length_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "alert", "\\u", "on", "\\u", "message", "\\u", "delivery", "_", ":_", "Emp", "ty", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", "T", ".", "its", "\\u", "repl", "y", "\\u", "type", ":", " ", "It", "s", "Repl", "y", "Type", "Encode", "r", "()", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "T", ".", "its", "\\u", "session", "\\u", "info", ":", " ", "It", "s", "Sess", "ion", "Info", "Encode", "r", "()", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "T", ".", "uss", "d\\u", "service", "\\u", "op", ":", " ", "Us", "sd", "Service", "Op", "Encode", "r", "()", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ja", "smi", "n", " ", "update", ":", " ", "bypass", " ", "vendor", " ", "specific", " ", "tags_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "._", "vendor", "\\u", "specific", "\\u", "bypass", "_", ":_", "Octet", "String", "Encoder_", "(_", "self_", "._", "get", "Length_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Optio", "n", "Encoder_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Length_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Optio", "n", "Encoder_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "option_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "option_", "._", "tag_", "not_", "in_", "self_", "._", "options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Un", "know", "n", " ", "option", " ", "%", "s", "\"_", "%_", "str_", "(_", "option_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "encoder_", "=_", "self_", "._", "options_", "[_", "option_", "._", "tag_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encode", "d", "Value_", "=_", "encoder_", "._", "encode_", "(_", "option_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "=_", "len_", "(_", "encode", "d", "Value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "string_", "._", "join_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "Ta", "g", "Encoder_", "(_", ")_", "._", "encode_", "(_", "option_", "._", "tag_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Int", "2E", "ncode", "r_", "(_", ")_", "._", "encode_", "(_", "length_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "encode", "d", "Value_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Optio", "n", "Encoder_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ja", "smi", "n", " ", "update", ":", " ", "bypass", " ", "vendor", " ", "specific", " ", "tags_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tag_", "=_", "Ta", "g", "Encoder_", "(_", ")_", "._", "decode_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "length_", "=_", "Int", "2E", "ncode", "r_", "(_", ")_", "._", "decode_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tag_", "not_", "in_", "self_", "._", "options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "PD", "UP", "arse", "Error_", "(_", "\"", "Optio", "nal", " ", "param", " ", "%", "s", " ", "unknown", "\"_", "%_", "tag_", ",_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "ROP", "TP", "AR", "NOT", "ALL", "WD", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "encoder_", "=_", "self_", "._", "options_", "[_", "tag_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i", "Be", "fore", "Decode", "_", "=_", "file_", "._", "tell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "encoder_", "._", "decode_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "PD", "UP", "arse", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "._", "status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VO", "PT", "PARAM", "VAL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i", "Af", "ter", "Decode", "_", "=_", "file_", "._", "tell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parse", "Len_", "=_", "i", "Af", "ter", "Decode", "_", "-_", "i", "Be", "fore", "Decode", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "parse", "Len_", "!=_", "self_", "._", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "PD", "UP", "arse", "Error_", "(_", "\"", "Inva", "lid", " ", "option", " ", "length", ":", " ", "label", "ed", " ", "[", "%", "d", "]", " ", "but", " ", "parsed", " ", "[", "%", "d", "]\"_", "%_", "(_", "self_", "._", "length_", ",_", "parse", "Len_", ")_", ",_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VP", "AR", "LEN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "pdu", "\\u", "types_", "._", "Option_", "(_", "tag_", ",_", "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_", "PD", "UE", "ncode", "r_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "HEAD", "ER", "\\u", "LEN_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Head", "er", "Encode", "rs_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "command", "\\u", "length", "'_", ":_", "Int", "4", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "command", "\\u", "id", "'_", ":_", "Command", "Id", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "command", "\\u", "status", "'_", ":_", "Command", "Status", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", "the", " ", "spec", " ", "say", "s", " ", "max", "=", "0x7", "FFFFFFF", " ", "but", " ", "vendor", "s", " ", "don", "'", "t", " ", "respec", "t", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sequence", "\\u", "number", "'_", ":_", "Int", "4", "Encoder_", "(_", "min_", "=_", "0x0000000", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Head", "er", "Params_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "command", "\\u", "length", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "command", "\\u", "id", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "command", "\\u", "status", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sequence", "\\u", "number", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Default", "Requ", "ired", "Param", "Encode", "rs_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "system", "\\u", "id", "'_", ":_", "CO", "cte", "t", "String", "Encoder_", "(_", "16_", ",_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VS", "YS", "ID_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "CO", "cte", "t", "String", "Encoder_", "(_", "9_", ",_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VP", "AS", "WD", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "system", "\\u", "type", "'_", ":_", "CO", "cte", "t", "String", "Encoder_", "(_", "13_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "interface", "\\u", "version", "'_", ":_", "Int", "1E", "ncode", "r_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "addr", "\\u", "ton", "'_", ":_", "Add", "r", "Ton", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "addr", "\\u", "npi", "'_", ":_", "Add", "r", "Np", "i", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "address", "\\u", "range", "'_", ":_", "CO", "cte", "t", "String", "Encoder_", "(_", "41_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "service", "\\u", "type", "'_", ":_", "CO", "cte", "t", "String", "Encoder_", "(_", "6_", ",_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VS", "ERT", "YP", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "source", "\\u", "addr", "\\u", "ton", "'_", ":_", "Add", "r", "Ton", "Encoder_", "(_", "field", "Name_", "=_", "'", "source", "\\u", "addr", "\\u", "ton", "'_", ",_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VS", "RC", "TON", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "source", "\\u", "addr", "\\u", "npi", "'_", ":_", "Add", "r", "Np", "i", "Encoder_", "(_", "field", "Name_", "=_", "'", "source", "\\u", "addr", "\\u", "npi", "'_", ",_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VS", "RC", "NP", "I_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "source", "\\u", "addr", "'_", ":_", "CO", "cte", "t", "String", "Encoder_", "(_", "21_", ",_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VS", "RC", "AD", "R_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dest", "\\u", "addr", "\\u", "ton", "'_", ":_", "Add", "r", "Ton", "Encoder_", "(_", "field", "Name_", "=_", "'", "dest", "\\u", "addr", "\\u", "ton", "'_", ",_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VD", "ST", "TON", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dest", "\\u", "addr", "\\u", "npi", "'_", ":_", "Add", "r", "Np", "i", "Encoder_", "(_", "field", "Name_", "=_", "'", "dest", "\\u", "addr", "\\u", "npi", "'_", ",_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VD", "ST", "NP", "I_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "destinat", "ion", "\\u", "addr", "'_", ":_", "CO", "cte", "t", "String", "Encoder_", "(_", "21_", ",_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VD", "STA", "DR", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "es", "m", "\\u", "class", "'_", ":_", "Es", "m", "Class", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "es", "me", "\\u", "addr", "\\u", "ton", "'_", ":_", "Add", "r", "Ton", "Encoder_", "(_", "field", "Name_", "=_", "'", "es", "me", "\\u", "addr", "\\u", "ton", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "es", "me", "\\u", "addr", "\\u", "npi", "'_", ":_", "Add", "r", "Np", "i", "Encoder_", "(_", "field", "Name_", "=_", "'", "es", "me", "\\u", "addr", "\\u", "npi", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "es", "me", "\\u", "addr", "'_", ":_", "CO", "cte", "t", "String", "Encoder_", "(_", "65_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "protoc", "ol", "\\u", "id", "'_", ":_", "Int", "1E", "ncode", "r_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "priorit", "y", "\\u", "flag", "'_", ":_", "Prior", "it", "y", "Fla", "g", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "schedule", "\\u", "delivery", "\\u", "time", "'_", ":_", "Time", "Encoder_", "(_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VS", "CHE", "D_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "valid", "it", "y", "\\u", "period", "'_", ":_", "Time", "Encoder_", "(_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VE", "XP", "IR", "Y_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "register", "ed", "\\u", "delivery", "'_", ":_", "Register", "ed", "Deliver", "y", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "replace", "\\u", "if", "\\u", "presen", "t", "\\u", "flag", "'_", ":_", "Replace", "If", "Present", "Fla", "g", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "data\\u", "codi", "ng", "'_", ":_", "Data", "Codi", "ng", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ja", "smi", "n", " ", "update", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Mini", "mum", " ", "for", " ", "sm", "\\u", "default", "\\u", "msg", "\\u", "id", " ", "can", " ", "be", " ", "0", " ", "(", "reserve", "d", " ", "value", ")_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sm", "\\u", "default", "\\u", "msg", "\\u", "id", "'_", ":_", "Int", "1E", "ncode", "r_", "(_", "min_", "=_", "0_", ",_", "max_", "=_", "254_", ",_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VD", "FT", "MS", "GID", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "short", "\\u", "message", "'_", ":_", "Short", "Messag", "e", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "id", "'_", ":_", "CO", "cte", "t", "String", "Encoder_", "(_", "65_", ",_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VM", "SGI", "D_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "'", "number", "\\u", "of", "\\u", "dest", "s", "':", " ", "Int", "1E", "ncode", "r", "(", "max", "=", "254", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "'", "no", "\\u", "unsuc", "cess", "':", " ", "Int", "1E", "ncode", "r", "()", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "'", "dl", "\\u", "name", "':", " ", "CO", "cte", "t", "String", "Encode", "r", "(", "21", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "state", "'_", ":_", "Messag", "e", "State", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "final", "\\u", "date", "'_", ":_", "Time", "Encoder_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "error", "\\u", "code", "'_", ":_", "Int", "1E", "ncode", "r_", "(_", "decode", "Null_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Custom", "Requ", "ired", "Param", "Encode", "rs_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "pdu", "\\u", "types_", "._", "Command", "Id_", "._", "alert", "\\u", "notification_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "source", "\\u", "addr", "'_", ":_", "CO", "cte", "t", "String", "Encoder_", "(_", "65_", ",_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VS", "RC", "AD", "R_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pdu", "\\u", "types_", "._", "Command", "Id_", "._", "data\\u", "sm_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "source", "\\u", "addr", "'_", ":_", "CO", "cte", "t", "String", "Encoder_", "(_", "65_", ",_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VS", "RC", "AD", "R_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "destinat", "ion", "\\u", "addr", "'_", ":_", "CO", "cte", "t", "String", "Encoder_", "(_", "65_", ",_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VD", "STA", "DR", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pdu", "\\u", "types_", "._", "Command", "Id_", "._", "deliver", "\\u", "sm_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "schedule", "\\u", "delivery", "\\u", "time", "'_", ":_", "Time", "Encoder_", "(_", "require", "Null_", "=_", "True_", ",_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VS", "CHE", "D_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "valid", "it", "y", "\\u", "period", "'_", ":_", "Time", "Encoder_", "(_", "require", "Null_", "=_", "True_", ",_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VE", "XP", "IR", "Y_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pdu", "\\u", "types_", "._", "Command", "Id_", "._", "deliver", "\\u", "sm", "\\u", "resp_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "id", "'_", ":_", "CO", "cte", "t", "String", "Encoder_", "(_", "decode", "Null_", "=_", "True_", ",_", "require", "Null_", "=_", "True_", ",_", "decode", "Error", "Status_", "=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VM", "SGI", "D_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "PD", "UE", "ncode", "r_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\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_", "._", "option", "Encoder_", "=_", "Optio", "n", "Encoder_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "PD", "UE", "ncode", "r_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Requ", "ired", "Param", "Encode", "rs_", "(_", "self_", ",_", "pdu_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "pdu_", "._", "id_", "in_", "self_", "._", "Custom", "Requ", "ired", "Param", "Encode", "rs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "dict_", "(_", "self_", "._", "Default", "Requ", "ired", "Param", "Encode", "rs_", "._", "items_", "(_", ")_", "+_", "self_", "._", "Custom", "Requ", "ired", "Param", "Encode", "rs_", "[_", "pdu_", "._", "id_", "]_", "._", "items_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "Default", "Requ", "ired", "Param", "Encode", "rs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "PD", "UE", "ncode", "r_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "pdu_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "body_", "=_", "self_", "._", "encode", "Body_", "(_", "pdu_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "encode", "Header_", "(_", "pdu_", ",_", "body_", ")_", "+_", "body_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "PD", "UE", "ncode", "r_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i", "Be", "fore", "Decode", "_", "=_", "file_", "._", "tell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header", "Params_", "=_", "self_", "._", "decode", "Header_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu", "Kl", "ass_", "=_", "operations_", "._", "get", "PD", "UC", "lass_", "(_", "header", "Params_", "[_", "'", "command", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdu_", "=_", "pdu", "Kl", "ass_", "(_", "header", "Params_", "[_", "'", "sequence", "\\u", "number", "'_", "]_", ",_", "header", "Params_", "[_", "'", "command", "\\u", "status", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "decode", "Body_", "(_", "file_", ",_", "pdu_", ",_", "header", "Params_", "[_", "'", "command", "\\u", "length", "'_", "]_", "-_", "self_", "._", "HEAD", "ER", "\\u", "LEN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "i", "Af", "ter", "Decode", "_", "=_", "file_", "._", "tell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parsed", "Len_", "=_", "i", "Af", "ter", "Decode", "_", "-_", "i", "Be", "fore", "Decode", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ja", "smi", "n", " ", "update", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Rela", "ted", " ", "to", " ", "#", "124", ",", " ", "don", "'", "t", " ", "error", " ", "if", " ", "parsed", "Len", " ", "is", " ", "great", "er", " ", "than", " ", "command", "\\u", "length", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "there", " ", "can", " ", "be", " ", "some", " ", "padd", "ing", " ", "in", " ", "PD", "Us", ",", " ", "this", " ", "is", " ", "a", " ", "fix", " ", "to", " ", "be", " ", "confirm", "ed", " ", "for", " ", "stability", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "header", "Params_", "[_", "'", "command", "\\u", "length", "'_", "]_", ">_", "parsed", "Len_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pad", "Bytes_", "=_", "file_", "._", "read_", "(_", "header", "Params_", "[_", "'", "command", "\\u", "length", "'_", "]_", "-_", "parsed", "Len_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "pad", "Bytes_", ")_", "!=_", "header", "Params_", "[_", "'", "command", "\\u", "length", "'_", "]_", "-_", "parsed", "Len_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "PD", "UC", "orr", "upt", "Error_", "(_", "\"", "Inva", "lid", " ", "command", " ", "length", ":", " ", "expected", " ", "%", "d", ",", " ", "parsed", " ", "%", "d", ",", " ", "padd", "ing", " ", "bytes", " ", "not", " ", "found", "\"_", "%_", "(_", "header", "Params_", "[_", "'", "command", "\\u", "length", "'_", "]_", ",_", "parsed", "Len_", ")_", ",_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VC", "MD", "LEN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "parsed", "Len_", "<_", "header", "Params_", "[_", "'", "command", "\\u", "length", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "PD", "UC", "orr", "upt", "Error_", "(_", "\"", "Inva", "lid", " ", "command", " ", "length", ":", " ", "expected", " ", "%", "d", ",", " ", "parsed", " ", "%", "d", "\"_", "%_", "(_", "header", "Params_", "[_", "'", "command", "\\u", "length", "'_", "]_", ",_", "parsed", "Len_", ")_", ",_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VC", "MD", "LEN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "pdu_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "PD", "UE", "ncode", "r_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode", "Header_", "(_", "self_", ",_", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "header", "Params_", "=_", "self_", "._", "decode", "Requ", "ired", "Params_", "(_", "self_", "._", "Head", "er", "Params_", ",_", "self_", "._", "Head", "er", "Encode", "rs_", ",_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "header", "Params_", "[_", "'", "command", "\\u", "length", "'_", "]_", "<_", "self_", "._", "HEAD", "ER", "\\u", "LEN_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "PD", "UC", "orr", "upt", "Error_", "(_", "\"", "Inva", "lid", " ", "command", "\\u", "length", " ", "%", "d", "\"_", "%_", "header", "Params_", "[_", "'", "command", "\\u", "length", "'_", "]_", ",_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RIN", "VC", "MD", "LEN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "header", "Params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "PD", "UE", "ncode", "r_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode", "Body_", "(_", "self_", ",_", "file_", ",_", "pdu_", ",_", "body", "Length_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mandat", "ory", "Params_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "option", "al", "Params_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Some", " ", "PD", "U", " ", "response", "s", " ", "have", " ", "no", " ", "defin", "ed", " ", "body", " ", "whe", "n", " ", "the", " ", "status", " ", "is", " ", "not", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "c", ".", "f", ".", " ", "4.1", ".2", ".", " ", "\"", "BIND", "\\u", "TRANS", "MIT", "TER", "\\u", "RESP", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "c", ".", "f", ".", " ", "4.1", ".4", ".", " ", "\"", "BIND", "\\u", "RECEIVE", "R", "\\u", "RESP", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "c", ".", "f", ".", " ", "4.4", ".2", ".", " ", "SM", "PP", " ", "PD", "U", " ", "Definit", "ion", " ", "\"", "SUBMIT", "\\u", "SM", "\\u", "RESP", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "pdu_", "._", "command", "Id_", "in_", "(_", "Command", "Id_", "._", "bind", "\\u", "receive", "r", "\\u", "resp_", ",_", "Command", "Id_", "._", "bind", "\\u", "transmitte", "r", "\\u", "resp_", ",_", "Command", "Id_", "._", "bind", "\\u", "transc", "eive", "r", "\\u", "resp_", ",_", "Command", "Id_", "._", "submit", "\\u", "sm", "\\u", "resp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "pdu_", "._", "status_", "!=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RO", "K_", "and_", "pdu_", "._", "no", "Bod", "y", "On", "Error_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i", "Be", "fore", "MP", "arams_", "=_", "file_", "._", "tell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "pdu_", "._", "mandat", "ory", "Params_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mandat", "ory", "Params_", "=_", "self_", "._", "decode", "Requ", "ired", "Params_", "(_", "pdu_", "._", "mandat", "ory", "Params_", ",_", "self_", "._", "get", "Requ", "ired", "Param", "Encode", "rs_", "(_", "pdu_", ")_", ",_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i", "Af", "ter", "MP", "arams_", "=_", "file_", "._", "tell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m", "Param", "s", "Len_", "=_", "i", "Af", "ter", "MP", "arams_", "-_", "i", "Be", "fore", "MP", "arams_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "pdu_", "._", "option", "al", "Params_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "option", "al", "Params_", "=_", "self_", "._", "decode", "Optio", "nal", "Params_", "(_", "pdu_", "._", "option", "al", "Params_", ",_", "file_", ",_", "body", "Length_", "-_", "m", "Param", "s", "Len_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pdu_", "._", "params_", "=_", "dict_", "(_", "mandat", "ory", "Params_", "._", "items_", "(_", ")_", "+_", "option", "al", "Params_", "._", "items_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "PD", "UE", "ncode", "r_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode", "Body_", "(_", "self_", ",_", "pdu_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "body_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Some", " ", "PD", "U", " ", "response", "s", " ", "have", " ", "no", " ", "defin", "ed", " ", "body", " ", "whe", "n", " ", "the", " ", "status", " ", "is", " ", "not", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "c", ".", "f", ".", " ", "4.1", ".2", ".", " ", "\"", "BIND", "\\u", "TRANS", "MIT", "TER", "\\u", "RESP", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "c", ".", "f", ".", " ", "4.1", ".4", ".", " ", "\"", "BIND", "\\u", "RECEIVE", "R", "\\u", "RESP", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "c", ".", "f", ".", " ", "4.4", ".2", ".", " ", "SM", "PP", " ", "PD", "U", " ", "Definit", "ion", " ", "\"", "SUBMIT", "\\u", "SM", "\\u", "RESP", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "pdu_", "._", "command", "Id_", "in_", "(_", "Command", "Id_", "._", "bind", "\\u", "receive", "r", "\\u", "resp_", ",_", "Command", "Id_", "._", "bind", "\\u", "transmitte", "r", "\\u", "resp_", ",_", "Command", "Id_", "._", "bind", "\\u", "transc", "eive", "r", "\\u", "resp_", ",_", "Command", "Id_", "._", "submit", "\\u", "sm", "\\u", "resp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "pdu_", "._", "status_", "!=_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "RO", "K_", "and_", "pdu_", "._", "no", "Bod", "y", "On", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "body_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "param", "Name_", "in_", "pdu_", "._", "mandat", "ory", "Params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "param", "Name_", "not_", "in_", "pdu_", "._", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Missing", " ", "require", "d", " ", "parameter", ":", " ", "%", "s", "\"_", "%_", "param", "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_", "body_", "+=_", "self_", "._", "encode", "Requ", "ired", "Params_", "(_", "pdu_", "._", "mandat", "ory", "Params_", ",_", "self_", "._", "get", "Requ", "ired", "Param", "Encode", "rs_", "(_", "pdu_", ")_", ",_", "pdu_", "._", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "+=_", "self_", "._", "encode", "Optio", "nal", "Params_", "(_", "pdu_", "._", "option", "al", "Params_", ",_", "pdu_", "._", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "body_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "PD", "UE", "ncode", "r_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode", "Header_", "(_", "self_", ",_", "pdu_", ",_", "body_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd", "Length_", "=_", "len_", "(_", "body_", ")_", "+_", "self_", "._", "HEAD", "ER", "\\u", "LEN_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header", "Params_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "command", "\\u", "length", "'_", ":_", "cmd", "Length_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "command", "\\u", "id", "'_", ":_", "pdu_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "command", "\\u", "status", "'_", ":_", "pdu_", "._", "status_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sequence", "\\u", "number", "'_", ":_", "pdu_", "._", "seq", "Num_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header_", "=_", "self_", "._", "encode", "Requ", "ired", "Params_", "(_", "self_", "._", "Head", "er", "Params_", ",_", "self_", "._", "Head", "er", "Encode", "rs_", ",_", "header", "Params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "header_", ")_", "==_", "self_", "._", "HEAD", "ER", "\\u", "LEN_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "header_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "PD", "UE", "ncode", "r_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode", "Optio", "nal", "Params_", "(_", "self_", ",_", "option", "al", "Params_", ",_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "param", "Name_", "in_", "option", "al", "Params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "param", "Name_", "in_", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tag_", "=_", "getattr_", "(_", "pdu", "\\u", "types_", "._", "Tag_", ",_", "param", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "params_", "[_", "param", "Name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "+=_", "self_", "._", "option", "Encoder_", "._", "encode_", "(_", "pdu", "\\u", "types_", "._", "Option_", "(_", "tag_", ",_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "PD", "UE", "ncode", "r_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode", "Optio", "nal", "Params_", "(_", "self_", ",_", "param", "List_", ",_", "file_", ",_", "options", "Length_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "option", "al", "Params_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i", "Before_", "=_", "file_", "._", "tell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "file_", "._", "tell_", "(_", ")_", "-_", "i", "Before_", "<_", "options", "Length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "option_", "=_", "self_", "._", "option", "Encoder_", "._", "decode_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "option", "Name_", "=_", "str_", "(_", "option_", "._", "tag_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "option", "Name_", "not_", "in_", "param", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "PD", "UP", "arse", "Error_", "(_", "\"", "Inva", "lid", " ", "option", " ", "%", "s", "\"_", "%_", "option", "Name_", ",_", "pdu", "\\u", "types_", "._", "Command", "Status_", "._", "ES", "ME", "\\u", "ROP", "TP", "AR", "NOT", "ALL", "WD", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "option", "al", "Params_", "[_", "option", "Name_", "]_", "=_", "option_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "option", "al", "Params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "PD", "UE", "ncode", "r_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode", "Requ", "ired", "Params_", "(_", "self_", ",_", "param", "List_", ",_", "encode", "r", "Map_", ",_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "string_", "._", "join_", "(_", "[_", "encode", "r", "Map_", "[_", "param", "Name_", "]_", "._", "encode_", "(_", "params_", "[_", "param", "Name_", "]_", ")_", "for_", "param", "Name_", "in_", "param", "List_", "]_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "PD", "UE", "ncode", "r_", "(_", "IE", "ncode", "r_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode", "Requ", "ired", "Params_", "(_", "self_", ",_", "param", "List_", ",_", "encode", "r", "Map_", ",_", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "param", "Name_", "in_", "param", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "[_", "param", "Name_", "]_", "=_", "encode", "r", "Map_", "[_", "param", "Name_", "]_", "._", "decode_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "params_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
Cclleemm/FriendlyTorrent/src/tornado/BitTornado/natpunch.py
[ { "content": " def _get_map(self):\n if self.last_got_map + EXPIRE_CACHE < clock():\n try:\n dispatcher = win32com.client.Dispatch(\"HNetCfg.NATUPnP\")\n self.map = dispatcher.StaticPortMappingCollection\n self.last_got_map = clock()\n except:\n self.map = None\n return self.map", "metadata": "root._UPnP1._get_map", "header": "['class', '_UPnP1', ':', \"# derived from Myers Carpenter's code\", '___NEWLINE___', \"# seems to use the machine's local UPnP\", '___NL___', '# system for its operation. Runs fairly fast', '___NL___', '___EOS___']", "index": 37 }, { "content": " def test(self):\n try:\n assert self._get_map() # make sure a map was found\n success = True\n except:\n success = False\n return success", "metadata": "root._UPnP1.test", "header": "['class', '_UPnP1', ':', \"# derived from Myers Carpenter's code\", '___NEWLINE___', \"# seems to use the machine's local UPnP\", '___NL___', '# system for its operation. Runs fairly fast', '___NL___', '___EOS___']", "index": 47 }, { "content": " def open(self, ip, p):\n map = self._get_map()\n try:\n map.Add(p,'TCP',p,ip,True,ID)\n if DEBUG:\n print 'port opened: '+ip+':'+str(p)\n success = True\n except:\n if DEBUG:\n print \"COULDN'T OPEN \"+str(p)\n print_exc()\n success = False\n return success", "metadata": "root._UPnP1.open", "header": "['class', '_UPnP1', ':', \"# derived from Myers Carpenter's code\", '___NEWLINE___', \"# seems to use the machine's local UPnP\", '___NL___', '# system for its operation. Runs fairly fast', '___NL___', '___EOS___']", "index": 56 }, { "content": " def close(self, p):\n map = self._get_map()\n try:\n map.Remove(p,'TCP')\n success = True\n if DEBUG:\n print 'port closed: '+str(p)\n except:\n if DEBUG:\n print 'ERROR CLOSING '+str(p)\n print_exc()\n success = False\n return success", "metadata": "root._UPnP1.close", "header": "['class', '_UPnP1', ':', \"# derived from Myers Carpenter's code\", '___NEWLINE___', \"# seems to use the machine's local UPnP\", '___NL___', '# system for its operation. Runs fairly fast', '___NL___', '___EOS___']", "index": 71 }, { "content": " def clean(self, retry = False):\n if not _supported:\n return\n try:\n map = self._get_map()\n ports_in_use = []\n for i in xrange(len(map)):\n try:\n mapping = map[i]\n port = mapping.ExternalPort\n prot = str(mapping.Protocol).lower()\n desc = str(mapping.Description).lower()\n except:\n port = None\n if port and prot == 'tcp' and desc[:3] == 'bt-':\n ports_in_use.append(port)\n success = True\n for port in ports_in_use:\n try:\n map.Remove(port,'TCP')\n except:\n success = False\n if not success and not retry:\n self.clean(retry = True)\n except:\n pass", "metadata": "root._UPnP1.clean", "header": "['class', '_UPnP1', ':', \"# derived from Myers Carpenter's code\", '___NEWLINE___', \"# seems to use the machine's local UPnP\", '___NL___', '# system for its operation. Runs fairly fast', '___NL___', '___EOS___']", "index": 86 }, { "content": " def _get_services(self):\n if not self.services or self.last_got_services + EXPIRE_CACHE < clock():\n self.services = []\n try:\n f=win32com.client.Dispatch(\"UPnP.UPnPDeviceFinder\")\n for t in ( \"urn:schemas-upnp-org:service:WANIPConnection:1\",\n \"urn:schemas-upnp-org:service:WANPPPConnection:1\" ):\n try:\n conns = f.FindByType(t,0)\n for c in xrange(len(conns)):\n try:\n svcs = conns[c].Services\n for s in xrange(len(svcs)):\n try:\n self.services.append(svcs[s])\n except:\n pass\n except:\n pass\n except:\n pass\n except:\n pass\n self.last_got_services = clock()\n return self.services", "metadata": "root._UPnP2._get_services", "header": "['class', '_UPnP2', ':', \"# derived from Yejun Yang's code\", '___NEWLINE___', '# apparently does a direct search for UPnP hardware', '___NL___', \"# may work in some cases where _UPnP1 won't, but is slow\", '___NL___', '# still need to implement \"clean\" method', '___NL___', '___EOS___']", "index": 123 }, { "content": " def test(self):\n try:\n assert self._get_services() # make sure some services can be found\n success = True\n except:\n success = False\n return success", "metadata": "root._UPnP2.test", "header": "['class', '_UPnP2', ':', \"# derived from Yejun Yang's code\", '___NEWLINE___', '# apparently does a direct search for UPnP hardware', '___NL___', \"# may work in some cases where _UPnP1 won't, but is slow\", '___NL___', '# still need to implement \"clean\" method', '___NL___', '___EOS___']", "index": 149 }, { "content": " def open(self, ip, p):\n svcs = self._get_services()\n success = False\n for s in svcs:\n try:\n s.InvokeAction('AddPortMapping',['',p,'TCP',p,ip,True,ID,0],'')\n success = True\n except:\n pass\n if DEBUG and not success:\n print \"COULDN'T OPEN \"+str(p)\n print_exc()\n return success", "metadata": "root._UPnP2.open", "header": "['class', '_UPnP2', ':', \"# derived from Yejun Yang's code\", '___NEWLINE___', '# apparently does a direct search for UPnP hardware', '___NL___', \"# may work in some cases where _UPnP1 won't, but is slow\", '___NL___', '# still need to implement \"clean\" method', '___NL___', '___EOS___']", "index": 158 }, { "content": " def close(self, p):\n svcs = self._get_services()\n success = False\n for s in svcs:\n try:\n s.InvokeAction('DeletePortMapping', ['',p,'TCP'], '')\n success = True\n except:\n pass\n if DEBUG and not success:\n print \"COULDN'T OPEN \"+str(p)\n print_exc()\n return success", "metadata": "root._UPnP2.close", "header": "['class', '_UPnP2', ':', \"# derived from Yejun Yang's code\", '___NEWLINE___', '# apparently does a direct search for UPnP hardware', '___NL___', \"# may work in some cases where _UPnP1 won't, but is slow\", '___NL___', '# still need to implement \"clean\" method', '___NL___', '___EOS___']", "index": 173 }, { "content": " def get_ip(self):\n if self.last_got_ip + EXPIRE_CACHE < clock():\n local_ips = IP_List()\n local_ips.set_intranet_addresses()\n try:\n for info in socket.getaddrinfo(socket.gethostname(),0,socket.AF_INET):\n # exception if socket library isn't recent\n self.local_ip = info[4][0]\n if local_ips.includes(self.local_ip):\n self.last_got_ip = clock()\n if DEBUG:\n print 'Local IP found: '+self.local_ip\n break\n else:\n raise ValueError('couldn\\'t find intranet IP')\n except:\n self.local_ip = None\n if DEBUG:\n print 'Error finding local IP'\n print_exc()\n return self.local_ip", "metadata": "root._UPnP.get_ip", "header": "['class', '_UPnP', ':', '# master holding class', '___EOS___']", "index": 197 } ]
[ { "span": "except:", "start_line": 43, "start_column": 12, "end_line": 43, "end_column": 19 }, { "span": "except:", "start_line": 51, "start_column": 8, "end_line": 51, "end_column": 15 }, { "span": "except:", "start_line": 63, "start_column": 8, "end_line": 63, "end_column": 15 }, { "span": "except:", "start_line": 78, "start_column": 8, "end_line": 78, "end_column": 15 }, { "span": "except:", "start_line": 98, "start_column": 16, "end_line": 98, "end_column": 23 }, { "span": "except:", "start_line": 106, "start_column": 16, "end_line": 106, "end_column": 23 }, { "span": "except:", "start_line": 110, "start_column": 8, "end_line": 110, "end_column": 15 }, { "span": "except:", "start_line": 138, "start_column": 36, "end_line": 138, "end_column": 43 }, { "span": "except:", "start_line": 140, "start_column": 28, "end_line": 140, "end_column": 35 }, { "span": "except:", "start_line": 142, "start_column": 20, "end_line": 142, "end_column": 27 }, { "span": "except:", "start_line": 144, "start_column": 12, "end_line": 144, "end_column": 19 }, { "span": "except:", "start_line": 153, "start_column": 8, "end_line": 153, "end_column": 15 }, { "span": "except:", "start_line": 165, "start_column": 12, "end_line": 165, "end_column": 19 }, { "span": "except:", "start_line": 180, "start_column": 12, "end_line": 180, "end_column": 19 }, { "span": "except:", "start_line": 212, "start_column": 12, "end_line": 212, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "\\u", "UP", "n", "P1_", ":_", "#", " ", "derive", "d", " ", "from", " ", "My", "ers", " ", "Car", "pent", "er", "'", "s", " ", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "see", "ms", " ", "to", " ", "use", " ", "the", " ", "machine", "'", "s", " ", "local", " ", "UP", "n", "P_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "system", " ", "for", " ", "its", " ", "operati", "on", ".", " ", " ", "Run", "s", " ", "fair", "ly", " ", "fast_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "map_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "last", "\\u", "got", "\\u", "map_", "+_", "EXPIRE", "\\u", "CACHE_", "<_", "clock_", "(_", ")_", ":_", "\\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 ", " _", "dispatcher_", "=_", "win32", "com_", "._", "client_", "._", "Dispa", "tch_", "(_", "\"", "HN", "et", "Cf", "g", ".", "NAT", "UP", "n", "P", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "map_", "=_", "dispatcher_", "._", "Static", "Port", "Map", "ping", "Collection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "\\u", "got", "\\u", "map_", "=_", "clock_", "(_", ")_", "\\u\\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_", "._", "map_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "UP", "n", "P1_", ":_", "#", " ", "derive", "d", " ", "from", " ", "My", "ers", " ", "Car", "pent", "er", "'", "s", " ", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "see", "ms", " ", "to", " ", "use", " ", "the", " ", "machine", "'", "s", " ", "local", " ", "UP", "n", "P_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "system", " ", "for", " ", "its", " ", "operati", "on", ".", " ", " ", "Run", "s", " ", "fair", "ly", " ", "fast_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test_", "(_", "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 ", " _", "assert_", "self_", "._", "\\u", "get", "\\u", "map_", "(_", ")_", "#", " ", "make", " ", "sure", " ", "a", " ", "map", " ", "was", " ", "found_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "success_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "UP", "n", "P1_", ":_", "#", " ", "derive", "d", " ", "from", " ", "My", "ers", " ", "Car", "pent", "er", "'", "s", " ", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "see", "ms", " ", "to", " ", "use", " ", "the", " ", "machine", "'", "s", " ", "local", " ", "UP", "n", "P_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "system", " ", "for", " ", "its", " ", "operati", "on", ".", " ", " ", "Run", "s", " ", "fair", "ly", " ", "fast_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "open_", "(_", "self_", ",_", "ip_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "map_", "=_", "self_", "._", "\\u", "get", "\\u", "map_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "map_", "._", "Add_", "(_", "p_", ",_", "'", "TC", "P", "'_", ",_", "p_", ",_", "ip_", ",_", "True_", ",_", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "DEBUG_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "port", " ", "opene", "d", ":", " ", "'_", "+_", "ip_", "+_", "':'_", "+_", "str_", "(_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "success_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "DEBUG_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "COU", "LD", "N", "'", "T", " ", "OPEN", " ", "\"_", "+_", "str_", "(_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print", "\\u", "exc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "success_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "UP", "n", "P1_", ":_", "#", " ", "derive", "d", " ", "from", " ", "My", "ers", " ", "Car", "pent", "er", "'", "s", " ", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "see", "ms", " ", "to", " ", "use", " ", "the", " ", "machine", "'", "s", " ", "local", " ", "UP", "n", "P_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "system", " ", "for", " ", "its", " ", "operati", "on", ".", " ", " ", "Run", "s", " ", "fair", "ly", " ", "fast_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "close_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "map_", "=_", "self_", "._", "\\u", "get", "\\u", "map_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "map_", "._", "Remove_", "(_", "p_", ",_", "'", "TC", "P", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "DEBUG_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "port", " ", "close", "d", ":", " ", "'_", "+_", "str_", "(_", "p_", ")_", "\\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_", "DEBUG_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "ERROR", " ", "CLO", "SIN", "G", " ", "'_", "+_", "str_", "(_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print", "\\u", "exc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "success_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "UP", "n", "P1_", ":_", "#", " ", "derive", "d", " ", "from", " ", "My", "ers", " ", "Car", "pent", "er", "'", "s", " ", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "see", "ms", " ", "to", " ", "use", " ", "the", " ", "machine", "'", "s", " ", "local", " ", "UP", "n", "P_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "system", " ", "for", " ", "its", " ", "operati", "on", ".", " ", " ", "Run", "s", " ", "fair", "ly", " ", "fast_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clean_", "(_", "self_", ",_", "retry_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "\\u", "supported_", ":_", "\\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_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "map_", "=_", "self_", "._", "\\u", "get", "\\u", "map_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "port", "s", "\\u", "in", "\\u", "use_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "len_", "(_", "map_", ")_", ")_", ":_", "\\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 ", " ", "_", "mapping_", "=_", "map_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "port_", "=_", "mapping_", "._", "Exter", "nal", "Port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prot_", "=_", "str_", "(_", "mapping_", "._", "Protocol_", ")_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "desc_", "=_", "str_", "(_", "mapping_", "._", "Description_", ")_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "port_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "port_", "and_", "prot_", "==_", "'", "tcp", "'_", "and_", "desc_", "[_", ":_", "3_", "]_", "==_", "'", "bt", "-'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "port", "s", "\\u", "in", "\\u", "use_", "._", "append_", "(_", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "success_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "port_", "in_", "port", "s", "\\u", "in", "\\u", "use_", ":_", "\\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 ", " ", "_", "map_", "._", "Remove_", "(_", "port_", ",_", "'", "TC", "P", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "success_", "and_", "not_", "retry_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "clean_", "(_", "retry_", "=_", "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_", "[SEP]_", "class_", "\\u", "UP", "n", "P2_", ":_", "#", " ", "derive", "d", " ", "from", " ", "Ye", "jun", " ", "Yan", "g", "'", "s", " ", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "appare", "ntl", "y", " ", "doe", "s", " ", "a", " ", "direct", " ", "search", " ", "for", " ", "UP", "n", "P", " ", "hardware_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "may", " ", "work", " ", "in", " ", "some", " ", "case", "s", " ", "where", " ", "\\u", "UP", "n", "P1", " ", "won", "'", "t", ",", " ", "but", " ", "is", " ", "slow_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "still", " ", "need", " ", "to", " ", "implement", " ", "\"", "clean", "\"", " ", "method_", "\\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", "services_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "services_", "or_", "self_", "._", "last", "\\u", "got", "\\u", "services_", "+_", "EXPIRE", "\\u", "CACHE_", "<_", "clock_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "services_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "win32", "com_", "._", "client_", "._", "Dispa", "tch_", "(_", "\"", "UP", "n", "P", ".", "UP", "n", "PD", "evice", "Fin", "der", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "t_", "in_", "(_", "\"", "urn", ":", "schema", "s", "-", "upnp", "-", "org", ":", "service", ":", "WAN", "IPC", "onnect", "ion", ":", "1", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "urn", ":", "schema", "s", "-", "upnp", "-", "org", ":", "service", ":", "WAN", "PPP", "Connect", "ion", ":", "1", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "conns_", "=_", "f_", "._", "Fin", "d", "By", "Type_", "(_", "t_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "c_", "in_", "xrange_", "(_", "len_", "(_", "conns_", ")_", ")_", ":_", "\\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 ", " ", " _", "svc", "s_", "=_", "conns_", "[_", "c_", "]_", "._", "Services_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "s_", "in_", "xrange_", "(_", "len_", "(_", "svc", "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 ", " ", " ", " _", "self_", "._", "services_", "._", "append_", "(_", "svc", "s_", "[_", "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 ", " ", " ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "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_", "\\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_", "\\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_", "._", "last", "\\u", "got", "\\u", "services_", "=_", "clock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "services_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "UP", "n", "P2_", ":_", "#", " ", "derive", "d", " ", "from", " ", "Ye", "jun", " ", "Yan", "g", "'", "s", " ", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "appare", "ntl", "y", " ", "doe", "s", " ", "a", " ", "direct", " ", "search", " ", "for", " ", "UP", "n", "P", " ", "hardware_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "may", " ", "work", " ", "in", " ", "some", " ", "case", "s", " ", "where", " ", "\\u", "UP", "n", "P1", " ", "won", "'", "t", ",", " ", "but", " ", "is", " ", "slow_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "still", " ", "need", " ", "to", " ", "implement", " ", "\"", "clean", "\"", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test_", "(_", "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 ", " _", "assert_", "self_", "._", "\\u", "get", "\\u", "services_", "(_", ")_", "#", " ", "make", " ", "sure", " ", "some", " ", "service", "s", " ", "can", " ", "be", " ", "found_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "success_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "UP", "n", "P2_", ":_", "#", " ", "derive", "d", " ", "from", " ", "Ye", "jun", " ", "Yan", "g", "'", "s", " ", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "appare", "ntl", "y", " ", "doe", "s", " ", "a", " ", "direct", " ", "search", " ", "for", " ", "UP", "n", "P", " ", "hardware_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "may", " ", "work", " ", "in", " ", "some", " ", "case", "s", " ", "where", " ", "\\u", "UP", "n", "P1", " ", "won", "'", "t", ",", " ", "but", " ", "is", " ", "slow_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "still", " ", "need", " ", "to", " ", "implement", " ", "\"", "clean", "\"", " ", "method_", "\\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_", "open_", "(_", "self_", ",_", "ip_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "svc", "s_", "=_", "self_", "._", "\\u", "get", "\\u", "services_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "s_", "in_", "svc", "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 ", " _", "s_", "._", "Invok", "e", "Action_", "(_", "'", "Add", "Port", "Map", "ping", "'_", ",_", "[_", "''_", ",_", "p_", ",_", "'", "TC", "P", "'_", ",_", "p_", ",_", "ip_", ",_", "True_", ",_", "ID_", ",_", "0_", "]_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "DEBUG_", "and_", "not_", "success_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "COU", "LD", "N", "'", "T", " ", "OPEN", " ", "\"_", "+_", "str_", "(_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print", "\\u", "exc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "UP", "n", "P2_", ":_", "#", " ", "derive", "d", " ", "from", " ", "Ye", "jun", " ", "Yan", "g", "'", "s", " ", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "appare", "ntl", "y", " ", "doe", "s", " ", "a", " ", "direct", " ", "search", " ", "for", " ", "UP", "n", "P", " ", "hardware_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "may", " ", "work", " ", "in", " ", "some", " ", "case", "s", " ", "where", " ", "\\u", "UP", "n", "P1", " ", "won", "'", "t", ",", " ", "but", " ", "is", " ", "slow_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "still", " ", "need", " ", "to", " ", "implement", " ", "\"", "clean", "\"", " ", "method_", "\\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_", "close_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "svc", "s_", "=_", "self_", "._", "\\u", "get", "\\u", "services_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "s_", "in_", "svc", "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 ", " _", "s_", "._", "Invok", "e", "Action_", "(_", "'", "Delete", "Port", "Map", "ping", "'_", ",_", "[_", "''_", ",_", "p_", ",_", "'", "TC", "P", "'_", "]_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "DEBUG_", "and_", "not_", "success_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "COU", "LD", "N", "'", "T", " ", "OPEN", " ", "\"_", "+_", "str_", "(_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print", "\\u", "exc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "UP", "n", "P_", ":_", "#", " ", "master", " ", "holding", " ", "class_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "ip_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "last", "\\u", "got", "\\u", "ip_", "+_", "EXPIRE", "\\u", "CACHE_", "<_", "clock_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "\\u", "ips_", "=_", "IP", "\\u", "List_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "local", "\\u", "ips_", "._", "set\\u", "intra", "net", "\\u", "addresses_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "info_", "in_", "socket_", "._", "getadd", "rin", "fo_", "(_", "socket_", "._", "gethostname_", "(_", ")_", ",_", "0_", ",_", "socket_", "._", "AF", "\\u", "INET_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "exception", " ", "if", " ", "socket", " ", "librar", "y", " ", "isn", "'", "t", " ", "recent_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "local", "\\u", "ip_", "=_", "info_", "[_", "4_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "local", "\\u", "ips_", "._", "includes_", "(_", "self_", "._", "local", "\\u", "ip_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "last", "\\u", "got", "\\u", "ip_", "=_", "clock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "DEBUG_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "'", "Local", " ", "IP", " ", "found", ":", " ", "'_", "+_", "self_", "._", "local", "\\u", "ip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Value", "Error_", "(_", "'", "coul", "dn", "\\\\'", "t", " ", "find", " ", "intra", "net", " ", "IP", "'_", ")_", "\\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_", "._", "local", "\\u", "ip_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "DEBUG_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "'", "Error", " ", "finding", " ", "local", " ", "IP", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print", "\\u", "exc_", "(_", ")_", "\\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_", "self_", "._", "local", "\\u", "ip_", "\\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, 0, 1, 1, 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2 ]
Imprecise assert
cournape/Bento/bento/core/tests/test_node.py
[ { "content": " def test_make_node(self):\n foo = self.d_node.make_node(\"foo\")\n foo.make_node(\"../bar\")\n self.assertTrue(self.d_node.find_node(\"bar\") is not None)", "metadata": "root.TestNodeInsideTemp.test_make_node", "header": "['class', 'TestNodeInsideTemp', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 106 } ]
[ { "span": "self.assertTrue(self.d_node.find_node(\"bar\") is not None)", "start_line": 109, "start_column": 8, "end_line": 109, "end_column": 65 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Node", "Inside", "Temp_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "make", "\\u", "node_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "foo_", "=_", "self_", "._", "d\\u", "node_", "._", "make", "\\u", "node_", "(_", "\"", "foo", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "foo_", "._", "make", "\\u", "node_", "(_", "\"..", "/", "bar", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "d\\u", "node_", "._", "find", "\\u", "node_", "(_", "\"", "bar", "\"_", ")_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused import
azoft-dev-team/imagrium/env/Lib/test/test_unittest.py
[ { "content": "\"\"\"Test script for unittest.\n\nBy Collin Winter <collinw at gmail.com>\n\nStill need testing:\n TestCase.{assert,fail}* methods (some are tested implicitly)\n\"\"\"\n\nimport sys\nfrom test import test_support\nimport unittest\nfrom unittest import TestCase\nimport types\n\n### Support code\n################################################################\n\n\n\n\n\n################################################################\n### /Support code\n\n\n### Support code for Test_TestSuite\n################################################################\n\n\n\n################################################################\n### /Support code for Test_TestSuite\n\n\n\n\n\n### Support code for Test_TestCase\n################################################################\n\n\n\n################################################################\n### /Support code for Test_TestCase\n\n\n\n\n\n######################################################################\n## Main\n######################################################################\n\n\nif __name__ == \"__main__\":\n test_main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class LoggingResult(unittest.TestResult):\n\n\n\n", "metadata": "root.LoggingResult", "header": "['module', '___EOS___']", "index": 17 }, { "content": " def __init__(self, log):\n self._events = log\n super(LoggingResult, self).__init__()", "metadata": "root.LoggingResult.__init__", "header": "['class', 'LoggingResult', '(', 'unittest', '.', 'TestResult', ')', ':', '___EOS___']", "index": 18 }, { "content": " def startTest(self, test):\n self._events.append('startTest')\n super(LoggingResult, self).startTest(test)", "metadata": "root.LoggingResult.startTest", "header": "['class', 'LoggingResult', '(', 'unittest', '.', 'TestResult', ')', ':', '___EOS___']", "index": 22 }, { "content": " def stopTest(self, test):\n self._events.append('stopTest')\n super(LoggingResult, self).stopTest(test)", "metadata": "root.LoggingResult.stopTest", "header": "['class', 'LoggingResult', '(', 'unittest', '.', 'TestResult', ')', ':', '___EOS___']", "index": 26 }, { "content": " def addFailure(self, *args):\n self._events.append('addFailure')\n super(LoggingResult, self).addFailure(*args)", "metadata": "root.LoggingResult.addFailure", "header": "['class', 'LoggingResult', '(', 'unittest', '.', 'TestResult', ')', ':', '___EOS___']", "index": 30 }, { "content": " def addError(self, *args):\n self._events.append('addError')\n super(LoggingResult, self).addError(*args)", "metadata": "root.LoggingResult.addError", "header": "['class', 'LoggingResult', '(', 'unittest', '.', 'TestResult', ')', ':', '___EOS___']", "index": 34 }, { "content": "class TestEquality(object):\n # Check for a valid __eq__ implementation\n\n # Check for a valid __ne__ implementation", "metadata": "root.TestEquality", "header": "['module', '___EOS___']", "index": 38 }, { "content": " def test_eq(self):\n for obj_1, obj_2 in self.eq_pairs:\n self.assertEqual(obj_1, obj_2)\n self.assertEqual(obj_2, obj_1)", "metadata": "root.TestEquality.test_eq", "header": "['class', 'TestEquality', '(', 'object', ')', ':', '___NEWLINE___', '# Check for a valid __eq__ implementation', '___NL___', '___EOS___']", "index": 40 }, { "content": " def test_ne(self):\n for obj_1, obj_2 in self.ne_pairs:\n self.failIfEqual(obj_1, obj_2)\n self.failIfEqual(obj_2, obj_1)", "metadata": "root.TestEquality.test_ne", "header": "['class', 'TestEquality', '(', 'object', ')', ':', '___NEWLINE___', '# Check for a valid __eq__ implementation', '___NL___', '___EOS___']", "index": 46 }, { "content": "class TestHashing(object):\n # Check for a valid __hash__ implementation", "metadata": "root.TestHashing", "header": "['module', '___EOS___']", "index": 51 }, { "content": " def test_hash(self):\n for obj_1, obj_2 in self.eq_pairs:\n try:\n assert hash(obj_1) == hash(obj_2)\n except KeyboardInterrupt:\n raise\n except AssertionError:\n self.fail(\"%s and %s do not hash equal\" % (obj_1, obj_2))\n except Exception, e:\n self.fail(\"Problem hashing %s and %s: %s\" % (obj_1, obj_2, e))\n\n for obj_1, obj_2 in self.ne_pairs:\n try:\n assert hash(obj_1) != hash(obj_2)\n except KeyboardInterrupt:\n raise\n except AssertionError:\n self.fail(\"%s and %s hash equal, but shouldn't\" % (obj_1, obj_2))\n except Exception, e:\n self.fail(\"Problem hashing %s and %s: %s\" % (obj_1, obj_2, e))", "metadata": "root.TestHashing.test_hash", "header": "['class', 'TestHashing', '(', 'object', ')', ':', '___NEWLINE___', '# Check for a valid __hash__ implementation', '___NL___', '___EOS___']", "index": 53 }, { "content": "class Test_TestLoader(TestCase):\n\n ### Tests for TestLoader.loadTestsFromTestCase\n ################################################################\n\n # \"Return a suite of all tests cases contained in the TestCase-derived\n # class testCaseClass\"\n\n # \"Return a suite of all tests cases contained in the TestCase-derived\n # class testCaseClass\"\n #\n # Make sure it does the right thing even if no tests were found\n\n # \"Return a suite of all tests cases contained in the TestCase-derived\n # class testCaseClass\"\n #\n # What happens if loadTestsFromTestCase() is given an object\n # that isn't a subclass of TestCase? Specifically, what happens\n # if testCaseClass is a subclass of TestSuite?\n #\n # This is checked for specifically in the code, so we better add a\n # test for it.\n\n # \"Return a suite of all tests cases contained in the TestCase-derived\n # class testCaseClass\"\n #\n # Make sure loadTestsFromTestCase() picks up the default test method\n # name (as specified by TestCase), even though the method name does\n # not match the default TestLoader.testMethodPrefix string\n\n ################################################################\n ### /Tests for TestLoader.loadTestsFromTestCase\n\n ### Tests for TestLoader.loadTestsFromModule\n ################################################################\n\n # \"This method searches `module` for classes derived from TestCase\"\n\n # \"This method searches `module` for classes derived from TestCase\"\n #\n # What happens if no tests are found (no TestCase instances)?\n\n # \"This method searches `module` for classes derived from TestCase\"\n #\n # What happens if no tests are found (TestCases instances, but no tests)?\n\n # \"This method searches `module` for classes derived from TestCase\"s\n #\n # What happens if loadTestsFromModule() is given something other\n # than a module?\n #\n # XXX Currently, it succeeds anyway. This flexibility\n # should either be documented or loadTestsFromModule() should\n # raise a TypeError\n #\n # XXX Certain people are using this behaviour. We'll add a test for it\n\n ################################################################\n ### /Tests for TestLoader.loadTestsFromModule()\n\n ### Tests for TestLoader.loadTestsFromName()\n ################################################################\n\n # \"The specifier name is a ``dotted name'' that may resolve either to\n # a module, a test case class, a TestSuite instance, a test method\n # within a test case class, or a callable object which returns a\n # TestCase or TestSuite instance.\"\n #\n # Is ValueError raised in response to an empty name?\n\n # \"The specifier name is a ``dotted name'' that may resolve either to\n # a module, a test case class, a TestSuite instance, a test method\n # within a test case class, or a callable object which returns a\n # TestCase or TestSuite instance.\"\n #\n # What happens when the name contains invalid characters?\n\n # \"The specifier name is a ``dotted name'' that may resolve ... to a\n # module\"\n #\n # What happens when a module by that name can't be found?\n\n # \"The specifier name is a ``dotted name'' that may resolve either to\n # a module, a test case class, a TestSuite instance, a test method\n # within a test case class, or a callable object which returns a\n # TestCase or TestSuite instance.\"\n #\n # What happens when the module is found, but the attribute can't?\n\n # \"The specifier name is a ``dotted name'' that may resolve either to\n # a module, a test case class, a TestSuite instance, a test method\n # within a test case class, or a callable object which returns a\n # TestCase or TestSuite instance.\"\n #\n # What happens when we provide the module, but the attribute can't be\n # found?\n\n # \"The specifier name is a ``dotted name'' that may resolve either to\n # a module, a test case class, a TestSuite instance, a test method\n # within a test case class, or a callable object which returns a\n # TestCase or TestSuite instance.\"\n # ...\n # \"The method optionally resolves name relative to the given module\"\n #\n # Does loadTestsFromName raise ValueError when passed an empty\n # name relative to a provided module?\n #\n # XXX Should probably raise a ValueError instead of an AttributeError\n\n # \"The specifier name is a ``dotted name'' that may resolve either to\n # a module, a test case class, a TestSuite instance, a test method\n # within a test case class, or a callable object which returns a\n # TestCase or TestSuite instance.\"\n # ...\n # \"The method optionally resolves name relative to the given module\"\n #\n # What happens when an impossible name is given, relative to the provided\n # `module`?\n\n # \"The method optionally resolves name relative to the given module\"\n #\n # Does loadTestsFromName raise TypeError when the `module` argument\n # isn't a module object?\n #\n # XXX Accepts the not-a-module object, ignorning the object's type\n # This should raise an exception or the method name should be changed\n #\n # XXX Some people are relying on this, so keep it for now\n\n # \"The specifier name is a ``dotted name'' that may resolve either to\n # a module, a test case class, a TestSuite instance, a test method\n # within a test case class, or a callable object which returns a\n # TestCase or TestSuite instance.\"\n #\n # Does it raise an exception if the name resolves to an invalid\n # object?\n\n # \"The specifier name is a ``dotted name'' that may\n # resolve either to ... a test case class\"\n\n # \"The specifier name is a ``dotted name'' that may resolve either to\n # a module, a test case class, a TestSuite instance, a test method\n # within a test case class, or a callable object which returns a\n # TestCase or TestSuite instance.\"\n\n # \"The specifier name is a ``dotted name'' that may resolve ... to\n # ... a test method within a test case class\"\n\n # \"The specifier name is a ``dotted name'' that may resolve either to\n # a module, a test case class, a TestSuite instance, a test method\n # within a test case class, or a callable object which returns a\n # TestCase or TestSuite instance.\"\n #\n # Does loadTestsFromName() raise the proper exception when trying to\n # resolve \"a test method within a test case class\" that doesn't exist\n # for the given name (relative to a provided module)?\n\n # \"The specifier name is a ``dotted name'' that may resolve ... to\n # ... a callable object which returns a ... TestSuite instance\"\n\n # \"The specifier name is a ``dotted name'' that may resolve ... to\n # ... a callable object which returns a TestCase ... instance\"\n\n # \"The specifier name is a ``dotted name'' that may resolve ... to\n # ... a callable object which returns a TestCase or TestSuite instance\"\n #\n # What happens if the callable returns something else?\n\n ################################################################\n ### Tests for TestLoader.loadTestsFromName()\n\n ### Tests for TestLoader.loadTestsFromNames()\n ################################################################\n\n # \"Similar to loadTestsFromName(), but takes a sequence of names rather\n # than a single name.\"\n #\n # What happens if that sequence of names is empty?\n\n # \"Similar to loadTestsFromName(), but takes a sequence of names rather\n # than a single name.\"\n # ...\n # \"The method optionally resolves name relative to the given module\"\n #\n # What happens if that sequence of names is empty?\n #\n # XXX Should this raise a ValueError or just return an empty TestSuite?\n\n # \"The specifier name is a ``dotted name'' that may resolve either to\n # a module, a test case class, a TestSuite instance, a test method\n # within a test case class, or a callable object which returns a\n # TestCase or TestSuite instance.\"\n #\n # Is ValueError raised in response to an empty name?\n\n # \"The specifier name is a ``dotted name'' that may resolve either to\n # a module, a test case class, a TestSuite instance, a test method\n # within a test case class, or a callable object which returns a\n # TestCase or TestSuite instance.\"\n #\n # What happens when presented with an impossible module name?\n\n # \"The specifier name is a ``dotted name'' that may resolve either to\n # a module, a test case class, a TestSuite instance, a test method\n # within a test case class, or a callable object which returns a\n # TestCase or TestSuite instance.\"\n #\n # What happens when no module can be found for the given name?\n\n # \"The specifier name is a ``dotted name'' that may resolve either to\n # a module, a test case class, a TestSuite instance, a test method\n # within a test case class, or a callable object which returns a\n # TestCase or TestSuite instance.\"\n #\n # What happens when the module can be found, but not the attribute?\n\n # \"The specifier name is a ``dotted name'' that may resolve either to\n # a module, a test case class, a TestSuite instance, a test method\n # within a test case class, or a callable object which returns a\n # TestCase or TestSuite instance.\"\n # ...\n # \"The method optionally resolves name relative to the given module\"\n #\n # What happens when given an unknown attribute on a specified `module`\n # argument?\n\n # \"The specifier name is a ``dotted name'' that may resolve either to\n # a module, a test case class, a TestSuite instance, a test method\n # within a test case class, or a callable object which returns a\n # TestCase or TestSuite instance.\"\n # ...\n # \"The method optionally resolves name relative to the given module\"\n #\n # Do unknown attributes (relative to a provided module) still raise an\n # exception even in the presence of valid attribute names?\n\n # \"The specifier name is a ``dotted name'' that may resolve either to\n # a module, a test case class, a TestSuite instance, a test method\n # within a test case class, or a callable object which returns a\n # TestCase or TestSuite instance.\"\n # ...\n # \"The method optionally resolves name relative to the given module\"\n #\n # What happens when faced with the empty string?\n #\n # XXX This currently raises AttributeError, though ValueError is probably\n # more appropriate\n\n # \"The specifier name is a ``dotted name'' that may resolve either to\n # a module, a test case class, a TestSuite instance, a test method\n # within a test case class, or a callable object which returns a\n # TestCase or TestSuite instance.\"\n # ...\n # \"The method optionally resolves name relative to the given module\"\n #\n # What happens when presented with an impossible attribute name?\n\n # \"The method optionally resolves name relative to the given module\"\n #\n # Does loadTestsFromNames() make sure the provided `module` is in fact\n # a module?\n #\n # XXX This validation is currently not done. This flexibility should\n # either be documented or a TypeError should be raised.\n\n # \"The specifier name is a ``dotted name'' that may resolve either to\n # a module, a test case class, a TestSuite instance, a test method\n # within a test case class, or a callable object which returns a\n # TestCase or TestSuite instance.\"\n #\n # Does it raise an exception if the name resolves to an invalid\n # object?\n\n # \"The specifier name is a ``dotted name'' that may resolve ... to\n # ... a test case class\"\n\n # \"The specifier name is a ``dotted name'' that may resolve ... to\n # ... a TestSuite instance\"\n\n # \"The specifier name is a ``dotted name'' that may resolve ... to ... a\n # test method within a test case class\"\n\n # \"The specifier name is a ``dotted name'' that may resolve ... to ... a\n # test method within a test case class\"\n #\n # Does the method gracefully handle names that initially look like they\n # resolve to \"a test method within a test case class\" but don't?\n\n # \"The specifier name is a ``dotted name'' that may resolve ... to\n # ... a callable object which returns a ... TestSuite instance\"\n\n # \"The specifier name is a ``dotted name'' that may resolve ... to\n # ... a callable object which returns a TestCase ... instance\"\n\n # \"The specifier name is a ``dotted name'' that may resolve ... to\n # ... a callable object which returns a TestCase or TestSuite instance\"\n #\n # Are staticmethods handled correctly?\n\n # \"The specifier name is a ``dotted name'' that may resolve ... to\n # ... a callable object which returns a TestCase or TestSuite instance\"\n #\n # What happens when the callable returns something else?\n\n ################################################################\n ### /Tests for TestLoader.loadTestsFromNames()\n\n ### Tests for TestLoader.getTestCaseNames()\n ################################################################\n\n # \"Return a sorted sequence of method names found within testCaseClass\"\n #\n # Test.foobar is defined to make sure getTestCaseNames() respects\n # loader.testMethodPrefix\n\n # \"Return a sorted sequence of method names found within testCaseClass\"\n #\n # Does getTestCaseNames() behave appropriately if no tests are found?\n\n # \"Return a sorted sequence of method names found within testCaseClass\"\n #\n # Are not-TestCases handled gracefully?\n #\n # XXX This should raise a TypeError, not return a list\n #\n # XXX It's too late in the 2.5 release cycle to fix this, but it should\n # probably be revisited for 2.6\n\n # \"Return a sorted sequence of method names found within testCaseClass\"\n #\n # Make sure inherited names are handled.\n #\n # TestP.foobar is defined to make sure getTestCaseNames() respects\n # loader.testMethodPrefix\n\n ################################################################\n ### /Tests for TestLoader.getTestCaseNames()\n\n ### Tests for TestLoader.testMethodPrefix\n ################################################################\n\n # \"String giving the prefix of method names which will be interpreted as\n # test methods\"\n #\n # Implicit in the documentation is that testMethodPrefix is respected by\n # all loadTestsFrom* methods.\n\n # \"String giving the prefix of method names which will be interpreted as\n # test methods\"\n #\n # Implicit in the documentation is that testMethodPrefix is respected by\n # all loadTestsFrom* methods.\n\n # \"String giving the prefix of method names which will be interpreted as\n # test methods\"\n #\n # Implicit in the documentation is that testMethodPrefix is respected by\n # all loadTestsFrom* methods.\n\n # \"String giving the prefix of method names which will be interpreted as\n # test methods\"\n #\n # Implicit in the documentation is that testMethodPrefix is respected by\n # all loadTestsFrom* methods.\n\n # \"The default value is 'test'\"\n\n ################################################################\n ### /Tests for TestLoader.testMethodPrefix\n\n ### Tests for TestLoader.sortTestMethodsUsing\n ################################################################\n\n # \"Function to be used to compare method names when sorting them in\n # getTestCaseNames() and all the loadTestsFromX() methods\"\n\n # \"Function to be used to compare method names when sorting them in\n # getTestCaseNames() and all the loadTestsFromX() methods\"\n\n # \"Function to be used to compare method names when sorting them in\n # getTestCaseNames() and all the loadTestsFromX() methods\"\n\n # \"Function to be used to compare method names when sorting them in\n # getTestCaseNames() and all the loadTestsFromX() methods\"\n\n # \"Function to be used to compare method names when sorting them in\n # getTestCaseNames()\"\n #\n # Does it actually affect getTestCaseNames()?\n\n # \"The default value is the built-in cmp() function\"\n\n # \"it can be set to None to disable the sort.\"\n #\n # XXX How is this different from reassigning cmp? Are the tests returned\n # in a random order or something? This behaviour should die\n\n ################################################################\n ### /Tests for TestLoader.sortTestMethodsUsing\n\n ### Tests for TestLoader.suiteClass\n ################################################################\n\n # \"Callable object that constructs a test suite from a list of tests.\"\n\n # It is implicit in the documentation for TestLoader.suiteClass that\n # all TestLoader.loadTestsFrom* methods respect it. Let's make sure\n\n # It is implicit in the documentation for TestLoader.suiteClass that\n # all TestLoader.loadTestsFrom* methods respect it. Let's make sure\n\n # It is implicit in the documentation for TestLoader.suiteClass that\n # all TestLoader.loadTestsFrom* methods respect it. Let's make sure\n\n # \"The default value is the TestSuite class\"\n\n ################################################################\n ### /Tests for TestLoader.suiteClass", "metadata": "root.Test_TestLoader", "header": "['module', '___EOS___']", "index": 78 }, { "content": " def test_loadTestsFromTestCase(self):\n class Foo(unittest.TestCase):\n def test_1(self): pass\n def test_2(self): pass\n def foo_bar(self): pass\n\n tests = unittest.TestSuite([Foo('test_1'), Foo('test_2')])\n\n loader = unittest.TestLoader()\n self.assertEqual(loader.loadTestsFromTestCase(Foo), tests)", "metadata": "root.Test_TestLoader.test_loadTestsFromTestCase", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 85 }, { "content": " def test_loadTestsFromTestCase__no_matches(self):\n class Foo(unittest.TestCase):\n def foo_bar(self): pass\n\n empty_suite = unittest.TestSuite()\n\n loader = unittest.TestLoader()\n self.assertEqual(loader.loadTestsFromTestCase(Foo), empty_suite)", "metadata": "root.Test_TestLoader.test_loadTestsFromTestCase__no_matches", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 100 }, { "content": " def test_loadTestsFromTestCase__TestSuite_subclass(self):\n class NotATestCase(unittest.TestSuite):\n pass\n\n loader = unittest.TestLoader()\n try:\n loader.loadTestsFromTestCase(NotATestCase)\n except TypeError:\n pass\n else:\n self.fail('Should raise TypeError')", "metadata": "root.Test_TestLoader.test_loadTestsFromTestCase__TestSuite_subclass", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 118 }, { "content": " def test_loadTestsFromTestCase__default_method_name(self):\n class Foo(unittest.TestCase):\n def runTest(self):\n pass\n\n loader = unittest.TestLoader()\n # This has to be false for the test to succeed\n self.failIf('runTest'.startswith(loader.testMethodPrefix))\n\n suite = loader.loadTestsFromTestCase(Foo)\n self.failUnless(isinstance(suite, loader.suiteClass))\n self.assertEqual(list(suite), [Foo('runTest')])", "metadata": "root.Test_TestLoader.test_loadTestsFromTestCase__default_method_name", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 136 }, { "content": " def test_loadTestsFromModule__TestCase_subclass(self):\n m = types.ModuleType('m')\n class MyTestCase(unittest.TestCase):\n def test(self):\n pass\n m.testcase_1 = MyTestCase\n\n loader = unittest.TestLoader()\n suite = loader.loadTestsFromModule(m)\n self.failUnless(isinstance(suite, loader.suiteClass))\n\n expected = [loader.suiteClass([MyTestCase('test')])]\n self.assertEqual(list(suite), expected)", "metadata": "root.Test_TestLoader.test_loadTestsFromModule__TestCase_subclass", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 156 }, { "content": " def test_loadTestsFromModule__no_TestCase_instances(self):\n m = types.ModuleType('m')\n\n loader = unittest.TestLoader()\n suite = loader.loadTestsFromModule(m)\n self.failUnless(isinstance(suite, loader.suiteClass))\n self.assertEqual(list(suite), [])", "metadata": "root.Test_TestLoader.test_loadTestsFromModule__no_TestCase_instances", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 173 }, { "content": " def test_loadTestsFromModule__no_TestCase_tests(self):\n m = types.ModuleType('m')\n class MyTestCase(unittest.TestCase):\n pass\n m.testcase_1 = MyTestCase\n\n loader = unittest.TestLoader()\n suite = loader.loadTestsFromModule(m)\n self.failUnless(isinstance(suite, loader.suiteClass))\n\n self.assertEqual(list(suite), [loader.suiteClass()])", "metadata": "root.Test_TestLoader.test_loadTestsFromModule__no_TestCase_tests", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 184 }, { "content": " def test_loadTestsFromModule__not_a_module(self):\n class MyTestCase(unittest.TestCase):\n def test(self):\n pass\n\n class NotAModule(object):\n test_2 = MyTestCase\n\n loader = unittest.TestLoader()\n suite = loader.loadTestsFromModule(NotAModule)\n\n reference = [unittest.TestSuite([MyTestCase('test')])]\n self.assertEqual(list(suite), reference)", "metadata": "root.Test_TestLoader.test_loadTestsFromModule__not_a_module", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 206 }, { "content": " def test_loadTestsFromName__empty_name(self):\n loader = unittest.TestLoader()\n\n try:\n loader.loadTestsFromName('')\n except ValueError, e:\n self.assertEqual(str(e), \"Empty module name\")\n else:\n self.fail(\"TestLoader.loadTestsFromName failed to raise ValueError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromName__empty_name", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 232 }, { "content": " def test_loadTestsFromName__malformed_name(self):\n loader = unittest.TestLoader()\n\n # XXX Should this raise ValueError or ImportError?\n try:\n loader.loadTestsFromName('abc () //')\n except ValueError:\n pass\n except ImportError:\n pass\n else:\n self.fail(\"TestLoader.loadTestsFromName failed to raise ValueError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromName__malformed_name", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 248 }, { "content": " def test_loadTestsFromName__unknown_module_name(self):\n loader = unittest.TestLoader()\n\n try:\n loader.loadTestsFromName('sdasfasfasdf')\n except ImportError, e:\n self.assertEqual(str(e), \"No module named sdasfasfasdf\")\n else:\n self.fail(\"TestLoader.loadTestsFromName failed to raise ImportError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromName__unknown_module_name", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 265 }, { "content": " def test_loadTestsFromName__unknown_attr_name(self):\n loader = unittest.TestLoader()\n\n try:\n loader.loadTestsFromName('unittest.sdasfasfasdf')\n except AttributeError, e:\n self.assertEqual(str(e), \"'module' object has no attribute 'sdasfasfasdf'\")\n else:\n self.fail(\"TestLoader.loadTestsFromName failed to raise AttributeError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromName__unknown_attr_name", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 281 }, { "content": " def test_loadTestsFromName__relative_unknown_name(self):\n loader = unittest.TestLoader()\n\n try:\n loader.loadTestsFromName('sdasfasfasdf', unittest)\n except AttributeError, e:\n self.assertEqual(str(e), \"'module' object has no attribute 'sdasfasfasdf'\")\n else:\n self.fail(\"TestLoader.loadTestsFromName failed to raise AttributeError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromName__relative_unknown_name", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 298 }, { "content": " def test_loadTestsFromName__relative_empty_name(self):\n loader = unittest.TestLoader()\n\n try:\n loader.loadTestsFromName('', unittest)\n except AttributeError, e:\n pass\n else:\n self.fail(\"Failed to raise AttributeError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromName__relative_empty_name", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 319 }, { "content": " def test_loadTestsFromName__relative_malformed_name(self):\n loader = unittest.TestLoader()\n\n # XXX Should this raise AttributeError or ValueError?\n try:\n loader.loadTestsFromName('abc () //', unittest)\n except ValueError:\n pass\n except AttributeError:\n pass\n else:\n self.fail(\"TestLoader.loadTestsFromName failed to raise ValueError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromName__relative_malformed_name", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 338 }, { "content": " def test_loadTestsFromName__relative_not_a_module(self):\n class MyTestCase(unittest.TestCase):\n def test(self):\n pass\n\n class NotAModule(object):\n test_2 = MyTestCase\n\n loader = unittest.TestLoader()\n suite = loader.loadTestsFromName('test_2', NotAModule)\n\n reference = [MyTestCase('test')]\n self.assertEqual(list(suite), reference)", "metadata": "root.Test_TestLoader.test_loadTestsFromName__relative_not_a_module", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 360 }, { "content": " def test_loadTestsFromName__relative_bad_object(self):\n m = types.ModuleType('m')\n m.testcase_1 = object()\n\n loader = unittest.TestLoader()\n try:\n loader.loadTestsFromName('testcase_1', m)\n except TypeError:\n pass\n else:\n self.fail(\"Should have raised TypeError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromName__relative_bad_object", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 381 }, { "content": " def test_loadTestsFromName__relative_TestCase_subclass(self):\n m = types.ModuleType('m')\n class MyTestCase(unittest.TestCase):\n def test(self):\n pass\n m.testcase_1 = MyTestCase\n\n loader = unittest.TestLoader()\n suite = loader.loadTestsFromName('testcase_1', m)\n self.failUnless(isinstance(suite, loader.suiteClass))\n self.assertEqual(list(suite), [MyTestCase('test')])", "metadata": "root.Test_TestLoader.test_loadTestsFromName__relative_TestCase_subclass", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 395 }, { "content": " def test_loadTestsFromName__relative_TestSuite(self):\n m = types.ModuleType('m')\n class MyTestCase(unittest.TestCase):\n def test(self):\n pass\n m.testsuite = unittest.TestSuite([MyTestCase('test')])\n\n loader = unittest.TestLoader()\n suite = loader.loadTestsFromName('testsuite', m)\n self.failUnless(isinstance(suite, loader.suiteClass))\n\n self.assertEqual(list(suite), [MyTestCase('test')])", "metadata": "root.Test_TestLoader.test_loadTestsFromName__relative_TestSuite", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 411 }, { "content": " def test_loadTestsFromName__relative_testmethod(self):\n m = types.ModuleType('m')\n class MyTestCase(unittest.TestCase):\n def test(self):\n pass\n m.testcase_1 = MyTestCase\n\n loader = unittest.TestLoader()\n suite = loader.loadTestsFromName('testcase_1.test', m)\n self.failUnless(isinstance(suite, loader.suiteClass))\n\n self.assertEqual(list(suite), [MyTestCase('test')])", "metadata": "root.Test_TestLoader.test_loadTestsFromName__relative_testmethod", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 426 }, { "content": " def test_loadTestsFromName__relative_invalid_testmethod(self):\n m = types.ModuleType('m')\n class MyTestCase(unittest.TestCase):\n def test(self):\n pass\n m.testcase_1 = MyTestCase\n\n loader = unittest.TestLoader()\n try:\n loader.loadTestsFromName('testcase_1.testfoo', m)\n except AttributeError, e:\n self.assertEqual(str(e), \"type object 'MyTestCase' has no attribute 'testfoo'\")\n else:\n self.fail(\"Failed to raise AttributeError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromName__relative_invalid_testmethod", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 447 }, { "content": " def test_loadTestsFromName__callable__TestSuite(self):\n m = types.ModuleType('m')\n testcase_1 = unittest.FunctionTestCase(lambda: None)\n testcase_2 = unittest.FunctionTestCase(lambda: None)\n def return_TestSuite():\n return unittest.TestSuite([testcase_1, testcase_2])\n m.return_TestSuite = return_TestSuite\n\n loader = unittest.TestLoader()\n suite = loader.loadTestsFromName('return_TestSuite', m)\n self.failUnless(isinstance(suite, loader.suiteClass))\n self.assertEqual(list(suite), [testcase_1, testcase_2])", "metadata": "root.Test_TestLoader.test_loadTestsFromName__callable__TestSuite", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 464 }, { "content": " def test_loadTestsFromName__callable__TestCase_instance(self):\n m = types.ModuleType('m')\n testcase_1 = unittest.FunctionTestCase(lambda: None)\n def return_TestCase():\n return testcase_1\n m.return_TestCase = return_TestCase\n\n loader = unittest.TestLoader()\n suite = loader.loadTestsFromName('return_TestCase', m)\n self.failUnless(isinstance(suite, loader.suiteClass))\n self.assertEqual(list(suite), [testcase_1])", "metadata": "root.Test_TestLoader.test_loadTestsFromName__callable__TestCase_instance", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 479 }, { "content": " def test_loadTestsFromName__callable__wrong_type(self):\n m = types.ModuleType('m')\n def return_wrong():\n return 6\n m.return_wrong = return_wrong\n\n loader = unittest.TestLoader()\n try:\n suite = loader.loadTestsFromName('return_wrong', m)\n except TypeError:\n pass\n else:\n self.fail(\"TestLoader.loadTestsFromName failed to raise TypeError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromName__callable__wrong_type", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 495 }, { "content": " def test_loadTestsFromNames__empty_name_list(self):\n loader = unittest.TestLoader()\n\n suite = loader.loadTestsFromNames([])\n self.failUnless(isinstance(suite, loader.suiteClass))\n self.assertEqual(list(suite), [])", "metadata": "root.Test_TestLoader.test_loadTestsFromNames__empty_name_list", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 519 }, { "content": " def test_loadTestsFromNames__relative_empty_name_list(self):\n loader = unittest.TestLoader()\n\n suite = loader.loadTestsFromNames([], unittest)\n self.failUnless(isinstance(suite, loader.suiteClass))\n self.assertEqual(list(suite), [])", "metadata": "root.Test_TestLoader.test_loadTestsFromNames__relative_empty_name_list", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 534 }, { "content": " def test_loadTestsFromNames__empty_name(self):\n loader = unittest.TestLoader()\n\n try:\n loader.loadTestsFromNames([''])\n except ValueError, e:\n self.assertEqual(str(e), \"Empty module name\")\n else:\n self.fail(\"TestLoader.loadTestsFromNames failed to raise ValueError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromNames__empty_name", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 547 }, { "content": " def test_loadTestsFromNames__malformed_name(self):\n loader = unittest.TestLoader()\n\n # XXX Should this raise ValueError or ImportError?\n try:\n loader.loadTestsFromNames(['abc () //'])\n except ValueError:\n pass\n except ImportError:\n pass\n else:\n self.fail(\"TestLoader.loadTestsFromNames failed to raise ValueError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromNames__malformed_name", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 563 }, { "content": " def test_loadTestsFromNames__unknown_module_name(self):\n loader = unittest.TestLoader()\n\n try:\n loader.loadTestsFromNames(['sdasfasfasdf'])\n except ImportError, e:\n self.assertEqual(str(e), \"No module named sdasfasfasdf\")\n else:\n self.fail(\"TestLoader.loadTestsFromNames failed to raise ImportError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromNames__unknown_module_name", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 582 }, { "content": " def test_loadTestsFromNames__unknown_attr_name(self):\n loader = unittest.TestLoader()\n\n try:\n loader.loadTestsFromNames(['unittest.sdasfasfasdf', 'unittest'])\n except AttributeError, e:\n self.assertEqual(str(e), \"'module' object has no attribute 'sdasfasfasdf'\")\n else:\n self.fail(\"TestLoader.loadTestsFromNames failed to raise AttributeError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromNames__unknown_attr_name", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 598 }, { "content": " def test_loadTestsFromNames__unknown_name_relative_1(self):\n loader = unittest.TestLoader()\n\n try:\n loader.loadTestsFromNames(['sdasfasfasdf'], unittest)\n except AttributeError, e:\n self.assertEqual(str(e), \"'module' object has no attribute 'sdasfasfasdf'\")\n else:\n self.fail(\"TestLoader.loadTestsFromName failed to raise AttributeError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromNames__unknown_name_relative_1", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 617 }, { "content": " def test_loadTestsFromNames__unknown_name_relative_2(self):\n loader = unittest.TestLoader()\n\n try:\n loader.loadTestsFromNames(['TestCase', 'sdasfasfasdf'], unittest)\n except AttributeError, e:\n self.assertEqual(str(e), \"'module' object has no attribute 'sdasfasfasdf'\")\n else:\n self.fail(\"TestLoader.loadTestsFromName failed to raise AttributeError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromNames__unknown_name_relative_2", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 636 }, { "content": " def test_loadTestsFromNames__relative_empty_name(self):\n loader = unittest.TestLoader()\n\n try:\n loader.loadTestsFromNames([''], unittest)\n except AttributeError:\n pass\n else:\n self.fail(\"Failed to raise ValueError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromNames__relative_empty_name", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 657 }, { "content": " def test_loadTestsFromNames__relative_malformed_name(self):\n loader = unittest.TestLoader()\n\n # XXX Should this raise AttributeError or ValueError?\n try:\n loader.loadTestsFromNames(['abc () //'], unittest)\n except AttributeError:\n pass\n except ValueError:\n pass\n else:\n self.fail(\"TestLoader.loadTestsFromNames failed to raise ValueError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromNames__relative_malformed_name", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 675 }, { "content": " def test_loadTestsFromNames__relative_not_a_module(self):\n class MyTestCase(unittest.TestCase):\n def test(self):\n pass\n\n class NotAModule(object):\n test_2 = MyTestCase\n\n loader = unittest.TestLoader()\n suite = loader.loadTestsFromNames(['test_2'], NotAModule)\n\n reference = [unittest.TestSuite([MyTestCase('test')])]\n self.assertEqual(list(suite), reference)", "metadata": "root.Test_TestLoader.test_loadTestsFromNames__relative_not_a_module", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 695 }, { "content": " def test_loadTestsFromNames__relative_bad_object(self):\n m = types.ModuleType('m')\n m.testcase_1 = object()\n\n loader = unittest.TestLoader()\n try:\n loader.loadTestsFromNames(['testcase_1'], m)\n except TypeError:\n pass\n else:\n self.fail(\"Should have raised TypeError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromNames__relative_bad_object", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 716 }, { "content": " def test_loadTestsFromNames__relative_TestCase_subclass(self):\n m = types.ModuleType('m')\n class MyTestCase(unittest.TestCase):\n def test(self):\n pass\n m.testcase_1 = MyTestCase\n\n loader = unittest.TestLoader()\n suite = loader.loadTestsFromNames(['testcase_1'], m)\n self.failUnless(isinstance(suite, loader.suiteClass))\n\n expected = loader.suiteClass([MyTestCase('test')])\n self.assertEqual(list(suite), [expected])", "metadata": "root.Test_TestLoader.test_loadTestsFromNames__relative_TestCase_subclass", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 730 }, { "content": " def test_loadTestsFromNames__relative_TestSuite(self):\n m = types.ModuleType('m')\n class MyTestCase(unittest.TestCase):\n def test(self):\n pass\n m.testsuite = unittest.TestSuite([MyTestCase('test')])\n\n loader = unittest.TestLoader()\n suite = loader.loadTestsFromNames(['testsuite'], m)\n self.failUnless(isinstance(suite, loader.suiteClass))\n\n self.assertEqual(list(suite), [m.testsuite])", "metadata": "root.Test_TestLoader.test_loadTestsFromNames__relative_TestSuite", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 746 }, { "content": " def test_loadTestsFromNames__relative_testmethod(self):\n m = types.ModuleType('m')\n class MyTestCase(unittest.TestCase):\n def test(self):\n pass\n m.testcase_1 = MyTestCase\n\n loader = unittest.TestLoader()\n suite = loader.loadTestsFromNames(['testcase_1.test'], m)\n self.failUnless(isinstance(suite, loader.suiteClass))\n\n ref_suite = unittest.TestSuite([MyTestCase('test')])\n self.assertEqual(list(suite), [ref_suite])", "metadata": "root.Test_TestLoader.test_loadTestsFromNames__relative_testmethod", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 761 }, { "content": " def test_loadTestsFromNames__relative_invalid_testmethod(self):\n m = types.ModuleType('m')\n class MyTestCase(unittest.TestCase):\n def test(self):\n pass\n m.testcase_1 = MyTestCase\n\n loader = unittest.TestLoader()\n try:\n loader.loadTestsFromNames(['testcase_1.testfoo'], m)\n except AttributeError, e:\n self.assertEqual(str(e), \"type object 'MyTestCase' has no attribute 'testfoo'\")\n else:\n self.fail(\"Failed to raise AttributeError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromNames__relative_invalid_testmethod", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 780 }, { "content": " def test_loadTestsFromNames__callable__TestSuite(self):\n m = types.ModuleType('m')\n testcase_1 = unittest.FunctionTestCase(lambda: None)\n testcase_2 = unittest.FunctionTestCase(lambda: None)\n def return_TestSuite():\n return unittest.TestSuite([testcase_1, testcase_2])\n m.return_TestSuite = return_TestSuite\n\n loader = unittest.TestLoader()\n suite = loader.loadTestsFromNames(['return_TestSuite'], m)\n self.failUnless(isinstance(suite, loader.suiteClass))\n\n expected = unittest.TestSuite([testcase_1, testcase_2])\n self.assertEqual(list(suite), [expected])", "metadata": "root.Test_TestLoader.test_loadTestsFromNames__callable__TestSuite", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 797 }, { "content": " def test_loadTestsFromNames__callable__TestCase_instance(self):\n m = types.ModuleType('m')\n testcase_1 = unittest.FunctionTestCase(lambda: None)\n def return_TestCase():\n return testcase_1\n m.return_TestCase = return_TestCase\n\n loader = unittest.TestLoader()\n suite = loader.loadTestsFromNames(['return_TestCase'], m)\n self.failUnless(isinstance(suite, loader.suiteClass))\n\n ref_suite = unittest.TestSuite([testcase_1])\n self.assertEqual(list(suite), [ref_suite])", "metadata": "root.Test_TestLoader.test_loadTestsFromNames__callable__TestCase_instance", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 814 }, { "content": " def test_loadTestsFromNames__callable__call_staticmethod(self):\n m = types.ModuleType('m')\n class Test1(unittest.TestCase):\n def test(self):\n pass\n\n testcase_1 = Test1('test')\n class Foo(unittest.TestCase):\n @staticmethod\n def foo():\n return testcase_1\n m.Foo = Foo\n\n loader = unittest.TestLoader()\n suite = loader.loadTestsFromNames(['Foo.foo'], m)\n self.failUnless(isinstance(suite, loader.suiteClass))\n\n ref_suite = unittest.TestSuite([testcase_1])\n self.assertEqual(list(suite), [ref_suite])", "metadata": "root.Test_TestLoader.test_loadTestsFromNames__callable__call_staticmethod", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 832 }, { "content": " def test_loadTestsFromNames__callable__wrong_type(self):\n m = types.ModuleType('m')\n def return_wrong():\n return 6\n m.return_wrong = return_wrong\n\n loader = unittest.TestLoader()\n try:\n suite = loader.loadTestsFromNames(['return_wrong'], m)\n except TypeError:\n pass\n else:\n self.fail(\"TestLoader.loadTestsFromNames failed to raise TypeError\")", "metadata": "root.Test_TestLoader.test_loadTestsFromNames__callable__wrong_type", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 856 }, { "content": " def test_getTestCaseNames(self):\n class Test(unittest.TestCase):\n def test_1(self): pass\n def test_2(self): pass\n def foobar(self): pass\n\n loader = unittest.TestLoader()\n\n self.assertEqual(loader.getTestCaseNames(Test), ['test_1', 'test_2'])", "metadata": "root.Test_TestLoader.test_getTestCaseNames", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 880 }, { "content": " def test_getTestCaseNames__no_tests(self):\n class Test(unittest.TestCase):\n def foobar(self): pass\n\n loader = unittest.TestLoader()\n\n self.assertEqual(loader.getTestCaseNames(Test), [])", "metadata": "root.Test_TestLoader.test_getTestCaseNames__no_tests", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 893 }, { "content": " def test_getTestCaseNames__not_a_TestCase(self):\n class BadCase(int):\n def test_foo(self):\n pass\n\n loader = unittest.TestLoader()\n names = loader.getTestCaseNames(BadCase)\n\n self.assertEqual(names, ['test_foo'])", "metadata": "root.Test_TestLoader.test_getTestCaseNames__not_a_TestCase", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 909 }, { "content": " def test_getTestCaseNames__inheritance(self):\n class TestP(unittest.TestCase):\n def test_1(self): pass\n def test_2(self): pass\n def foobar(self): pass\n\n class TestC(TestP):\n def test_1(self): pass\n def test_3(self): pass\n\n loader = unittest.TestLoader()\n\n names = ['test_1', 'test_2', 'test_3']\n self.assertEqual(loader.getTestCaseNames(TestC), names)", "metadata": "root.Test_TestLoader.test_getTestCaseNames__inheritance", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 925 }, { "content": " def test_testMethodPrefix__loadTestsFromTestCase(self):\n class Foo(unittest.TestCase):\n def test_1(self): pass\n def test_2(self): pass\n def foo_bar(self): pass\n\n tests_1 = unittest.TestSuite([Foo('foo_bar')])\n tests_2 = unittest.TestSuite([Foo('test_1'), Foo('test_2')])\n\n loader = unittest.TestLoader()\n loader.testMethodPrefix = 'foo'\n self.assertEqual(loader.loadTestsFromTestCase(Foo), tests_1)\n\n loader.testMethodPrefix = 'test'\n self.assertEqual(loader.loadTestsFromTestCase(Foo), tests_2)", "metadata": "root.Test_TestLoader.test_testMethodPrefix__loadTestsFromTestCase", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 951 }, { "content": " def test_testMethodPrefix__loadTestsFromModule(self):\n m = types.ModuleType('m')\n class Foo(unittest.TestCase):\n def test_1(self): pass\n def test_2(self): pass\n def foo_bar(self): pass\n m.Foo = Foo\n\n tests_1 = [unittest.TestSuite([Foo('foo_bar')])]\n tests_2 = [unittest.TestSuite([Foo('test_1'), Foo('test_2')])]\n\n loader = unittest.TestLoader()\n loader.testMethodPrefix = 'foo'\n self.assertEqual(list(loader.loadTestsFromModule(m)), tests_1)\n\n loader.testMethodPrefix = 'test'\n self.assertEqual(list(loader.loadTestsFromModule(m)), tests_2)", "metadata": "root.Test_TestLoader.test_testMethodPrefix__loadTestsFromModule", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 972 }, { "content": " def test_testMethodPrefix__loadTestsFromName(self):\n m = types.ModuleType('m')\n class Foo(unittest.TestCase):\n def test_1(self): pass\n def test_2(self): pass\n def foo_bar(self): pass\n m.Foo = Foo\n\n tests_1 = unittest.TestSuite([Foo('foo_bar')])\n tests_2 = unittest.TestSuite([Foo('test_1'), Foo('test_2')])\n\n loader = unittest.TestLoader()\n loader.testMethodPrefix = 'foo'\n self.assertEqual(loader.loadTestsFromName('Foo', m), tests_1)\n\n loader.testMethodPrefix = 'test'\n self.assertEqual(loader.loadTestsFromName('Foo', m), tests_2)", "metadata": "root.Test_TestLoader.test_testMethodPrefix__loadTestsFromName", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 995 }, { "content": " def test_testMethodPrefix__loadTestsFromNames(self):\n m = types.ModuleType('m')\n class Foo(unittest.TestCase):\n def test_1(self): pass\n def test_2(self): pass\n def foo_bar(self): pass\n m.Foo = Foo\n\n tests_1 = unittest.TestSuite([unittest.TestSuite([Foo('foo_bar')])])\n tests_2 = unittest.TestSuite([Foo('test_1'), Foo('test_2')])\n tests_2 = unittest.TestSuite([tests_2])\n\n loader = unittest.TestLoader()\n loader.testMethodPrefix = 'foo'\n self.assertEqual(loader.loadTestsFromNames(['Foo'], m), tests_1)\n\n loader.testMethodPrefix = 'test'\n self.assertEqual(loader.loadTestsFromNames(['Foo'], m), tests_2)", "metadata": "root.Test_TestLoader.test_testMethodPrefix__loadTestsFromNames", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 1018 }, { "content": " def test_testMethodPrefix__default_value(self):\n loader = unittest.TestLoader()\n self.failUnless(loader.testMethodPrefix == 'test')", "metadata": "root.Test_TestLoader.test_testMethodPrefix__default_value", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 1038 }, { "content": " def test_sortTestMethodsUsing__loadTestsFromTestCase(self):\n def reversed_cmp(x, y):\n return -cmp(x, y)\n\n class Foo(unittest.TestCase):\n def test_1(self): pass\n def test_2(self): pass\n\n loader = unittest.TestLoader()\n loader.sortTestMethodsUsing = reversed_cmp\n\n tests = loader.suiteClass([Foo('test_2'), Foo('test_1')])\n self.assertEqual(loader.loadTestsFromTestCase(Foo), tests)", "metadata": "root.Test_TestLoader.test_sortTestMethodsUsing__loadTestsFromTestCase", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 1050 }, { "content": " def test_sortTestMethodsUsing__loadTestsFromModule(self):\n def reversed_cmp(x, y):\n return -cmp(x, y)\n\n m = types.ModuleType('m')\n class Foo(unittest.TestCase):\n def test_1(self): pass\n def test_2(self): pass\n m.Foo = Foo\n\n loader = unittest.TestLoader()\n loader.sortTestMethodsUsing = reversed_cmp\n\n tests = [loader.suiteClass([Foo('test_2'), Foo('test_1')])]\n self.assertEqual(list(loader.loadTestsFromModule(m)), tests)", "metadata": "root.Test_TestLoader.test_sortTestMethodsUsing__loadTestsFromModule", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 1066 }, { "content": " def test_sortTestMethodsUsing__loadTestsFromName(self):\n def reversed_cmp(x, y):\n return -cmp(x, y)\n\n m = types.ModuleType('m')\n class Foo(unittest.TestCase):\n def test_1(self): pass\n def test_2(self): pass\n m.Foo = Foo\n\n loader = unittest.TestLoader()\n loader.sortTestMethodsUsing = reversed_cmp\n\n tests = loader.suiteClass([Foo('test_2'), Foo('test_1')])\n self.assertEqual(loader.loadTestsFromName('Foo', m), tests)", "metadata": "root.Test_TestLoader.test_sortTestMethodsUsing__loadTestsFromName", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 1084 }, { "content": " def test_sortTestMethodsUsing__loadTestsFromNames(self):\n def reversed_cmp(x, y):\n return -cmp(x, y)\n\n m = types.ModuleType('m')\n class Foo(unittest.TestCase):\n def test_1(self): pass\n def test_2(self): pass\n m.Foo = Foo\n\n loader = unittest.TestLoader()\n loader.sortTestMethodsUsing = reversed_cmp\n\n tests = [loader.suiteClass([Foo('test_2'), Foo('test_1')])]\n self.assertEqual(list(loader.loadTestsFromNames(['Foo'], m)), tests)", "metadata": "root.Test_TestLoader.test_sortTestMethodsUsing__loadTestsFromNames", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 1102 }, { "content": " def test_sortTestMethodsUsing__getTestCaseNames(self):\n def reversed_cmp(x, y):\n return -cmp(x, y)\n\n class Foo(unittest.TestCase):\n def test_1(self): pass\n def test_2(self): pass\n\n loader = unittest.TestLoader()\n loader.sortTestMethodsUsing = reversed_cmp\n\n test_names = ['test_2', 'test_1']\n self.assertEqual(loader.getTestCaseNames(Foo), test_names)", "metadata": "root.Test_TestLoader.test_sortTestMethodsUsing__getTestCaseNames", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 1122 }, { "content": " def test_sortTestMethodsUsing__default_value(self):\n loader = unittest.TestLoader()\n self.failUnless(loader.sortTestMethodsUsing is cmp)", "metadata": "root.Test_TestLoader.test_sortTestMethodsUsing__default_value", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 1137 }, { "content": " def test_sortTestMethodsUsing__None(self):\n class Foo(unittest.TestCase):\n def test_1(self): pass\n def test_2(self): pass\n\n loader = unittest.TestLoader()\n loader.sortTestMethodsUsing = None\n\n test_names = ['test_2', 'test_1']\n self.assertEqual(set(loader.getTestCaseNames(Foo)), set(test_names))", "metadata": "root.Test_TestLoader.test_sortTestMethodsUsing__None", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 1145 }, { "content": " def test_suiteClass__loadTestsFromTestCase(self):\n class Foo(unittest.TestCase):\n def test_1(self): pass\n def test_2(self): pass\n def foo_bar(self): pass\n\n tests = [Foo('test_1'), Foo('test_2')]\n\n loader = unittest.TestLoader()\n loader.suiteClass = list\n self.assertEqual(loader.loadTestsFromTestCase(Foo), tests)", "metadata": "root.Test_TestLoader.test_suiteClass__loadTestsFromTestCase", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 1163 }, { "content": " def test_suiteClass__loadTestsFromModule(self):\n m = types.ModuleType('m')\n class Foo(unittest.TestCase):\n def test_1(self): pass\n def test_2(self): pass\n def foo_bar(self): pass\n m.Foo = Foo\n\n tests = [[Foo('test_1'), Foo('test_2')]]\n\n loader = unittest.TestLoader()\n loader.suiteClass = list\n self.assertEqual(loader.loadTestsFromModule(m), tests)", "metadata": "root.Test_TestLoader.test_suiteClass__loadTestsFromModule", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 1177 }, { "content": " def test_suiteClass__loadTestsFromName(self):\n m = types.ModuleType('m')\n class Foo(unittest.TestCase):\n def test_1(self): pass\n def test_2(self): pass\n def foo_bar(self): pass\n m.Foo = Foo\n\n tests = [Foo('test_1'), Foo('test_2')]\n\n loader = unittest.TestLoader()\n loader.suiteClass = list\n self.assertEqual(loader.loadTestsFromName('Foo', m), tests)", "metadata": "root.Test_TestLoader.test_suiteClass__loadTestsFromName", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 1193 }, { "content": " def test_suiteClass__loadTestsFromNames(self):\n m = types.ModuleType('m')\n class Foo(unittest.TestCase):\n def test_1(self): pass\n def test_2(self): pass\n def foo_bar(self): pass\n m.Foo = Foo\n\n tests = [[Foo('test_1'), Foo('test_2')]]\n\n loader = unittest.TestLoader()\n loader.suiteClass = list\n self.assertEqual(loader.loadTestsFromNames(['Foo'], m), tests)", "metadata": "root.Test_TestLoader.test_suiteClass__loadTestsFromNames", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 1209 }, { "content": " def test_suiteClass__default_value(self):\n loader = unittest.TestLoader()\n self.failUnless(loader.suiteClass is unittest.TestSuite)", "metadata": "root.Test_TestLoader.test_suiteClass__default_value", "header": "['class', 'Test_TestLoader', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '### Tests for TestLoader.loadTestsFromTestCase', '___NL___', '################################################################', '___NL___', '___NL___', '# \"Return a suite of all tests cases contained in the TestCase-derived', '___NL___', '# class testCaseClass\"', '___NL___', '___EOS___']", "index": 1224 }, { "content": "class Foo(unittest.TestCase):", "metadata": "root.Foo", "header": "['module', '___EOS___']", "index": 1234 }, { "content": " def test_1(self): pass", "metadata": "root.Foo.test_1", "header": "['class', 'Foo', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1235 }, { "content": " def test_2(self): pass", "metadata": "root.Foo.test_2", "header": "['class', 'Foo', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1236 }, { "content": " def test_3(self): pass", "metadata": "root.Foo.test_3", "header": "['class', 'Foo', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1237 }, { "content": " def runTest(self): pass", "metadata": "root.Foo.runTest", "header": "['class', 'Foo', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1238 }, { "content": "def _mk_TestSuite(*names):\n return unittest.TestSuite(Foo(n) for n in names)", "metadata": "root._mk_TestSuite", "header": "['module', '___EOS___']", "index": 1240 }, { "content": "class Test_TestSuite(TestCase, TestEquality):\n\n ### Set up attributes needed by inherited tests\n ################################################################\n\n # Used by TestEquality.test_eq\n eq_pairs = [(unittest.TestSuite(), unittest.TestSuite())\n ,(unittest.TestSuite(), unittest.TestSuite([]))\n ,(_mk_TestSuite('test_1'), _mk_TestSuite('test_1'))]\n\n # Used by TestEquality.test_ne\n ne_pairs = [(unittest.TestSuite(), _mk_TestSuite('test_1'))\n ,(unittest.TestSuite([]), _mk_TestSuite('test_1'))\n ,(_mk_TestSuite('test_1', 'test_2'), _mk_TestSuite('test_1', 'test_3'))\n ,(_mk_TestSuite('test_1'), _mk_TestSuite('test_2'))]\n\n ################################################################\n ### /Set up attributes needed by inherited tests\n\n ### Tests for TestSuite.__init__\n ################################################################\n\n # \"class TestSuite([tests])\"\n #\n # The tests iterable should be optional\n\n # \"class TestSuite([tests])\"\n # ...\n # \"If tests is given, it must be an iterable of individual test cases\n # or other test suites that will be used to build the suite initially\"\n #\n # TestSuite should deal with empty tests iterables by allowing the\n # creation of an empty suite\n\n # \"class TestSuite([tests])\"\n # ...\n # \"If tests is given, it must be an iterable of individual test cases\n # or other test suites that will be used to build the suite initially\"\n #\n # TestSuite should allow any iterable to provide tests\n\n # \"class TestSuite([tests])\"\n # ...\n # \"If tests is given, it must be an iterable of individual test cases\n # or other test suites that will be used to build the suite initially\"\n #\n # Does TestSuite() also allow other TestSuite() instances to be present\n # in the tests iterable?\n\n ################################################################\n ### /Tests for TestSuite.__init__\n\n # Container types should support the iter protocol\n\n # \"Return the number of tests represented by the this test object.\n # ...this method is also implemented by the TestSuite class, which can\n # return larger [greater than 1] values\"\n #\n # Presumably an empty TestSuite returns 0?\n\n # \"Return the number of tests represented by the this test object.\n # ...this method is also implemented by the TestSuite class, which can\n # return larger [greater than 1] values\"\n #\n # Presumably an empty TestSuite (even if it contains other empty\n # TestSuite instances) returns 0?\n\n # \"Return the number of tests represented by the this test object.\n # ...this method is also implemented by the TestSuite class, which can\n # return larger [greater than 1] values\"\n\n # \"Return the number of tests represented by the this test object.\n # ...this method is also implemented by the TestSuite class, which can\n # return larger [greater than 1] values\"\n #\n # Make sure this holds for nested TestSuite instances, too\n\n # \"Run the tests associated with this suite, collecting the result into\n # the test result object passed as result.\"\n #\n # And if there are no tests? What then?\n\n # \"Note that unlike TestCase.run(), TestSuite.run() requires the\n # \"result object to be passed in.\"\n\n # \"Run the tests associated with this suite, collecting the result into\n # the test result object passed as result.\"\n\n # \"Add a TestCase ... to the suite\"\n\n # \"Add a ... TestSuite to the suite\"\n\n # \"Add all the tests from an iterable of TestCase and TestSuite\n # instances to this test suite.\"\n #\n # \"This is equivalent to iterating over tests, calling addTest() for\n # each element\"\n\n # \"Add all the tests from an iterable of TestCase and TestSuite\n # instances to this test suite.\"\n #\n # What happens if it doesn't get an iterable?\n\n\n", "metadata": "root.Test_TestSuite", "header": "['module', '___EOS___']", "index": 1246 }, { "content": " def test_init__tests_optional(self):\n suite = unittest.TestSuite()\n\n self.assertEqual(suite.countTestCases(), 0)", "metadata": "root.Test_TestSuite.test_init__tests_optional", "header": "['class', 'Test_TestSuite', '(', 'TestCase', ',', 'TestEquality', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes needed by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1271 }, { "content": " def test_init__empty_tests(self):\n suite = unittest.TestSuite([])\n\n self.assertEqual(suite.countTestCases(), 0)", "metadata": "root.Test_TestSuite.test_init__empty_tests", "header": "['class', 'Test_TestSuite', '(', 'TestCase', ',', 'TestEquality', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes needed by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1283 }, { "content": " def test_init__tests_from_any_iterable(self):\n def tests():\n yield unittest.FunctionTestCase(lambda: None)\n yield unittest.FunctionTestCase(lambda: None)\n\n suite_1 = unittest.TestSuite(tests())\n self.assertEqual(suite_1.countTestCases(), 2)\n\n suite_2 = unittest.TestSuite(suite_1)\n self.assertEqual(suite_2.countTestCases(), 2)\n\n suite_3 = unittest.TestSuite(set(suite_1))\n self.assertEqual(suite_3.countTestCases(), 2)", "metadata": "root.Test_TestSuite.test_init__tests_from_any_iterable", "header": "['class', 'Test_TestSuite', '(', 'TestCase', ',', 'TestEquality', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes needed by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1294 }, { "content": " def test_init__TestSuite_instances_in_tests(self):\n def tests():\n ftc = unittest.FunctionTestCase(lambda: None)\n yield unittest.TestSuite([ftc])\n yield unittest.FunctionTestCase(lambda: None)\n\n suite = unittest.TestSuite(tests())\n self.assertEqual(suite.countTestCases(), 2)", "metadata": "root.Test_TestSuite.test_init__TestSuite_instances_in_tests", "header": "['class', 'Test_TestSuite', '(', 'TestCase', ',', 'TestEquality', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes needed by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1315 }, { "content": " def test_iter(self):\n test1 = unittest.FunctionTestCase(lambda: None)\n test2 = unittest.FunctionTestCase(lambda: None)\n suite = unittest.TestSuite((test1, test2))\n\n self.assertEqual(list(suite), [test1, test2])", "metadata": "root.Test_TestSuite.test_iter", "header": "['class', 'Test_TestSuite', '(', 'TestCase', ',', 'TestEquality', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes needed by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1328 }, { "content": " def test_countTestCases_zero_simple(self):\n suite = unittest.TestSuite()\n\n self.assertEqual(suite.countTestCases(), 0)", "metadata": "root.Test_TestSuite.test_countTestCases_zero_simple", "header": "['class', 'Test_TestSuite', '(', 'TestCase', ',', 'TestEquality', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes needed by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1340 }, { "content": " def test_countTestCases_zero_nested(self):\n class Test1(unittest.TestCase):\n def test(self):\n pass\n\n suite = unittest.TestSuite([unittest.TestSuite()])\n\n self.assertEqual(suite.countTestCases(), 0)", "metadata": "root.Test_TestSuite.test_countTestCases_zero_nested", "header": "['class', 'Test_TestSuite', '(', 'TestCase', ',', 'TestEquality', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes needed by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1351 }, { "content": " def test_countTestCases_simple(self):\n test1 = unittest.FunctionTestCase(lambda: None)\n test2 = unittest.FunctionTestCase(lambda: None)\n suite = unittest.TestSuite((test1, test2))\n\n self.assertEqual(suite.countTestCases(), 2)", "metadata": "root.Test_TestSuite.test_countTestCases_simple", "header": "['class', 'Test_TestSuite', '(', 'TestCase', ',', 'TestEquality', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes needed by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1363 }, { "content": " def test_countTestCases_nested(self):\n class Test1(unittest.TestCase):\n def test1(self): pass\n def test2(self): pass\n\n test2 = unittest.FunctionTestCase(lambda: None)\n test3 = unittest.FunctionTestCase(lambda: None)\n child = unittest.TestSuite((Test1('test2'), test2))\n parent = unittest.TestSuite((test3, child, Test1('test1')))\n\n self.assertEqual(parent.countTestCases(), 4)", "metadata": "root.Test_TestSuite.test_countTestCases_nested", "header": "['class', 'Test_TestSuite', '(', 'TestCase', ',', 'TestEquality', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes needed by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1375 }, { "content": " def test_run__empty_suite(self):\n events = []\n result = LoggingResult(events)\n\n suite = unittest.TestSuite()\n\n suite.run(result)\n\n self.assertEqual(events, [])", "metadata": "root.Test_TestSuite.test_run__empty_suite", "header": "['class', 'Test_TestSuite', '(', 'TestCase', ',', 'TestEquality', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes needed by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1391 }, { "content": " def test_run__requires_result(self):\n suite = unittest.TestSuite()\n\n try:\n suite.run()\n except TypeError:\n pass\n else:\n self.fail(\"Failed to raise TypeError\")", "metadata": "root.Test_TestSuite.test_run__requires_result", "header": "['class', 'Test_TestSuite', '(', 'TestCase', ',', 'TestEquality', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes needed by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1403 }, { "content": " def test_run(self):\n events = []\n result = LoggingResult(events)\n\n class LoggingCase(unittest.TestCase):\n def run(self, result):\n events.append('run %s' % self._testMethodName)\n\n def test1(self): pass\n def test2(self): pass\n\n tests = [LoggingCase('test1'), LoggingCase('test2')]\n\n unittest.TestSuite(tests).run(result)\n\n self.assertEqual(events, ['run test1', 'run test2'])", "metadata": "root.Test_TestSuite.test_run", "header": "['class', 'Test_TestSuite', '(', 'TestCase', ',', 'TestEquality', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes needed by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1415 }, { "content": " def test_addTest__TestCase(self):\n class Foo(unittest.TestCase):\n def test(self): pass\n\n test = Foo('test')\n suite = unittest.TestSuite()\n\n suite.addTest(test)\n\n self.assertEqual(suite.countTestCases(), 1)\n self.assertEqual(list(suite), [test])", "metadata": "root.Test_TestSuite.test_addTest__TestCase", "header": "['class', 'Test_TestSuite', '(', 'TestCase', ',', 'TestEquality', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes needed by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1433 }, { "content": " def test_addTest__TestSuite(self):\n class Foo(unittest.TestCase):\n def test(self): pass\n\n suite_2 = unittest.TestSuite([Foo('test')])\n\n suite = unittest.TestSuite()\n suite.addTest(suite_2)\n\n self.assertEqual(suite.countTestCases(), 1)\n self.assertEqual(list(suite), [suite_2])", "metadata": "root.Test_TestSuite.test_addTest__TestSuite", "header": "['class', 'Test_TestSuite', '(', 'TestCase', ',', 'TestEquality', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes needed by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1446 }, { "content": " def test_addTests(self):\n class Foo(unittest.TestCase):\n def test_1(self): pass\n def test_2(self): pass\n\n test_1 = Foo('test_1')\n test_2 = Foo('test_2')\n inner_suite = unittest.TestSuite([test_2])\n\n def gen():\n yield test_1\n yield test_2\n yield inner_suite\n\n suite_1 = unittest.TestSuite()\n suite_1.addTests(gen())\n\n self.assertEqual(list(suite_1), list(gen()))\n\n # \"This is equivalent to iterating over tests, calling addTest() for\n # each element\"\n suite_2 = unittest.TestSuite()\n for t in gen():\n suite_2.addTest(t)\n\n self.assertEqual(suite_1, suite_2)", "metadata": "root.Test_TestSuite.test_addTests", "header": "['class', 'Test_TestSuite', '(', 'TestCase', ',', 'TestEquality', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes needed by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1463 }, { "content": " def test_addTest__noniterable(self):\n suite = unittest.TestSuite()\n\n try:\n suite.addTests(5)\n except TypeError:\n pass\n else:\n self.fail(\"Failed to raise TypeError\")", "metadata": "root.Test_TestSuite.test_addTest__noniterable", "header": "['class', 'Test_TestSuite', '(', 'TestCase', ',', 'TestEquality', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes needed by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1494 }, { "content": " def test_addTest__noncallable(self):\n suite = unittest.TestSuite()\n self.assertRaises(TypeError, suite.addTest, 5)", "metadata": "root.Test_TestSuite.test_addTest__noncallable", "header": "['class', 'Test_TestSuite', '(', 'TestCase', ',', 'TestEquality', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes needed by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1504 }, { "content": " def test_addTest__casesuiteclass(self):\n suite = unittest.TestSuite()\n self.assertRaises(TypeError, suite.addTest, Test_TestSuite)\n self.assertRaises(TypeError, suite.addTest, unittest.TestSuite)", "metadata": "root.Test_TestSuite.test_addTest__casesuiteclass", "header": "['class', 'Test_TestSuite', '(', 'TestCase', ',', 'TestEquality', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes needed by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1508 }, { "content": " def test_addTests__string(self):\n suite = unittest.TestSuite()\n self.assertRaises(TypeError, suite.addTests, \"foo\")", "metadata": "root.Test_TestSuite.test_addTests__string", "header": "['class', 'Test_TestSuite', '(', 'TestCase', ',', 'TestEquality', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes needed by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1513 }, { "content": "class Test_FunctionTestCase(TestCase):\n\n # \"Return the number of tests represented by the this test object. For\n # TestCase instances, this will always be 1\"\n\n # \"When a setUp() method is defined, the test runner will run that method\n # prior to each test. Likewise, if a tearDown() method is defined, the\n # test runner will invoke that method after each test. In the example,\n # setUp() was used to create a fresh sequence for each test.\"\n #\n # Make sure the proper call order is maintained, even if setUp() raises\n # an exception.\n\n # \"When a setUp() method is defined, the test runner will run that method\n # prior to each test. Likewise, if a tearDown() method is defined, the\n # test runner will invoke that method after each test. In the example,\n # setUp() was used to create a fresh sequence for each test.\"\n #\n # Make sure the proper call order is maintained, even if the test raises\n # an error (as opposed to a failure).\n\n # \"When a setUp() method is defined, the test runner will run that method\n # prior to each test. Likewise, if a tearDown() method is defined, the\n # test runner will invoke that method after each test. In the example,\n # setUp() was used to create a fresh sequence for each test.\"\n #\n # Make sure the proper call order is maintained, even if the test signals\n # a failure (as opposed to an error).\n\n # \"When a setUp() method is defined, the test runner will run that method\n # prior to each test. Likewise, if a tearDown() method is defined, the\n # test runner will invoke that method after each test. In the example,\n # setUp() was used to create a fresh sequence for each test.\"\n #\n # Make sure the proper call order is maintained, even if tearDown() raises\n # an exception.\n\n # \"Return a string identifying the specific test case.\"\n #\n # Because of the vague nature of the docs, I'm not going to lock this\n # test down too much. Really all that can be asserted is that the id()\n # will be a string (either 8-byte or unicode -- again, because the docs\n # just say \"string\")\n\n # \"Returns a one-line description of the test, or None if no description\n # has been provided. The default implementation of this method returns\n # the first line of the test method's docstring, if available, or None.\"\n\n # \"Returns a one-line description of the test, or None if no description\n # has been provided. The default implementation of this method returns\n # the first line of the test method's docstring, if available, or None.\"", "metadata": "root.Test_FunctionTestCase", "header": "['module', '___EOS___']", "index": 1518 }, { "content": " def test_countTestCases(self):\n test = unittest.FunctionTestCase(lambda: None)\n\n self.assertEqual(test.countTestCases(), 1)", "metadata": "root.Test_FunctionTestCase.test_countTestCases", "header": "['class', 'Test_FunctionTestCase', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '# \"Return the number of tests represented by the this test object. For', '___NL___', '# TestCase instances, this will always be 1\"', '___NL___', '___EOS___']", "index": 1522 }, { "content": " def test_run_call_order__error_in_setUp(self):\n events = []\n result = LoggingResult(events)\n\n def setUp():\n events.append('setUp')\n raise RuntimeError('raised by setUp')\n\n def test():\n events.append('test')\n\n def tearDown():\n events.append('tearDown')\n\n expected = ['startTest', 'setUp', 'addError', 'stopTest']\n unittest.FunctionTestCase(test, setUp, tearDown).run(result)\n self.assertEqual(events, expected)", "metadata": "root.Test_FunctionTestCase.test_run_call_order__error_in_setUp", "header": "['class', 'Test_FunctionTestCase', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '# \"Return the number of tests represented by the this test object. For', '___NL___', '# TestCase instances, this will always be 1\"', '___NL___', '___EOS___']", "index": 1534 }, { "content": " def test_run_call_order__error_in_test(self):\n events = []\n result = LoggingResult(events)\n\n def setUp():\n events.append('setUp')\n\n def test():\n events.append('test')\n raise RuntimeError('raised by test')\n\n def tearDown():\n events.append('tearDown')\n\n expected = ['startTest', 'setUp', 'test', 'addError', 'tearDown',\n 'stopTest']\n unittest.FunctionTestCase(test, setUp, tearDown).run(result)\n self.assertEqual(events, expected)", "metadata": "root.Test_FunctionTestCase.test_run_call_order__error_in_test", "header": "['class', 'Test_FunctionTestCase', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '# \"Return the number of tests represented by the this test object. For', '___NL___', '# TestCase instances, this will always be 1\"', '___NL___', '___EOS___']", "index": 1559 }, { "content": " def test_run_call_order__failure_in_test(self):\n events = []\n result = LoggingResult(events)\n\n def setUp():\n events.append('setUp')\n\n def test():\n events.append('test')\n self.fail('raised by test')\n\n def tearDown():\n events.append('tearDown')\n\n expected = ['startTest', 'setUp', 'test', 'addFailure', 'tearDown',\n 'stopTest']\n unittest.FunctionTestCase(test, setUp, tearDown).run(result)\n self.assertEqual(events, expected)", "metadata": "root.Test_FunctionTestCase.test_run_call_order__failure_in_test", "header": "['class', 'Test_FunctionTestCase', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '# \"Return the number of tests represented by the this test object. For', '___NL___', '# TestCase instances, this will always be 1\"', '___NL___', '___EOS___']", "index": 1585 }, { "content": " def test_run_call_order__error_in_tearDown(self):\n events = []\n result = LoggingResult(events)\n\n def setUp():\n events.append('setUp')\n\n def test():\n events.append('test')\n\n def tearDown():\n events.append('tearDown')\n raise RuntimeError('raised by tearDown')\n\n expected = ['startTest', 'setUp', 'test', 'tearDown', 'addError',\n 'stopTest']\n unittest.FunctionTestCase(test, setUp, tearDown).run(result)\n self.assertEqual(events, expected)", "metadata": "root.Test_FunctionTestCase.test_run_call_order__error_in_tearDown", "header": "['class', 'Test_FunctionTestCase', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '# \"Return the number of tests represented by the this test object. For', '___NL___', '# TestCase instances, this will always be 1\"', '___NL___', '___EOS___']", "index": 1611 }, { "content": " def test_id(self):\n test = unittest.FunctionTestCase(lambda: None)\n\n self.failUnless(isinstance(test.id(), basestring))", "metadata": "root.Test_FunctionTestCase.test_id", "header": "['class', 'Test_FunctionTestCase', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '# \"Return the number of tests represented by the this test object. For', '___NL___', '# TestCase instances, this will always be 1\"', '___NL___', '___EOS___']", "index": 1636 }, { "content": " def test_shortDescription__no_docstring(self):\n test = unittest.FunctionTestCase(lambda: None)\n\n self.assertEqual(test.shortDescription(), None)", "metadata": "root.Test_FunctionTestCase.test_shortDescription__no_docstring", "header": "['class', 'Test_FunctionTestCase', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '# \"Return the number of tests represented by the this test object. For', '___NL___', '# TestCase instances, this will always be 1\"', '___NL___', '___EOS___']", "index": 1644 }, { "content": " def test_shortDescription__singleline_docstring(self):\n desc = \"this tests foo\"\n test = unittest.FunctionTestCase(lambda: None, description=desc)\n\n self.assertEqual(test.shortDescription(), \"this tests foo\")", "metadata": "root.Test_FunctionTestCase.test_shortDescription__singleline_docstring", "header": "['class', 'Test_FunctionTestCase', '(', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '# \"Return the number of tests represented by the this test object. For', '___NL___', '# TestCase instances, this will always be 1\"', '___NL___', '___EOS___']", "index": 1652 }, { "content": "class Test_TestResult(TestCase):\n # Note: there are not separate tests for TestResult.wasSuccessful(),\n # TestResult.errors, TestResult.failures, TestResult.testsRun or\n # TestResult.shouldStop because these only have meaning in terms of\n # other TestResult methods.\n #\n # Accordingly, tests for the aforenamed attributes are incorporated\n # in with the tests for the defining methods.\n ################################################################\n\n\n # \"This method can be called to signal that the set of tests being\n # run should be aborted by setting the TestResult's shouldStop\n # attribute to True.\"\n\n # \"Called when the test case test is about to be run. The default\n # implementation simply increments the instance's testsRun counter.\"\n\n # \"Called after the test case test has been executed, regardless of\n # the outcome. The default implementation does nothing.\"\n\n # \"addSuccess(test)\"\n # ...\n # \"Called when the test case test succeeds\"\n # ...\n # \"wasSuccessful() - Returns True if all tests run so far have passed,\n # otherwise returns False\"\n # ...\n # \"testsRun - The total number of tests run so far.\"\n # ...\n # \"errors - A list containing 2-tuples of TestCase instances and\n # formatted tracebacks. Each tuple represents a test which raised an\n # unexpected exception. Contains formatted\n # tracebacks instead of sys.exc_info() results.\"\n # ...\n # \"failures - A list containing 2-tuples of TestCase instances and\n # formatted tracebacks. Each tuple represents a test where a failure was\n # explicitly signalled using the TestCase.fail*() or TestCase.assert*()\n # methods. Contains formatted tracebacks instead\n # of sys.exc_info() results.\"\n\n # \"addFailure(test, err)\"\n # ...\n # \"Called when the test case test signals a failure. err is a tuple of\n # the form returned by sys.exc_info(): (type, value, traceback)\"\n # ...\n # \"wasSuccessful() - Returns True if all tests run so far have passed,\n # otherwise returns False\"\n # ...\n # \"testsRun - The total number of tests run so far.\"\n # ...\n # \"errors - A list containing 2-tuples of TestCase instances and\n # formatted tracebacks. Each tuple represents a test which raised an\n # unexpected exception. Contains formatted\n # tracebacks instead of sys.exc_info() results.\"\n # ...\n # \"failures - A list containing 2-tuples of TestCase instances and\n # formatted tracebacks. Each tuple represents a test where a failure was\n # explicitly signalled using the TestCase.fail*() or TestCase.assert*()\n # methods. Contains formatted tracebacks instead\n # of sys.exc_info() results.\"\n\n # \"addError(test, err)\"\n # ...\n # \"Called when the test case test raises an unexpected exception err\n # is a tuple of the form returned by sys.exc_info():\n # (type, value, traceback)\"\n # ...\n # \"wasSuccessful() - Returns True if all tests run so far have passed,\n # otherwise returns False\"\n # ...\n # \"testsRun - The total number of tests run so far.\"\n # ...\n # \"errors - A list containing 2-tuples of TestCase instances and\n # formatted tracebacks. Each tuple represents a test which raised an\n # unexpected exception. Contains formatted\n # tracebacks instead of sys.exc_info() results.\"\n # ...\n # \"failures - A list containing 2-tuples of TestCase instances and\n # formatted tracebacks. Each tuple represents a test where a failure was\n # explicitly signalled using the TestCase.fail*() or TestCase.assert*()\n # methods. Contains formatted tracebacks instead\n # of sys.exc_info() results.\"", "metadata": "root.Test_TestResult", "header": "['module', '___EOS___']", "index": 1658 }, { "content": " def test_init(self):\n result = unittest.TestResult()\n\n self.failUnless(result.wasSuccessful())\n self.assertEqual(len(result.errors), 0)\n self.assertEqual(len(result.failures), 0)\n self.assertEqual(result.testsRun, 0)\n self.assertEqual(result.shouldStop, False)", "metadata": "root.Test_TestResult.test_init", "header": "['class', 'Test_TestResult', '(', 'TestCase', ')', ':', '___NEWLINE___', '# Note: there are not separate tests for TestResult.wasSuccessful(),', '___NL___', '# TestResult.errors, TestResult.failures, TestResult.testsRun or', '___NL___', '# TestResult.shouldStop because these only have meaning in terms of', '___NL___', '# other TestResult methods.', '___NL___', '#', '___NL___', '# Accordingly, tests for the aforenamed attributes are incorporated', '___NL___', '# in with the tests for the defining methods.', '___NL___', '################################################################', '___NL___', '___EOS___']", "index": 1668 }, { "content": " def test_stop(self):\n result = unittest.TestResult()\n\n result.stop()\n\n self.assertEqual(result.shouldStop, True)", "metadata": "root.Test_TestResult.test_stop", "header": "['class', 'Test_TestResult', '(', 'TestCase', ')', ':', '___NEWLINE___', '# Note: there are not separate tests for TestResult.wasSuccessful(),', '___NL___', '# TestResult.errors, TestResult.failures, TestResult.testsRun or', '___NL___', '# TestResult.shouldStop because these only have meaning in terms of', '___NL___', '# other TestResult methods.', '___NL___', '#', '___NL___', '# Accordingly, tests for the aforenamed attributes are incorporated', '___NL___', '# in with the tests for the defining methods.', '___NL___', '################################################################', '___NL___', '___EOS___']", "index": 1680 }, { "content": " def test_startTest(self):\n class Foo(unittest.TestCase):\n def test_1(self):\n pass\n\n test = Foo('test_1')\n\n result = unittest.TestResult()\n\n result.startTest(test)\n\n self.failUnless(result.wasSuccessful())\n self.assertEqual(len(result.errors), 0)\n self.assertEqual(len(result.failures), 0)\n self.assertEqual(result.testsRun, 1)\n self.assertEqual(result.shouldStop, False)\n\n result.stopTest(test)", "metadata": "root.Test_TestResult.test_startTest", "header": "['class', 'Test_TestResult', '(', 'TestCase', ')', ':', '___NEWLINE___', '# Note: there are not separate tests for TestResult.wasSuccessful(),', '___NL___', '# TestResult.errors, TestResult.failures, TestResult.testsRun or', '___NL___', '# TestResult.shouldStop because these only have meaning in terms of', '___NL___', '# other TestResult methods.', '___NL___', '#', '___NL___', '# Accordingly, tests for the aforenamed attributes are incorporated', '___NL___', '# in with the tests for the defining methods.', '___NL___', '################################################################', '___NL___', '___EOS___']", "index": 1689 }, { "content": " def test_stopTest(self):\n class Foo(unittest.TestCase):\n def test_1(self):\n pass\n\n test = Foo('test_1')\n\n result = unittest.TestResult()\n\n result.startTest(test)\n\n self.failUnless(result.wasSuccessful())\n self.assertEqual(len(result.errors), 0)\n self.assertEqual(len(result.failures), 0)\n self.assertEqual(result.testsRun, 1)\n self.assertEqual(result.shouldStop, False)\n\n result.stopTest(test)\n\n # Same tests as above; make sure nothing has changed\n self.failUnless(result.wasSuccessful())\n self.assertEqual(len(result.errors), 0)\n self.assertEqual(len(result.failures), 0)\n self.assertEqual(result.testsRun, 1)\n self.assertEqual(result.shouldStop, False)", "metadata": "root.Test_TestResult.test_stopTest", "header": "['class', 'Test_TestResult', '(', 'TestCase', ')', ':', '___NEWLINE___', '# Note: there are not separate tests for TestResult.wasSuccessful(),', '___NL___', '# TestResult.errors, TestResult.failures, TestResult.testsRun or', '___NL___', '# TestResult.shouldStop because these only have meaning in terms of', '___NL___', '# other TestResult methods.', '___NL___', '#', '___NL___', '# Accordingly, tests for the aforenamed attributes are incorporated', '___NL___', '# in with the tests for the defining methods.', '___NL___', '################################################################', '___NL___', '___EOS___']", "index": 1710 }, { "content": " def test_addSuccess(self):\n class Foo(unittest.TestCase):\n def test_1(self):\n pass\n\n test = Foo('test_1')\n\n result = unittest.TestResult()\n\n result.startTest(test)\n result.addSuccess(test)\n result.stopTest(test)\n\n self.failUnless(result.wasSuccessful())\n self.assertEqual(len(result.errors), 0)\n self.assertEqual(len(result.failures), 0)\n self.assertEqual(result.testsRun, 1)\n self.assertEqual(result.shouldStop, False)", "metadata": "root.Test_TestResult.test_addSuccess", "header": "['class', 'Test_TestResult', '(', 'TestCase', ')', ':', '___NEWLINE___', '# Note: there are not separate tests for TestResult.wasSuccessful(),', '___NL___', '# TestResult.errors, TestResult.failures, TestResult.testsRun or', '___NL___', '# TestResult.shouldStop because these only have meaning in terms of', '___NL___', '# other TestResult methods.', '___NL___', '#', '___NL___', '# Accordingly, tests for the aforenamed attributes are incorporated', '___NL___', '# in with the tests for the defining methods.', '___NL___', '################################################################', '___NL___', '___EOS___']", "index": 1755 }, { "content": " def test_addFailure(self):\n import sys\n\n class Foo(unittest.TestCase):\n def test_1(self):\n pass\n\n test = Foo('test_1')\n try:\n test.fail(\"foo\")\n except:\n exc_info_tuple = sys.exc_info()\n\n result = unittest.TestResult()\n\n result.startTest(test)\n result.addFailure(test, exc_info_tuple)\n result.stopTest(test)\n\n self.failIf(result.wasSuccessful())\n self.assertEqual(len(result.errors), 0)\n self.assertEqual(len(result.failures), 1)\n self.assertEqual(result.testsRun, 1)\n self.assertEqual(result.shouldStop, False)\n\n test_case, formatted_exc = result.failures[0]\n self.failUnless(test_case is test)\n self.failUnless(isinstance(formatted_exc, str))", "metadata": "root.Test_TestResult.test_addFailure", "header": "['class', 'Test_TestResult', '(', 'TestCase', ')', ':', '___NEWLINE___', '# Note: there are not separate tests for TestResult.wasSuccessful(),', '___NL___', '# TestResult.errors, TestResult.failures, TestResult.testsRun or', '___NL___', '# TestResult.shouldStop because these only have meaning in terms of', '___NL___', '# other TestResult methods.', '___NL___', '#', '___NL___', '# Accordingly, tests for the aforenamed attributes are incorporated', '___NL___', '# in with the tests for the defining methods.', '___NL___', '################################################################', '___NL___', '___EOS___']", "index": 1794 }, { "content": " def test_addError(self):\n import sys\n\n class Foo(unittest.TestCase):\n def test_1(self):\n pass\n\n test = Foo('test_1')\n try:\n raise TypeError()\n except:\n exc_info_tuple = sys.exc_info()\n\n result = unittest.TestResult()\n\n result.startTest(test)\n result.addError(test, exc_info_tuple)\n result.stopTest(test)\n\n self.failIf(result.wasSuccessful())\n self.assertEqual(len(result.errors), 1)\n self.assertEqual(len(result.failures), 0)\n self.assertEqual(result.testsRun, 1)\n self.assertEqual(result.shouldStop, False)\n\n test_case, formatted_exc = result.errors[0]\n self.failUnless(test_case is test)\n self.failUnless(isinstance(formatted_exc, str))", "metadata": "root.Test_TestResult.test_addError", "header": "['class', 'Test_TestResult', '(', 'TestCase', ')', ':', '___NEWLINE___', '# Note: there are not separate tests for TestResult.wasSuccessful(),', '___NL___', '# TestResult.errors, TestResult.failures, TestResult.testsRun or', '___NL___', '# TestResult.shouldStop because these only have meaning in terms of', '___NL___', '# other TestResult methods.', '___NL___', '#', '___NL___', '# Accordingly, tests for the aforenamed attributes are incorporated', '___NL___', '# in with the tests for the defining methods.', '___NL___', '################################################################', '___NL___', '___EOS___']", "index": 1844 }, { "content": "class Foo(unittest.TestCase):", "metadata": "root.Foo", "header": "['module', '___EOS___']", "index": 1876 }, { "content": " def runTest(self): pass", "metadata": "root.Foo.runTest", "header": "['class', 'Foo', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1877 }, { "content": " def test1(self): pass", "metadata": "root.Foo.test1", "header": "['class', 'Foo', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1878 }, { "content": "class Bar(Foo):", "metadata": "root.Bar", "header": "['module', '___EOS___']", "index": 1880 }, { "content": " def test2(self): pass", "metadata": "root.Bar.test2", "header": "['class', 'Bar', '(', 'Foo', ')', ':', '___EOS___']", "index": 1881 }, { "content": "class Test_TestCase(TestCase, TestEquality, TestHashing):\n\n ### Set up attributes used by inherited tests\n ################################################################\n\n # Used by TestHashing.test_hash and TestEquality.test_eq\n eq_pairs = [(Foo('test1'), Foo('test1'))]\n\n # Used by TestEquality.test_ne\n ne_pairs = [(Foo('test1'), Foo('runTest'))\n ,(Foo('test1'), Bar('test1'))\n ,(Foo('test1'), Bar('test2'))]\n\n ################################################################\n ### /Set up attributes used by inherited tests\n\n\n # \"class TestCase([methodName])\"\n # ...\n # \"Each instance of TestCase will run a single test method: the\n # method named methodName.\"\n # ...\n # \"methodName defaults to \"runTest\".\"\n #\n # Make sure it really is optional, and that it defaults to the proper\n # thing.\n\n # \"class TestCase([methodName])\"\n # ...\n # \"Each instance of TestCase will run a single test method: the\n # method named methodName.\"\n\n # \"class TestCase([methodName])\"\n # ...\n # \"Each instance of TestCase will run a single test method: the\n # method named methodName.\"\n\n # \"Return the number of tests represented by the this test object. For\n # TestCase instances, this will always be 1\"\n\n # \"Return the default type of test result object to be used to run this\n # test. For TestCase instances, this will always be\n # unittest.TestResult; subclasses of TestCase should\n # override this as necessary.\"\n\n # \"When a setUp() method is defined, the test runner will run that method\n # prior to each test. Likewise, if a tearDown() method is defined, the\n # test runner will invoke that method after each test. In the example,\n # setUp() was used to create a fresh sequence for each test.\"\n #\n # Make sure the proper call order is maintained, even if setUp() raises\n # an exception.\n\n # \"When a setUp() method is defined, the test runner will run that method\n # prior to each test. Likewise, if a tearDown() method is defined, the\n # test runner will invoke that method after each test. In the example,\n # setUp() was used to create a fresh sequence for each test.\"\n #\n # Make sure the proper call order is maintained, even if the test raises\n # an error (as opposed to a failure).\n\n # \"When a setUp() method is defined, the test runner will run that method\n # prior to each test. Likewise, if a tearDown() method is defined, the\n # test runner will invoke that method after each test. In the example,\n # setUp() was used to create a fresh sequence for each test.\"\n #\n # Make sure the proper call order is maintained, even if the test signals\n # a failure (as opposed to an error).\n\n # \"When a setUp() method is defined, the test runner will run that method\n # prior to each test. Likewise, if a tearDown() method is defined, the\n # test runner will invoke that method after each test. In the example,\n # setUp() was used to create a fresh sequence for each test.\"\n #\n # Make sure the proper call order is maintained, even if tearDown() raises\n # an exception.\n\n # \"This class attribute gives the exception raised by the test() method.\n # If a test framework needs to use a specialized exception, possibly to\n # carry additional information, it must subclass this exception in\n # order to ``play fair'' with the framework. The initial value of this\n # attribute is AssertionError\"\n\n # \"This class attribute gives the exception raised by the test() method.\n # If a test framework needs to use a specialized exception, possibly to\n # carry additional information, it must subclass this exception in\n # order to ``play fair'' with the framework.\"\n #\n # Make sure TestCase.run() respects the designated failureException\n\n # \"This class attribute gives the exception raised by the test() method.\n # If a test framework needs to use a specialized exception, possibly to\n # carry additional information, it must subclass this exception in\n # order to ``play fair'' with the framework.\"\n #\n # Make sure TestCase.run() respects the designated failureException\n\n # \"The default implementation does nothing.\"\n\n # \"The default implementation does nothing.\"\n\n # \"Return a string identifying the specific test case.\"\n #\n # Because of the vague nature of the docs, I'm not going to lock this\n # test down too much. Really all that can be asserted is that the id()\n # will be a string (either 8-byte or unicode -- again, because the docs\n # just say \"string\")\n\n # \"Returns a one-line description of the test, or None if no description\n # has been provided. The default implementation of this method returns\n # the first line of the test method's docstring, if available, or None.\"\n\n # \"Returns a one-line description of the test, or None if no description\n # has been provided. The default implementation of this method returns\n # the first line of the test method's docstring, if available, or None.\"\n\n # \"Returns a one-line description of the test, or None if no description\n # has been provided. The default implementation of this method returns\n # the first line of the test method's docstring, if available, or None.\"\n\n # \"If result is omitted or None, a temporary result object is created\n # and used, but is not made available to the caller\"", "metadata": "root.Test_TestCase", "header": "['module', '___EOS___']", "index": 1886 }, { "content": " def test_init__no_test_name(self):\n class Test(unittest.TestCase):\n def runTest(self): raise MyException()\n def test(self): pass\n\n self.assertEqual(Test().id()[-13:], '.Test.runTest')", "metadata": "root.Test_TestCase.test_init__no_test_name", "header": "['class', 'Test_TestCase', '(', 'TestCase', ',', 'TestEquality', ',', 'TestHashing', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes used by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestHashing.test_hash and TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1912 }, { "content": " def test_init__test_name__valid(self):\n class Test(unittest.TestCase):\n def runTest(self): raise MyException()\n def test(self): pass\n\n self.assertEqual(Test('test').id()[-10:], '.Test.test')", "metadata": "root.Test_TestCase.test_init__test_name__valid", "header": "['class', 'Test_TestCase', '(', 'TestCase', ',', 'TestEquality', ',', 'TestHashing', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes used by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestHashing.test_hash and TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1923 }, { "content": " def test_init__test_name__invalid(self):\n class Test(unittest.TestCase):\n def runTest(self): raise MyException()\n def test(self): pass\n\n try:\n Test('testfoo')\n except ValueError:\n pass\n else:\n self.fail(\"Failed to raise ValueError\")", "metadata": "root.Test_TestCase.test_init__test_name__invalid", "header": "['class', 'Test_TestCase', '(', 'TestCase', ',', 'TestEquality', ',', 'TestHashing', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes used by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestHashing.test_hash and TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1934 }, { "content": " def test_countTestCases(self):\n class Foo(unittest.TestCase):\n def test(self): pass\n\n self.assertEqual(Foo('test').countTestCases(), 1)", "metadata": "root.Test_TestCase.test_countTestCases", "header": "['class', 'Test_TestCase', '(', 'TestCase', ',', 'TestEquality', ',', 'TestHashing', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes used by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestHashing.test_hash and TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1948 }, { "content": " def test_defaultTestResult(self):\n class Foo(unittest.TestCase):\n def runTest(self):\n pass\n\n result = Foo().defaultTestResult()\n self.assertEqual(type(result), unittest.TestResult)", "metadata": "root.Test_TestCase.test_defaultTestResult", "header": "['class', 'Test_TestCase', '(', 'TestCase', ',', 'TestEquality', ',', 'TestHashing', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes used by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestHashing.test_hash and TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1958 }, { "content": " def test_run_call_order__error_in_setUp(self):\n events = []\n result = LoggingResult(events)\n\n class Foo(unittest.TestCase):\n def setUp(self):\n events.append('setUp')\n raise RuntimeError('raised by Foo.setUp')\n\n def test(self):\n events.append('test')\n\n def tearDown(self):\n events.append('tearDown')\n\n Foo('test').run(result)\n expected = ['startTest', 'setUp', 'addError', 'stopTest']\n self.assertEqual(events, expected)", "metadata": "root.Test_TestCase.test_run_call_order__error_in_setUp", "header": "['class', 'Test_TestCase', '(', 'TestCase', ',', 'TestEquality', ',', 'TestHashing', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes used by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestHashing.test_hash and TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1973 }, { "content": " def test_run_call_order__error_in_test(self):\n events = []\n result = LoggingResult(events)\n\n class Foo(unittest.TestCase):\n def setUp(self):\n events.append('setUp')\n\n def test(self):\n events.append('test')\n raise RuntimeError('raised by Foo.test')\n\n def tearDown(self):\n events.append('tearDown')\n\n expected = ['startTest', 'setUp', 'test', 'addError', 'tearDown',\n 'stopTest']\n Foo('test').run(result)\n self.assertEqual(events, expected)", "metadata": "root.Test_TestCase.test_run_call_order__error_in_test", "header": "['class', 'Test_TestCase', '(', 'TestCase', ',', 'TestEquality', ',', 'TestHashing', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes used by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestHashing.test_hash and TestEquality.test_eq', '___NL___', '___EOS___']", "index": 1999 }, { "content": " def test_run_call_order__failure_in_test(self):\n events = []\n result = LoggingResult(events)\n\n class Foo(unittest.TestCase):\n def setUp(self):\n events.append('setUp')\n\n def test(self):\n events.append('test')\n self.fail('raised by Foo.test')\n\n def tearDown(self):\n events.append('tearDown')\n\n expected = ['startTest', 'setUp', 'test', 'addFailure', 'tearDown',\n 'stopTest']\n Foo('test').run(result)\n self.assertEqual(events, expected)", "metadata": "root.Test_TestCase.test_run_call_order__failure_in_test", "header": "['class', 'Test_TestCase', '(', 'TestCase', ',', 'TestEquality', ',', 'TestHashing', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes used by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestHashing.test_hash and TestEquality.test_eq', '___NL___', '___EOS___']", "index": 2026 }, { "content": " def test_run_call_order__error_in_tearDown(self):\n events = []\n result = LoggingResult(events)\n\n class Foo(unittest.TestCase):\n def setUp(self):\n events.append('setUp')\n\n def test(self):\n events.append('test')\n\n def tearDown(self):\n events.append('tearDown')\n raise RuntimeError('raised by Foo.tearDown')\n\n Foo('test').run(result)\n expected = ['startTest', 'setUp', 'test', 'tearDown', 'addError',\n 'stopTest']\n self.assertEqual(events, expected)", "metadata": "root.Test_TestCase.test_run_call_order__error_in_tearDown", "header": "['class', 'Test_TestCase', '(', 'TestCase', ',', 'TestEquality', ',', 'TestHashing', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes used by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestHashing.test_hash and TestEquality.test_eq', '___NL___', '___EOS___']", "index": 2053 }, { "content": " def test_failureException__default(self):\n class Foo(unittest.TestCase):\n def test(self):\n pass\n\n self.failUnless(Foo('test').failureException is AssertionError)", "metadata": "root.Test_TestCase.test_failureException__default", "header": "['class', 'Test_TestCase', '(', 'TestCase', ',', 'TestEquality', ',', 'TestHashing', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes used by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestHashing.test_hash and TestEquality.test_eq', '___NL___', '___EOS___']", "index": 2078 }, { "content": " def test_failureException__subclassing__explicit_raise(self):\n events = []\n result = LoggingResult(events)\n\n class Foo(unittest.TestCase):\n def test(self):\n raise RuntimeError()\n\n failureException = RuntimeError\n\n self.failUnless(Foo('test').failureException is RuntimeError)\n\n\n Foo('test').run(result)\n expected = ['startTest', 'addFailure', 'stopTest']\n self.assertEqual(events, expected)", "metadata": "root.Test_TestCase.test_failureException__subclassing__explicit_raise", "header": "['class', 'Test_TestCase', '(', 'TestCase', ',', 'TestEquality', ',', 'TestHashing', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes used by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestHashing.test_hash and TestEquality.test_eq', '___NL___', '___EOS___']", "index": 2091 }, { "content": " def test_failureException__subclassing__implicit_raise(self):\n events = []\n result = LoggingResult(events)\n\n class Foo(unittest.TestCase):\n def test(self):\n self.fail(\"foo\")\n\n failureException = RuntimeError\n\n self.failUnless(Foo('test').failureException is RuntimeError)\n\n\n Foo('test').run(result)\n expected = ['startTest', 'addFailure', 'stopTest']\n self.assertEqual(events, expected)", "metadata": "root.Test_TestCase.test_failureException__subclassing__implicit_raise", "header": "['class', 'Test_TestCase', '(', 'TestCase', ',', 'TestEquality', ',', 'TestHashing', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes used by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestHashing.test_hash and TestEquality.test_eq', '___NL___', '___EOS___']", "index": 2114 }, { "content": " def test_setUp(self):\n class Foo(unittest.TestCase):\n def runTest(self):\n pass\n\n # ... and nothing should happen\n Foo().setUp()", "metadata": "root.Test_TestCase.test_setUp", "header": "['class', 'Test_TestCase', '(', 'TestCase', ',', 'TestEquality', ',', 'TestHashing', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes used by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestHashing.test_hash and TestEquality.test_eq', '___NL___', '___EOS___']", "index": 2132 }, { "content": " def test_tearDown(self):\n class Foo(unittest.TestCase):\n def runTest(self):\n pass\n\n # ... and nothing should happen\n Foo().tearDown()", "metadata": "root.Test_TestCase.test_tearDown", "header": "['class', 'Test_TestCase', '(', 'TestCase', ',', 'TestEquality', ',', 'TestHashing', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes used by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestHashing.test_hash and TestEquality.test_eq', '___NL___', '___EOS___']", "index": 2141 }, { "content": " def test_id(self):\n class Foo(unittest.TestCase):\n def runTest(self):\n pass\n\n self.failUnless(isinstance(Foo().id(), basestring))", "metadata": "root.Test_TestCase.test_id", "header": "['class', 'Test_TestCase', '(', 'TestCase', ',', 'TestEquality', ',', 'TestHashing', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes used by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestHashing.test_hash and TestEquality.test_eq', '___NL___', '___EOS___']", "index": 2155 }, { "content": " def test_shortDescription__no_docstring(self):\n class Foo(unittest.TestCase):\n def runTest(self):\n pass\n\n self.assertEqual(Foo().shortDescription(), None)", "metadata": "root.Test_TestCase.test_shortDescription__no_docstring", "header": "['class', 'Test_TestCase', '(', 'TestCase', ',', 'TestEquality', ',', 'TestHashing', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes used by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestHashing.test_hash and TestEquality.test_eq', '___NL___', '___EOS___']", "index": 2165 }, { "content": " def test_shortDescription__singleline_docstring(self):\n class Foo(unittest.TestCase):\n def runTest(self):\n \"this tests foo\"\n pass\n\n self.assertEqual(Foo().shortDescription(), \"this tests foo\")", "metadata": "root.Test_TestCase.test_shortDescription__singleline_docstring", "header": "['class', 'Test_TestCase', '(', 'TestCase', ',', 'TestEquality', ',', 'TestHashing', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes used by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestHashing.test_hash and TestEquality.test_eq', '___NL___', '___EOS___']", "index": 2175 }, { "content": " def test_shortDescription__multiline_docstring(self):\n class Foo(unittest.TestCase):\n def runTest(self):\n \"\"\"this tests foo\n blah, bar and baz are also tested\"\"\"\n pass\n\n self.assertEqual(Foo().shortDescription(), \"this tests foo\")", "metadata": "root.Test_TestCase.test_shortDescription__multiline_docstring", "header": "['class', 'Test_TestCase', '(', 'TestCase', ',', 'TestEquality', ',', 'TestHashing', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes used by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestHashing.test_hash and TestEquality.test_eq', '___NL___', '___EOS___']", "index": 2186 }, { "content": " def test_run__uses_defaultTestResult(self):\n events = []\n\n class Foo(unittest.TestCase):\n def test(self):\n events.append('test')\n\n def defaultTestResult(self):\n return LoggingResult(events)\n\n # Make run() find a result object on its own\n Foo('test').run()\n\n expected = ['startTest', 'test', 'stopTest']\n self.assertEqual(events, expected)", "metadata": "root.Test_TestCase.test_run__uses_defaultTestResult", "header": "['class', 'Test_TestCase', '(', 'TestCase', ',', 'TestEquality', ',', 'TestHashing', ')', ':', '___NEWLINE___', '___NL___', '### Set up attributes used by inherited tests', '___NL___', '################################################################', '___NL___', '___NL___', '# Used by TestHashing.test_hash and TestEquality.test_eq', '___NL___', '___EOS___']", "index": 2197 }, { "content": "class Test_Assertions(TestCase):", "metadata": "root.Test_Assertions", "header": "['module', '___EOS___']", "index": 2213 }, { "content": " def test_AlmostEqual(self):\n self.failUnlessAlmostEqual(1.00000001, 1.0)\n self.failIfAlmostEqual(1.0000001, 1.0)\n self.assertRaises(AssertionError,\n self.failUnlessAlmostEqual, 1.0000001, 1.0)\n self.assertRaises(AssertionError,\n self.failIfAlmostEqual, 1.00000001, 1.0)\n\n self.failUnlessAlmostEqual(1.1, 1.0, places=0)\n self.assertRaises(AssertionError,\n self.failUnlessAlmostEqual, 1.1, 1.0, places=1)\n\n self.failUnlessAlmostEqual(0, .1+.1j, places=0)\n self.failIfAlmostEqual(0, .1+.1j, places=1)\n self.assertRaises(AssertionError,\n self.failUnlessAlmostEqual, 0, .1+.1j, places=1)\n self.assertRaises(AssertionError,\n self.failIfAlmostEqual, 0, .1+.1j, places=0)", "metadata": "root.Test_Assertions.test_AlmostEqual", "header": "['class', 'Test_Assertions', '(', 'TestCase', ')', ':', '___EOS___']", "index": 2214 }, { "content": "def test_main():\n test_support.run_unittest(Test_TestCase, Test_TestLoader,\n Test_TestSuite, Test_TestResult, Test_FunctionTestCase,\n Test_Assertions)", "metadata": "root.test_main", "header": "['module', '___EOS___']", "index": 2239 } ]
[ { "span": "import sys", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 10 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "Test", " ", "script", " ", "for", " ", "unittest", ".", "\\", "10", ";", "\\", "10", ";", "By", " ", "Colli", "n", " ", "Win", "ter", " ", "<", "colli", "nw", " ", "at", " ", "gma", "il", ".", "com", ">", "\\", "10", ";", "\\", "10", ";", "Stil", "l", " ", "need", " ", "testi", "ng", ":", "\\", "10", ";", " ", " ", " ", " ", "Test", "Case", ".", "{", "assert", ",", "fail", "}*", " ", "method", "s", " ", "(", "some", " ", "are", " ", "tested", " ", "implicit", "ly", ")", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test_", "import_", "test\\u", "support_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "unittest_", "import_", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "types_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Supp", "ort", " ", "code_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "/", "Supp", "ort", " ", "code_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Supp", "ort", " ", "code", " ", "for", " ", "Test", "\\u", "Test", "Suite_", "\\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_", "###", " ", "/", "Supp", "ort", " ", "code", " ", "for", " ", "Test", "\\u", "Test", "Suite_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "###", " ", "Supp", "ort", " ", "code", " ", "for", " ", "Test", "\\u", "Test", "Case_", "\\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_", "###", " ", "/", "Supp", "ort", " ", "code", " ", "for", " ", "Test", "\\u", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Main_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Log", "ging", "Result_", "(_", "unittest_", "._", "Test", "Result_", ")_", ":_", "\\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_", "Log", "ging", "Result_", "(_", "unittest_", "._", "Test", "Result_", ")_", ":_", "\\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_", ",_", "log_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "events_", "=_", "log_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Log", "ging", "Result_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "ging", "Result_", "(_", "unittest_", "._", "Test", "Result_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "start", "Test_", "(_", "self_", ",_", "test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "events_", "._", "append_", "(_", "'", "start", "Test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Log", "ging", "Result_", ",_", "self_", ")_", "._", "start", "Test_", "(_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "ging", "Result_", "(_", "unittest_", "._", "Test", "Result_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "stop", "Test_", "(_", "self_", ",_", "test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "events_", "._", "append_", "(_", "'", "stop", "Test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Log", "ging", "Result_", ",_", "self_", ")_", "._", "stop", "Test_", "(_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "ging", "Result_", "(_", "unittest_", "._", "Test", "Result_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Failure_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "events_", "._", "append_", "(_", "'", "add", "Fail", "ure", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Log", "ging", "Result_", ",_", "self_", ")_", "._", "add", "Failure_", "(_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "ging", "Result_", "(_", "unittest_", "._", "Test", "Result_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Error_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "events_", "._", "append_", "(_", "'", "add", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Log", "ging", "Result_", ",_", "self_", ")_", "._", "add", "Error_", "(_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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", "Equali", "ty_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "a", " ", "valid", " ", "\\u\\u", "eq", "\\u\\u", " ", "implementation_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "a", " ", "valid", " ", "\\u\\u", "ne", "\\u\\u", " ", "implementation_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Equali", "ty_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "a", " ", "valid", " ", "\\u\\u", "eq", "\\u\\u", " ", "implementation_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "eq_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "obj", "\\u", "1_", ",_", "obj", "\\u", "2_", "in_", "self_", "._", "eq", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "obj", "\\u", "1_", ",_", "obj", "\\u", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "obj", "\\u", "2_", ",_", "obj", "\\u", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Equali", "ty_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "a", " ", "valid", " ", "\\u\\u", "eq", "\\u\\u", " ", "implementation_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "ne_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "obj", "\\u", "1_", ",_", "obj", "\\u", "2_", "in_", "self_", "._", "ne", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail", "If", "Equal_", "(_", "obj", "\\u", "1_", ",_", "obj", "\\u", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "If", "Equal_", "(_", "obj", "\\u", "2_", ",_", "obj", "\\u", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Hash", "ing_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "a", " ", "valid", " ", "\\u\\u", "hash", "\\u\\u", " ", "implementation_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Hash", "ing_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "a", " ", "valid", " ", "\\u\\u", "hash", "\\u\\u", " ", "implementation_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "hash_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "obj", "\\u", "1_", ",_", "obj", "\\u", "2_", "in_", "self_", "._", "eq", "\\u", "pairs_", ":_", "\\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 ", " _", "assert_", "hash_", "(_", "obj", "\\u", "1_", ")_", "==_", "hash_", "(_", "obj", "\\u", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Assert", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"%", "s", " ", "and", " ", "%", "s", " ", "do", " ", "not", " ", "hash", " ", "equal", "\"_", "%_", "(_", "obj", "\\u", "1_", ",_", "obj", "\\u", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Prob", "lem", " ", "hashin", "g", " ", "%", "s", " ", "and", " ", "%", "s", ":", " ", "%", "s", "\"_", "%_", "(_", "obj", "\\u", "1_", ",_", "obj", "\\u", "2_", ",_", "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_", "for_", "obj", "\\u", "1_", ",_", "obj", "\\u", "2_", "in_", "self_", "._", "ne", "\\u", "pairs_", ":_", "\\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 ", " _", "assert_", "hash_", "(_", "obj", "\\u", "1_", ")_", "!=_", "hash_", "(_", "obj", "\\u", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Assert", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"%", "s", " ", "and", " ", "%", "s", " ", "hash", " ", "equal", ",", " ", "but", " ", "shou", "ld", "n", "'", "t", "\"_", "%_", "(_", "obj", "\\u", "1_", ",_", "obj", "\\u", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Prob", "lem", " ", "hashin", "g", " ", "%", "s", " ", "and", " ", "%", "s", ":", " ", "%", "s", "\"_", "%_", "(_", "obj", "\\u", "1_", ",_", "obj", "\\u", "2_", ",_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "it", " ", "doe", "s", " ", "the", " ", "right", " ", "thing", " ", "even", " ", "if", " ", "no", " ", "tests", " ", "wer", "e", " ", "found_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "happ", "ens", " ", "if", " ", "load", "Test", "s", "Fro", "m", "Test", "Case", "()", " ", "is", " ", "give", "n", " ", "an", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tha", "t", " ", "isn", "'", "t", " ", "a", " ", "subclass", " ", "of", " ", "Test", "Case", "?", " ", "Specifi", "call", "y", ",", " ", "what", " ", "happ", "ens_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "test", "Case", "Class", " ", "is", " ", "a", " ", "subclass", " ", "of", " ", "Test", "Suit", "e", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "checke", "d", " ", "for", " ", "specifica", "ll", "y", " ", "in", " ", "the", " ", "code", ",", " ", "so", " ", "we", " ", "bett", "er", " ", "add", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "for", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "load", "Test", "s", "Fro", "m", "Test", "Case", "()", " ", "picks", " ", "up", " ", "the", " ", "default", " ", "test", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "name", " ", "(", "as", " ", "specified", " ", "by", " ", "Test", "Case", "),", " ", "even", " ", "tho", "ugh", " ", "the", " ", "method", " ", "name", " ", "doe", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "not", " ", "match", " ", "the", " ", "default", " ", "Test", "Load", "er", ".", "test", "Meth", "od", "Pref", "ix", " ", "string_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "/", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Module_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Thi", "s", " ", "method", " ", "searche", "s", " ", "`", "module", "`", " ", "for", " ", "classe", "s", " ", "derive", "d", " ", "from", " ", "Test", "Case", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Thi", "s", " ", "method", " ", "searche", "s", " ", "`", "module", "`", " ", "for", " ", "classe", "s", " ", "derive", "d", " ", "from", " ", "Test", "Case", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "happ", "ens", " ", "if", " ", "no", " ", "tests", " ", "are", " ", "found", " ", "(", "no", " ", "Test", "Case", " ", "instance", "s", ")?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Thi", "s", " ", "method", " ", "searche", "s", " ", "`", "module", "`", " ", "for", " ", "classe", "s", " ", "derive", "d", " ", "from", " ", "Test", "Case", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "happ", "ens", " ", "if", " ", "no", " ", "tests", " ", "are", " ", "found", " ", "(", "Test", "Case", "s", " ", "instance", "s", ",", " ", "but", " ", "no", " ", "tests", ")?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Thi", "s", " ", "method", " ", "searche", "s", " ", "`", "module", "`", " ", "for", " ", "classe", "s", " ", "derive", "d", " ", "from", " ", "Test", "Case", "\"", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "happ", "ens", " ", "if", " ", "load", "Test", "s", "Fro", "m", "Modul", "e", "()", " ", "is", " ", "give", "n", " ", "somet", "hing", " ", "other_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "than", " ", "a", " ", "module", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", " ", "Curr", "ent", "ly", ",", " ", "it", " ", "succeeds", " ", "anyway", ".", " ", "Thi", "s", " ", "flexib", "ility_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "shou", "ld", " ", "eit", "her", " ", "be", " ", "documente", "d", " ", "or", " ", "load", "Test", "s", "Fro", "m", "Modul", "e", "()", " ", "should_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "raise", " ", "a", " ", "Type", "Error_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", " ", "Cert", "ain", " ", "people", " ", "are", " ", "usi", "ng", " ", "this", " ", "behaviour", ".", " ", "We", "'", "ll", " ", "add", " ", "a", " ", "test", " ", "for", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "/", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Modul", "e", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Name", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "eit", "her", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "module", ",", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "a", " ", "Test", "Suit", "e", " ", "instance", ",", " ", "a", " ", "test", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "or", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Is", " ", "Value", "Error", " ", "raise", "d", " ", "in", " ", "response", " ", "to", " ", "an", " ", "empty", " ", "name", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "eit", "her", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "module", ",", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "a", " ", "Test", "Suit", "e", " ", "instance", ",", " ", "a", " ", "test", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "or", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "happ", "ens", " ", "whe", "n", " ", "the", " ", "name", " ", "contain", "s", " ", "invalid", " ", "character", "s", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "...", " ", "to", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "module", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "happ", "ens", " ", "whe", "n", " ", "a", " ", "module", " ", "by", " ", "tha", "t", " ", "name", " ", "can", "'", "t", " ", "be", " ", "found", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "eit", "her", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "module", ",", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "a", " ", "Test", "Suit", "e", " ", "instance", ",", " ", "a", " ", "test", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "or", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "happ", "ens", " ", "whe", "n", " ", "the", " ", "module", " ", "is", " ", "found", ",", " ", "but", " ", "the", " ", "attribute", " ", "can", "'", "t", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "eit", "her", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "module", ",", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "a", " ", "Test", "Suit", "e", " ", "instance", ",", " ", "a", " ", "test", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "or", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "happ", "ens", " ", "whe", "n", " ", "we", " ", "provide", " ", "the", " ", "module", ",", " ", "but", " ", "the", " ", "attribute", " ", "can", "'", "t", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "found", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "eit", "her", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "module", ",", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "a", " ", "Test", "Suit", "e", " ", "instance", ",", " ", "a", " ", "test", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "or", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "method", " ", "option", "ally", " ", "resolve", "s", " ", "name", " ", "relative", " ", "to", " ", "the", " ", "give", "n", " ", "module", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Do", "es", " ", "load", "Test", "s", "Fro", "m", "Name", " ", "raise", " ", "Value", "Error", " ", "whe", "n", " ", "pass", "ed", " ", "an", " ", "empty_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "name", " ", "relative", " ", "to", " ", "a", " ", "provided", " ", "module", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", " ", "Sho", "ul", "d", " ", "probab", "ly", " ", "raise", " ", "a", " ", "Value", "Error", " ", "inst", "ead", " ", "of", " ", "an", " ", "Attribute", "Error_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "eit", "her", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "module", ",", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "a", " ", "Test", "Suit", "e", " ", "instance", ",", " ", "a", " ", "test", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "or", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "method", " ", "option", "ally", " ", "resolve", "s", " ", "name", " ", "relative", " ", "to", " ", "the", " ", "give", "n", " ", "module", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "happ", "ens", " ", "whe", "n", " ", "an", " ", "impossible", " ", "name", " ", "is", " ", "give", "n", ",", " ", "relative", " ", "to", " ", "the", " ", "provided", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "`", "module", "`", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "method", " ", "option", "ally", " ", "resolve", "s", " ", "name", " ", "relative", " ", "to", " ", "the", " ", "give", "n", " ", "module", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Do", "es", " ", "load", "Test", "s", "Fro", "m", "Name", " ", "raise", " ", "Type", "Error", " ", "whe", "n", " ", "the", " ", "`", "module", "`", " ", "argument_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "isn", "'", "t", " ", "a", " ", "module", " ", "object", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", " ", "Accept", "s", " ", "the", " ", "not", "-", "a", "-", "module", " ", "object", ",", " ", "ign", "orn", "ing", " ", "the", " ", "object", "'", "s", " ", "type_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "shou", "ld", " ", "raise", " ", "an", " ", "exception", " ", "or", " ", "the", " ", "method", " ", "name", " ", "shou", "ld", " ", "be", " ", "changed_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", " ", "Some", " ", "people", " ", "are", " ", "rely", "ing", " ", "on", " ", "this", ",", " ", "so", " ", "keep", " ", "it", " ", "for", " ", "now_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "eit", "her", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "module", ",", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "a", " ", "Test", "Suit", "e", " ", "instance", ",", " ", "a", " ", "test", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "or", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Do", "es", " ", "it", " ", "raise", " ", "an", " ", "exception", " ", "if", " ", "the", " ", "name", " ", "resolve", "s", " ", "to", " ", "an", " ", "invalid_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "object", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "resolve", " ", "eit", "her", " ", "to", " ", "...", " ", "a", " ", "test", " ", "case", " ", "class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "eit", "her", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "module", ",", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "a", " ", "Test", "Suit", "e", " ", "instance", ",", " ", "a", " ", "test", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "or", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "...", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "...", " ", "a", " ", "test", " ", "method", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "eit", "her", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "module", ",", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "a", " ", "Test", "Suit", "e", " ", "instance", ",", " ", "a", " ", "test", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "or", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Do", "es", " ", "load", "Test", "s", "Fro", "m", "Name", "()", " ", "raise", " ", "the", " ", "proper", " ", "exception", " ", "whe", "n", " ", "try", "ing", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "resolve", " ", "\"", "a", " ", "test", " ", "method", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", "\"", " ", "tha", "t", " ", "doe", "sn", "'", "t", " ", "exist_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "the", " ", "give", "n", " ", "name", " ", "(", "relative", " ", "to", " ", "a", " ", "provided", " ", "module", ")?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "...", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "...", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a", " ", "...", " ", "Test", "Suit", "e", " ", "instance", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "...", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "...", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a", " ", "Test", "Case", " ", "...", " ", "instance", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "...", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "...", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "happ", "ens", " ", "if", " ", "the", " ", "calla", "ble", " ", "return", "s", " ", "somet", "hing", " ", "else", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Name", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Names", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Simil", "ar", " ", "to", " ", "load", "Test", "s", "Fro", "m", "Name", "()", ",", " ", "but", " ", "take", "s", " ", "a", " ", "sequence", " ", "of", " ", "names", " ", "rat", "her_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "than", " ", "a", " ", "single", " ", "name", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "happ", "ens", " ", "if", " ", "tha", "t", " ", "sequence", " ", "of", " ", "names", " ", "is", " ", "empty", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Simil", "ar", " ", "to", " ", "load", "Test", "s", "Fro", "m", "Name", "()", ",", " ", "but", " ", "take", "s", " ", "a", " ", "sequence", " ", "of", " ", "names", " ", "rat", "her_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "than", " ", "a", " ", "single", " ", "name", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "method", " ", "option", "ally", " ", "resolve", "s", " ", "name", " ", "relative", " ", "to", " ", "the", " ", "give", "n", " ", "module", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "happ", "ens", " ", "if", " ", "tha", "t", " ", "sequence", " ", "of", " ", "names", " ", "is", " ", "empty", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", " ", "Sho", "ul", "d", " ", "this", " ", "raise", " ", "a", " ", "Value", "Error", " ", "or", " ", "just", " ", "return", " ", "an", " ", "empty", " ", "Test", "Suit", "e", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "eit", "her", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "module", ",", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "a", " ", "Test", "Suit", "e", " ", "instance", ",", " ", "a", " ", "test", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "or", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Is", " ", "Value", "Error", " ", "raise", "d", " ", "in", " ", "response", " ", "to", " ", "an", " ", "empty", " ", "name", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "eit", "her", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "module", ",", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "a", " ", "Test", "Suit", "e", " ", "instance", ",", " ", "a", " ", "test", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "or", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "happ", "ens", " ", "whe", "n", " ", "presente", "d", " ", "with", " ", "an", " ", "impossible", " ", "module", " ", "name", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "eit", "her", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "module", ",", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "a", " ", "Test", "Suit", "e", " ", "instance", ",", " ", "a", " ", "test", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "or", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "happ", "ens", " ", "whe", "n", " ", "no", " ", "module", " ", "can", " ", "be", " ", "found", " ", "for", " ", "the", " ", "give", "n", " ", "name", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "eit", "her", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "module", ",", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "a", " ", "Test", "Suit", "e", " ", "instance", ",", " ", "a", " ", "test", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "or", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "happ", "ens", " ", "whe", "n", " ", "the", " ", "module", " ", "can", " ", "be", " ", "found", ",", " ", "but", " ", "not", " ", "the", " ", "attribute", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "eit", "her", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "module", ",", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "a", " ", "Test", "Suit", "e", " ", "instance", ",", " ", "a", " ", "test", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "or", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "method", " ", "option", "ally", " ", "resolve", "s", " ", "name", " ", "relative", " ", "to", " ", "the", " ", "give", "n", " ", "module", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "happ", "ens", " ", "whe", "n", " ", "give", "n", " ", "an", " ", "unknown", " ", "attribute", " ", "on", " ", "a", " ", "specified", " ", "`", "module", "`_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "argu", "ment", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "eit", "her", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "module", ",", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "a", " ", "Test", "Suit", "e", " ", "instance", ",", " ", "a", " ", "test", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "or", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "method", " ", "option", "ally", " ", "resolve", "s", " ", "name", " ", "relative", " ", "to", " ", "the", " ", "give", "n", " ", "module", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Do", " ", "unknown", " ", "attribute", "s", " ", "(", "relative", " ", "to", " ", "a", " ", "provided", " ", "module", ")", " ", "still", " ", "raise", " ", "an_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "exception", " ", "even", " ", "in", " ", "the", " ", "presen", "ce", " ", "of", " ", "valid", " ", "attribute", " ", "names", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "eit", "her", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "module", ",", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "a", " ", "Test", "Suit", "e", " ", "instance", ",", " ", "a", " ", "test", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "or", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "method", " ", "option", "ally", " ", "resolve", "s", " ", "name", " ", "relative", " ", "to", " ", "the", " ", "give", "n", " ", "module", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "happ", "ens", " ", "whe", "n", " ", "face", "d", " ", "with", " ", "the", " ", "empty", " ", "string", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", " ", "Thi", "s", " ", "currentl", "y", " ", "raise", "s", " ", "Attribute", "Error", ",", " ", "tho", "ugh", " ", "Value", "Error", " ", "is", " ", "probab", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "more", " ", "appropr", "iate", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "eit", "her", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "module", ",", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "a", " ", "Test", "Suit", "e", " ", "instance", ",", " ", "a", " ", "test", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "or", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "method", " ", "option", "ally", " ", "resolve", "s", " ", "name", " ", "relative", " ", "to", " ", "the", " ", "give", "n", " ", "module", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "happ", "ens", " ", "whe", "n", " ", "presente", "d", " ", "with", " ", "an", " ", "impossible", " ", "attribute", " ", "name", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "method", " ", "option", "ally", " ", "resolve", "s", " ", "name", " ", "relative", " ", "to", " ", "the", " ", "give", "n", " ", "module", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Do", "es", " ", "load", "Test", "s", "Fro", "m", "Names", "()", " ", "make", " ", "sure", " ", "the", " ", "provided", " ", "`", "module", "`", " ", "is", " ", "in", " ", "fact_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "module", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", " ", "Thi", "s", " ", "validation", " ", "is", " ", "currentl", "y", " ", "not", " ", "don", "e", ".", " ", "Thi", "s", " ", "flexib", "ilit", "y", " ", "should_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "eit", "her", " ", "be", " ", "documente", "d", " ", "or", " ", "a", " ", "Type", "Error", " ", "shou", "ld", " ", "be", " ", "raise", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "eit", "her", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "module", ",", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "a", " ", "Test", "Suit", "e", " ", "instance", ",", " ", "a", " ", "test", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", ",", " ", "or", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Do", "es", " ", "it", " ", "raise", " ", "an", " ", "exception", " ", "if", " ", "the", " ", "name", " ", "resolve", "s", " ", "to", " ", "an", " ", "invalid_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "object", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "...", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "...", " ", "a", " ", "test", " ", "case", " ", "class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "...", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "...", " ", "a", " ", "Test", "Suit", "e", " ", "instance", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "...", " ", "to", " ", "...", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "method", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "...", " ", "to", " ", "...", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "method", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Do", "es", " ", "the", " ", "method", " ", "graceful", "ly", " ", "handle", " ", "names", " ", "tha", "t", " ", "initially", " ", "look", " ", "like", " ", "the", "y_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "resolve", " ", "to", " ", "\"", "a", " ", "test", " ", "method", " ", "within", " ", "a", " ", "test", " ", "case", " ", "class", "\"", " ", "but", " ", "don", "'", "t", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "...", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "...", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a", " ", "...", " ", "Test", "Suit", "e", " ", "instance", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "...", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "...", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a", " ", "Test", "Case", " ", "...", " ", "instance", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "...", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "...", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Are", " ", "static", "method", "s", " ", "handle", "d", " ", "correct", "ly", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "specifier", " ", "name", " ", "is", " ", "a", " ", "``", "dot", "ted", " ", "name", "''", " ", "tha", "t", " ", "may", " ", "resolve", " ", "...", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "...", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", " ", "return", "s", " ", "a", " ", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", " ", "instance", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "happ", "ens", " ", "whe", "n", " ", "the", " ", "calla", "ble", " ", "return", "s", " ", "somet", "hing", " ", "else", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "/", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Names", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "get", "Test", "Case", "Names", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "sorte", "d", " ", "sequence", " ", "of", " ", "method", " ", "names", " ", "found", " ", "within", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", ".", "fooba", "r", " ", "is", " ", "defin", "ed", " ", "to", " ", "make", " ", "sure", " ", "get", "Test", "Case", "Names", "()", " ", "respec", "ts_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "load", "er", ".", "test", "Meth", "od", "Prefix_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "sorte", "d", " ", "sequence", " ", "of", " ", "method", " ", "names", " ", "found", " ", "within", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Do", "es", " ", "get", "Test", "Case", "Names", "()", " ", "behave", " ", "appropr", "iate", "ly", " ", "if", " ", "no", " ", "tests", " ", "are", " ", "found", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "sorte", "d", " ", "sequence", " ", "of", " ", "method", " ", "names", " ", "found", " ", "within", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Are", " ", "not", "-", "Test", "Case", "s", " ", "handle", "d", " ", "graceful", "ly", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", " ", "Thi", "s", " ", "shou", "ld", " ", "raise", " ", "a", " ", "Type", "Error", ",", " ", "not", " ", "return", " ", "a", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", " ", "It", "'", "s", " ", "too", " ", "late", " ", "in", " ", "the", " ", "2.5", " ", "release", " ", "cycle", " ", "to", " ", "fix", " ", "this", ",", " ", "but", " ", "it", " ", "should_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "probab", "ly", " ", "be", " ", "revis", "ited", " ", "for", " ", "2.6", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "sorte", "d", " ", "sequence", " ", "of", " ", "method", " ", "names", " ", "found", " ", "within", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "inherited", " ", "names", " ", "are", " ", "handle", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "P", ".", "fooba", "r", " ", "is", " ", "defin", "ed", " ", "to", " ", "make", " ", "sure", " ", "get", "Test", "Case", "Names", "()", " ", "respec", "ts_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "load", "er", ".", "test", "Meth", "od", "Prefix_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "/", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "get", "Test", "Case", "Names", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "test", "Meth", "od", "Prefix_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "String", " ", "gi", "ving", " ", "the", " ", "prefix", " ", "of", " ", "method", " ", "names", " ", "whi", "ch", " ", "will", " ", "be", " ", "interprete", "d", " ", "as_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "method", "s", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Implicit", " ", "in", " ", "the", " ", "documentation", " ", "is", " ", "tha", "t", " ", "test", "Meth", "od", "Pref", "ix", " ", "is", " ", "respec", "ted", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "all", " ", "load", "Test", "s", "Fro", "m", "*", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "String", " ", "gi", "ving", " ", "the", " ", "prefix", " ", "of", " ", "method", " ", "names", " ", "whi", "ch", " ", "will", " ", "be", " ", "interprete", "d", " ", "as_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "method", "s", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Implicit", " ", "in", " ", "the", " ", "documentation", " ", "is", " ", "tha", "t", " ", "test", "Meth", "od", "Pref", "ix", " ", "is", " ", "respec", "ted", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "all", " ", "load", "Test", "s", "Fro", "m", "*", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "String", " ", "gi", "ving", " ", "the", " ", "prefix", " ", "of", " ", "method", " ", "names", " ", "whi", "ch", " ", "will", " ", "be", " ", "interprete", "d", " ", "as_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "method", "s", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Implicit", " ", "in", " ", "the", " ", "documentation", " ", "is", " ", "tha", "t", " ", "test", "Meth", "od", "Pref", "ix", " ", "is", " ", "respec", "ted", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "all", " ", "load", "Test", "s", "Fro", "m", "*", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "String", " ", "gi", "ving", " ", "the", " ", "prefix", " ", "of", " ", "method", " ", "names", " ", "whi", "ch", " ", "will", " ", "be", " ", "interprete", "d", " ", "as_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "method", "s", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Implicit", " ", "in", " ", "the", " ", "documentation", " ", "is", " ", "tha", "t", " ", "test", "Meth", "od", "Pref", "ix", " ", "is", " ", "respec", "ted", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "all", " ", "load", "Test", "s", "Fro", "m", "*", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "default", " ", "value", " ", "is", " ", "'", "test", "'\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "/", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "test", "Meth", "od", "Prefix_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "sort", "Test", "Meth", "ods", "Us", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Function", " ", "to", " ", "be", " ", "used", " ", "to", " ", "compare", " ", "method", " ", "names", " ", "whe", "n", " ", "sorting", " ", "them", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", "Test", "Case", "Names", "()", " ", "and", " ", "all", " ", "the", " ", "load", "Test", "s", "Fro", "m", "X", "()", " ", "method", "s", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Function", " ", "to", " ", "be", " ", "used", " ", "to", " ", "compare", " ", "method", " ", "names", " ", "whe", "n", " ", "sorting", " ", "them", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", "Test", "Case", "Names", "()", " ", "and", " ", "all", " ", "the", " ", "load", "Test", "s", "Fro", "m", "X", "()", " ", "method", "s", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Function", " ", "to", " ", "be", " ", "used", " ", "to", " ", "compare", " ", "method", " ", "names", " ", "whe", "n", " ", "sorting", " ", "them", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", "Test", "Case", "Names", "()", " ", "and", " ", "all", " ", "the", " ", "load", "Test", "s", "Fro", "m", "X", "()", " ", "method", "s", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Function", " ", "to", " ", "be", " ", "used", " ", "to", " ", "compare", " ", "method", " ", "names", " ", "whe", "n", " ", "sorting", " ", "them", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", "Test", "Case", "Names", "()", " ", "and", " ", "all", " ", "the", " ", "load", "Test", "s", "Fro", "m", "X", "()", " ", "method", "s", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Function", " ", "to", " ", "be", " ", "used", " ", "to", " ", "compare", " ", "method", " ", "names", " ", "whe", "n", " ", "sorting", " ", "them", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", "Test", "Case", "Names", "()\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Do", "es", " ", "it", " ", "actual", "ly", " ", "affect", " ", "get", "Test", "Case", "Names", "()", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "default", " ", "value", " ", "is", " ", "the", " ", "bui", "lt", "-", "in", " ", "cmp", "()", " ", "function", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "it", " ", "can", " ", "be", " ", "set", " ", "to", " ", "Non", "e", " ", "to", " ", "disable", " ", "the", " ", "sort", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", " ", "Ho", "w", " ", "is", " ", "this", " ", "different", " ", "from", " ", "reass", "ign", "ing", " ", "cmp", "?", " ", "Are", " ", "the", " ", "tests", " ", "returned_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "a", " ", "random", " ", "order", " ", "or", " ", "somet", "hing", "?", " ", "Thi", "s", " ", "behaviour", " ", "shou", "ld", " ", "die_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "/", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "sort", "Test", "Meth", "ods", "Us", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "suit", "e", "Class_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Call", "able", " ", "object", " ", "tha", "t", " ", "construct", "s", " ", "a", " ", "test", " ", "suit", "e", " ", "from", " ", "a", " ", "list", " ", "of", " ", "tests", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "It", " ", "is", " ", "implicit", " ", "in", " ", "the", " ", "documentation", " ", "for", " ", "Test", "Load", "er", ".", "suit", "e", "Class", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "all", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "*", " ", "method", "s", " ", "respec", "t", " ", "it", ".", " ", "Let", "'", "s", " ", "make", " ", "sure", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "It", " ", "is", " ", "implicit", " ", "in", " ", "the", " ", "documentation", " ", "for", " ", "Test", "Load", "er", ".", "suit", "e", "Class", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "all", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "*", " ", "method", "s", " ", "respec", "t", " ", "it", ".", " ", "Let", "'", "s", " ", "make", " ", "sure", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "It", " ", "is", " ", "implicit", " ", "in", " ", "the", " ", "documentation", " ", "for", " ", "Test", "Load", "er", ".", "suit", "e", "Class", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "all", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "*", " ", "method", "s", " ", "respec", "t", " ", "it", ".", " ", "Let", "'", "s", " ", "make", " ", "sure", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "default", " ", "value", " ", "is", " ", "the", " ", "Test", "Suit", "e", " ", "class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "/", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "suit", "e", "Class_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Test", "Case_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "foo", "\\u", "bar_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tests_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "Foo_", "(_", "'", "test\\u", "1", "'_", ")_", ",_", "Foo_", "(_", "'", "test\\u", "2", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Test", "Case_", "(_", "Foo_", ")_", ",_", "tests_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Test", "Case", "\\u\\u", "no", "\\u", "matches_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "foo", "\\u", "bar_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "empty", "\\u", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Test", "Case_", "(_", "Foo_", ")_", ",_", "empty", "\\u", "suite_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Test", "Case", "\\u\\u", "Test", "Suit", "e\\u", "subclass_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Not", "AT", "est", "Case_", "(_", "unittest_", "._", "Test", "Suite_", ")_", ":_", "\\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_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "._", "load", "Test", "s", "Fro", "m", "Test", "Case_", "(_", "Not", "AT", "est", "Case_", ")_", "\\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\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "'", "Sho", "ul", "d", " ", "raise", " ", "Type", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Test", "Case", "\\u\\u", "default", "\\u", "method", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run", "Test_", "(_", "self_", ")_", ":_", "\\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_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "has", " ", "to", " ", "be", " ", "fal", "se", " ", "for", " ", "the", " ", "test", " ", "to", " ", "succeed_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fail", "If_", "(_", "'", "run", "Test", "'_", "._", "startswith_", "(_", "loader_", "._", "test", "Meth", "od", "Prefix_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Test", "Case_", "(_", "Foo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "suite_", ",_", "loader_", "._", "suit", "e", "Class_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "[_", "Foo_", "(_", "'", "run", "Test", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Modul", "e\\u", "\\u", "Test", "Case", "\\u", "subclass_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "My", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "\\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_", "m_", "._", "testc", "ase", "\\u", "1_", "=_", "My", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Module_", "(_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "suite_", ",_", "loader_", "._", "suit", "e", "Class_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "[_", "loader_", "._", "suit", "e", "Class_", "(_", "[_", "My", "Test", "Case_", "(_", "'", "test", "'_", ")_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Modul", "e\\u", "\\u", "no", "\\u", "Test", "Case", "\\u", "instances_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Module_", "(_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "suite_", ",_", "loader_", "._", "suit", "e", "Class_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Modul", "e\\u", "\\u", "no", "\\u", "Test", "Case", "\\u", "tests_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "My", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\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_", "m_", "._", "testc", "ase", "\\u", "1_", "=_", "My", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Module_", "(_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "suite_", ",_", "loader_", "._", "suit", "e", "Class_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "[_", "loader_", "._", "suit", "e", "Class_", "(_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Modul", "e\\u", "\\u", "not", "\\u", "a", "\\u", "module_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "My", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "\\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_", "class_", "Not", "AM", "odule_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "2_", "=_", "My", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Module_", "(_", "Not", "AM", "odule_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "reference_", "=_", "[_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "My", "Test", "Case_", "(_", "'", "test", "'_", ")_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "reference_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Name", "\\u\\u", "empty", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\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 ", " _", "loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "''_", ")_", "\\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 ", " _", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "e_", ")_", ",_", "\"", "Emp", "ty", " ", "module", " ", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Name", " ", "fail", "ed", " ", "to", " ", "raise", " ", "Value", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Name", "\\u\\u", "mal", "formed", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", " ", "Sho", "ul", "d", " ", "this", " ", "raise", " ", "Value", "Error", " ", "or", " ", "Import", "Error", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "'", "abc", " ", "()", " ", "//", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Name", " ", "fail", "ed", " ", "to", " ", "raise", " ", "Value", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Name", "\\u\\u", "unknown", "\\u", "module", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\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 ", " _", "loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "'", "sda", "sfa", "sfa", "sdf", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "e_", ")_", ",_", "\"", "No", " ", "module", " ", "named", " ", "sda", "sfa", "sfa", "sdf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Name", " ", "fail", "ed", " ", "to", " ", "raise", " ", "Import", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Name", "\\u\\u", "unknown", "\\u", "attr", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\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 ", " _", "loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "'", "unittest", ".", "sda", "sfa", "sfa", "sdf", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "e_", ")_", ",_", "\"'", "module", "'", " ", "object", " ", "has", " ", "no", " ", "attribute", " ", "'", "sda", "sfa", "sfa", "sdf", "'\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Name", " ", "fail", "ed", " ", "to", " ", "raise", " ", "Attribute", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Name", "\\u\\u", "relative", "\\u", "unknown", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\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 ", " _", "loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "'", "sda", "sfa", "sfa", "sdf", "'_", ",_", "unittest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "e_", ")_", ",_", "\"'", "module", "'", " ", "object", " ", "has", " ", "no", " ", "attribute", " ", "'", "sda", "sfa", "sfa", "sdf", "'\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Name", " ", "fail", "ed", " ", "to", " ", "raise", " ", "Attribute", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Name", "\\u\\u", "relative", "\\u", "empty", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\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 ", " _", "loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "''_", ",_", "unittest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Fail", "ed", " ", "to", " ", "raise", " ", "Attribute", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Name", "\\u\\u", "relative", "\\u", "mal", "formed", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", " ", "Sho", "ul", "d", " ", "this", " ", "raise", " ", "Attribute", "Error", " ", "or", " ", "Value", "Error", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "'", "abc", " ", "()", " ", "//", "'_", ",_", "unittest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Name", " ", "fail", "ed", " ", "to", " ", "raise", " ", "Value", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Name", "\\u\\u", "relative", "\\u", "not", "\\u", "a", "\\u", "module_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "My", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "\\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_", "class_", "Not", "AM", "odule_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "2_", "=_", "My", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "'", "test\\u", "2", "'_", ",_", "Not", "AM", "odule_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "reference_", "=_", "[_", "My", "Test", "Case_", "(_", "'", "test", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "reference_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Name", "\\u\\u", "relative", "\\u", "bad", "\\u", "object_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "testc", "ase", "\\u", "1_", "=_", "object_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "'", "testc", "ase", "\\u", "1", "'_", ",_", "m_", ")_", "\\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\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Sho", "ul", "d", " ", "have", " ", "raise", "d", " ", "Type", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Name", "\\u\\u", "relative", "\\u", "Test", "Case", "\\u", "subclass_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "My", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "\\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_", "m_", "._", "testc", "ase", "\\u", "1_", "=_", "My", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "'", "testc", "ase", "\\u", "1", "'_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "suite_", ",_", "loader_", "._", "suit", "e", "Class_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "[_", "My", "Test", "Case_", "(_", "'", "test", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Name", "\\u\\u", "relative", "\\u", "Test", "Suite_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "My", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "\\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_", "m_", "._", "testsuite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "My", "Test", "Case_", "(_", "'", "test", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "'", "testsuite", "'_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "suite_", ",_", "loader_", "._", "suit", "e", "Class_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "[_", "My", "Test", "Case_", "(_", "'", "test", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Name", "\\u\\u", "relative", "\\u", "testm", "ethod", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "My", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "\\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_", "m_", "._", "testc", "ase", "\\u", "1_", "=_", "My", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "'", "testc", "ase", "\\u", "1", ".", "test", "'_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "suite_", ",_", "loader_", "._", "suit", "e", "Class_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "[_", "My", "Test", "Case_", "(_", "'", "test", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Name", "\\u\\u", "relative", "\\u", "invalid", "\\u", "testm", "ethod", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "My", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "\\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_", "m_", "._", "testc", "ase", "\\u", "1_", "=_", "My", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "'", "testc", "ase", "\\u", "1", ".", "testf", "oo", "'_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "e_", ")_", ",_", "\"", "type", " ", "object", " ", "'", "My", "Test", "Case", "'", " ", "has", " ", "no", " ", "attribute", " ", "'", "testf", "oo", "'\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Fail", "ed", " ", "to", " ", "raise", " ", "Attribute", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Name", "\\u\\u", "callable\\u", "\\u", "Test", "Suite_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "testc", "ase", "\\u", "1_", "=_", "unittest_", "._", "Function", "Test", "Case_", "(_", "lambda_", ":_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "testc", "ase", "\\u", "2_", "=_", "unittest_", "._", "Function", "Test", "Case_", "(_", "lambda_", ":_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "return", "\\u", "Test", "Suite_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "testc", "ase", "\\u", "1_", ",_", "testc", "ase", "\\u", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "._", "return", "\\u", "Test", "Suite_", "=_", "return", "\\u", "Test", "Suite_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "'", "return", "\\u", "Test", "Suit", "e", "'_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "suite_", ",_", "loader_", "._", "suit", "e", "Class_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "[_", "testc", "ase", "\\u", "1_", ",_", "testc", "ase", "\\u", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Name", "\\u\\u", "callable\\u", "\\u", "Test", "Case", "\\u", "instance_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "testc", "ase", "\\u", "1_", "=_", "unittest_", "._", "Function", "Test", "Case_", "(_", "lambda_", ":_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "return", "\\u", "Test", "Case_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "testc", "ase", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "._", "return", "\\u", "Test", "Case_", "=_", "return", "\\u", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "'", "return", "\\u", "Test", "Case", "'_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "suite_", ",_", "loader_", "._", "suit", "e", "Class_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "[_", "testc", "ase", "\\u", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Name", "\\u\\u", "callable\\u", "\\u", "wrong", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "return", "\\u", "wrong", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "._", "return", "\\u", "wrong", "_", "=_", "return", "\\u", "wrong", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "'", "return", "\\u", "wrong", "'_", ",_", "m_", ")_", "\\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\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Name", " ", "fail", "ed", " ", "to", " ", "raise", " ", "Type", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Names", "\\u\\u", "empty", "\\u", "name", "\\u", "list_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "suite_", ",_", "loader_", "._", "suit", "e", "Class_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Names", "\\u\\u", "relative", "\\u", "empty", "\\u", "name", "\\u", "list_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "]_", ",_", "unittest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "suite_", ",_", "loader_", "._", "suit", "e", "Class_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Names", "\\u\\u", "empty", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\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 ", " _", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "''_", "]_", ")_", "\\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 ", " _", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "e_", ")_", ",_", "\"", "Emp", "ty", " ", "module", " ", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Names", " ", "fail", "ed", " ", "to", " ", "raise", " ", "Value", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Names", "\\u\\u", "mal", "formed", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", " ", "Sho", "ul", "d", " ", "this", " ", "raise", " ", "Value", "Error", " ", "or", " ", "Import", "Error", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "'", "abc", " ", "()", " ", "//", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Names", " ", "fail", "ed", " ", "to", " ", "raise", " ", "Value", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Names", "\\u\\u", "unknown", "\\u", "module", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\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 ", " _", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "'", "sda", "sfa", "sfa", "sdf", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "e_", ")_", ",_", "\"", "No", " ", "module", " ", "named", " ", "sda", "sfa", "sfa", "sdf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Names", " ", "fail", "ed", " ", "to", " ", "raise", " ", "Import", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Names", "\\u\\u", "unknown", "\\u", "attr", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\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 ", " _", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "'", "unittest", ".", "sda", "sfa", "sfa", "sdf", "'_", ",_", "'", "unittest", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "e_", ")_", ",_", "\"'", "module", "'", " ", "object", " ", "has", " ", "no", " ", "attribute", " ", "'", "sda", "sfa", "sfa", "sdf", "'\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Names", " ", "fail", "ed", " ", "to", " ", "raise", " ", "Attribute", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Names", "\\u\\u", "unknown", "\\u", "name", "\\u", "relative", "\\u", "1_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\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 ", " _", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "'", "sda", "sfa", "sfa", "sdf", "'_", "]_", ",_", "unittest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "e_", ")_", ",_", "\"'", "module", "'", " ", "object", " ", "has", " ", "no", " ", "attribute", " ", "'", "sda", "sfa", "sfa", "sdf", "'\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Name", " ", "fail", "ed", " ", "to", " ", "raise", " ", "Attribute", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Names", "\\u\\u", "unknown", "\\u", "name", "\\u", "relative", "\\u", "2_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\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 ", " _", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "'", "Test", "Case", "'_", ",_", "'", "sda", "sfa", "sfa", "sdf", "'_", "]_", ",_", "unittest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "e_", ")_", ",_", "\"'", "module", "'", " ", "object", " ", "has", " ", "no", " ", "attribute", " ", "'", "sda", "sfa", "sfa", "sdf", "'\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Name", " ", "fail", "ed", " ", "to", " ", "raise", " ", "Attribute", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Names", "\\u\\u", "relative", "\\u", "empty", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\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 ", " _", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "''_", "]_", ",_", "unittest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Fail", "ed", " ", "to", " ", "raise", " ", "Value", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Names", "\\u\\u", "relative", "\\u", "mal", "formed", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", " ", "Sho", "ul", "d", " ", "this", " ", "raise", " ", "Attribute", "Error", " ", "or", " ", "Value", "Error", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "'", "abc", " ", "()", " ", "//", "'_", "]_", ",_", "unittest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Names", " ", "fail", "ed", " ", "to", " ", "raise", " ", "Value", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Names", "\\u\\u", "relative", "\\u", "not", "\\u", "a", "\\u", "module_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "My", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "\\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_", "class_", "Not", "AM", "odule_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "2_", "=_", "My", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "'", "test\\u", "2", "'_", "]_", ",_", "Not", "AM", "odule_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "reference_", "=_", "[_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "My", "Test", "Case_", "(_", "'", "test", "'_", ")_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "reference_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Names", "\\u\\u", "relative", "\\u", "bad", "\\u", "object_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "testc", "ase", "\\u", "1_", "=_", "object_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "'", "testc", "ase", "\\u", "1", "'_", "]_", ",_", "m_", ")_", "\\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\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Sho", "ul", "d", " ", "have", " ", "raise", "d", " ", "Type", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Names", "\\u\\u", "relative", "\\u", "Test", "Case", "\\u", "subclass_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "My", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "\\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_", "m_", "._", "testc", "ase", "\\u", "1_", "=_", "My", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "'", "testc", "ase", "\\u", "1", "'_", "]_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "suite_", ",_", "loader_", "._", "suit", "e", "Class_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "loader_", "._", "suit", "e", "Class_", "(_", "[_", "My", "Test", "Case_", "(_", "'", "test", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "[_", "expected_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Names", "\\u\\u", "relative", "\\u", "Test", "Suite_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "My", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "\\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_", "m_", "._", "testsuite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "My", "Test", "Case_", "(_", "'", "test", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "'", "testsuite", "'_", "]_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "suite_", ",_", "loader_", "._", "suit", "e", "Class_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "[_", "m_", "._", "testsuite_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Names", "\\u\\u", "relative", "\\u", "testm", "ethod", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "My", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "\\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_", "m_", "._", "testc", "ase", "\\u", "1_", "=_", "My", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "'", "testc", "ase", "\\u", "1", ".", "test", "'_", "]_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "suite_", ",_", "loader_", "._", "suit", "e", "Class_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ref", "\\u", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "My", "Test", "Case_", "(_", "'", "test", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "[_", "ref", "\\u", "suite_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Names", "\\u\\u", "relative", "\\u", "invalid", "\\u", "testm", "ethod", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "My", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "\\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_", "m_", "._", "testc", "ase", "\\u", "1_", "=_", "My", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "'", "testc", "ase", "\\u", "1", ".", "testf", "oo", "'_", "]_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "e_", ")_", ",_", "\"", "type", " ", "object", " ", "'", "My", "Test", "Case", "'", " ", "has", " ", "no", " ", "attribute", " ", "'", "testf", "oo", "'\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Fail", "ed", " ", "to", " ", "raise", " ", "Attribute", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Names", "\\u\\u", "callable\\u", "\\u", "Test", "Suite_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "testc", "ase", "\\u", "1_", "=_", "unittest_", "._", "Function", "Test", "Case_", "(_", "lambda_", ":_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "testc", "ase", "\\u", "2_", "=_", "unittest_", "._", "Function", "Test", "Case_", "(_", "lambda_", ":_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "return", "\\u", "Test", "Suite_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "testc", "ase", "\\u", "1_", ",_", "testc", "ase", "\\u", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "._", "return", "\\u", "Test", "Suite_", "=_", "return", "\\u", "Test", "Suite_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "'", "return", "\\u", "Test", "Suit", "e", "'_", "]_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "suite_", ",_", "loader_", "._", "suit", "e", "Class_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "testc", "ase", "\\u", "1_", ",_", "testc", "ase", "\\u", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "[_", "expected_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Names", "\\u\\u", "callable\\u", "\\u", "Test", "Case", "\\u", "instance_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "testc", "ase", "\\u", "1_", "=_", "unittest_", "._", "Function", "Test", "Case_", "(_", "lambda_", ":_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "return", "\\u", "Test", "Case_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "testc", "ase", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "._", "return", "\\u", "Test", "Case_", "=_", "return", "\\u", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "'", "return", "\\u", "Test", "Case", "'_", "]_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "suite_", ",_", "loader_", "._", "suit", "e", "Class_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ref", "\\u", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "testc", "ase", "\\u", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "[_", "ref", "\\u", "suite_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Names", "\\u\\u", "callable\\u", "\\u", "call", "\\u", "staticmethod_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Test", "1_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "\\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_", "testc", "ase", "\\u", "1_", "=_", "Test", "1_", "(_", "'", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "foo_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "testc", "ase", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "._", "Foo_", "=_", "Foo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "'", "Foo", ".", "foo", "'_", "]_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "suite_", ",_", "loader_", "._", "suit", "e", "Class_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ref", "\\u", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "testc", "ase", "\\u", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "[_", "ref", "\\u", "suite_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "Test", "s", "Fro", "m", "Names", "\\u\\u", "callable\\u", "\\u", "wrong", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "return", "\\u", "wrong", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "._", "return", "\\u", "wrong", "_", "=_", "return", "\\u", "wrong", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "suite_", "=_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "'", "return", "\\u", "wrong", "'_", "]_", ",_", "m_", ")_", "\\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\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Names", " ", "fail", "ed", " ", "to", " ", "raise", " ", "Type", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "Test", "Case", "Names_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "fooba", "r_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "loader_", "._", "get", "Test", "Case", "Names_", "(_", "Test_", ")_", ",_", "[_", "'", "test\\u", "1", "'_", ",_", "'", "test\\u", "2", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "Test", "Case", "Names", "\\u\\u", "no", "\\u", "tests_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "fooba", "r_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "loader_", "._", "get", "Test", "Case", "Names_", "(_", "Test_", ")_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "Test", "Case", "Names", "\\u\\u", "not", "\\u", "a", "\\u", "Test", "Case_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Ba", "d", "Case_", "(_", "int_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "foo_", "(_", "self_", ")_", ":_", "\\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_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "names_", "=_", "loader_", "._", "get", "Test", "Case", "Names_", "(_", "Ba", "d", "Case_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "names_", ",_", "[_", "'", "test\\u", "foo", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "Test", "Case", "Names", "\\u\\u", "inherita", "nce_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Test", "P_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "fooba", "r_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "C_", "(_", "Test", "P_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "3_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "names_", "=_", "[_", "'", "test\\u", "1", "'_", ",_", "'", "test\\u", "2", "'_", ",_", "'", "test\\u", "3", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "loader_", "._", "get", "Test", "Case", "Names_", "(_", "Test", "C_", ")_", ",_", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "test", "Meth", "od", "Pref", "ix", "\\u\\u", "load", "Test", "s", "Fro", "m", "Test", "Case_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "foo", "\\u", "bar_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tests", "\\u", "1_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "Foo_", "(_", "'", "foo", "\\u", "bar", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tests", "\\u", "2_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "Foo_", "(_", "'", "test\\u", "1", "'_", ")_", ",_", "Foo_", "(_", "'", "test\\u", "2", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loader_", "._", "test", "Meth", "od", "Prefix_", "=_", "'", "foo", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Test", "Case_", "(_", "Foo_", ")_", ",_", "tests", "\\u", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "._", "test", "Meth", "od", "Prefix_", "=_", "'", "test", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Test", "Case_", "(_", "Foo_", ")_", ",_", "tests", "\\u", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "test", "Meth", "od", "Pref", "ix", "\\u\\u", "load", "Test", "s", "Fro", "m", "Module_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "foo", "\\u", "bar_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "._", "Foo_", "=_", "Foo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tests", "\\u", "1_", "=_", "[_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "Foo_", "(_", "'", "foo", "\\u", "bar", "'_", ")_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tests", "\\u", "2_", "=_", "[_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "Foo_", "(_", "'", "test\\u", "1", "'_", ")_", ",_", "Foo_", "(_", "'", "test\\u", "2", "'_", ")_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loader_", "._", "test", "Meth", "od", "Prefix_", "=_", "'", "foo", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Module_", "(_", "m_", ")_", ")_", ",_", "tests", "\\u", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "._", "test", "Meth", "od", "Prefix_", "=_", "'", "test", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Module_", "(_", "m_", ")_", ")_", ",_", "tests", "\\u", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "test", "Meth", "od", "Pref", "ix", "\\u\\u", "load", "Test", "s", "Fro", "m", "Name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "foo", "\\u", "bar_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "._", "Foo_", "=_", "Foo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tests", "\\u", "1_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "Foo_", "(_", "'", "foo", "\\u", "bar", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tests", "\\u", "2_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "Foo_", "(_", "'", "test\\u", "1", "'_", ")_", ",_", "Foo_", "(_", "'", "test\\u", "2", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loader_", "._", "test", "Meth", "od", "Prefix_", "=_", "'", "foo", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "'", "Foo", "'_", ",_", "m_", ")_", ",_", "tests", "\\u", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "._", "test", "Meth", "od", "Prefix_", "=_", "'", "test", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "'", "Foo", "'_", ",_", "m_", ")_", ",_", "tests", "\\u", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "test", "Meth", "od", "Pref", "ix", "\\u\\u", "load", "Test", "s", "Fro", "m", "Names_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "foo", "\\u", "bar_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "._", "Foo_", "=_", "Foo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tests", "\\u", "1_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "Foo_", "(_", "'", "foo", "\\u", "bar", "'_", ")_", "]_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tests", "\\u", "2_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "Foo_", "(_", "'", "test\\u", "1", "'_", ")_", ",_", "Foo_", "(_", "'", "test\\u", "2", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tests", "\\u", "2_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "tests", "\\u", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loader_", "._", "test", "Meth", "od", "Prefix_", "=_", "'", "foo", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "'", "Foo", "'_", "]_", ",_", "m_", ")_", ",_", "tests", "\\u", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "._", "test", "Meth", "od", "Prefix_", "=_", "'", "test", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "'", "Foo", "'_", "]_", ",_", "m_", ")_", ",_", "tests", "\\u", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "test", "Meth", "od", "Pref", "ix", "\\u\\u", "default", "\\u", "value_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "loader_", "._", "test", "Meth", "od", "Prefix_", "==_", "'", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "sort", "Test", "Meth", "ods", "Us", "ing", "\\u\\u", "load", "Test", "s", "Fro", "m", "Test", "Case_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "reverse", "d\\u", "cmp_", "(_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "-_", "cmp_", "(_", "x_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loader_", "._", "sort", "Test", "Meth", "ods", "Us", "ing_", "=_", "reverse", "d\\u", "cmp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tests_", "=_", "loader_", "._", "suit", "e", "Class_", "(_", "[_", "Foo_", "(_", "'", "test\\u", "2", "'_", ")_", ",_", "Foo_", "(_", "'", "test\\u", "1", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Test", "Case_", "(_", "Foo_", ")_", ",_", "tests_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "sort", "Test", "Meth", "ods", "Us", "ing", "\\u\\u", "load", "Test", "s", "Fro", "m", "Module_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "reverse", "d\\u", "cmp_", "(_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "-_", "cmp_", "(_", "x_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "._", "Foo_", "=_", "Foo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loader_", "._", "sort", "Test", "Meth", "ods", "Us", "ing_", "=_", "reverse", "d\\u", "cmp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tests_", "=_", "[_", "loader_", "._", "suit", "e", "Class_", "(_", "[_", "Foo_", "(_", "'", "test\\u", "2", "'_", ")_", ",_", "Foo_", "(_", "'", "test\\u", "1", "'_", ")_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Module_", "(_", "m_", ")_", ")_", ",_", "tests_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "sort", "Test", "Meth", "ods", "Us", "ing", "\\u\\u", "load", "Test", "s", "Fro", "m", "Name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "reverse", "d\\u", "cmp_", "(_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "-_", "cmp_", "(_", "x_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "._", "Foo_", "=_", "Foo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loader_", "._", "sort", "Test", "Meth", "ods", "Us", "ing_", "=_", "reverse", "d\\u", "cmp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tests_", "=_", "loader_", "._", "suit", "e", "Class_", "(_", "[_", "Foo_", "(_", "'", "test\\u", "2", "'_", ")_", ",_", "Foo_", "(_", "'", "test\\u", "1", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "'", "Foo", "'_", ",_", "m_", ")_", ",_", "tests_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "sort", "Test", "Meth", "ods", "Us", "ing", "\\u\\u", "load", "Test", "s", "Fro", "m", "Names_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "reverse", "d\\u", "cmp_", "(_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "-_", "cmp_", "(_", "x_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "._", "Foo_", "=_", "Foo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loader_", "._", "sort", "Test", "Meth", "ods", "Us", "ing_", "=_", "reverse", "d\\u", "cmp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tests_", "=_", "[_", "loader_", "._", "suit", "e", "Class_", "(_", "[_", "Foo_", "(_", "'", "test\\u", "2", "'_", ")_", ",_", "Foo_", "(_", "'", "test\\u", "1", "'_", ")_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "'", "Foo", "'_", "]_", ",_", "m_", ")_", ")_", ",_", "tests_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "sort", "Test", "Meth", "ods", "Us", "ing", "\\u\\u", "get", "Test", "Case", "Names_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "reverse", "d\\u", "cmp_", "(_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "-_", "cmp_", "(_", "x_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loader_", "._", "sort", "Test", "Meth", "ods", "Us", "ing_", "=_", "reverse", "d\\u", "cmp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "names_", "=_", "[_", "'", "test\\u", "2", "'_", ",_", "'", "test\\u", "1", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "loader_", "._", "get", "Test", "Case", "Names_", "(_", "Foo_", ")_", ",_", "test\\u", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "sort", "Test", "Meth", "ods", "Us", "ing", "\\u\\u", "default", "\\u", "value_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "loader_", "._", "sort", "Test", "Meth", "ods", "Us", "ing_", "is_", "cmp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "sort", "Test", "Meth", "ods", "Us", "ing", "\\u\\u", "None_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loader_", "._", "sort", "Test", "Meth", "ods", "Us", "ing_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "names_", "=_", "[_", "'", "test\\u", "2", "'_", ",_", "'", "test\\u", "1", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "set_", "(_", "loader_", "._", "get", "Test", "Case", "Names_", "(_", "Foo_", ")_", ")_", ",_", "set_", "(_", "test\\u", "names_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "suit", "e", "Class\\u", "\\u", "load", "Test", "s", "Fro", "m", "Test", "Case_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "foo", "\\u", "bar_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tests_", "=_", "[_", "Foo_", "(_", "'", "test\\u", "1", "'_", ")_", ",_", "Foo_", "(_", "'", "test\\u", "2", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loader_", "._", "suit", "e", "Class_", "=_", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Test", "Case_", "(_", "Foo_", ")_", ",_", "tests_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "suit", "e", "Class\\u", "\\u", "load", "Test", "s", "Fro", "m", "Module_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "foo", "\\u", "bar_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "._", "Foo_", "=_", "Foo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tests_", "=_", "[_", "[_", "Foo_", "(_", "'", "test\\u", "1", "'_", ")_", ",_", "Foo_", "(_", "'", "test\\u", "2", "'_", ")_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loader_", "._", "suit", "e", "Class_", "=_", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Module_", "(_", "m_", ")_", ",_", "tests_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "suit", "e", "Class\\u", "\\u", "load", "Test", "s", "Fro", "m", "Name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "foo", "\\u", "bar_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "._", "Foo_", "=_", "Foo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tests_", "=_", "[_", "Foo_", "(_", "'", "test\\u", "1", "'_", ")_", ",_", "Foo_", "(_", "'", "test\\u", "2", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loader_", "._", "suit", "e", "Class_", "=_", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "'", "Foo", "'_", ",_", "m_", ")_", ",_", "tests_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "suit", "e", "Class\\u", "\\u", "load", "Test", "s", "Fro", "m", "Names_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "types_", "._", "Modul", "e", "Type_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "foo", "\\u", "bar_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "._", "Foo_", "=_", "Foo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tests_", "=_", "[_", "[_", "Foo_", "(_", "'", "test\\u", "1", "'_", ")_", ",_", "Foo_", "(_", "'", "test\\u", "2", "'_", ")_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loader_", "._", "suit", "e", "Class_", "=_", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "loader_", "._", "load", "Test", "s", "Fro", "m", "Names_", "(_", "[_", "'", "Foo", "'_", "]_", ",_", "m_", ")_", ",_", "tests_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Loader_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Load", "er", ".", "load", "Test", "s", "Fro", "m", "Test", "Case_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "suit", "e", " ", "of", " ", "all", " ", "tests", " ", "case", "s", " ", "contain", "ed", " ", "in", " ", "the", " ", "Test", "Case", "-", "derive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "test", "Case", "Class", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "suit", "e", "Class\\u", "\\u", "default", "\\u", "value_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "loader_", "._", "suit", "e", "Class_", "is_", "unittest_", "._", "Test", "Suite_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "3_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "run", "Test_", "(_", "self_", ")_", ":_", "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", "mk", "\\u", "Test", "Suite_", "(_", "*_", "names_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "unittest_", "._", "Test", "Suite_", "(_", "Foo_", "(_", "n_", ")_", "for_", "n_", "in_", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "\\u", "Test", "Suite_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eq", "\\u", "pairs_", "=_", "[_", "(_", "unittest_", "._", "Test", "Suite_", "(_", ")_", ",_", "unittest_", "._", "Test", "Suite_", "(_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ",_", "(_", "unittest_", "._", "Test", "Suite_", "(_", ")_", ",_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "]_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ",_", "(_", "\\u", "mk", "\\u", "Test", "Suite_", "(_", "'", "test\\u", "1", "'_", ")_", ",_", "\\u", "mk", "\\u", "Test", "Suite_", "(_", "'", "test\\u", "1", "'_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "ne_", "\\u\\u\\uNL\\u\\u\\u_", "ne", "\\u", "pairs_", "=_", "[_", "(_", "unittest_", "._", "Test", "Suite_", "(_", ")_", ",_", "\\u", "mk", "\\u", "Test", "Suite_", "(_", "'", "test\\u", "1", "'_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ",_", "(_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "]_", ")_", ",_", "\\u", "mk", "\\u", "Test", "Suite_", "(_", "'", "test\\u", "1", "'_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ",_", "(_", "\\u", "mk", "\\u", "Test", "Suite_", "(_", "'", "test\\u", "1", "'_", ",_", "'", "test\\u", "2", "'_", ")_", ",_", "\\u", "mk", "\\u", "Test", "Suite_", "(_", "'", "test\\u", "1", "'_", ",_", "'", "test\\u", "3", "'_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ",_", "(_", "\\u", "mk", "\\u", "Test", "Suite_", "(_", "'", "test\\u", "1", "'_", ")_", ",_", "\\u", "mk", "\\u", "Test", "Suite_", "(_", "'", "test\\u", "2", "'_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "/", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Test", "s", " ", "for", " ", "Test", "Suit", "e", ".\\u", "\\u", "init\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "class", " ", "Test", "Suit", "e", "([", "tests", "])\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "tests", " ", "iterable", " ", "shou", "ld", " ", "be", " ", "optional_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "class", " ", "Test", "Suit", "e", "([", "tests", "])\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "If", " ", "tests", " ", "is", " ", "give", "n", ",", " ", "it", " ", "must", " ", "be", " ", "an", " ", "iterable", " ", "of", " ", "individual", " ", "test", " ", "cases_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "or", " ", "other", " ", "test", " ", "suites", " ", "tha", "t", " ", "will", " ", "be", " ", "used", " ", "to", " ", "build", " ", "the", " ", "suit", "e", " ", "initially", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Suit", "e", " ", "shou", "ld", " ", "deal", " ", "with", " ", "empty", " ", "tests", " ", "iterable", "s", " ", "by", " ", "allow", "ing", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "creati", "on", " ", "of", " ", "an", " ", "empty", " ", "suite_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "class", " ", "Test", "Suit", "e", "([", "tests", "])\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "If", " ", "tests", " ", "is", " ", "give", "n", ",", " ", "it", " ", "must", " ", "be", " ", "an", " ", "iterable", " ", "of", " ", "individual", " ", "test", " ", "cases_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "or", " ", "other", " ", "test", " ", "suites", " ", "tha", "t", " ", "will", " ", "be", " ", "used", " ", "to", " ", "build", " ", "the", " ", "suit", "e", " ", "initially", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Suit", "e", " ", "shou", "ld", " ", "allow", " ", "any", " ", "iterable", " ", "to", " ", "provide", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "class", " ", "Test", "Suit", "e", "([", "tests", "])\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "If", " ", "tests", " ", "is", " ", "give", "n", ",", " ", "it", " ", "must", " ", "be", " ", "an", " ", "iterable", " ", "of", " ", "individual", " ", "test", " ", "cases_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "or", " ", "other", " ", "test", " ", "suites", " ", "tha", "t", " ", "will", " ", "be", " ", "used", " ", "to", " ", "build", " ", "the", " ", "suit", "e", " ", "initially", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Do", "es", " ", "Test", "Suit", "e", "()", " ", "als", "o", " ", "allow", " ", "other", " ", "Test", "Suit", "e", "()", " ", "instance", "s", " ", "to", " ", "be", " ", "present_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "the", " ", "tests", " ", "iterable", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "/", "Test", "s", " ", "for", " ", "Test", "Suit", "e", ".\\u", "\\u", "init\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Containe", "r", " ", "types", " ", "shou", "ld", " ", "support", " ", "the", " ", "iter", " ", "protocol_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "the", " ", "number", " ", "of", " ", "tests", " ", "represent", "ed", " ", "by", " ", "the", " ", "this", " ", "test", " ", "object", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "...", "this", " ", "method", " ", "is", " ", "als", "o", " ", "implemented", " ", "by", " ", "the", " ", "Test", "Suit", "e", " ", "class", ",", " ", "whi", "ch", " ", "can_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", " ", "large", "r", " ", "[", "great", "er", " ", "than", " ", "1", "]", " ", "values", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pres", "uma", "bly", " ", "an", " ", "empty", " ", "Test", "Suit", "e", " ", "return", "s", " ", "0", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "the", " ", "number", " ", "of", " ", "tests", " ", "represent", "ed", " ", "by", " ", "the", " ", "this", " ", "test", " ", "object", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "...", "this", " ", "method", " ", "is", " ", "als", "o", " ", "implemented", " ", "by", " ", "the", " ", "Test", "Suit", "e", " ", "class", ",", " ", "whi", "ch", " ", "can_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", " ", "large", "r", " ", "[", "great", "er", " ", "than", " ", "1", "]", " ", "values", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pres", "uma", "bly", " ", "an", " ", "empty", " ", "Test", "Suit", "e", " ", "(", "even", " ", "if", " ", "it", " ", "contain", "s", " ", "other", " ", "empty_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Suit", "e", " ", "instance", "s", ")", " ", "return", "s", " ", "0", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "the", " ", "number", " ", "of", " ", "tests", " ", "represent", "ed", " ", "by", " ", "the", " ", "this", " ", "test", " ", "object", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "...", "this", " ", "method", " ", "is", " ", "als", "o", " ", "implemented", " ", "by", " ", "the", " ", "Test", "Suit", "e", " ", "class", ",", " ", "whi", "ch", " ", "can_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", " ", "large", "r", " ", "[", "great", "er", " ", "than", " ", "1", "]", " ", "values", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "the", " ", "number", " ", "of", " ", "tests", " ", "represent", "ed", " ", "by", " ", "the", " ", "this", " ", "test", " ", "object", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "...", "this", " ", "method", " ", "is", " ", "als", "o", " ", "implemented", " ", "by", " ", "the", " ", "Test", "Suit", "e", " ", "class", ",", " ", "whi", "ch", " ", "can_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", " ", "large", "r", " ", "[", "great", "er", " ", "than", " ", "1", "]", " ", "values", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "this", " ", "hold", "s", " ", "for", " ", "nest", "ed", " ", "Test", "Suit", "e", " ", "instance", "s", ",", " ", "too", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Run", " ", "the", " ", "tests", " ", "associate", "d", " ", "with", " ", "this", " ", "suit", "e", ",", " ", "collecti", "ng", " ", "the", " ", "result", " ", "into_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "test", " ", "result", " ", "object", " ", "pass", "ed", " ", "as", " ", "result", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "And", " ", "if", " ", "there", " ", "are", " ", "no", " ", "tests", "?", " ", "What", " ", "then", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Not", "e", " ", "tha", "t", " ", "unli", "ke", " ", "Test", "Case", ".", "run", "()", ",", " ", "Test", "Suit", "e", ".", "run", "()", " ", "require", "s", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "result", " ", "object", " ", "to", " ", "be", " ", "pass", "ed", " ", "in", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Run", " ", "the", " ", "tests", " ", "associate", "d", " ", "with", " ", "this", " ", "suit", "e", ",", " ", "collecti", "ng", " ", "the", " ", "result", " ", "into_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "test", " ", "result", " ", "object", " ", "pass", "ed", " ", "as", " ", "result", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Add", " ", "a", " ", "Test", "Case", " ", "...", " ", "to", " ", "the", " ", "suit", "e", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Add", " ", "a", " ", "...", " ", "Test", "Suit", "e", " ", "to", " ", "the", " ", "suit", "e", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Add", " ", "all", " ", "the", " ", "tests", " ", "from", " ", "an", " ", "iterable", " ", "of", " ", "Test", "Case", " ", "and", " ", "Test", "Suite_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "instance", "s", " ", "to", " ", "this", " ", "test", " ", "suit", "e", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Thi", "s", " ", "is", " ", "equivalent", " ", "to", " ", "iterati", "ng", " ", "over", " ", "tests", ",", " ", "calling", " ", "add", "Test", "()", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "each", " ", "element", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Add", " ", "all", " ", "the", " ", "tests", " ", "from", " ", "an", " ", "iterable", " ", "of", " ", "Test", "Case", " ", "and", " ", "Test", "Suite_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "instance", "s", " ", "to", " ", "this", " ", "test", " ", "suit", "e", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "What", " ", "happ", "ens", " ", "if", " ", "it", " ", "doe", "sn", "'", "t", " ", "get", " ", "an", " ", "iterable", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Suite_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "init", "\\u\\u", "tests", "\\u", "optional_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "suite_", "._", "count", "Test", "Cases_", "(_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Suite_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "init", "\\u\\u", "empty", "\\u", "tests_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "suite_", "._", "count", "Test", "Cases_", "(_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Suite_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "init", "\\u\\u", "tests", "\\u", "from", "\\u", "any", "\\u", "iterable_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "tests_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "unittest_", "._", "Function", "Test", "Case_", "(_", "lambda_", ":_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "unittest_", "._", "Function", "Test", "Case_", "(_", "lambda_", ":_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "suit", "e\\u", "1_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "tests_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "suit", "e\\u", "1_", "._", "count", "Test", "Cases_", "(_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "suit", "e\\u", "2_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "suit", "e\\u", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "suit", "e\\u", "2_", "._", "count", "Test", "Cases_", "(_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "suit", "e\\u", "3_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "set_", "(_", "suit", "e\\u", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "suit", "e\\u", "3_", "._", "count", "Test", "Cases_", "(_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Suite_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "init", "\\u\\u", "Test", "Suit", "e\\u", "instance", "s", "\\u", "in", "\\u", "tests_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "tests_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ft", "c_", "=_", "unittest_", "._", "Function", "Test", "Case_", "(_", "lambda_", ":_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "ft", "c_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "unittest_", "._", "Function", "Test", "Case_", "(_", "lambda_", ":_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "tests_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "suite_", "._", "count", "Test", "Cases_", "(_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Suite_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "iter_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test1_", "=_", "unittest_", "._", "Function", "Test", "Case_", "(_", "lambda_", ":_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test2_", "=_", "unittest_", "._", "Function", "Test", "Case_", "(_", "lambda_", ":_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "(_", "test1_", ",_", "test2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "[_", "test1_", ",_", "test2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Suite_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "count", "Test", "Case", "s", "\\u", "zero", "\\u", "simple_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "suite_", "._", "count", "Test", "Cases_", "(_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Suite_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "count", "Test", "Case", "s", "\\u", "zero", "\\u", "nested_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Test", "1_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "\\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_", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "unittest_", "._", "Test", "Suite_", "(_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "suite_", "._", "count", "Test", "Cases_", "(_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Suite_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "count", "Test", "Case", "s", "\\u", "simple_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test1_", "=_", "unittest_", "._", "Function", "Test", "Case_", "(_", "lambda_", ":_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test2_", "=_", "unittest_", "._", "Function", "Test", "Case_", "(_", "lambda_", ":_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "(_", "test1_", ",_", "test2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "suite_", "._", "count", "Test", "Cases_", "(_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Suite_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "count", "Test", "Case", "s", "\\u", "nested_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Test", "1_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "test2_", "=_", "unittest_", "._", "Function", "Test", "Case_", "(_", "lambda_", ":_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test", "3_", "=_", "unittest_", "._", "Function", "Test", "Case_", "(_", "lambda_", ":_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "child_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "(_", "Test", "1_", "(_", "'", "test", "2", "'_", ")_", ",_", "test2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "(_", "test", "3_", ",_", "child_", ",_", "Test", "1_", "(_", "'", "test", "1", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "parent_", "._", "count", "Test", "Cases_", "(_", ")_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Suite_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "run", "\\u\\u", "empty", "\\u", "suite_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Log", "ging", "Result_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "suite_", "._", "run_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "events_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Suite_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "run", "\\u\\u", "require", "s", "\\u", "result_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", ")_", "\\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 ", " _", "suite_", "._", "run_", "(_", ")_", "\\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\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Fail", "ed", " ", "to", " ", "raise", " ", "Type", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Suite_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Log", "ging", "Result_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Log", "ging", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "run", " ", "%", "s", "'_", "%_", "self_", "._", "\\u", "test", "Meth", "od", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tests_", "=_", "[_", "Log", "ging", "Case_", "(_", "'", "test", "1", "'_", ")_", ",_", "Log", "ging", "Case_", "(_", "'", "test", "2", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "unittest_", "._", "Test", "Suite_", "(_", "tests_", ")_", "._", "run_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "events_", ",_", "[_", "'", "run", " ", "test", "1", "'_", ",_", "'", "run", " ", "test", "2", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Suite_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "Test", "\\u\\u", "Test", "Case_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "test_", "=_", "Foo_", "(_", "'", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "suite_", "._", "add", "Test_", "(_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "suite_", "._", "count", "Test", "Cases_", "(_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "[_", "test_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Suite_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "Test", "\\u\\u", "Test", "Suite_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "suit", "e\\u", "2_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "Foo_", "(_", "'", "test", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "._", "add", "Test_", "(_", "suit", "e\\u", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "suite_", "._", "count", "Test", "Cases_", "(_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suite_", ")_", ",_", "[_", "suit", "e\\u", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Suite_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "Tests_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "2_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "test\\u", "1_", "=_", "Foo_", "(_", "'", "test\\u", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "2_", "=_", "Foo_", "(_", "'", "test\\u", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inner", "\\u", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "[_", "test\\u", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "gen_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "test\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "test\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "inner", "\\u", "suite_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "suit", "e\\u", "1_", "=_", "unittest_", "._", "Test", "Suite_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suit", "e\\u", "1_", "._", "add", "Tests_", "(_", "gen_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "suit", "e\\u", "1_", ")_", ",_", "list_", "(_", "gen_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Thi", "s", " ", "is", " ", "equivalent", " ", "to", " ", "iterati", "ng", " ", "over", " ", "tests", ",", " ", "calling", " ", "add", "Test", "()", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "each", " ", "element", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "suit", "e\\u", "2_", "=_", "unittest_", "._", "Test", "Suite_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "t_", "in_", "gen_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "suit", "e\\u", "2_", "._", "add", "Test_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "suit", "e\\u", "1_", ",_", "suit", "e\\u", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Suite_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "Test", "\\u\\u", "non", "iterable_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", ")_", "\\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 ", " _", "suite_", "._", "add", "Tests_", "(_", "5_", ")_", "\\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\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Fail", "ed", " ", "to", " ", "raise", " ", "Type", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Suite_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "Test", "\\u\\u", "nonc", "alla", "ble_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "suite_", "._", "add", "Test_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Suite_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "Test", "\\u\\u", "case", "suit", "ecl", "ass_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "suite_", "._", "add", "Test_", ",_", "Test", "\\u", "Test", "Suite_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "suite_", "._", "add", "Test_", ",_", "unittest_", "._", "Test", "Suite_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Suite_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "need", "ed", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "Test", "s", "\\u\\u", "string_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "suite_", "._", "add", "Tests_", ",_", "\"", "foo", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "\\u", "Function", "Test", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "the", " ", "number", " ", "of", " ", "tests", " ", "represent", "ed", " ", "by", " ", "the", " ", "this", " ", "test", " ", "object", ".", " ", "For_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "instance", "s", ",", " ", "this", " ", "will", " ", "alw", "ay", "s", " ", "be", " ", "1", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Whe", "n", " ", "a", " ", "set", "Up", "()", " ", "method", " ", "is", " ", "defin", "ed", ",", " ", "the", " ", "test", " ", "runn", "er", " ", "will", " ", "run", " ", "tha", "t", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "prior", " ", "to", " ", "each", " ", "test", ".", " ", "Lik", "ew", "ise", ",", " ", "if", " ", "a", " ", "tear", "Down", "()", " ", "method", " ", "is", " ", "defin", "ed", ",", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "runn", "er", " ", "will", " ", "invoke", " ", "tha", "t", " ", "method", " ", "after", " ", "each", " ", "test", ".", " ", "In", " ", "the", " ", "example", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", "Up", "()", " ", "was", " ", "used", " ", "to", " ", "create", " ", "a", " ", "fresh", " ", "sequence", " ", "for", " ", "each", " ", "test", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "the", " ", "proper", " ", "call", " ", "order", " ", "is", " ", "maintain", "ed", ",", " ", "even", " ", "if", " ", "set", "Up", "()", " ", "raises_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "an", " ", "exception", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Whe", "n", " ", "a", " ", "set", "Up", "()", " ", "method", " ", "is", " ", "defin", "ed", ",", " ", "the", " ", "test", " ", "runn", "er", " ", "will", " ", "run", " ", "tha", "t", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "prior", " ", "to", " ", "each", " ", "test", ".", " ", "Lik", "ew", "ise", ",", " ", "if", " ", "a", " ", "tear", "Down", "()", " ", "method", " ", "is", " ", "defin", "ed", ",", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "runn", "er", " ", "will", " ", "invoke", " ", "tha", "t", " ", "method", " ", "after", " ", "each", " ", "test", ".", " ", "In", " ", "the", " ", "example", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", "Up", "()", " ", "was", " ", "used", " ", "to", " ", "create", " ", "a", " ", "fresh", " ", "sequence", " ", "for", " ", "each", " ", "test", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "the", " ", "proper", " ", "call", " ", "order", " ", "is", " ", "maintain", "ed", ",", " ", "even", " ", "if", " ", "the", " ", "test", " ", "raises_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "an", " ", "error", " ", "(", "as", " ", "oppo", "sed", " ", "to", " ", "a", " ", "fail", "ure", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Whe", "n", " ", "a", " ", "set", "Up", "()", " ", "method", " ", "is", " ", "defin", "ed", ",", " ", "the", " ", "test", " ", "runn", "er", " ", "will", " ", "run", " ", "tha", "t", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "prior", " ", "to", " ", "each", " ", "test", ".", " ", "Lik", "ew", "ise", ",", " ", "if", " ", "a", " ", "tear", "Down", "()", " ", "method", " ", "is", " ", "defin", "ed", ",", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "runn", "er", " ", "will", " ", "invoke", " ", "tha", "t", " ", "method", " ", "after", " ", "each", " ", "test", ".", " ", "In", " ", "the", " ", "example", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", "Up", "()", " ", "was", " ", "used", " ", "to", " ", "create", " ", "a", " ", "fresh", " ", "sequence", " ", "for", " ", "each", " ", "test", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "the", " ", "proper", " ", "call", " ", "order", " ", "is", " ", "maintain", "ed", ",", " ", "even", " ", "if", " ", "the", " ", "test", " ", "signals_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "fail", "ure", " ", "(", "as", " ", "oppo", "sed", " ", "to", " ", "an", " ", "error", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Whe", "n", " ", "a", " ", "set", "Up", "()", " ", "method", " ", "is", " ", "defin", "ed", ",", " ", "the", " ", "test", " ", "runn", "er", " ", "will", " ", "run", " ", "tha", "t", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "prior", " ", "to", " ", "each", " ", "test", ".", " ", "Lik", "ew", "ise", ",", " ", "if", " ", "a", " ", "tear", "Down", "()", " ", "method", " ", "is", " ", "defin", "ed", ",", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "runn", "er", " ", "will", " ", "invoke", " ", "tha", "t", " ", "method", " ", "after", " ", "each", " ", "test", ".", " ", "In", " ", "the", " ", "example", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", "Up", "()", " ", "was", " ", "used", " ", "to", " ", "create", " ", "a", " ", "fresh", " ", "sequence", " ", "for", " ", "each", " ", "test", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "the", " ", "proper", " ", "call", " ", "order", " ", "is", " ", "maintain", "ed", ",", " ", "even", " ", "if", " ", "tear", "Down", "()", " ", "raises_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "an", " ", "exception", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "string", " ", "identify", "ing", " ", "the", " ", "specific", " ", "test", " ", "case", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Be", "caus", "e", " ", "of", " ", "the", " ", "vag", "ue", " ", "natur", "e", " ", "of", " ", "the", " ", "docs", ",", " ", "I", "'", "m", " ", "not", " ", "goi", "ng", " ", "to", " ", "lock", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "down", " ", "too", " ", "muc", "h", ".", " ", "Real", "ly", " ", "all", " ", "tha", "t", " ", "can", " ", "be", " ", "assert", "ed", " ", "is", " ", "tha", "t", " ", "the", " ", "id", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "will", " ", "be", " ", "a", " ", "string", " ", "(", "eit", "her", " ", "8", "-", "byte", " ", "or", " ", "unicode", " ", "--", " ", "again", ",", " ", "bec", "aus", "e", " ", "the", " ", "docs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "just", " ", "say", " ", "\"", "string", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", "s", " ", "a", " ", "one", "-", "line", " ", "description", " ", "of", " ", "the", " ", "test", ",", " ", "or", " ", "Non", "e", " ", "if", " ", "no", " ", "description_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "has", " ", "bee", "n", " ", "provided", ".", " ", "The", " ", "default", " ", "implementation", " ", "of", " ", "this", " ", "method", " ", "returns_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "first", " ", "line", " ", "of", " ", "the", " ", "test", " ", "method", "'", "s", " ", "docstr", "ing", ",", " ", "if", " ", "avail", "able", ",", " ", "or", " ", "Non", "e", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", "s", " ", "a", " ", "one", "-", "line", " ", "description", " ", "of", " ", "the", " ", "test", ",", " ", "or", " ", "Non", "e", " ", "if", " ", "no", " ", "description_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "has", " ", "bee", "n", " ", "provided", ".", " ", "The", " ", "default", " ", "implementation", " ", "of", " ", "this", " ", "method", " ", "returns_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "first", " ", "line", " ", "of", " ", "the", " ", "test", " ", "method", "'", "s", " ", "docstr", "ing", ",", " ", "if", " ", "avail", "able", ",", " ", "or", " ", "Non", "e", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Function", "Test", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "the", " ", "number", " ", "of", " ", "tests", " ", "represent", "ed", " ", "by", " ", "the", " ", "this", " ", "test", " ", "object", ".", " ", "For_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "instance", "s", ",", " ", "this", " ", "will", " ", "alw", "ay", "s", " ", "be", " ", "1", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "count", "Test", "Cases_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test_", "=_", "unittest_", "._", "Function", "Test", "Case_", "(_", "lambda_", ":_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "test_", "._", "count", "Test", "Cases_", "(_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Function", "Test", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "the", " ", "number", " ", "of", " ", "tests", " ", "represent", "ed", " ", "by", " ", "the", " ", "this", " ", "test", " ", "object", ".", " ", "For_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "instance", "s", ",", " ", "this", " ", "will", " ", "alw", "ay", "s", " ", "be", " ", "1", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "run", "\\u", "call", "\\u", "order", "\\u\\u", "error", "\\u", "in", "\\u", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Log", "ging", "Result_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "set", "Up", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Run", "time", "Error_", "(_", "'", "raise", "d", " ", "by", " ", "set", "Up", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "tear", "Down", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expected_", "=_", "[_", "'", "start", "Test", "'_", ",_", "'", "set", "Up", "'_", ",_", "'", "add", "Error", "'_", ",_", "'", "stop", "Test", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unittest_", "._", "Function", "Test", "Case_", "(_", "test_", ",_", "set", "Up_", ",_", "tear", "Down_", ")_", "._", "run_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "events_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Function", "Test", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "the", " ", "number", " ", "of", " ", "tests", " ", "represent", "ed", " ", "by", " ", "the", " ", "this", " ", "test", " ", "object", ".", " ", "For_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "instance", "s", ",", " ", "this", " ", "will", " ", "alw", "ay", "s", " ", "be", " ", "1", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "run", "\\u", "call", "\\u", "order", "\\u\\u", "error", "\\u", "in", "\\u", "test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Log", "ging", "Result_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "set", "Up", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Run", "time", "Error_", "(_", "'", "raise", "d", " ", "by", " ", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "tear", "Down", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expected_", "=_", "[_", "'", "start", "Test", "'_", ",_", "'", "set", "Up", "'_", ",_", "'", "test", "'_", ",_", "'", "add", "Error", "'_", ",_", "'", "tear", "Down", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "stop", "Test", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unittest_", "._", "Function", "Test", "Case_", "(_", "test_", ",_", "set", "Up_", ",_", "tear", "Down_", ")_", "._", "run_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "events_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Function", "Test", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "the", " ", "number", " ", "of", " ", "tests", " ", "represent", "ed", " ", "by", " ", "the", " ", "this", " ", "test", " ", "object", ".", " ", "For_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "instance", "s", ",", " ", "this", " ", "will", " ", "alw", "ay", "s", " ", "be", " ", "1", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "run", "\\u", "call", "\\u", "order", "\\u\\u", "fail", "ure", "\\u", "in", "\\u", "test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Log", "ging", "Result_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "set", "Up", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", "'", "raise", "d", " ", "by", " ", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "tear", "Down", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expected_", "=_", "[_", "'", "start", "Test", "'_", ",_", "'", "set", "Up", "'_", ",_", "'", "test", "'_", ",_", "'", "add", "Fail", "ure", "'_", ",_", "'", "tear", "Down", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "stop", "Test", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unittest_", "._", "Function", "Test", "Case_", "(_", "test_", ",_", "set", "Up_", ",_", "tear", "Down_", ")_", "._", "run_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "events_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Function", "Test", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "the", " ", "number", " ", "of", " ", "tests", " ", "represent", "ed", " ", "by", " ", "the", " ", "this", " ", "test", " ", "object", ".", " ", "For_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "instance", "s", ",", " ", "this", " ", "will", " ", "alw", "ay", "s", " ", "be", " ", "1", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "run", "\\u", "call", "\\u", "order", "\\u\\u", "error", "\\u", "in", "\\u", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Log", "ging", "Result_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "set", "Up", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "tear", "Down", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Run", "time", "Error_", "(_", "'", "raise", "d", " ", "by", " ", "tear", "Down", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expected_", "=_", "[_", "'", "start", "Test", "'_", ",_", "'", "set", "Up", "'_", ",_", "'", "test", "'_", ",_", "'", "tear", "Down", "'_", ",_", "'", "add", "Error", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "stop", "Test", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unittest_", "._", "Function", "Test", "Case_", "(_", "test_", ",_", "set", "Up_", ",_", "tear", "Down_", ")_", "._", "run_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "events_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Function", "Test", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "the", " ", "number", " ", "of", " ", "tests", " ", "represent", "ed", " ", "by", " ", "the", " ", "this", " ", "test", " ", "object", ".", " ", "For_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "instance", "s", ",", " ", "this", " ", "will", " ", "alw", "ay", "s", " ", "be", " ", "1", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test_", "=_", "unittest_", "._", "Function", "Test", "Case_", "(_", "lambda_", ":_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "test_", "._", "id_", "(_", ")_", ",_", "basestring_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Function", "Test", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "the", " ", "number", " ", "of", " ", "tests", " ", "represent", "ed", " ", "by", " ", "the", " ", "this", " ", "test", " ", "object", ".", " ", "For_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "instance", "s", ",", " ", "this", " ", "will", " ", "alw", "ay", "s", " ", "be", " ", "1", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "short", "Descripti", "on", "\\u\\u", "no", "\\u", "docstring_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test_", "=_", "unittest_", "._", "Function", "Test", "Case_", "(_", "lambda_", ":_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "test_", "._", "short", "Description_", "(_", ")_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Function", "Test", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "the", " ", "number", " ", "of", " ", "tests", " ", "represent", "ed", " ", "by", " ", "the", " ", "this", " ", "test", " ", "object", ".", " ", "For_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "instance", "s", ",", " ", "this", " ", "will", " ", "alw", "ay", "s", " ", "be", " ", "1", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "short", "Descripti", "on", "\\u\\u", "single", "line", "\\u", "docstring_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "desc_", "=_", "\"", "this", " ", "tests", " ", "foo", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test_", "=_", "unittest_", "._", "Function", "Test", "Case_", "(_", "lambda_", ":_", "None_", ",_", "description_", "=_", "desc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "test_", "._", "short", "Description_", "(_", ")_", ",_", "\"", "this", " ", "tests", " ", "foo", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "\\u", "Test", "Result_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", "e", ":", " ", "there", " ", "are", " ", "not", " ", "separate", " ", "tests", " ", "for", " ", "Test", "Result", ".", "was", "Success", "ful", "()", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Result", ".", "error", "s", ",", " ", "Test", "Result", ".", "fail", "ure", "s", ",", " ", "Test", "Result", ".", "tests", "Run", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Result", ".", "shou", "ld", "Sto", "p", " ", "bec", "aus", "e", " ", "these", " ", "only", " ", "have", " ", "meaning", " ", "in", " ", "term", "s", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", " ", "Test", "Result", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Acco", "rdin", "gly", ",", " ", "tests", " ", "for", " ", "the", " ", "af", "ore", "named", " ", "attribute", "s", " ", "are", " ", "inco", "rpor", "ated", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "with", " ", "the", " ", "tests", " ", "for", " ", "the", " ", "defini", "ng", " ", "method", "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_", "#", " ", "\"", "Thi", "s", " ", "method", " ", "can", " ", "be", " ", "call", "ed", " ", "to", " ", "signal", " ", "tha", "t", " ", "the", " ", "set", " ", "of", " ", "tests", " ", "bei", "ng_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "run", " ", "shou", "ld", " ", "be", " ", "abort", "ed", " ", "by", " ", "setti", "ng", " ", "the", " ", "Test", "Result", "'", "s", " ", "shou", "ld", "Stop_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "attribute", " ", "to", " ", "Tru", "e", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Call", "ed", " ", "whe", "n", " ", "the", " ", "test", " ", "case", " ", "test", " ", "is", " ", "abo", "ut", " ", "to", " ", "be", " ", "run", ".", " ", "The", " ", "default_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "implementation", " ", "simp", "ly", " ", "increment", "s", " ", "the", " ", "instance", "'", "s", " ", "tests", "Run", " ", "counter", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Call", "ed", " ", "after", " ", "the", " ", "test", " ", "case", " ", "test", " ", "has", " ", "bee", "n", " ", "executed", ",", " ", "rega", "rd", "less", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "outco", "me", ".", " ", "The", " ", "default", " ", "implementation", " ", "doe", "s", " ", "not", "hing", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "add", "Success", "(", "test", ")\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Call", "ed", " ", "whe", "n", " ", "the", " ", "test", " ", "case", " ", "test", " ", "succeeds", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "was", "Success", "ful", "()", " ", "-", " ", "Return", "s", " ", "Tru", "e", " ", "if", " ", "all", " ", "tests", " ", "run", " ", "so", " ", "far", " ", "have", " ", "pass", "ed", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", "wis", "e", " ", "return", "s", " ", "Fal", "se", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "tests", "Run", " ", "-", " ", "The", " ", "total", " ", "number", " ", "of", " ", "tests", " ", "run", " ", "so", " ", "far", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "error", "s", " ", "-", " ", "A", " ", "list", " ", "contain", "ing", " ", "2", "-", "tuple", "s", " ", "of", " ", "Test", "Case", " ", "instance", "s", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "format", "ted", " ", "traceback", "s", ".", " ", "Ea", "ch", " ", "tuple", " ", "represent", "s", " ", "a", " ", "test", " ", "whi", "ch", " ", "raise", "d", " ", "an_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unexpected", " ", "exception", ".", " ", "Contain", "s", " ", "formatted_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "traceback", "s", " ", "inst", "ead", " ", "of", " ", "sys", ".", "exc", "\\u", "info", "()", " ", "results", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "fail", "ure", "s", " ", "-", " ", "A", " ", "list", " ", "contain", "ing", " ", "2", "-", "tuple", "s", " ", "of", " ", "Test", "Case", " ", "instance", "s", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "format", "ted", " ", "traceback", "s", ".", " ", "Ea", "ch", " ", "tuple", " ", "represent", "s", " ", "a", " ", "test", " ", "where", " ", "a", " ", "fail", "ure", " ", "was", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "explicit", "ly", " ", "signal", "led", " ", "usi", "ng", " ", "the", " ", "Test", "Case", ".", "fail", "*(", ")", " ", "or", " ", "Test", "Case", ".", "assert", "*(", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "method", "s", ".", " ", "Contain", "s", " ", "format", "ted", " ", "traceback", "s", " ", "inst", "ead_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "sys", ".", "exc", "\\u", "info", "()", " ", "results", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "add", "Fail", "ure", "(", "test", ",", " ", "err", ")\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Call", "ed", " ", "whe", "n", " ", "the", " ", "test", " ", "case", " ", "test", " ", "signal", "s", " ", "a", " ", "fail", "ure", ".", " ", "err", " ", "is", " ", "a", " ", "tuple", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "form", " ", "return", "ed", " ", "by", " ", "sys", ".", "exc", "\\u", "info", "():", " ", "(", "type", ",", " ", "value", ",", " ", "traceback", ")\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "was", "Success", "ful", "()", " ", "-", " ", "Return", "s", " ", "Tru", "e", " ", "if", " ", "all", " ", "tests", " ", "run", " ", "so", " ", "far", " ", "have", " ", "pass", "ed", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", "wis", "e", " ", "return", "s", " ", "Fal", "se", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "tests", "Run", " ", "-", " ", "The", " ", "total", " ", "number", " ", "of", " ", "tests", " ", "run", " ", "so", " ", "far", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "error", "s", " ", "-", " ", "A", " ", "list", " ", "contain", "ing", " ", "2", "-", "tuple", "s", " ", "of", " ", "Test", "Case", " ", "instance", "s", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "format", "ted", " ", "traceback", "s", ".", " ", "Ea", "ch", " ", "tuple", " ", "represent", "s", " ", "a", " ", "test", " ", "whi", "ch", " ", "raise", "d", " ", "an_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unexpected", " ", "exception", ".", " ", "Contain", "s", " ", "formatted_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "traceback", "s", " ", "inst", "ead", " ", "of", " ", "sys", ".", "exc", "\\u", "info", "()", " ", "results", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "fail", "ure", "s", " ", "-", " ", "A", " ", "list", " ", "contain", "ing", " ", "2", "-", "tuple", "s", " ", "of", " ", "Test", "Case", " ", "instance", "s", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "format", "ted", " ", "traceback", "s", ".", " ", "Ea", "ch", " ", "tuple", " ", "represent", "s", " ", "a", " ", "test", " ", "where", " ", "a", " ", "fail", "ure", " ", "was", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "explicit", "ly", " ", "signal", "led", " ", "usi", "ng", " ", "the", " ", "Test", "Case", ".", "fail", "*(", ")", " ", "or", " ", "Test", "Case", ".", "assert", "*(", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "method", "s", ".", " ", "Contain", "s", " ", "format", "ted", " ", "traceback", "s", " ", "inst", "ead_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "sys", ".", "exc", "\\u", "info", "()", " ", "results", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "add", "Error", "(", "test", ",", " ", "err", ")\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Call", "ed", " ", "whe", "n", " ", "the", " ", "test", " ", "case", " ", "test", " ", "raise", "s", " ", "an", " ", "unexpected", " ", "exception", " ", "err_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "a", " ", "tuple", " ", "of", " ", "the", " ", "form", " ", "return", "ed", " ", "by", " ", "sys", ".", "exc", "\\u", "info", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "type", ",", " ", "value", ",", " ", "traceback", ")\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "was", "Success", "ful", "()", " ", "-", " ", "Return", "s", " ", "Tru", "e", " ", "if", " ", "all", " ", "tests", " ", "run", " ", "so", " ", "far", " ", "have", " ", "pass", "ed", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", "wis", "e", " ", "return", "s", " ", "Fal", "se", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "tests", "Run", " ", "-", " ", "The", " ", "total", " ", "number", " ", "of", " ", "tests", " ", "run", " ", "so", " ", "far", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "error", "s", " ", "-", " ", "A", " ", "list", " ", "contain", "ing", " ", "2", "-", "tuple", "s", " ", "of", " ", "Test", "Case", " ", "instance", "s", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "format", "ted", " ", "traceback", "s", ".", " ", "Ea", "ch", " ", "tuple", " ", "represent", "s", " ", "a", " ", "test", " ", "whi", "ch", " ", "raise", "d", " ", "an_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unexpected", " ", "exception", ".", " ", "Contain", "s", " ", "formatted_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "traceback", "s", " ", "inst", "ead", " ", "of", " ", "sys", ".", "exc", "\\u", "info", "()", " ", "results", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "fail", "ure", "s", " ", "-", " ", "A", " ", "list", " ", "contain", "ing", " ", "2", "-", "tuple", "s", " ", "of", " ", "Test", "Case", " ", "instance", "s", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "format", "ted", " ", "traceback", "s", ".", " ", "Ea", "ch", " ", "tuple", " ", "represent", "s", " ", "a", " ", "test", " ", "where", " ", "a", " ", "fail", "ure", " ", "was", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "explicit", "ly", " ", "signal", "led", " ", "usi", "ng", " ", "the", " ", "Test", "Case", ".", "fail", "*(", ")", " ", "or", " ", "Test", "Case", ".", "assert", "*(", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "method", "s", ".", " ", "Contain", "s", " ", "format", "ted", " ", "traceback", "s", " ", "inst", "ead_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "sys", ".", "exc", "\\u", "info", "()", " ", "results", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Result_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", "e", ":", " ", "there", " ", "are", " ", "not", " ", "separate", " ", "tests", " ", "for", " ", "Test", "Result", ".", "was", "Success", "ful", "()", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Result", ".", "error", "s", ",", " ", "Test", "Result", ".", "fail", "ure", "s", ",", " ", "Test", "Result", ".", "tests", "Run", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Result", ".", "shou", "ld", "Sto", "p", " ", "bec", "aus", "e", " ", "these", " ", "only", " ", "have", " ", "meaning", " ", "in", " ", "term", "s", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", " ", "Test", "Result", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Acco", "rdin", "gly", ",", " ", "tests", " ", "for", " ", "the", " ", "af", "ore", "named", " ", "attribute", "s", " ", "are", " ", "inco", "rpor", "ated", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "with", " ", "the", " ", "tests", " ", "for", " ", "the", " ", "defini", "ng", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "init_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "unittest_", "._", "Test", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "result_", "._", "was", "Success", "ful_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "result_", "._", "errors_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "result_", "._", "failures_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", "._", "tests", "Run_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", "._", "shou", "ld", "Stop_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Result_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", "e", ":", " ", "there", " ", "are", " ", "not", " ", "separate", " ", "tests", " ", "for", " ", "Test", "Result", ".", "was", "Success", "ful", "()", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Result", ".", "error", "s", ",", " ", "Test", "Result", ".", "fail", "ure", "s", ",", " ", "Test", "Result", ".", "tests", "Run", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Result", ".", "shou", "ld", "Sto", "p", " ", "bec", "aus", "e", " ", "these", " ", "only", " ", "have", " ", "meaning", " ", "in", " ", "term", "s", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", " ", "Test", "Result", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Acco", "rdin", "gly", ",", " ", "tests", " ", "for", " ", "the", " ", "af", "ore", "named", " ", "attribute", "s", " ", "are", " ", "inco", "rpor", "ated", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "with", " ", "the", " ", "tests", " ", "for", " ", "the", " ", "defini", "ng", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "stop_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "unittest_", "._", "Test", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", "._", "shou", "ld", "Stop_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Result_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", "e", ":", " ", "there", " ", "are", " ", "not", " ", "separate", " ", "tests", " ", "for", " ", "Test", "Result", ".", "was", "Success", "ful", "()", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Result", ".", "error", "s", ",", " ", "Test", "Result", ".", "fail", "ure", "s", ",", " ", "Test", "Result", ".", "tests", "Run", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Result", ".", "shou", "ld", "Sto", "p", " ", "bec", "aus", "e", " ", "these", " ", "only", " ", "have", " ", "meaning", " ", "in", " ", "term", "s", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", " ", "Test", "Result", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Acco", "rdin", "gly", ",", " ", "tests", " ", "for", " ", "the", " ", "af", "ore", "named", " ", "attribute", "s", " ", "are", " ", "inco", "rpor", "ated", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "with", " ", "the", " ", "tests", " ", "for", " ", "the", " ", "defini", "ng", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "start", "Test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "\\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_", "test_", "=_", "Foo_", "(_", "'", "test\\u", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "unittest_", "._", "Test", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "._", "start", "Test_", "(_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "result_", "._", "was", "Success", "ful_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "result_", "._", "errors_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "result_", "._", "failures_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", "._", "tests", "Run_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", "._", "shou", "ld", "Stop_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "._", "stop", "Test_", "(_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Result_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", "e", ":", " ", "there", " ", "are", " ", "not", " ", "separate", " ", "tests", " ", "for", " ", "Test", "Result", ".", "was", "Success", "ful", "()", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Result", ".", "error", "s", ",", " ", "Test", "Result", ".", "fail", "ure", "s", ",", " ", "Test", "Result", ".", "tests", "Run", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Result", ".", "shou", "ld", "Sto", "p", " ", "bec", "aus", "e", " ", "these", " ", "only", " ", "have", " ", "meaning", " ", "in", " ", "term", "s", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", " ", "Test", "Result", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Acco", "rdin", "gly", ",", " ", "tests", " ", "for", " ", "the", " ", "af", "ore", "named", " ", "attribute", "s", " ", "are", " ", "inco", "rpor", "ated", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "with", " ", "the", " ", "tests", " ", "for", " ", "the", " ", "defini", "ng", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "stop", "Test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "\\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_", "test_", "=_", "Foo_", "(_", "'", "test\\u", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "unittest_", "._", "Test", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "._", "start", "Test_", "(_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "result_", "._", "was", "Success", "ful_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "result_", "._", "errors_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "result_", "._", "failures_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", "._", "tests", "Run_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", "._", "shou", "ld", "Stop_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "._", "stop", "Test_", "(_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sam", "e", " ", "tests", " ", "as", " ", "above", ";", " ", "make", " ", "sure", " ", "not", "hing", " ", "has", " ", "changed_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "result_", "._", "was", "Success", "ful_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "result_", "._", "errors_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "result_", "._", "failures_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", "._", "tests", "Run_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", "._", "shou", "ld", "Stop_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Result_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", "e", ":", " ", "there", " ", "are", " ", "not", " ", "separate", " ", "tests", " ", "for", " ", "Test", "Result", ".", "was", "Success", "ful", "()", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Result", ".", "error", "s", ",", " ", "Test", "Result", ".", "fail", "ure", "s", ",", " ", "Test", "Result", ".", "tests", "Run", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Result", ".", "shou", "ld", "Sto", "p", " ", "bec", "aus", "e", " ", "these", " ", "only", " ", "have", " ", "meaning", " ", "in", " ", "term", "s", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", " ", "Test", "Result", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Acco", "rdin", "gly", ",", " ", "tests", " ", "for", " ", "the", " ", "af", "ore", "named", " ", "attribute", "s", " ", "are", " ", "inco", "rpor", "ated", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "with", " ", "the", " ", "tests", " ", "for", " ", "the", " ", "defini", "ng", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "Success_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "\\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_", "test_", "=_", "Foo_", "(_", "'", "test\\u", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "unittest_", "._", "Test", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "._", "start", "Test_", "(_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "add", "Success_", "(_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "stop", "Test_", "(_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "result_", "._", "was", "Success", "ful_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "result_", "._", "errors_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "result_", "._", "failures_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", "._", "tests", "Run_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", "._", "shou", "ld", "Stop_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Result_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", "e", ":", " ", "there", " ", "are", " ", "not", " ", "separate", " ", "tests", " ", "for", " ", "Test", "Result", ".", "was", "Success", "ful", "()", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Result", ".", "error", "s", ",", " ", "Test", "Result", ".", "fail", "ure", "s", ",", " ", "Test", "Result", ".", "tests", "Run", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Result", ".", "shou", "ld", "Sto", "p", " ", "bec", "aus", "e", " ", "these", " ", "only", " ", "have", " ", "meaning", " ", "in", " ", "term", "s", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", " ", "Test", "Result", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Acco", "rdin", "gly", ",", " ", "tests", " ", "for", " ", "the", " ", "af", "ore", "named", " ", "attribute", "s", " ", "are", " ", "inco", "rpor", "ated", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "with", " ", "the", " ", "tests", " ", "for", " ", "the", " ", "defini", "ng", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "Failure_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "\\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_", "test_", "=_", "Foo_", "(_", "'", "test\\u", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test_", "._", "fail_", "(_", "\"", "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 ", " _", "exc", "\\u", "info", "\\u", "tuple_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "unittest_", "._", "Test", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "._", "start", "Test_", "(_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "add", "Failure_", "(_", "test_", ",_", "exc", "\\u", "info", "\\u", "tuple_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "stop", "Test_", "(_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fail", "If_", "(_", "result_", "._", "was", "Success", "ful_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "result_", "._", "errors_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "result_", "._", "failures_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", "._", "tests", "Run_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", "._", "shou", "ld", "Stop_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "case_", ",_", "format", "ted", "\\u", "exc_", "=_", "result_", "._", "failures_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "test\\u", "case_", "is_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "format", "ted", "\\u", "exc_", ",_", "str_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Result_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", "e", ":", " ", "there", " ", "are", " ", "not", " ", "separate", " ", "tests", " ", "for", " ", "Test", "Result", ".", "was", "Success", "ful", "()", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Result", ".", "error", "s", ",", " ", "Test", "Result", ".", "fail", "ure", "s", ",", " ", "Test", "Result", ".", "tests", "Run", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Result", ".", "shou", "ld", "Sto", "p", " ", "bec", "aus", "e", " ", "these", " ", "only", " ", "have", " ", "meaning", " ", "in", " ", "term", "s", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", " ", "Test", "Result", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Acco", "rdin", "gly", ",", " ", "tests", " ", "for", " ", "the", " ", "af", "ore", "named", " ", "attribute", "s", " ", "are", " ", "inco", "rpor", "ated", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "with", " ", "the", " ", "tests", " ", "for", " ", "the", " ", "defini", "ng", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "Error_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "1_", "(_", "self_", ")_", ":_", "\\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_", "test_", "=_", "Foo_", "(_", "'", "test\\u", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exc", "\\u", "info", "\\u", "tuple_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "unittest_", "._", "Test", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "._", "start", "Test_", "(_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "add", "Error_", "(_", "test_", ",_", "exc", "\\u", "info", "\\u", "tuple_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "stop", "Test_", "(_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fail", "If_", "(_", "result_", "._", "was", "Success", "ful_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "result_", "._", "errors_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "result_", "._", "failures_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", "._", "tests", "Run_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", "._", "shou", "ld", "Stop_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "case_", ",_", "format", "ted", "\\u", "exc_", "=_", "result_", "._", "errors_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "test\\u", "case_", "is_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "format", "ted", "\\u", "exc_", ",_", "str_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run", "Test_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test1_", "(_", "self_", ")_", ":_", "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_", "Bar_", "(_", "Foo_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bar_", "(_", "Foo_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test2_", "(_", "self_", ")_", ":_", "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_", "Test", "\\u", "Test", "Case_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ",_", "Test", "Hash", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Hash", "ing", ".", "test\\u", "hash", " ", "and", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eq", "\\u", "pairs_", "=_", "[_", "(_", "Foo_", "(_", "'", "test", "1", "'_", ")_", ",_", "Foo_", "(_", "'", "test", "1", "'_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Equali", "ty", ".", "test\\u", "ne_", "\\u\\u\\uNL\\u\\u\\u_", "ne", "\\u", "pairs_", "=_", "[_", "(_", "Foo_", "(_", "'", "test", "1", "'_", ")_", ",_", "Foo_", "(_", "'", "run", "Test", "'_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ",_", "(_", "Foo_", "(_", "'", "test", "1", "'_", ")_", ",_", "Bar_", "(_", "'", "test", "1", "'_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ",_", "(_", "Foo_", "(_", "'", "test", "1", "'_", ")_", ",_", "Bar_", "(_", "'", "test", "2", "'_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "/", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "class", " ", "Test", "Case", "([", "method", "Name", "])\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Ea", "ch", " ", "instance", " ", "of", " ", "Test", "Case", " ", "will", " ", "run", " ", "a", " ", "single", " ", "test", " ", "method", ":", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "method", " ", "named", " ", "method", "Name", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "method", "Name", " ", "default", "s", " ", "to", " ", "\"", "run", "Test", "\".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "it", " ", "reall", "y", " ", "is", " ", "option", "al", ",", " ", "and", " ", "tha", "t", " ", "it", " ", "default", "s", " ", "to", " ", "the", " ", "proper", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "thing", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "class", " ", "Test", "Case", "([", "method", "Name", "])\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Ea", "ch", " ", "instance", " ", "of", " ", "Test", "Case", " ", "will", " ", "run", " ", "a", " ", "single", " ", "test", " ", "method", ":", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "method", " ", "named", " ", "method", "Name", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "class", " ", "Test", "Case", "([", "method", "Name", "])\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Ea", "ch", " ", "instance", " ", "of", " ", "Test", "Case", " ", "will", " ", "run", " ", "a", " ", "single", " ", "test", " ", "method", ":", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "method", " ", "named", " ", "method", "Name", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "the", " ", "number", " ", "of", " ", "tests", " ", "represent", "ed", " ", "by", " ", "the", " ", "this", " ", "test", " ", "object", ".", " ", "For_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "Case", " ", "instance", "s", ",", " ", "this", " ", "will", " ", "alw", "ay", "s", " ", "be", " ", "1", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "the", " ", "default", " ", "type", " ", "of", " ", "test", " ", "result", " ", "object", " ", "to", " ", "be", " ", "used", " ", "to", " ", "run", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", ".", " ", "For", " ", "Test", "Case", " ", "instance", "s", ",", " ", "this", " ", "will", " ", "alw", "ay", "s", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unittest", ".", "Test", "Result", ";", " ", " ", "subclasses", " ", "of", " ", "Test", "Case", " ", "should_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "override", " ", "this", " ", "as", " ", "necessar", "y", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Whe", "n", " ", "a", " ", "set", "Up", "()", " ", "method", " ", "is", " ", "defin", "ed", ",", " ", "the", " ", "test", " ", "runn", "er", " ", "will", " ", "run", " ", "tha", "t", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "prior", " ", "to", " ", "each", " ", "test", ".", " ", "Lik", "ew", "ise", ",", " ", "if", " ", "a", " ", "tear", "Down", "()", " ", "method", " ", "is", " ", "defin", "ed", ",", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "runn", "er", " ", "will", " ", "invoke", " ", "tha", "t", " ", "method", " ", "after", " ", "each", " ", "test", ".", " ", "In", " ", "the", " ", "example", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", "Up", "()", " ", "was", " ", "used", " ", "to", " ", "create", " ", "a", " ", "fresh", " ", "sequence", " ", "for", " ", "each", " ", "test", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "the", " ", "proper", " ", "call", " ", "order", " ", "is", " ", "maintain", "ed", ",", " ", "even", " ", "if", " ", "set", "Up", "()", " ", "raises_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "an", " ", "exception", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Whe", "n", " ", "a", " ", "set", "Up", "()", " ", "method", " ", "is", " ", "defin", "ed", ",", " ", "the", " ", "test", " ", "runn", "er", " ", "will", " ", "run", " ", "tha", "t", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "prior", " ", "to", " ", "each", " ", "test", ".", " ", "Lik", "ew", "ise", ",", " ", "if", " ", "a", " ", "tear", "Down", "()", " ", "method", " ", "is", " ", "defin", "ed", ",", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "runn", "er", " ", "will", " ", "invoke", " ", "tha", "t", " ", "method", " ", "after", " ", "each", " ", "test", ".", " ", "In", " ", "the", " ", "example", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", "Up", "()", " ", "was", " ", "used", " ", "to", " ", "create", " ", "a", " ", "fresh", " ", "sequence", " ", "for", " ", "each", " ", "test", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "the", " ", "proper", " ", "call", " ", "order", " ", "is", " ", "maintain", "ed", ",", " ", "even", " ", "if", " ", "the", " ", "test", " ", "raises_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "an", " ", "error", " ", "(", "as", " ", "oppo", "sed", " ", "to", " ", "a", " ", "fail", "ure", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Whe", "n", " ", "a", " ", "set", "Up", "()", " ", "method", " ", "is", " ", "defin", "ed", ",", " ", "the", " ", "test", " ", "runn", "er", " ", "will", " ", "run", " ", "tha", "t", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "prior", " ", "to", " ", "each", " ", "test", ".", " ", "Lik", "ew", "ise", ",", " ", "if", " ", "a", " ", "tear", "Down", "()", " ", "method", " ", "is", " ", "defin", "ed", ",", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "runn", "er", " ", "will", " ", "invoke", " ", "tha", "t", " ", "method", " ", "after", " ", "each", " ", "test", ".", " ", "In", " ", "the", " ", "example", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", "Up", "()", " ", "was", " ", "used", " ", "to", " ", "create", " ", "a", " ", "fresh", " ", "sequence", " ", "for", " ", "each", " ", "test", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "the", " ", "proper", " ", "call", " ", "order", " ", "is", " ", "maintain", "ed", ",", " ", "even", " ", "if", " ", "the", " ", "test", " ", "signals_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "fail", "ure", " ", "(", "as", " ", "oppo", "sed", " ", "to", " ", "an", " ", "error", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Whe", "n", " ", "a", " ", "set", "Up", "()", " ", "method", " ", "is", " ", "defin", "ed", ",", " ", "the", " ", "test", " ", "runn", "er", " ", "will", " ", "run", " ", "tha", "t", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "prior", " ", "to", " ", "each", " ", "test", ".", " ", "Lik", "ew", "ise", ",", " ", "if", " ", "a", " ", "tear", "Down", "()", " ", "method", " ", "is", " ", "defin", "ed", ",", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "runn", "er", " ", "will", " ", "invoke", " ", "tha", "t", " ", "method", " ", "after", " ", "each", " ", "test", ".", " ", "In", " ", "the", " ", "example", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", "Up", "()", " ", "was", " ", "used", " ", "to", " ", "create", " ", "a", " ", "fresh", " ", "sequence", " ", "for", " ", "each", " ", "test", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "the", " ", "proper", " ", "call", " ", "order", " ", "is", " ", "maintain", "ed", ",", " ", "even", " ", "if", " ", "tear", "Down", "()", " ", "raises_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "an", " ", "exception", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Thi", "s", " ", "class", " ", "attribute", " ", "give", "s", " ", "the", " ", "exception", " ", "raise", "d", " ", "by", " ", "the", " ", "test", "()", " ", "method", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "test", " ", "frame", "work", " ", "need", "s", " ", "to", " ", "use", " ", "a", " ", "specialize", "d", " ", "exception", ",", " ", "possib", "ly", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "carry", " ", "addition", "al", " ", "informati", "on", ",", " ", "it", " ", "must", " ", "subclass", " ", "this", " ", "exception", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "order", " ", "to", " ", "``", "play", " ", "fair", "''", " ", "with", " ", "the", " ", "frame", "work", ".", " ", " ", "The", " ", "initial", " ", "value", " ", "of", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "attribute", " ", "is", " ", "Assert", "ion", "Error", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Thi", "s", " ", "class", " ", "attribute", " ", "give", "s", " ", "the", " ", "exception", " ", "raise", "d", " ", "by", " ", "the", " ", "test", "()", " ", "method", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "test", " ", "frame", "work", " ", "need", "s", " ", "to", " ", "use", " ", "a", " ", "specialize", "d", " ", "exception", ",", " ", "possib", "ly", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "carry", " ", "addition", "al", " ", "informati", "on", ",", " ", "it", " ", "must", " ", "subclass", " ", "this", " ", "exception", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "order", " ", "to", " ", "``", "play", " ", "fair", "''", " ", "with", " ", "the", " ", "frame", "work", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "Test", "Case", ".", "run", "()", " ", "respec", "ts", " ", "the", " ", "designate", "d", " ", "fail", "ure", "Exception_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Thi", "s", " ", "class", " ", "attribute", " ", "give", "s", " ", "the", " ", "exception", " ", "raise", "d", " ", "by", " ", "the", " ", "test", "()", " ", "method", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "test", " ", "frame", "work", " ", "need", "s", " ", "to", " ", "use", " ", "a", " ", "specialize", "d", " ", "exception", ",", " ", "possib", "ly", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "carry", " ", "addition", "al", " ", "informati", "on", ",", " ", "it", " ", "must", " ", "subclass", " ", "this", " ", "exception", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "order", " ", "to", " ", "``", "play", " ", "fair", "''", " ", "with", " ", "the", " ", "frame", "work", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "Test", "Case", ".", "run", "()", " ", "respec", "ts", " ", "the", " ", "designate", "d", " ", "fail", "ure", "Exception_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "default", " ", "implementation", " ", "doe", "s", " ", "not", "hing", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "The", " ", "default", " ", "implementation", " ", "doe", "s", " ", "not", "hing", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", " ", "a", " ", "string", " ", "identify", "ing", " ", "the", " ", "specific", " ", "test", " ", "case", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Be", "caus", "e", " ", "of", " ", "the", " ", "vag", "ue", " ", "natur", "e", " ", "of", " ", "the", " ", "docs", ",", " ", "I", "'", "m", " ", "not", " ", "goi", "ng", " ", "to", " ", "lock", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "down", " ", "too", " ", "muc", "h", ".", " ", "Real", "ly", " ", "all", " ", "tha", "t", " ", "can", " ", "be", " ", "assert", "ed", " ", "is", " ", "tha", "t", " ", "the", " ", "id", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "will", " ", "be", " ", "a", " ", "string", " ", "(", "eit", "her", " ", "8", "-", "byte", " ", "or", " ", "unicode", " ", "--", " ", "again", ",", " ", "bec", "aus", "e", " ", "the", " ", "docs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "just", " ", "say", " ", "\"", "string", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", "s", " ", "a", " ", "one", "-", "line", " ", "description", " ", "of", " ", "the", " ", "test", ",", " ", "or", " ", "Non", "e", " ", "if", " ", "no", " ", "description_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "has", " ", "bee", "n", " ", "provided", ".", " ", "The", " ", "default", " ", "implementation", " ", "of", " ", "this", " ", "method", " ", "returns_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "first", " ", "line", " ", "of", " ", "the", " ", "test", " ", "method", "'", "s", " ", "docstr", "ing", ",", " ", "if", " ", "avail", "able", ",", " ", "or", " ", "Non", "e", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", "s", " ", "a", " ", "one", "-", "line", " ", "description", " ", "of", " ", "the", " ", "test", ",", " ", "or", " ", "Non", "e", " ", "if", " ", "no", " ", "description_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "has", " ", "bee", "n", " ", "provided", ".", " ", "The", " ", "default", " ", "implementation", " ", "of", " ", "this", " ", "method", " ", "returns_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "first", " ", "line", " ", "of", " ", "the", " ", "test", " ", "method", "'", "s", " ", "docstr", "ing", ",", " ", "if", " ", "avail", "able", ",", " ", "or", " ", "Non", "e", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Return", "s", " ", "a", " ", "one", "-", "line", " ", "description", " ", "of", " ", "the", " ", "test", ",", " ", "or", " ", "Non", "e", " ", "if", " ", "no", " ", "description_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "has", " ", "bee", "n", " ", "provided", ".", " ", "The", " ", "default", " ", "implementation", " ", "of", " ", "this", " ", "method", " ", "returns_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "first", " ", "line", " ", "of", " ", "the", " ", "test", " ", "method", "'", "s", " ", "docstr", "ing", ",", " ", "if", " ", "avail", "able", ",", " ", "or", " ", "Non", "e", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "If", " ", "result", " ", "is", " ", "omit", "ted", " ", "or", " ", "Non", "e", ",", " ", "a", " ", "temporar", "y", " ", "result", " ", "object", " ", "is", " ", "created_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "used", ",", " ", "but", " ", "is", " ", "not", " ", "made", " ", "avail", "able", " ", "to", " ", "the", " ", "caller", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Case_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ",_", "Test", "Hash", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Hash", "ing", ".", "test\\u", "hash", " ", "and", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "init", "\\u\\u", "no", "\\u", "test\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run", "Test_", "(_", "self_", ")_", ":_", "raise_", "My", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "Test_", "(_", ")_", "._", "id_", "(_", ")_", "[_", "-_", "13_", ":_", "]_", ",_", "'.", "Test", ".", "run", "Test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Case_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ",_", "Test", "Hash", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Hash", "ing", ".", "test\\u", "hash", " ", "and", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "init", "\\u\\u", "test\\u", "name", "\\u\\u", "valid_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run", "Test_", "(_", "self_", ")_", ":_", "raise_", "My", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "Test_", "(_", "'", "test", "'_", ")_", "._", "id_", "(_", ")_", "[_", "-_", "10_", ":_", "]_", ",_", "'.", "Test", ".", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Case_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ",_", "Test", "Hash", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Hash", "ing", ".", "test\\u", "hash", " ", "and", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "init", "\\u\\u", "test\\u", "name", "\\u\\u", "invalid_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run", "Test_", "(_", "self_", ")_", ":_", "raise_", "My", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test_", "(_", "self_", ")_", ":_", "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 ", " _", "Test_", "(_", "'", "testf", "oo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Fail", "ed", " ", "to", " ", "raise", " ", "Value", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Case_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ",_", "Test", "Hash", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Hash", "ing", ".", "test\\u", "hash", " ", "and", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "count", "Test", "Cases_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "Foo_", "(_", "'", "test", "'_", ")_", "._", "count", "Test", "Cases_", "(_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Case_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ",_", "Test", "Hash", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Hash", "ing", ".", "test\\u", "hash", " ", "and", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "default", "Test", "Result_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run", "Test_", "(_", "self_", ")_", ":_", "\\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_", "result_", "=_", "Foo_", "(_", ")_", "._", "default", "Test", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "type_", "(_", "result_", ")_", ",_", "unittest_", "._", "Test", "Result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Case_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ",_", "Test", "Hash", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Hash", "ing", ".", "test\\u", "hash", " ", "and", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "run", "\\u", "call", "\\u", "order", "\\u\\u", "error", "\\u", "in", "\\u", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Log", "ging", "Result_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "set", "Up", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Run", "time", "Error_", "(_", "'", "raise", "d", " ", "by", " ", "Foo", ".", "set", "Up", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\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 ", " _", "events_", "._", "append_", "(_", "'", "tear", "Down", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Foo_", "(_", "'", "test", "'_", ")_", "._", "run_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "'", "start", "Test", "'_", ",_", "'", "set", "Up", "'_", ",_", "'", "add", "Error", "'_", ",_", "'", "stop", "Test", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "events_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Case_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ",_", "Test", "Hash", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Hash", "ing", ".", "test\\u", "hash", " ", "and", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "run", "\\u", "call", "\\u", "order", "\\u\\u", "error", "\\u", "in", "\\u", "test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Log", "ging", "Result_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "set", "Up", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Run", "time", "Error_", "(_", "'", "raise", "d", " ", "by", " ", "Foo", ".", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\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 ", " _", "events_", "._", "append_", "(_", "'", "tear", "Down", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expected_", "=_", "[_", "'", "start", "Test", "'_", ",_", "'", "set", "Up", "'_", ",_", "'", "test", "'_", ",_", "'", "add", "Error", "'_", ",_", "'", "tear", "Down", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "stop", "Test", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Foo_", "(_", "'", "test", "'_", ")_", "._", "run_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "events_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Case_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ",_", "Test", "Hash", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Hash", "ing", ".", "test\\u", "hash", " ", "and", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "run", "\\u", "call", "\\u", "order", "\\u\\u", "fail", "ure", "\\u", "in", "\\u", "test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Log", "ging", "Result_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "set", "Up", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", "'", "raise", "d", " ", "by", " ", "Foo", ".", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\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 ", " _", "events_", "._", "append_", "(_", "'", "tear", "Down", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expected_", "=_", "[_", "'", "start", "Test", "'_", ",_", "'", "set", "Up", "'_", ",_", "'", "test", "'_", ",_", "'", "add", "Fail", "ure", "'_", ",_", "'", "tear", "Down", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "stop", "Test", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Foo_", "(_", "'", "test", "'_", ")_", "._", "run_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "events_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Case_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ",_", "Test", "Hash", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Hash", "ing", ".", "test\\u", "hash", " ", "and", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "run", "\\u", "call", "\\u", "order", "\\u\\u", "error", "\\u", "in", "\\u", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Log", "ging", "Result_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "set", "Up", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\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 ", " _", "events_", "._", "append_", "(_", "'", "tear", "Down", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Run", "time", "Error_", "(_", "'", "raise", "d", " ", "by", " ", "Foo", ".", "tear", "Down", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Foo_", "(_", "'", "test", "'_", ")_", "._", "run_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "'", "start", "Test", "'_", ",_", "'", "set", "Up", "'_", ",_", "'", "test", "'_", ",_", "'", "tear", "Down", "'_", ",_", "'", "add", "Error", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "stop", "Test", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "events_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Case_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ",_", "Test", "Hash", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Hash", "ing", ".", "test\\u", "hash", " ", "and", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "fail", "ure", "Except", "ion", "\\u\\u", "default_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "\\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_", "self_", "._", "fail", "Unless_", "(_", "Foo_", "(_", "'", "test", "'_", ")_", "._", "fail", "ure", "Exception_", "is_", "Assert", "ion", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Case_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ",_", "Test", "Hash", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Hash", "ing", ".", "test\\u", "hash", " ", "and", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "fail", "ure", "Except", "ion", "\\u\\u", "subclassing", "\\u\\u", "explicit", "\\u", "raise_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Log", "ging", "Result_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Run", "time", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fail", "ure", "Exception_", "=_", "Run", "time", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "Foo_", "(_", "'", "test", "'_", ")_", "._", "fail", "ure", "Exception_", "is_", "Run", "time", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Foo_", "(_", "'", "test", "'_", ")_", "._", "run_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "'", "start", "Test", "'_", ",_", "'", "add", "Fail", "ure", "'_", ",_", "'", "stop", "Test", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "events_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Case_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ",_", "Test", "Hash", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Hash", "ing", ".", "test\\u", "hash", " ", "and", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "fail", "ure", "Except", "ion", "\\u\\u", "subclassing", "\\u\\u", "implicit", "\\u", "raise_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Log", "ging", "Result_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "foo", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fail", "ure", "Exception_", "=_", "Run", "time", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "Foo_", "(_", "'", "test", "'_", ")_", "._", "fail", "ure", "Exception_", "is_", "Run", "time", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Foo_", "(_", "'", "test", "'_", ")_", "._", "run_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "'", "start", "Test", "'_", ",_", "'", "add", "Fail", "ure", "'_", ",_", "'", "stop", "Test", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "events_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Case_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ",_", "Test", "Hash", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Hash", "ing", ".", "test\\u", "hash", " ", "and", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run", "Test_", "(_", "self_", ")_", ":_", "\\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_", "#", " ", "...", " ", "and", " ", "not", "hing", " ", "shou", "ld", " ", "happ", "en_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Foo_", "(_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Case_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ",_", "Test", "Hash", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Hash", "ing", ".", "test\\u", "hash", " ", "and", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run", "Test_", "(_", "self_", ")_", ":_", "\\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_", "#", " ", "...", " ", "and", " ", "not", "hing", " ", "shou", "ld", " ", "happ", "en_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Foo_", "(_", ")_", "._", "tear", "Down_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Case_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ",_", "Test", "Hash", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Hash", "ing", ".", "test\\u", "hash", " ", "and", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run", "Test_", "(_", "self_", ")_", ":_", "\\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_", "self_", "._", "fail", "Unless_", "(_", "isinstance_", "(_", "Foo_", "(_", ")_", "._", "id_", "(_", ")_", ",_", "basestring_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Case_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ",_", "Test", "Hash", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Hash", "ing", ".", "test\\u", "hash", " ", "and", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "short", "Descripti", "on", "\\u\\u", "no", "\\u", "docstring_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run", "Test_", "(_", "self_", ")_", ":_", "\\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_", "self_", "._", "assert", "Equal_", "(_", "Foo_", "(_", ")_", "._", "short", "Description_", "(_", ")_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Case_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ",_", "Test", "Hash", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Hash", "ing", ".", "test\\u", "hash", " ", "and", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "short", "Descripti", "on", "\\u\\u", "single", "line", "\\u", "docstring_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run", "Test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "this", " ", "tests", " ", "foo", "\"_", "\\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_", "self_", "._", "assert", "Equal_", "(_", "Foo_", "(_", ")_", "._", "short", "Description_", "(_", ")_", ",_", "\"", "this", " ", "tests", " ", "foo", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Case_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ",_", "Test", "Hash", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Hash", "ing", ".", "test\\u", "hash", " ", "and", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "short", "Descripti", "on", "\\u\\u", "multiline", "\\u", "docstring_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run", "Test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "this", " ", "tests", " ", "foo", "\\", "10", ";", " ", " ", " ", " ", "bla", "h", ",", " ", "bar", " ", "and", " ", "ba", "z", " ", "are", " ", "als", "o", " ", "tested", "\"\"\"_", "\\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_", "self_", "._", "assert", "Equal_", "(_", "Foo_", "(_", ")_", "._", "short", "Description_", "(_", ")_", ",_", "\"", "this", " ", "tests", " ", "foo", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Test", "Case_", "(_", "Test", "Case_", ",_", "Test", "Equali", "ty_", ",_", "Test", "Hash", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Set", " ", "up", " ", "attribute", "s", " ", "used", " ", "by", " ", "inherited", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "by", " ", "Test", "Hash", "ing", ".", "test\\u", "hash", " ", "and", " ", "Test", "Equali", "ty", ".", "test\\u", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "run", "\\u\\u", "use", "s", "\\u", "default", "Test", "Result_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Foo_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "._", "append_", "(_", "'", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "default", "Test", "Result_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Log", "ging", "Result_", "(_", "events_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "run", "()", " ", "find", " ", "a", " ", "result", " ", "object", " ", "on", " ", "its", " ", "own_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Foo_", "(_", "'", "test", "'_", ")_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "[_", "'", "start", "Test", "'_", ",_", "'", "test", "'_", ",_", "'", "stop", "Test", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "events_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "\\u", "Assert", "ions_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Assert", "ions_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "Al", "most", "Equal_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail", "Un", "less", "Al", "most", "Equal_", "(_", "1.000000", "01_", ",_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "If", "Al", "most", "Equal_", "(_", "1.000000", "1_", ",_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Assert", "ion", "Error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fail", "Un", "less", "Al", "most", "Equal_", ",_", "1.000000", "1_", ",_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Assert", "ion", "Error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fail", "If", "Al", "most", "Equal_", ",_", "1.000000", "01_", ",_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fail", "Un", "less", "Al", "most", "Equal_", "(_", "1.1_", ",_", "1.0_", ",_", "places_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Assert", "ion", "Error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fail", "Un", "less", "Al", "most", "Equal_", ",_", "1.1_", ",_", "1.0_", ",_", "places_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fail", "Un", "less", "Al", "most", "Equal_", "(_", "0_", ",_", ".1_", "+_", ".1", "j_", ",_", "places_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "If", "Al", "most", "Equal_", "(_", "0_", ",_", ".1_", "+_", ".1", "j_", ",_", "places_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Assert", "ion", "Error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fail", "Un", "less", "Al", "most", "Equal_", ",_", "0_", ",_", ".1_", "+_", ".1", "j_", ",_", "places_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Assert", "ion", "Error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fail", "If", "Al", "most", "Equal_", ",_", "0_", ",_", ".1_", "+_", ".1", "j_", ",_", "places_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "support_", "._", "run", "\\u", "unittest_", "(_", "Test", "\\u", "Test", "Case_", ",_", "Test", "\\u", "Test", "Loader_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Test", "\\u", "Test", "Suite_", ",_", "Test", "\\u", "Test", "Result_", ",_", "Test", "\\u", "Function", "Test", "Case_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Test", "\\u", "Assert", "ions_", ")_", "\\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,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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
okfn/bibserver/bibserver/ingest.py
[ { "content": "'''\nIndependent running process.\nHandling uploads asynchronously.\nSee: https://github.com/okfn/bibserver/wiki/AsyncUploadDesign\n'''\n\nimport os, stat, sys, uuid, time\nimport subprocess\nfrom cStringIO import StringIO\nimport requests\nimport hashlib\nimport json\nfrom datetime import datetime\nimport traceback\nimport bibserver.dao\nfrom bibserver.config import config\nfrom bibserver.importer import Importer\nfrom bibserver.core import app\nimport bibserver.util as util\nfrom flask import render_template, make_response, abort, send_from_directory, redirect, request\n\n# Constant used to track installed plugins\nPLUGINS = {}\n\n \n\n \n \n \n \n \n\n \n\n \n\n\n\n\n\n\n \nif __name__ == '__main__':\n init()\n for x in sys.argv[1:]: \n if x == '-x':\n reset_all_tickets()\n elif x.startswith('-p'):\n for t in get_tickets():\n print t\n if x == '-pp':\n print '-' * 80\n for k,v in t.items():\n print ' '*4, k+':', v\n elif x == '-d':\n open('ingest.pid', 'w').write('%s' % os.getpid())\n run()\n if len(sys.argv) == 1:\n run()\n \n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class IngestTicketInvalidOwnerException(Exception):\n pass", "metadata": "root.IngestTicketInvalidOwnerException", "header": "['module', '___EOS___']", "index": 24 }, { "content": "class IngestTicketInvalidInit(Exception):\n pass", "metadata": "root.IngestTicketInvalidInit", "header": "['module', '___EOS___']", "index": 26 }, { "content": "class IngestTicketInvalidId(Exception):\n pass", "metadata": "root.IngestTicketInvalidId", "header": "['module', '___EOS___']", "index": 28 }, { "content": "class IngestTicket(dict):\n \n \n \n\n \n \n ", "metadata": "root.IngestTicket", "header": "['module', '___EOS___']", "index": 31 }, { "content": " def __init__(self,*args,**kwargs): \n 'Creates a new Ingest Ticket, ready for processing by the ingest pipeline'\n if '_id' not in kwargs:\n kwargs['_id'] = uuid.uuid4().hex\n if 'state' not in kwargs:\n kwargs['state'] = 'new'\n if '_created' not in kwargs:\n kwargs['_created'] = time.time()\n owner = kwargs.get('owner')\n if not type(owner) in (str, unicode):\n raise IngestTicketInvalidOwnerException()\n for x in ('collection', 'format'):\n if not kwargs.get(x):\n raise IngestTicketInvalidInit('You need to supply the parameter %s' % x)\n for x in ('_created', '_last_modified'):\n if x in kwargs:\n kwargs[x] = datetime.fromtimestamp(kwargs[x])\n dict.__init__(self,*args,**kwargs)", "metadata": "root.IngestTicket.__init__", "header": "['class', 'IngestTicket', '(', 'dict', ')', ':', '___EOS___']", "index": 32 }, { "content": " @classmethod\n def load(cls, ticket_id):\n filename = os.path.join(config['download_cache_directory'], ticket_id) + '.ticket'\n if not os.path.exists(filename):\n raise IngestTicketInvalidId(ticket_id)\n data = json.loads(open(filename).read())\n return cls(**data)", "metadata": "root.IngestTicket.load", "header": "['class', 'IngestTicket', '(', 'dict', ')', ':', '___EOS___']", "index": 51 }, { "content": " def save(self):\n self['_last_modified'] = time.time()\n self['_created'] = time.mktime(self['_created'].timetuple())\n filename = os.path.join(config['download_cache_directory'], self['_id']) + '.ticket'\n open(filename, 'wb').write(json.dumps(self))\n for x in ('_created', '_last_modified'):\n self[x] = datetime.fromtimestamp(self[x])", "metadata": "root.IngestTicket.save", "header": "['class', 'IngestTicket', '(', 'dict', ')', ':', '___EOS___']", "index": 59 }, { "content": " def fail(self, msg):\n self['state'] = 'failed'\n err = (datetime.now().strftime(\"%Y%m%d%H%M\"), msg)\n self.setdefault('exception', []).append(err)\n self.save()", "metadata": "root.IngestTicket.fail", "header": "['class', 'IngestTicket', '(', 'dict', ')', ':', '___EOS___']", "index": 67 }, { "content": " def delete(self):\n filename = os.path.join(config['download_cache_directory'], self['_id']) + '.ticket'\n os.remove(filename)", "metadata": "root.IngestTicket.delete", "header": "['class', 'IngestTicket', '(', 'dict', ')', ':', '___EOS___']", "index": 73 }, { "content": " def __unicode__(self):\n try:\n return u'%s/%s,%s [%s] - %s' % (self['owner'], self['collection'], self['format'], self['state'], self['_last_modified'])\n except:\n return repr(self)", "metadata": "root.IngestTicket.__unicode__", "header": "['class', 'IngestTicket', '(', 'dict', ')', ':', '___EOS___']", "index": 77 }, { "content": " def __str__(self):\n return unicode(self).encode('utf8')", "metadata": "root.IngestTicket.__str__", "header": "['class', 'IngestTicket', '(', 'dict', ')', ':', '___EOS___']", "index": 83 }, { "content": " @property\n def id(self):\n return self['_id']", "metadata": "root.IngestTicket.id", "header": "['class', 'IngestTicket', '(', 'dict', ')', ':', '___EOS___']", "index": 86 }, { "content": "def index(ticket):\n ticket['state'] = 'populating_index'\n ticket.save()\n # Make sure the parsed content is in the cache\n download_cache_directory = config['download_cache_directory']\n in_path = os.path.join(download_cache_directory, ticket['data_json'])\n if not os.path.exists(in_path):\n ticket.fail('Parsed content for %s not found' % in_path)\n return\n data = open(in_path).read()\n if len(data) < 1:\n raise Exception('The parsed data in this ticket is empty.' )\n \n # TODO check for metadata section to update collection from this?\n owner = bibserver.dao.Account.get(ticket['owner'])\n importer = Importer(owner=owner)\n collection = {\n 'label': ticket['collection'],\n 'collection': util.slugify(ticket['collection']),\n 'description': ticket.get('description'),\n 'source': ticket['source_url'],\n 'format': ticket['format'],\n 'license': ticket.get('license', u\"Not specified\"),\n }\n collection, records = importer.upload(open(in_path), collection)\n ticket['state'] = 'done'\n ticket.save()", "metadata": "root.index", "header": "['module', '___EOS___']", "index": 90 }, { "content": "def parse(ticket):\n ticket['state'] = 'parsing'\n ticket.save()\n if 'data_md5' not in ticket:\n ticket.fail('Attempt to parse ticket, but no data_md5 found')\n return\n p = PLUGINS.get(ticket['format'])\n if not p:\n ticket.fail('Parser plugin for format %s not found' % ticket['format'])\n return\n # Make sure the downloaded content is in the cache\n download_cache_directory = config['download_cache_directory']\n in_path = os.path.join(download_cache_directory, ticket['data_md5'])\n if not os.path.exists(in_path):\n ticket.fail('Downloaded content for %s not found' % in_path)\n return\n p = subprocess.Popen(p['_path'], shell=True, stdin=open(in_path), stdout=subprocess.PIPE, stderr=subprocess.PIPE) \n data = p.stdout.read()\n md5sum = hashlib.md5(data).hexdigest()\n download_cache_directory = config['download_cache_directory'] \n out_path = os.path.join(download_cache_directory, md5sum)\n open(out_path, 'wb').write(data)\n \n ticket['data_json'] = md5sum\n if ticket.get('only_parse') == True:\n ticket['state'] = 'done'\n else:\n ticket['state'] = 'parsed'\n # Check if there is any data in the stderr of the parser\n # If so, add it to the ticket as potential feedback\n data_stderr = p.stderr.read()\n if len(data_stderr) > 0:\n ticket['parse_feedback'] = data_stderr\n ticket.save()", "metadata": "root.parse", "header": "['module', '___EOS___']", "index": 118 }, { "content": "def store_data_in_cache(data):\n md5sum = hashlib.md5(data).hexdigest()\n download_cache_directory = config['download_cache_directory']\n out_path = os.path.join(download_cache_directory, md5sum)\n if not os.path.exists(out_path):\n open(out_path, 'wb').write(data)\n return md5sum", "metadata": "root.store_data_in_cache", "header": "['module', '___EOS___']", "index": 153 }, { "content": "def download(ticket):\n ticket['state'] = 'downloading'\n ticket.save()\n p = PLUGINS.get(ticket['format'])\n if p and p.get('downloads'):\n data = ticket['source_url'].strip()\n content_type = 'text/plain'\n else:\n url = ticket['source_url'].strip()\n r = requests.get(url)\n content_type = r.headers['content-type']\n r.raise_for_status()\n data = r.content\n if len(data) < 1:\n ticket.fail('Data is empty, HTTP status code %s ' % r.status_code)\n return\n \n ticket['data_md5'] = store_data_in_cache(data)\n ticket['data_content_type'] = content_type\n\n ticket['state'] = 'downloaded'\n ticket.save()", "metadata": "root.download", "header": "['module', '___EOS___']", "index": 161 }, { "content": "def determine_action(ticket):\n 'For the given ticket determine what the next action to take is based on the state'\n try:\n state = ticket['state']\n print ticket['state'], ticket['_id'],\n if state == 'new':\n download(ticket)\n if state == 'downloaded':\n parse(ticket)\n if state == 'parsed':\n index(ticket)\n except:\n ## TODO\n # For some reason saving the traceback to the ticket here is not saving the exception\n # The ticket does not record the 'failed' state, and remains in eg. a 'downloading' state\n ticket.fail(traceback.format_exc())\n print '...', ticket['state']", "metadata": "root.determine_action", "header": "['module', '___EOS___']", "index": 185 }, { "content": "def get_tickets(state=None):\n \"Get tickets with the given state\"\n buf = []\n for f in os.listdir(config['download_cache_directory']):\n if f.endswith('.ticket'):\n t = IngestTicket.load(f[:-7])\n if not state or (state == t['state']):\n buf.append(t)\n return buf", "metadata": "root.get_tickets", "header": "['module', '___EOS___']", "index": 203 }, { "content": "def scan_parserscrapers(directory):\n \"Scan the specified directory for valid parser/scraper executables\"\n found = []\n for root, dirs, files in os.walk(directory):\n for name in files:\n filename = os.path.join(root, name)\n is_ex = stat.S_IXUSR & os.stat(filename)[stat.ST_MODE] \n if is_ex:\n # Try and call this executable with a -bibserver to get a config\n try:\n output = subprocess.check_output(filename+' -bibserver', shell=True)\n output_json = json.loads(output)\n if output_json['bibserver_plugin']:\n output_json['_path'] = filename\n found.append(output_json)\n except subprocess.CalledProcessError:\n sys.stderr.write(traceback.format_exc())\n except ValueError:\n sys.stderr.write('Error parsing plugin output:\\n')\n sys.stderr.write(output)\n return found", "metadata": "root.scan_parserscrapers", "header": "['module', '___EOS___']", "index": 213 }, { "content": "def get_plugins():\n filename = os.path.join(config.get('parserscrapers_plugin_directory'), 'plugins.json')\n return json.loads(open(filename).read())", "metadata": "root.get_plugins", "header": "['module', '___EOS___']", "index": 235 }, { "content": "def init():\n for d in ('download_cache_directory', 'parserscrapers_plugin_directory'):\n dd = config.get(d)\n if not os.path.exists(dd):\n os.mkdir(dd)\n\n # Scan for available parser/scraper plugins\n parserscrapers_plugin_directory = config.get('parserscrapers_plugin_directory')\n if not parserscrapers_plugin_directory:\n sys.stderr.write('Error: parserscrapers_plugin_directory config entry not found\\n')\n plugins = scan_parserscrapers(parserscrapers_plugin_directory)\n if plugins:\n for ps in plugins:\n PLUGINS[ps['format']] = ps\n filename = os.path.join(config.get('parserscrapers_plugin_directory'), 'plugins.json')\n open(filename, 'w').write(json.dumps(PLUGINS))", "metadata": "root.init", "header": "['module', '___EOS___']", "index": 239 }, { "content": "def run():\n last_flash = time.time() - 500\n count = 0\n running = True\n while running:\n try:\n pid = open('ingest.pid').read()\n if str(pid) != str(os.getpid()):\n print 'Other ingest process %s detected not %s, exiting' % (pid, os.getpid())\n sys.exit(2)\n except IOError:\n print 'Ingest process exiting: ingest.pid file cound not be read'\n sys.exit(3)\n except:\n traceback.print_exc()\n sys.exit(4)\n for state in ('new', 'downloaded', 'parsed'):\n for t in get_tickets(state):\n determine_action(t)\n count += 1\n time.sleep(15)\n if time.time() - last_flash > (5 * 60):\n sys.stdout.write('Ingest pipeline %s %s performed %s actions\\n' % (os.getpid(), time.ctime(), count))\n last_flash = time.time()", "metadata": "root.run", "header": "['module', '___EOS___']", "index": 256 }, { "content": "def reset_all_tickets():\n for t in get_tickets():\n print 'Resetting', t['_id']\n t['state'] = 'new'\n t.save()", "metadata": "root.reset_all_tickets", "header": "['module', '___EOS___']", "index": 281 }, { "content": "@app.route('/ticket/')\[email protected]('/ticket/<ticket_id>')\ndef view_ticket(ticket_id=None):\n ingest_tickets = get_tickets()\n sort_key = request.values.get('sort')\n if sort_key:\n ingest_tickets.sort(key=lambda x: x.get(sort_key))\n if ticket_id:\n try:\n t = IngestTicket.load(ticket_id)\n except bibserver.ingest.IngestTicketInvalidId:\n abort(404)\n else:\n t = None\n return render_template('tickets/view.html', ticket=t, ingest_tickets = ingest_tickets)", "metadata": "root.view_ticket", "header": "['module', '___EOS___']", "index": 287 }, { "content": "@app.route('/ticket/<ticket_id>/<payload>', methods=['GET', 'POST'])\ndef ticket_serve(ticket_id, payload):\n t = IngestTicket.load(ticket_id)\n if payload == 'data':\n filename = t['data_md5']\n elif payload == 'bibjson':\n filename = t['data_json']\n elif (payload == 'reset') and (request.method == 'POST'):\n t['state'] = 'new'\n for cleanfield in ('failed_index', 'parse_feedback'):\n if cleanfield in t:\n del t[cleanfield]\n t.save()\n return make_response('OK')\n elif (payload == 'delete') and (request.method == 'POST'):\n t.delete()\n return make_response('OK')\n return redirect('/data/'+filename)", "metadata": "root.ticket_serve", "header": "['module', '___EOS___']", "index": 303 }, { "content": "@app.route('/data.txt')\ndef data_list():\n 'Output a list of all the raw data files, one file per line'\n data_list = []\n for t in get_tickets():\n if 'data_json' in t:\n data_list.append('/data/' + t['data_json'])\n resp = make_response( '\\n'.join(data_list) )\n resp.mimetype = \"text/plain\"\n return resp", "metadata": "root.data_list", "header": "['module', '___EOS___']", "index": 322 }, { "content": "@app.route('/data/<filename>')\ndef data_serve(filename):\n path = config['download_cache_directory']\n if not path.startswith('/'):\n path = os.path.join(os.getcwd(), path)\n response = send_from_directory(path, filename)\n response.headers['Content-Type'] = 'text/plain'\n return response", "metadata": "root.data_serve", "header": "['module', '___EOS___']", "index": 333 } ]
[ { "span": "from cStringIO import StringIO", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 30 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "'''", "\\", "10", ";", "Inde", "pend", "ent", " ", "runn", "ing", " ", "process", ".", "\\", "10", ";", "Hand", "ling", " ", "uploads", " ", "async", "hronous", "ly", ".", "\\", "10", ";", "See", ":", " ", "https", "://", "git", "hub", ".", "com", "/", "ok", "fn", "/", "bib", "server", "/", "wiki", "/", "Async", "Upload", "Desig", "n", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", ",_", "stat_", ",_", "sys_", ",_", "uuid_", ",_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "c", "String", "IO_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "requests_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "hashlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "datetime_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "bib", "server_", "._", "dao_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bib", "server_", "._", "config_", "import_", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bib", "server_", "._", "importer_", "import_", "Importer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bib", "server_", "._", "core_", "import_", "app_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "bib", "server_", "._", "util_", "as_", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "flask_", "import_", "render", "\\u", "template_", ",_", "make", "\\u", "response_", ",_", "abort_", ",_", "send", "\\u", "from", "\\u", "directory_", ",_", "redirect_", ",_", "request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Const", "ant", " ", "used", " ", "to", " ", "track", " ", "install", "ed", " ", "plugins_", "\\u\\u\\uNL\\u\\u\\u_", "PLUGINS", "_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "init_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "sys_", "._", "argv_", "[_", "1_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "x_", "==_", "'-", "x", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reset", "\\u", "all", "\\u", "tickets_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "x_", "._", "startswith_", "(_", "'-", "p", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "t_", "in_", "get", "\\u", "tickets_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "x_", "==_", "'-", "pp", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "'-'_", "*_", "80_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "t_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "'", " ", "'_", "*_", "4_", ",_", "k_", "+_", "':'_", ",_", "v_", "\\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_", "elif_", "x_", "==_", "'-", "d", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "open_", "(_", "'", "ingest", ".", "pid", "'_", ",_", "'", "w", "'_", ")_", "._", "write_", "(_", "'%", "s", "'_", "%_", "os_", "._", "getpid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "sys_", "._", "argv_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "run_", "(_", ")_", "\\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_", "Ing", "est", "Ticke", "t", "Inva", "lid", "Owne", "r", "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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Ing", "est", "Ticke", "t", "Inva", "lid", "Init_", "(_", "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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Ing", "est", "Ticke", "t", "Inva", "lid", "Id_", "(_", "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_", "Ing", "est", "Ticket_", "(_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Ing", "est", "Ticket_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "Creat", "es", " ", "a", " ", "new", " ", "Ing", "est", " ", "Ticke", "t", ",", " ", "read", "y", " ", "for", " ", "process", "ing", " ", "by", " ", "the", " ", "ingest", " ", "pipeline", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'\\u", "id", "'_", "not_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'\\u", "id", "'_", "]_", "=_", "uuid_", "._", "uuid4_", "(_", ")_", "._", "hex_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "state", "'_", "not_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'", "state", "'_", "]_", "=_", "'", "new", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'\\u", "created", "'_", "not_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'\\u", "created", "'_", "]_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "owner_", "=_", "kwargs_", "._", "get_", "(_", "'", "owner", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "type_", "(_", "owner_", ")_", "in_", "(_", "str_", ",_", "unicode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Ing", "est", "Ticke", "t", "Inva", "lid", "Owne", "r", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "x_", "in_", "(_", "'", "collection", "'_", ",_", "'", "format", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "kwargs_", "._", "get_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Ing", "est", "Ticke", "t", "Inva", "lid", "Init_", "(_", "'", "You", " ", "need", " ", "to", " ", "supply", " ", "the", " ", "parameter", " ", "%", "s", "'_", "%_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "x_", "in_", "(_", "'\\u", "created", "'_", ",_", "'\\u", "last", "\\u", "modifi", "ed", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "x_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "x_", "]_", "=_", "datetime_", "._", "fromtimestamp_", "(_", "kwargs_", "[_", "x_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dict_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ing", "est", "Ticket_", "(_", "dict_", ")_", ":_", "\\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_", "load_", "(_", "cls_", ",_", "tick", "et", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "os_", "._", "path_", "._", "join_", "(_", "config_", "[_", "'", "download", "\\u", "cache", "\\u", "director", "y", "'_", "]_", ",_", "tick", "et", "\\u", "id_", ")_", "+_", "'.", "tick", "et", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Ing", "est", "Ticke", "t", "Inva", "lid", "Id_", "(_", "tick", "et", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "=_", "json_", "._", "loads_", "(_", "open_", "(_", "filename_", ")_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cls_", "(_", "**_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ing", "est", "Ticket_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "[_", "'\\u", "last", "\\u", "modifi", "ed", "'_", "]_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "[_", "'\\u", "created", "'_", "]_", "=_", "time_", "._", "mktime_", "(_", "self_", "[_", "'\\u", "created", "'_", "]_", "._", "timetuple_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", "=_", "os_", "._", "path_", "._", "join_", "(_", "config_", "[_", "'", "download", "\\u", "cache", "\\u", "director", "y", "'_", "]_", ",_", "self_", "[_", "'\\u", "id", "'_", "]_", ")_", "+_", "'.", "tick", "et", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "open_", "(_", "filename_", ",_", "'", "wb", "'_", ")_", "._", "write_", "(_", "json_", "._", "dumps_", "(_", "self_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "(_", "'\\u", "created", "'_", ",_", "'\\u", "last", "\\u", "modifi", "ed", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "[_", "x_", "]_", "=_", "datetime_", "._", "fromtimestamp_", "(_", "self_", "[_", "x_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ing", "est", "Ticket_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fail_", "(_", "self_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "[_", "'", "state", "'_", "]_", "=_", "'", "fail", "ed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "err_", "=_", "(_", "datetime_", "._", "now_", "(_", ")_", "._", "strftime_", "(_", "\"%", "Y", "%", "m", "%", "d", "%", "H", "%", "M", "\"_", ")_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "setdefault_", "(_", "'", "exception", "'_", ",_", "[_", "]_", ")_", "._", "append_", "(_", "err_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ing", "est", "Ticket_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "os_", "._", "path_", "._", "join_", "(_", "config_", "[_", "'", "download", "\\u", "cache", "\\u", "director", "y", "'_", "]_", ",_", "self_", "[_", "'\\u", "id", "'_", "]_", ")_", "+_", "'.", "tick", "et", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "remove_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ing", "est", "Ticket_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "unicode\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "u", "'%", "s", "/", "%", "s", ",%", "s", " ", "[", "%", "s", "]", " ", "-", " ", "%", "s", "'_", "%_", "(_", "self_", "[_", "'", "owner", "'_", "]_", ",_", "self_", "[_", "'", "collection", "'_", "]_", ",_", "self_", "[_", "'", "format", "'_", "]_", ",_", "self_", "[_", "'", "state", "'_", "]_", ",_", "self_", "[_", "'\\u", "last", "\\u", "modifi", "ed", "'_", "]_", ")_", "\\u\\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_", "repr_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ing", "est", "Ticket_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "unicode_", "(_", "self_", ")_", "._", "encode_", "(_", "'", "utf", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ing", "est", "Ticket_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "[_", "'\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "index_", "(_", "ticket_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ticket_", "[_", "'", "state", "'_", "]_", "=_", "'", "popul", "ati", "ng", "\\u", "index", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ticket_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "the", " ", "parsed", " ", "content", " ", "is", " ", "in", " ", "the", " ", "cache_", "\\u\\u\\uNL\\u\\u\\u_", "download", "\\u", "cache", "\\u", "directory_", "=_", "config_", "[_", "'", "download", "\\u", "cache", "\\u", "director", "y", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "in", "\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "download", "\\u", "cache", "\\u", "directory_", ",_", "ticket_", "[_", "'", "data\\u", "json", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "in", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ticket_", "._", "fail_", "(_", "'", "Pars", "ed", " ", "content", " ", "for", " ", "%", "s", " ", "not", " ", "found", "'_", "%_", "in", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "=_", "open_", "(_", "in", "\\u", "path_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "data_", ")_", "<_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "The", " ", "parsed", " ", "data", " ", "in", " ", "this", " ", "tick", "et", " ", "is", " ", "empty", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", " ", "check", " ", "for", " ", "metadata", " ", "section", " ", "to", " ", "update", " ", "collection", " ", "from", " ", "this", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "owner_", "=_", "bib", "server_", "._", "dao_", "._", "Account_", "._", "get_", "(_", "ticket_", "[_", "'", "owner", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "importer_", "=_", "Importer_", "(_", "owner_", "=_", "owner_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "collection_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "label", "'_", ":_", "ticket_", "[_", "'", "collection", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "collection", "'_", ":_", "util_", "._", "slugify_", "(_", "ticket_", "[_", "'", "collection", "'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "ticket_", "._", "get_", "(_", "'", "description", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "source", "'_", ":_", "ticket_", "[_", "'", "source", "\\u", "url", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "format", "'_", ":_", "ticket_", "[_", "'", "format", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "license", "'_", ":_", "ticket_", "._", "get_", "(_", "'", "license", "'_", ",_", "u", "\"", "Not", " ", "specified", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "collection_", ",_", "records_", "=_", "importer_", "._", "upload_", "(_", "open_", "(_", "in", "\\u", "path_", ")_", ",_", "collection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ticket_", "[_", "'", "state", "'_", "]_", "=_", "'", "don", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ticket_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse_", "(_", "ticket_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ticket_", "[_", "'", "state", "'_", "]_", "=_", "'", "pars", "ing", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ticket_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "data\\u", "md5", "'_", "not_", "in_", "ticket_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ticket_", "._", "fail_", "(_", "'", "Atte", "mpt", " ", "to", " ", "parse", " ", "tick", "et", ",", " ", "but", " ", "no", " ", "data\\u", "md5", " ", "found", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p_", "=_", "PLUGINS", "_", "._", "get_", "(_", "ticket_", "[_", "'", "format", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "p_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ticket_", "._", "fail_", "(_", "'", "Parser", " ", "plugin", " ", "for", " ", "format", " ", "%", "s", " ", "not", " ", "found", "'_", "%_", "ticket_", "[_", "'", "format", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "the", " ", "download", "ed", " ", "content", " ", "is", " ", "in", " ", "the", " ", "cache_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "download", "\\u", "cache", "\\u", "directory_", "=_", "config_", "[_", "'", "download", "\\u", "cache", "\\u", "director", "y", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "in", "\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "download", "\\u", "cache", "\\u", "directory_", ",_", "ticket_", "[_", "'", "data\\u", "md5", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "in", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ticket_", "._", "fail_", "(_", "'", "Downloade", "d", " ", "content", " ", "for", " ", "%", "s", " ", "not", " ", "found", "'_", "%_", "in", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p_", "=_", "subprocess_", "._", "Popen_", "(_", "p_", "[_", "'\\u", "path", "'_", "]_", ",_", "shell_", "=_", "True_", ",_", "stdin_", "=_", "open_", "(_", "in", "\\u", "path_", ")_", ",_", "stdout_", "=_", "subprocess_", "._", "PIPE_", ",_", "stderr_", "=_", "subprocess_", "._", "PIPE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "p_", "._", "stdout_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "md5sum", "_", "=_", "hashlib_", "._", "md5_", "(_", "data_", ")_", "._", "hexdigest_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "download", "\\u", "cache", "\\u", "directory_", "=_", "config_", "[_", "'", "download", "\\u", "cache", "\\u", "director", "y", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out", "\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "download", "\\u", "cache", "\\u", "directory_", ",_", "md5sum", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "open_", "(_", "out", "\\u", "path_", ",_", "'", "wb", "'_", ")_", "._", "write_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ticket_", "[_", "'", "data\\u", "json", "'_", "]_", "=_", "md5sum", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ticket_", "._", "get_", "(_", "'", "only", "\\u", "parse", "'_", ")_", "==_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ticket_", "[_", "'", "state", "'_", "]_", "=_", "'", "don", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ticket_", "[_", "'", "state", "'_", "]_", "=_", "'", "parsed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "if", " ", "there", " ", "is", " ", "any", " ", "data", " ", "in", " ", "the", " ", "std", "err", " ", "of", " ", "the", " ", "parser_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "so", ",", " ", "add", " ", "it", " ", "to", " ", "the", " ", "tick", "et", " ", "as", " ", "potenti", "al", " ", "feedback_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data\\u", "stderr_", "=_", "p_", "._", "stderr_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "data\\u", "stderr_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ticket_", "[_", "'", "parse", "\\u", "feed", "back", "'_", "]_", "=_", "data\\u", "stderr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ticket_", "._", "save_", "(_", ")_", "\\u\\u\\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_", "store", "\\u", "data\\u", "in", "\\u", "cache_", "(_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "md5sum", "_", "=_", "hashlib_", "._", "md5_", "(_", "data_", ")_", "._", "hexdigest_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "download", "\\u", "cache", "\\u", "directory_", "=_", "config_", "[_", "'", "download", "\\u", "cache", "\\u", "director", "y", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out", "\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "download", "\\u", "cache", "\\u", "directory_", ",_", "md5sum", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "out", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "open_", "(_", "out", "\\u", "path_", ",_", "'", "wb", "'_", ")_", "._", "write_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "md5sum", "_", "\\u\\u\\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_", "download_", "(_", "ticket_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ticket_", "[_", "'", "state", "'_", "]_", "=_", "'", "download", "ing", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ticket_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "PLUGINS", "_", "._", "get_", "(_", "ticket_", "[_", "'", "format", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "p_", "and_", "p_", "._", "get_", "(_", "'", "download", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "ticket_", "[_", "'", "source", "\\u", "url", "'_", "]_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content", "\\u", "type_", "=_", "'", "text", "/", "plain", "'_", "\\u\\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_", "=_", "ticket_", "[_", "'", "source", "\\u", "url", "'_", "]_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "requests_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content", "\\u", "type_", "=_", "r_", "._", "headers_", "[_", "'", "content", "-", "type", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "._", "raise", "\\u", "for", "\\u", "status_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "r_", "._", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "data_", ")_", "<_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ticket_", "._", "fail_", "(_", "'", "Data", " ", "is", " ", "empty", ",", " ", "HTTP", " ", "status", " ", "code", " ", "%", "s", " ", "'_", "%_", "r_", "._", "status", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ticket_", "[_", "'", "data\\u", "md5", "'_", "]_", "=_", "store", "\\u", "data\\u", "in", "\\u", "cache_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ticket_", "[_", "'", "data\\u", "content", "\\u", "type", "'_", "]_", "=_", "content", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ticket_", "[_", "'", "state", "'_", "]_", "=_", "'", "download", "ed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ticket_", "._", "save_", "(_", ")_", "\\u\\u\\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_", "dete", "rmin", "e\\u", "action_", "(_", "ticket_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "For", " ", "the", " ", "give", "n", " ", "tick", "et", " ", "dete", "rmin", "e", " ", "what", " ", "the", " ", "next", " ", "action", " ", "to", " ", "take", " ", "is", " ", "based", " ", "on", " ", "the", " ", "state", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "state_", "=_", "ticket_", "[_", "'", "state", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "ticket_", "[_", "'", "state", "'_", "]_", ",_", "ticket_", "[_", "'\\u", "id", "'_", "]_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "state_", "==_", "'", "new", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "download_", "(_", "ticket_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "state_", "==_", "'", "download", "ed", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parse_", "(_", "ticket_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "state_", "==_", "'", "parsed", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "index_", "(_", "ticket_", ")_", "\\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_", "##", " ", "TOD", "O_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "some", " ", "reason", " ", "saving", " ", "the", " ", "traceback", " ", "to", " ", "the", " ", "tick", "et", " ", "here", " ", "is", " ", "not", " ", "saving", " ", "the", " ", "exception_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "tick", "et", " ", "doe", "s", " ", "not", " ", "record", " ", "the", " ", "'", "fail", "ed", "'", " ", "state", ",", " ", "and", " ", "remains", " ", "in", " ", "eg", ".", " ", "a", " ", "'", "download", "ing", "'", " ", "state_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ticket_", "._", "fail_", "(_", "traceback_", "._", "format\\u", "exc_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'...'_", ",_", "ticket_", "[_", "'", "state", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "tickets_", "(_", "state_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Get", " ", "tick", "ets", " ", "with", " ", "the", " ", "give", "n", " ", "state", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "buf_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "f_", "in_", "os_", "._", "listdir_", "(_", "config_", "[_", "'", "download", "\\u", "cache", "\\u", "director", "y", "'_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "f_", "._", "endswith_", "(_", "'.", "tick", "et", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Ing", "est", "Ticket_", "._", "load_", "(_", "f_", "[_", ":_", "-_", "7_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "state_", "or_", "(_", "state_", "==_", "t_", "[_", "'", "state", "'_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "buf_", "._", "append_", "(_", "t_", ")_", "\\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_", "buf_", "\\u\\u\\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_", "scan", "\\u", "parser", "scraper", "s_", "(_", "directory_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Sca", "n", " ", "the", " ", "specified", " ", "director", "y", " ", "for", " ", "valid", " ", "parser", "/", "scraper", " ", "executable", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "root_", ",_", "dirs_", ",_", "files_", "in_", "os_", "._", "walk_", "(_", "directory_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "name_", "in_", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "\\u", "ex_", "=_", "stat_", "._", "S", "\\u", "IX", "USR", "_", "&_", "os_", "._", "stat_", "(_", "filename_", ")_", "[_", "stat_", "._", "ST", "\\u", "MODE_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "\\u", "ex_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Tr", "y", " ", "and", " ", "call", " ", "this", " ", "executable", " ", "with", " ", "a", " ", "-", "bib", "server", " ", "to", " ", "get", " ", "a", " ", "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 ", " ", "_", "output_", "=_", "subprocess_", "._", "check", "\\u", "output_", "(_", "filename_", "+_", "'", " ", "-", "bib", "server", "'_", ",_", "shell_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "json_", "=_", "json_", "._", "loads_", "(_", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "output", "\\u", "json_", "[_", "'", "bib", "server", "\\u", "plugin", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "output", "\\u", "json_", "[_", "'\\u", "path", "'_", "]_", "=_", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found_", "._", "append_", "(_", "output", "\\u", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "subprocess_", "._", "Call", "ed", "Process", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "sys_", "._", "stderr_", "._", "write_", "(_", "traceback_", "._", "format\\u", "exc_", "(_", ")_", ")_", "\\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 ", " ", "_", "sys_", "._", "stderr_", "._", "write_", "(_", "'", "Error", " ", "pars", "ing", " ", "plugin", " ", "output", ":\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stderr_", "._", "write_", "(_", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "found_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "plugins_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "os_", "._", "path_", "._", "join_", "(_", "config_", "._", "get_", "(_", "'", "parser", "scraper", "s", "\\u", "plugin", "\\u", "director", "y", "'_", ")_", ",_", "'", "plugin", "s", ".", "json", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "json_", "._", "loads_", "(_", "open_", "(_", "filename_", ")_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "init_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "d_", "in_", "(_", "'", "download", "\\u", "cache", "\\u", "director", "y", "'_", ",_", "'", "parser", "scraper", "s", "\\u", "plugin", "\\u", "director", "y", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dd_", "=_", "config_", "._", "get_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "dd_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "mkdir_", "(_", "dd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sca", "n", " ", "for", " ", "avail", "able", " ", "parser", "/", "scraper", " ", "plugins_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "parser", "scraper", "s", "\\u", "plugin", "\\u", "directory_", "=_", "config_", "._", "get_", "(_", "'", "parser", "scraper", "s", "\\u", "plugin", "\\u", "director", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "parser", "scraper", "s", "\\u", "plugin", "\\u", "directory_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stderr_", "._", "write_", "(_", "'", "Error", ":", " ", "parser", "scraper", "s", "\\u", "plugin", "\\u", "director", "y", " ", "config", " ", "entry", " ", "not", " ", "found", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plugins_", "=_", "scan", "\\u", "parser", "scraper", "s_", "(_", "parser", "scraper", "s", "\\u", "plugin", "\\u", "directory_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "plugins_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "ps_", "in_", "plugins_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "PLUGINS", "_", "[_", "ps_", "[_", "'", "format", "'_", "]_", "]_", "=_", "ps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "filename_", "=_", "os_", "._", "path_", "._", "join_", "(_", "config_", "._", "get_", "(_", "'", "parser", "scraper", "s", "\\u", "plugin", "\\u", "director", "y", "'_", ")_", ",_", "'", "plugin", "s", ".", "json", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "open_", "(_", "filename_", ",_", "'", "w", "'_", ")_", "._", "write_", "(_", "json_", "._", "dumps_", "(_", "PLUGINS", "_", ")_", ")_", "\\u\\u\\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\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "last", "\\u", "flash_", "=_", "time_", "._", "time_", "(_", ")_", "-_", "500_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "running_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "running_", ":_", "\\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 ", " _", "pid_", "=_", "open_", "(_", "'", "ingest", ".", "pid", "'_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "str_", "(_", "pid_", ")_", "!=_", "str_", "(_", "os_", "._", "getpid_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Ot", "her", " ", "ingest", " ", "process", " ", "%", "s", " ", "detect", "ed", " ", "not", " ", "%", "s", ",", " ", "exit", "ing", "'_", "%_", "(_", "pid_", ",_", "os_", "._", "getpid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "2_", ")_", "\\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_", "'", "Ing", "est", " ", "process", " ", "exit", "ing", ":", " ", "ingest", ".", "pid", " ", "file", " ", "cou", "nd", " ", "not", " ", "be", " ", "read", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "traceback_", "._", "print", "\\u", "exc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "state_", "in_", "(_", "'", "new", "'_", ",_", "'", "download", "ed", "'_", ",_", "'", "parsed", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "t_", "in_", "get", "\\u", "tickets_", "(_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dete", "rmin", "e\\u", "action_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time_", "._", "sleep_", "(_", "15_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "time_", "._", "time_", "(_", ")_", "-_", "last", "\\u", "flash_", ">_", "(_", "5_", "*_", "60_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "Ing", "est", " ", "pipeline", " ", "%", "s", " ", "%", "s", " ", "perform", "ed", " ", "%", "s", " ", "action", "s", "\\\\", "n", "'_", "%_", "(_", "os_", "._", "getpid_", "(_", ")_", ",_", "time_", "._", "ctime_", "(_", ")_", ",_", "count_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "flash_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "reset", "\\u", "all", "\\u", "tickets_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "t_", "in_", "get", "\\u", "tickets_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Reset", "ting", "'_", ",_", "t_", "[_", "'\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "[_", "'", "state", "'_", "]_", "=_", "'", "new", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "app_", "._", "route_", "(_", "'/", "tick", "et", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "app_", "._", "route_", "(_", "'/", "tick", "et", "/", "<", "tick", "et", "\\u", "id", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "view", "\\u", "ticket_", "(_", "tick", "et", "\\u", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ingest", "\\u", "tickets_", "=_", "get", "\\u", "tickets_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sort", "\\u", "key_", "=_", "request_", "._", "values_", "._", "get_", "(_", "'", "sort", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sort", "\\u", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ingest", "\\u", "tickets_", "._", "sort_", "(_", "key_", "=_", "lambda_", "x_", ":_", "x_", "._", "get_", "(_", "sort", "\\u", "key_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "tick", "et", "\\u", "id_", ":_", "\\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 ", " _", "t_", "=_", "Ing", "est", "Ticket_", "._", "load_", "(_", "tick", "et", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "bib", "server_", "._", "ingest", "_", "._", "Ing", "est", "Ticke", "t", "Inva", "lid", "Id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "abort_", "(_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "render", "\\u", "template_", "(_", "'", "tick", "ets", "/", "view", ".", "html", "'_", ",_", "ticket_", "=_", "t_", ",_", "ingest", "\\u", "tickets_", "=_", "ingest", "\\u", "tickets_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "app_", "._", "route_", "(_", "'/", "tick", "et", "/", "<", "tick", "et", "\\u", "id", ">/", "<", "payload", ">'_", ",_", "methods_", "=_", "[_", "'", "GET", "'_", ",_", "'", "POST", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "tick", "et", "\\u", "serve_", "(_", "tick", "et", "\\u", "id_", ",_", "payload_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Ing", "est", "Ticket_", "._", "load_", "(_", "tick", "et", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "payload_", "==_", "'", "data", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "t_", "[_", "'", "data\\u", "md5", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "payload_", "==_", "'", "bib", "json", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "t_", "[_", "'", "data\\u", "json", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "payload_", "==_", "'", "reset", "'_", ")_", "and_", "(_", "request_", "._", "method_", "==_", "'", "POST", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "[_", "'", "state", "'_", "]_", "=_", "'", "new", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "clean", "field_", "in_", "(_", "'", "fail", "ed", "\\u", "index", "'_", ",_", "'", "parse", "\\u", "feed", "back", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "clean", "field_", "in_", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "t_", "[_", "clean", "field_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "t_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "make", "\\u", "response_", "(_", "'", "OK", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "payload_", "==_", "'", "delete", "'_", ")_", "and_", "(_", "request_", "._", "method_", "==_", "'", "POST", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "make", "\\u", "response_", "(_", "'", "OK", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "redirect_", "(_", "'/", "data", "/'_", "+_", "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_", "@_", "app_", "._", "route_", "(_", "'/", "data", ".", "txt", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "data\\u", "list_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "Output", " ", "a", " ", "list", " ", "of", " ", "all", " ", "the", " ", "raw", " ", "data", " ", "files", ",", " ", "one", " ", "file", " ", "per", " ", "line", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "t_", "in_", "get", "\\u", "tickets_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "data\\u", "json", "'_", "in_", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data\\u", "list_", "._", "append_", "(_", "'/", "data", "/'_", "+_", "t_", "[_", "'", "data\\u", "json", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "resp_", "=_", "make", "\\u", "response_", "(_", "'\\\\", "n", "'_", "._", "join_", "(_", "data\\u", "list_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "mimetype_", "=_", "\"", "text", "/", "plain", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "app_", "._", "route_", "(_", "'/", "data", "/", "<", "filename", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "data\\u", "serve_", "(_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", "=_", "config_", "[_", "'", "download", "\\u", "cache", "\\u", "director", "y", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "path_", "._", "startswith_", "(_", "'/'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "getcwd_", "(_", ")_", ",_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "=_", "send", "\\u", "from", "\\u", "directory_", "(_", "path_", ",_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "._", "headers_", "[_", "'", "Conten", "t", "-", "Type", "'_", "]_", "=_", "'", "text", "/", "plain", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "response_", "\\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, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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 ]
Unused import
OpenCobolIDE/OpenCobolIDE/open_cobol_ide/extlibs/future/moves/dbm/__init__.py
[ { "content": "from __future__ import absolute_import\nfrom future.utils import PY3\n\nif PY3:\n from dbm import *\nelse:\n __future_module__ = True\n from whichdb import *\n from anydbm import *\n\n# Py3.3's dbm/__init__.py imports ndbm but doesn't expose it via __all__.\n# In case some (badly written) code depends on dbm.ndbm after import dbm,\n# we simulate this:\nif PY3:\n from dbm import ndbm\nelse:\n try:\n from future.moves.dbm import ndbm\n except ImportError:\n ndbm = None\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from dbm import ndbm", "start_line": 14, "start_column": 4, "end_line": 14, "end_column": 24 }, { "span": "from future.moves.dbm import ndbm", "start_line": 17, "start_column": 8, "end_line": 17, "end_column": 41 } ]
[]
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_", "from_", "future_", "._", "utils_", "import_", "PY", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "PY", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "dbm", "_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "future", "\\u", "module\\u\\u_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "whi", "chd", "b_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "any", "dbm", "_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Py", "3.3", "'", "s", " ", "dbm", "/\\u", "\\u", "init", "\\u\\u", ".", "py", " ", "import", "s", " ", "ndb", "m", " ", "but", " ", "doe", "sn", "'", "t", " ", "expos", "e", " ", "it", " ", "via", " ", "\\u\\u", "all", "\\u\\u", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "In", " ", "case", " ", "some", " ", "(", "bad", "ly", " ", "writt", "en", ")", " ", "code", " ", "depend", "s", " ", "on", " ", "dbm", ".", "ndb", "m", " ", "after", " ", "import", " ", "dbm", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "simulat", "e", " ", "this", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "PY", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "dbm", "_", "import_", "ndb", "m_", "\\u\\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 ", " _", "from_", "future_", "._", "moves_", "._", "dbm", "_", "import_", "ndb", "m_", "\\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 ", " _", "ndb", "m_", "=_", "None_", "\\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, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unreachable code
crossbario/autobahn-python/examples/twisted/websocket/streaming/frame_based_client.py
[ { "content": "###############################################################################\n#\n# The MIT License (MIT)\n#\n# Copyright (c) Tavendo GmbH\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n#\n###############################################################################\n\nimport hashlib\nfrom ranstring import randomByteString\n\nfrom twisted.internet import reactor\n\nfrom autobahn.twisted.websocket import WebSocketClientFactory, \\\n WebSocketClientProtocol, \\\n connectWS\n\n\nFRAME_SIZE = 1 * 2**20\nFRAME_COUNT = 10\n\n\n\n\nif __name__ == '__main__':\n\n factory = WebSocketClientFactory(u\"ws://127.0.0.1:9000\")\n factory.protocol = FrameBasedHashClientProtocol\n\n enableCompression = False\n if enableCompression:\n from autobahn.websocket.compress import PerMessageDeflateOffer, \\\n PerMessageDeflateResponse, \\\n PerMessageDeflateResponseAccept\n\n # The extensions offered to the server ..\n offers = [PerMessageDeflateOffer()]\n factory.setProtocolOptions(perMessageCompressionOffers=offers)\n\n # Function to accept responses from the server ..\n\n factory.setProtocolOptions(perMessageCompressionAccept=accept)\n\n connectWS(factory)\n reactor.run()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from autobahn.websocket.compress import PerMessageDeflateOffer, \\\n PerMessageDeflateResponse, \\\n PerMessageDeflateResponseAccept", "start_line": 89, "start_column": 8, "end_line": 91, "end_column": 43 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "MIT", " ", "License", " ", "(", "MIT", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "Ta", "vend", "o", " ", "Gm", "b", "H_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Permi", "ssion", " ", "is", " ", "here", "by", " ", "grant", "ed", ",", " ", "free", " ", "of", " ", "charge", ",", " ", "to", " ", "any", " ", "person", " ", "obtain", "ing", " ", "a", " ", "copy_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "this", " ", "software", " ", "and", " ", "associate", "d", " ", "documentation", " ", "files", " ", "(", "the", " ", "\"", "Sof", "twa", "re", "\")", ",", " ", "to", " ", "deal", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "the", " ", "Sof", "twa", "re", " ", "with", "out", " ", "restriction", ",", " ", "inclu", "ding", " ", "with", "out", " ", "limit", "ation", " ", "the", " ", "rights_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "use", ",", " ", "copy", ",", " ", "modif", "y", ",", " ", "merge", ",", " ", "publi", "sh", ",", " ", "distribute", ",", " ", "subli", "cens", "e", ",", " ", "and", "/", "or", " ", "sell", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "copie", "s", " ", "of", " ", "the", " ", "Sof", "twa", "re", ",", " ", "and", " ", "to", " ", "permit", " ", "person", "s", " ", "to", " ", "who", "m", " ", "the", " ", "Sof", "twa", "re", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fur", "nish", "ed", " ", "to", " ", "do", " ", "so", ",", " ", "subject", " ", "to", " ", "the", " ", "follow", "ing", " ", "condition", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "above", " ", "copyr", "ight", " ", "notice", " ", "and", " ", "this", " ", "permissi", "on", " ", "notice", " ", "sha", "ll", " ", "be", " ", "include", "d", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "all", " ", "copie", "s", " ", "or", " ", "substa", "nti", "al", " ", "porti", "ons", " ", "of", " ", "the", " ", "Sof", "twa", "re", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THE", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "\"", "AS", " ", "IS", "\",", " ", "WITH", "OUT", " ", "WAR", "RAN", "TY", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "EXPR", "ESS", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IMPL", "IED", ",", " ", "INC", "LU", "DING", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", " ", "THE", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", " ", "AND", " ", "NON", "INF", "RING", "EME", "NT", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "AUTHOR", "S", " ", "OR", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "CLA", "IM", ",", " ", "DA", "MAGE", "S", " ", "OR", " ", "OTHER", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "AN", " ", "ACTI", "ON", " ", "OF", " ", "CONTR", "ACT", ",", " ", "TOR", "T", " ", "OR", " ", "OTHER", "WI", "SE", ",", " ", "ARI", "SIN", "G", " ", "FROM", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "OUT", " ", "OF", " ", "OR", " ", "IN", " ", "CONNECTION", " ", "WITH", " ", "THE", " ", "SOFT", "WARE", " ", "OR", " ", "THE", " ", "USE", " ", "OR", " ", "OTHER", " ", "DEA", "LING", "S", " ", "IN_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THE", " ", "SOFT", "WARE", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "hashlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "rans", "tring_", "import_", "random", "Byte", "String_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "twisted_", "._", "internet_", "import_", "reactor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "autob", "ah", "n_", "._", "twisted_", "._", "websocket_", "import_", "Web", "Sock", "et", "Client", "Factory_", ",_", "Web", "Sock", "et", "Client", "Protocol_", ",_", "connect", "WS_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "FRAME", "\\u", "SIZE_", "=_", "1_", "*_", "2_", "**_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FRAME", "\\u", "COUNT_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "factory_", "=_", "Web", "Sock", "et", "Client", "Factory_", "(_", "u", "\"", "ws", "://", "127", ".0", ".0", ".1", ":", "9000", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "factory_", "._", "protocol_", "=_", "Frame", "Base", "d", "Hash", "Client", "Protocol_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "enable", "Compress", "ion_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "enable", "Compress", "ion_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "autob", "ah", "n_", "._", "websocket_", "._", "compress_", "import_", "Per", "Messag", "e", "Def", "late", "Offer", "_", ",_", "Per", "Messag", "e", "Def", "late", "Response_", ",_", "Per", "Messag", "e", "Def", "late", "Respons", "e", "Accept", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "extensi", "ons", " ", "offered", " ", "to", " ", "the", " ", "server", " ", "..", "_", "\\u\\u\\uNL\\u\\u\\u_", "offers", "_", "=_", "[_", "Per", "Messag", "e", "Def", "late", "Offer", "_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "factory_", "._", "set", "Proto", "col", "Options_", "(_", "per", "Messag", "e", "Compress", "ion", "Offer", "s_", "=_", "offers", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Function", " ", "to", " ", "accept", " ", "response", "s", " ", "from", " ", "the", " ", "server", " ", "..", "_", "\\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_", "factory_", "._", "set", "Proto", "col", "Options_", "(_", "per", "Messag", "e", "Compress", "ion", "Accept", "_", "=_", "accept_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "connect", "WS_", "(_", "factory_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reactor_", "._", "run_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
StackStorm/st2/st2actions/tests/unit/test_actionchain.py
[ { "content": " @mock.patch.object(action_db_util, 'get_action_by_ref',\n mock.MagicMock(return_value=ACTION_1))\n @mock.patch.object(action_service, 'request',\n return_value=(DummyActionExecution(result={'o1': '1'}), None))\n def test_chain_runner_dependent_param_temp(self, request):\n chain_runner = acr.get_runner()\n chain_runner.entry_point = CHAIN_DEP_INPUT\n chain_runner.action = ACTION_1\n chain_runner.container_service = RunnerContainerService()\n chain_runner.pre_run()\n chain_runner.run({'s1': 1, 's2': 2, 's3': 3, 's4': 4})\n self.assertNotEqual(chain_runner.chain_holder.actionchain, None)\n expected_values = [{u'p1': u'1'},\n {u'p1': u'1'},\n {u'p2': u'1', u'p3': u'1', u'p1': u'1'}]\n # Each of the call_args must be one of\n for call_args in request.call_args_list:\n self.assertTrue(call_args[0][0].parameters in expected_values)\n expected_values.remove(call_args[0][0].parameters)\n self.assertEqual(len(expected_values), 0, 'Not all expected values received.')", "metadata": "root.TestActionChainRunner.test_chain_runner_dependent_param_temp", "header": "['class', 'TestActionChainRunner', '(', 'DbTestCase', ')', ':', '___EOS___']", "index": 425 }, { "content": " @mock.patch.object(action_db_util, 'get_action_by_ref',\n mock.MagicMock(return_value=ACTION_1))\n @mock.patch.object(action_service, 'request',\n return_value=(DummyActionExecution(result={'o1': '1'}), None))\n def test_chain_runner_dependent_results_param(self, request):\n chain_runner = acr.get_runner()\n chain_runner.entry_point = CHAIN_DEP_RESULTS_INPUT\n chain_runner.action = ACTION_1\n chain_runner.container_service = RunnerContainerService()\n chain_runner.pre_run()\n chain_runner.run({'s1': 1})\n self.assertNotEqual(chain_runner.chain_holder.actionchain, None)\n expected_values = [{u'p1': u'1'},\n {u'p1': u'1'},\n {u'out': u\"{'c2': {'o1': '1'}, 'c1': {'o1': '1'}}\"}]\n # Each of the call_args must be one of\n self.assertEqual(request.call_count, 3)\n for call_args in request.call_args_list:\n self.assertTrue(call_args[0][0].parameters in expected_values)\n expected_values.remove(call_args[0][0].parameters)\n self.assertEqual(len(expected_values), 0, 'Not all expected values received.')", "metadata": "root.TestActionChainRunner.test_chain_runner_dependent_results_param", "header": "['class', 'TestActionChainRunner', '(', 'DbTestCase', ')', ':', '___EOS___']", "index": 446 }, { "content": " @mock.patch.object(action_db_util, 'get_action_by_ref',\n mock.MagicMock(return_value=ACTION_1))\n @mock.patch.object(action_service, 'request', return_value=(DummyActionExecution(), None))\n def test_chain_runner_failure_during_param_rendering_single_task(self, request):\n # Parameter rendering should result in a top level error which aborts\n # the whole chain\n chain_runner = acr.get_runner()\n chain_runner.entry_point = CHAIN_FIRST_TASK_RENDER_FAIL_PATH\n chain_runner.action = ACTION_1\n chain_runner.container_service = RunnerContainerService()\n chain_runner.pre_run()\n status, result, _ = chain_runner.run({})\n\n # No tasks ran because rendering of parameters for the first task failed\n self.assertEqual(status, LIVEACTION_STATUS_FAILED)\n self.assertEqual(result['tasks'], [])\n self.assertTrue('error' in result)\n self.assertTrue('traceback' in result)\n self.assertTrue('Failed to run task \"c1\". Parameter rendering failed' in result['error'])\n self.assertTrue('Traceback' in result['traceback'])", "metadata": "root.TestActionChainRunner.test_chain_runner_failure_during_param_rendering_single_task", "header": "['class', 'TestActionChainRunner', '(', 'DbTestCase', ')', ':', '___EOS___']", "index": 482 }, { "content": " @mock.patch.object(action_db_util, 'get_action_by_ref',\n mock.MagicMock(return_value=ACTION_1))\n @mock.patch.object(action_service, 'request', return_value=(DummyActionExecution(), None))\n def test_chain_runner_failure_during_param_rendering_multiple_tasks(self, request):\n # Parameter rendering should result in a top level error which aborts\n # the whole chain\n chain_runner = acr.get_runner()\n chain_runner.entry_point = CHAIN_SECOND_TASK_RENDER_FAIL_PATH\n chain_runner.action = ACTION_1\n chain_runner.container_service = RunnerContainerService()\n chain_runner.pre_run()\n status, result, _ = chain_runner.run({})\n\n # Verify that only first task has ran\n self.assertEqual(status, LIVEACTION_STATUS_FAILED)\n self.assertEqual(len(result['tasks']), 1)\n self.assertEqual(result['tasks'][0]['name'], 'c1')\n\n expected_error = ('Failed rendering value for action parameter \"p1\" in '\n 'task \"c2\" (template string={{s1}}):')\n\n self.assertTrue('error' in result)\n self.assertTrue('traceback' in result)\n self.assertTrue('Failed to run task \"c2\". Parameter rendering failed' in result['error'])\n self.assertTrue(expected_error in result['error'])\n self.assertTrue('Traceback' in result['traceback'])", "metadata": "root.TestActionChainRunner.test_chain_runner_failure_during_param_rendering_multiple_tasks", "header": "['class', 'TestActionChainRunner', '(', 'DbTestCase', ')', ':', '___EOS___']", "index": 503 }, { "content": " @mock.patch.object(action_db_util, 'get_action_by_ref',\n mock.MagicMock(return_value=ACTION_1))\n @mock.patch.object(action_service, 'request', return_value=(DummyActionExecution(), None))\n def test_chain_runner_publish_param_rendering_failure(self, request):\n # Parameter rendering should result in a top level error which aborts\n # the whole chain\n chain_runner = acr.get_runner()\n chain_runner.entry_point = CHAIN_WITH_PUBLISH_PARAM_RENDERING_FAILURE\n chain_runner.action = ACTION_1\n chain_runner.container_service = RunnerContainerService()\n chain_runner.pre_run()\n\n try:\n chain_runner.run({})\n except ParameterRenderingFailedException as e:\n # TODO: Should we treat this as task error? Right now it bubbles all\n # the way up and it's not really consistent with action param\n # rendering failure\n expected_error = ('Failed rendering value for publish parameter \"p1\" in '\n 'task \"c2\" (template string={{ not_defined }}):')\n self.assertTrue(expected_error in str(e))\n pass\n else:\n self.fail('Exception was not thrown')", "metadata": "root.TestActionChainRunner.test_chain_runner_publish_param_rendering_failure", "header": "['class', 'TestActionChainRunner', '(', 'DbTestCase', ')', ':', '___EOS___']", "index": 642 }, { "content": " @mock.patch.object(action_db_util, 'get_action_by_ref',\n mock.MagicMock(return_value=None))\n @mock.patch.object(action_service, 'request',\n return_value=(DummyActionExecution(result={'raw_out': 'published'}), None))\n def test_action_chain_runner_referenced_action_doesnt_exist(self, mock_request):\n # Action referenced by a task doesn't exist, should result in a top level error\n chain_runner = acr.get_runner()\n chain_runner.entry_point = CHAIN_WITH_INVALID_ACTION\n chain_runner.action = ACTION_2\n chain_runner.container_service = RunnerContainerService()\n chain_runner.pre_run()\n\n action_parameters = {}\n status, output, _ = chain_runner.run(action_parameters=action_parameters)\n\n expected_error = ('Failed to run task \"c1\". Action with reference \"wolfpack.a2\" '\n 'doesn\\'t exist.')\n self.assertEqual(status, LIVEACTION_STATUS_FAILED)\n self.assertTrue(expected_error in output['error'])\n self.assertTrue('Traceback' in output['traceback'], output['traceback'])", "metadata": "root.TestActionChainRunner.test_action_chain_runner_referenced_action_doesnt_exist", "header": "['class', 'TestActionChainRunner', '(', 'DbTestCase', ')', ':', '___EOS___']", "index": 683 } ]
[ { "span": "self.assertTrue(call_args[0][0].parameters in expected_values)", "start_line": 442, "start_column": 12, "end_line": 442, "end_column": 74 }, { "span": "self.assertTrue(call_args[0][0].parameters in expected_values)", "start_line": 464, "start_column": 12, "end_line": 464, "end_column": 74 }, { "span": "self.assertTrue('error' in result)", "start_line": 498, "start_column": 8, "end_line": 498, "end_column": 42 }, { "span": "self.assertTrue('traceback' in result)", "start_line": 499, "start_column": 8, "end_line": 499, "end_column": 46 }, { "span": "self.assertTrue('Failed to run task \"c1\". Parameter rendering failed' in result['error'])", "start_line": 500, "start_column": 8, "end_line": 500, "end_column": 97 }, { "span": "self.assertTrue('Traceback' in result['traceback'])", "start_line": 501, "start_column": 8, "end_line": 501, "end_column": 59 }, { "span": "self.assertTrue('error' in result)", "start_line": 524, "start_column": 8, "end_line": 524, "end_column": 42 }, { "span": "self.assertTrue('traceback' in result)", "start_line": 525, "start_column": 8, "end_line": 525, "end_column": 46 }, { "span": "self.assertTrue('Failed to run task \"c2\". Parameter rendering failed' in result['error'])", "start_line": 526, "start_column": 8, "end_line": 526, "end_column": 97 }, { "span": "self.assertTrue(expected_error in result['error'])", "start_line": 527, "start_column": 8, "end_line": 527, "end_column": 58 }, { "span": "self.assertTrue('Traceback' in result['traceback'])", "start_line": 528, "start_column": 8, "end_line": 528, "end_column": 59 }, { "span": "self.assertTrue(expected_error in str(e))", "start_line": 662, "start_column": 12, "end_line": 662, "end_column": 53 }, { "span": "self.assertTrue(expected_error in output['error'])", "start_line": 701, "start_column": 8, "end_line": 701, "end_column": 58 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Action", "Chain", "Runner_", "(_", "Db", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "action", "\\u", "db", "\\u", "util_", ",_", "'", "get", "\\u", "action", "\\u", "by", "\\u", "ref", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mock_", "._", "Mag", "ic", "Mock_", "(_", "return", "\\u", "value_", "=_", "ACTI", "ON", "\\u", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "action", "\\u", "service_", ",_", "'", "request", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "value_", "=_", "(_", "Du", "mm", "y", "Action", "Execution_", "(_", "result_", "=_", "{_", "'", "o", "1", "'_", ":_", "'", "1", "'_", "}_", ")_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "chain", "\\u", "runn", "er", "\\u", "dependent", "\\u", "param", "\\u", "temp_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "chain", "\\u", "runner_", "=_", "acr", "_", "._", "get", "\\u", "runner_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "entry", "\\u", "point_", "=_", "CHAIN", "\\u", "DEP", "\\u", "INPUT_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "action_", "=_", "ACTI", "ON", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "container", "\\u", "service_", "=_", "Run", "ner", "Containe", "r", "Service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "pre", "\\u", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "run_", "(_", "{_", "'", "s1", "'_", ":_", "1_", ",_", "'", "s2", "'_", ":_", "2_", ",_", "'", "s3", "'_", ":_", "3_", ",_", "'", "s", "4", "'_", ":_", "4_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "chain", "\\u", "runner_", "._", "chain", "\\u", "holder_", "._", "action", "chain_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "values_", "=_", "[_", "{_", "u", "'", "p1", "'_", ":_", "u", "'", "1", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "u", "'", "p1", "'_", ":_", "u", "'", "1", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "u", "'", "p2", "'_", ":_", "u", "'", "1", "'_", ",_", "u", "'", "p3", "'_", ":_", "u", "'", "1", "'_", ",_", "u", "'", "p1", "'_", ":_", "u", "'", "1", "'_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ea", "ch", " ", "of", " ", "the", " ", "call", "\\u", "args", " ", "must", " ", "be", " ", "one", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "call", "\\u", "args_", "in_", "request_", "._", "call", "\\u", "args", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "call", "\\u", "args_", "[_", "0_", "]_", "[_", "0_", "]_", "._", "parameters_", "in_", "expected", "\\u", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "values_", "._", "remove_", "(_", "call", "\\u", "args_", "[_", "0_", "]_", "[_", "0_", "]_", "._", "parameters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "expected", "\\u", "values_", ")_", ",_", "0_", ",_", "'", "Not", " ", "all", " ", "expected", " ", "values", " ", "receive", "d", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Action", "Chain", "Runner_", "(_", "Db", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "action", "\\u", "db", "\\u", "util_", ",_", "'", "get", "\\u", "action", "\\u", "by", "\\u", "ref", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mock_", "._", "Mag", "ic", "Mock_", "(_", "return", "\\u", "value_", "=_", "ACTI", "ON", "\\u", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "action", "\\u", "service_", ",_", "'", "request", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "value_", "=_", "(_", "Du", "mm", "y", "Action", "Execution_", "(_", "result_", "=_", "{_", "'", "o", "1", "'_", ":_", "'", "1", "'_", "}_", ")_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "chain", "\\u", "runn", "er", "\\u", "dependent", "\\u", "results", "\\u", "param_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "chain", "\\u", "runner_", "=_", "acr", "_", "._", "get", "\\u", "runner_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "entry", "\\u", "point_", "=_", "CHAIN", "\\u", "DEP", "\\u", "RESULTS", "\\u", "INPUT_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "action_", "=_", "ACTI", "ON", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "container", "\\u", "service_", "=_", "Run", "ner", "Containe", "r", "Service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "pre", "\\u", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "run_", "(_", "{_", "'", "s1", "'_", ":_", "1_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "chain", "\\u", "runner_", "._", "chain", "\\u", "holder_", "._", "action", "chain_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "values_", "=_", "[_", "{_", "u", "'", "p1", "'_", ":_", "u", "'", "1", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "u", "'", "p1", "'_", ":_", "u", "'", "1", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "u", "'", "out", "'_", ":_", "u", "\"{", "'", "c2", "':", " ", "{", "'", "o", "1", "':", " ", "'", "1", "'}", ",", " ", "'", "c1", "':", " ", "{", "'", "o", "1", "':", " ", "'", "1", "'}", "}\"_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ea", "ch", " ", "of", " ", "the", " ", "call", "\\u", "args", " ", "must", " ", "be", " ", "one", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "request_", "._", "call", "\\u", "count_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "call", "\\u", "args_", "in_", "request_", "._", "call", "\\u", "args", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "call", "\\u", "args_", "[_", "0_", "]_", "[_", "0_", "]_", "._", "parameters_", "in_", "expected", "\\u", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "values_", "._", "remove_", "(_", "call", "\\u", "args_", "[_", "0_", "]_", "[_", "0_", "]_", "._", "parameters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "expected", "\\u", "values_", ")_", ",_", "0_", ",_", "'", "Not", " ", "all", " ", "expected", " ", "values", " ", "receive", "d", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Action", "Chain", "Runner_", "(_", "Db", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "action", "\\u", "db", "\\u", "util_", ",_", "'", "get", "\\u", "action", "\\u", "by", "\\u", "ref", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mock_", "._", "Mag", "ic", "Mock_", "(_", "return", "\\u", "value_", "=_", "ACTI", "ON", "\\u", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "action", "\\u", "service_", ",_", "'", "request", "'_", ",_", "return", "\\u", "value_", "=_", "(_", "Du", "mm", "y", "Action", "Execution_", "(_", ")_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "chain", "\\u", "runn", "er", "\\u", "fail", "ure", "\\u", "dur", "ing", "\\u", "param", "\\u", "render", "ing", "\\u", "single", "\\u", "task_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Parameter", " ", "render", "ing", " ", "shou", "ld", " ", "result", " ", "in", " ", "a", " ", "top", " ", "level", " ", "error", " ", "whi", "ch", " ", "abort", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "whole", " ", "chain_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "chain", "\\u", "runner_", "=_", "acr", "_", "._", "get", "\\u", "runner_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "entry", "\\u", "point_", "=_", "CHAIN", "\\u", "FIR", "ST", "\\u", "TASK", "\\u", "RENDER", "\\u", "FAIL", "\\u", "PATH_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "action_", "=_", "ACTI", "ON", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "container", "\\u", "service_", "=_", "Run", "ner", "Containe", "r", "Service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "pre", "\\u", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", ",_", "result_", ",_", "\\u_", "=_", "chain", "\\u", "runner_", "._", "run_", "(_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", " ", "task", "s", " ", "ran", " ", "bec", "aus", "e", " ", "render", "ing", " ", "of", " ", "parameter", "s", " ", "for", " ", "the", " ", "first", " ", "task", " ", "failed_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "status_", ",_", "LIVE", "ACTI", "ON", "\\u", "STATUS", "\\u", "FAILED_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", "[_", "'", "task", "s", "'_", "]_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "error", "'_", "in_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "traceback", "'_", "in_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "Fail", "ed", " ", "to", " ", "run", " ", "task", " ", "\"", "c1", "\".", " ", "Parameter", " ", "render", "ing", " ", "fail", "ed", "'_", "in_", "result_", "[_", "'", "error", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "Trace", "back", "'_", "in_", "result_", "[_", "'", "traceback", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Action", "Chain", "Runner_", "(_", "Db", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "action", "\\u", "db", "\\u", "util_", ",_", "'", "get", "\\u", "action", "\\u", "by", "\\u", "ref", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mock_", "._", "Mag", "ic", "Mock_", "(_", "return", "\\u", "value_", "=_", "ACTI", "ON", "\\u", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "action", "\\u", "service_", ",_", "'", "request", "'_", ",_", "return", "\\u", "value_", "=_", "(_", "Du", "mm", "y", "Action", "Execution_", "(_", ")_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "chain", "\\u", "runn", "er", "\\u", "fail", "ure", "\\u", "dur", "ing", "\\u", "param", "\\u", "render", "ing", "\\u", "multiple", "\\u", "tasks_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Parameter", " ", "render", "ing", " ", "shou", "ld", " ", "result", " ", "in", " ", "a", " ", "top", " ", "level", " ", "error", " ", "whi", "ch", " ", "abort", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "whole", " ", "chain_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "chain", "\\u", "runner_", "=_", "acr", "_", "._", "get", "\\u", "runner_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "entry", "\\u", "point_", "=_", "CHAIN", "\\u", "SECOND", "\\u", "TASK", "\\u", "RENDER", "\\u", "FAIL", "\\u", "PATH_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "action_", "=_", "ACTI", "ON", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "container", "\\u", "service_", "=_", "Run", "ner", "Containe", "r", "Service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "pre", "\\u", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", ",_", "result_", ",_", "\\u_", "=_", "chain", "\\u", "runner_", "._", "run_", "(_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Verify", " ", "tha", "t", " ", "only", " ", "first", " ", "task", " ", "has", " ", "ran_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "status_", ",_", "LIVE", "ACTI", "ON", "\\u", "STATUS", "\\u", "FAILED_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "result_", "[_", "'", "task", "s", "'_", "]_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", "[_", "'", "task", "s", "'_", "]_", "[_", "0_", "]_", "[_", "'", "name", "'_", "]_", ",_", "'", "c1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected", "\\u", "error_", "=_", "(_", "'", "Fail", "ed", " ", "render", "ing", " ", "value", " ", "for", " ", "action", " ", "parameter", " ", "\"", "p1", "\"", " ", "in", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "task", " ", "\"", "c2", "\"", " ", "(", "template", " ", "string", "={", "{", "s1", "}}", "):'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "error", "'_", "in_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "traceback", "'_", "in_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "Fail", "ed", " ", "to", " ", "run", " ", "task", " ", "\"", "c2", "\".", " ", "Parameter", " ", "render", "ing", " ", "fail", "ed", "'_", "in_", "result_", "[_", "'", "error", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "expected", "\\u", "error_", "in_", "result_", "[_", "'", "error", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "Trace", "back", "'_", "in_", "result_", "[_", "'", "traceback", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Action", "Chain", "Runner_", "(_", "Db", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "action", "\\u", "db", "\\u", "util_", ",_", "'", "get", "\\u", "action", "\\u", "by", "\\u", "ref", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mock_", "._", "Mag", "ic", "Mock_", "(_", "return", "\\u", "value_", "=_", "ACTI", "ON", "\\u", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "action", "\\u", "service_", ",_", "'", "request", "'_", ",_", "return", "\\u", "value_", "=_", "(_", "Du", "mm", "y", "Action", "Execution_", "(_", ")_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "chain", "\\u", "runn", "er", "\\u", "publi", "sh", "\\u", "param", "\\u", "render", "ing", "\\u", "failure_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Parameter", " ", "render", "ing", " ", "shou", "ld", " ", "result", " ", "in", " ", "a", " ", "top", " ", "level", " ", "error", " ", "whi", "ch", " ", "abort", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "whole", " ", "chain_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "chain", "\\u", "runner_", "=_", "acr", "_", "._", "get", "\\u", "runner_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "entry", "\\u", "point_", "=_", "CHAIN", "\\u", "WITH", "\\u", "PUBLISH", "\\u", "PARAM", "\\u", "RENDER", "ING", "\\u", "FAILURE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "action_", "=_", "ACTI", "ON", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "container", "\\u", "service_", "=_", "Run", "ner", "Containe", "r", "Service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "pre", "\\u", "run_", "(_", ")_", "\\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 ", " _", "chain", "\\u", "runner_", "._", "run_", "(_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Parameter", "Rendering", "Fail", "ed", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Sho", "ul", "d", " ", "we", " ", "treat", " ", "this", " ", "as", " ", "task", " ", "error", "?", " ", "Rig", "ht", " ", "now", " ", "it", " ", "bubble", "s", " ", "all_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "way", " ", "up", " ", "and", " ", "it", "'", "s", " ", "not", " ", "reall", "y", " ", "consistent", " ", "with", " ", "action", " ", "param_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "render", "ing", " ", "failure_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected", "\\u", "error_", "=_", "(_", "'", "Fail", "ed", " ", "render", "ing", " ", "value", " ", "for", " ", "publi", "sh", " ", "parameter", " ", "\"", "p1", "\"", " ", "in", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "task", " ", "\"", "c2", "\"", " ", "(", "template", " ", "string", "={", "{", " ", "not", "\\u", "defin", "ed", " ", "}}", "):'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "expected", "\\u", "error_", "in_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "'", "Except", "ion", " ", "was", " ", "not", " ", "throw", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Action", "Chain", "Runner_", "(_", "Db", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "action", "\\u", "db", "\\u", "util_", ",_", "'", "get", "\\u", "action", "\\u", "by", "\\u", "ref", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mock_", "._", "Mag", "ic", "Mock_", "(_", "return", "\\u", "value_", "=_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "action", "\\u", "service_", ",_", "'", "request", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "value_", "=_", "(_", "Du", "mm", "y", "Action", "Execution_", "(_", "result_", "=_", "{_", "'", "raw", "\\u", "out", "'_", ":_", "'", "publi", "shed", "'_", "}_", ")_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "action", "\\u", "chain", "\\u", "runn", "er", "\\u", "referenced", "\\u", "action", "\\u", "doesnt", "\\u", "exist_", "(_", "self_", ",_", "mock", "\\u", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Action", " ", "referenced", " ", "by", " ", "a", " ", "task", " ", "doe", "sn", "'", "t", " ", "exist", ",", " ", "shou", "ld", " ", "result", " ", "in", " ", "a", " ", "top", " ", "level", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "chain", "\\u", "runner_", "=_", "acr", "_", "._", "get", "\\u", "runner_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "entry", "\\u", "point_", "=_", "CHAIN", "\\u", "WITH", "\\u", "INVALID", "\\u", "ACTION_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "action_", "=_", "ACTI", "ON", "\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "container", "\\u", "service_", "=_", "Run", "ner", "Containe", "r", "Service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "runner_", "._", "pre", "\\u", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "action", "\\u", "parameters_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", ",_", "output_", ",_", "\\u_", "=_", "chain", "\\u", "runner_", "._", "run_", "(_", "action", "\\u", "parameters_", "=_", "action", "\\u", "parameters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected", "\\u", "error_", "=_", "(_", "'", "Fail", "ed", " ", "to", " ", "run", " ", "task", " ", "\"", "c1", "\".", " ", "Action", " ", "with", " ", "reference", " ", "\"", "wolf", "pack", ".", "a2", "\"", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "doe", "sn", "\\\\'", "t", " ", "exist", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "status_", ",_", "LIVE", "ACTI", "ON", "\\u", "STATUS", "\\u", "FAILED_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "expected", "\\u", "error_", "in_", "output_", "[_", "'", "error", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "Trace", "back", "'_", "in_", "output_", "[_", "'", "traceback", "'_", "]_", ",_", "output_", "[_", "'", "traceback", "'_", "]_", ")_", "\\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, 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():\n\n parser = argparse.ArgumentParser(description='Cutout a portion of the database.')\n parser.add_argument('baseurl', action=\"store\")\n parser.add_argument('dataset', action=\"store\")\n parser.add_argument('token', action=\"store\")\n parser.add_argument('resolution', action=\"store\", type=int )\n parser.add_argument('xlow', action=\"store\", type=int )\n parser.add_argument('xhigh', action=\"store\", type=int)\n parser.add_argument('ylow', action=\"store\", type=int)\n parser.add_argument('yhigh', action=\"store\", type=int)\n parser.add_argument('zlow', action=\"store\", type=int)\n parser.add_argument('zhigh', action=\"store\", type=int)\n\n result = parser.parse_args()\n\n url = 'http://' + result.baseurl + '/ca/' + result.dataset + '/npz/' +\\\n str(result.resolution) + \"/\" +\\\n str(result.xlow) + \",\" + str(result.xhigh) + \"/\" +\\\n str(result.ylow) + \",\" + str(result.yhigh) + \"/\" +\\\n str(result.zlow) + \",\" + str(result.zhigh) + \"/\"\\\n\n\n # Grab the bottom corner of the cutout\n xoffset = result.xlow\n yoffset = result.ylow\n zoffset = result.zlow\n\n print \"Getting \", url\n\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 zdata = f.read ()\n\n print \"Retrieved\"\n\n # get the data out of the compressed blob\n pagestr = zlib.decompress ( zdata[:] )\n pagefobj = StringIO.StringIO ( pagestr )\n cube = np.load ( pagefobj )\n\n annodata = np.zeros( [ result.zhigh - result.zlow, result.yhigh - result.ylow, result.xhigh-result.xlow ] )\n\n vec_func = np.vectorize ( lambda x: 0 if x > 30 else 125 ) \n annodata = vec_func ( cube )\n\n print np.nonzero ( annodata )\n\n url = 'http://%s/ca/%s/npz/%s/%s,%s/%s,%s/%s,%s/' % ( result.baseurl, result.token, result.resolution, result.xlow, result.xhigh, result.ylow, result.yhigh, result.zlow, result.zhigh ) \n\n\n # Encode the voxelist an pickle\n fileobj = cStringIO.StringIO ()\n np.save ( fileobj, annodata )\n cdz = zlib.compress (fileobj.getvalue())\n\n print \"Posting to\", url\n\n # Build the post request\n req = urllib2.Request(url, cdz)\n response = urllib2.urlopen(req)\n the_page = response.read()\n\n print \"Done\"", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 23 } ]
[ { "span": "annodata ", "start_line": 69, "start_column": 2, "end_line": 69, "end_column": 10 } ]
[ { "span": "annodata ", "start_line": 72, "start_column": 2, "end_line": 72, "end_column": 10 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[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_", "=_", "'", "Cuto", "ut", " ", "a", " ", "porti", "on", " ", "of", " ", "the", " ", "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_", "(_", "'", "dataset", "'_", ",_", "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_", "(_", "'", "resolu", "tion", "'_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "type_", "=_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "xlo", "w", "'_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "type_", "=_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "xh", "igh", "'_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "type_", "=_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "ylo", "w", "'_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "type_", "=_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "yh", "igh", "'_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "type_", "=_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "zl", "ow", "'_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "type_", "=_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "zhi", "gh", "'_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "type_", "=_", "int_", ")_", "\\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_", "url_", "=_", "'", "http", "://'_", "+_", "result_", "._", "baseurl_", "+_", "'/", "ca", "/'_", "+_", "result_", "._", "dataset_", "+_", "'/", "np", "z", "/'_", "+_", "str_", "(_", "result_", "._", "resolution_", ")_", "+_", "\"/\"_", "+_", "str_", "(_", "result_", "._", "xlo", "w_", ")_", "+_", "\",\"_", "+_", "str_", "(_", "result_", "._", "xh", "igh", "_", ")_", "+_", "\"/\"_", "+_", "str_", "(_", "result_", "._", "ylo", "w_", ")_", "+_", "\",\"_", "+_", "str_", "(_", "result_", "._", "yh", "igh", "_", ")_", "+_", "\"/\"_", "+_", "str_", "(_", "result_", "._", "zl", "ow_", ")_", "+_", "\",\"_", "+_", "str_", "(_", "result_", "._", "zhi", "gh_", ")_", "+_", "\"/\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Grab", " ", "the", " ", "bottom", " ", "corn", "er", " ", "of", " ", "the", " ", "cuto", "ut_", "\\u\\u\\uNL\\u\\u\\u_", "xoff", "set_", "=_", "result_", "._", "xlo", "w_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yoff", "set_", "=_", "result_", "._", "ylo", "w_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zo", "ffset", "_", "=_", "result_", "._", "zl", "ow_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"", "Get", "ting", " ", "\"_", ",_", "url_", "\\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 ", " _", "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\\uDEDENT\\u\\u\\u_", "zd", "ata_", "=_", "f_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"", "Retrieve", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "the", " ", "data", " ", "out", " ", "of", " ", "the", " ", "compress", "ed", " ", "blob_", "\\u\\u\\uNL\\u\\u\\u_", "page", "str_", "=_", "zlib_", "._", "decompress_", "(_", "zd", "ata_", "[_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "fobj_", "=_", "String", "IO_", "._", "String", "IO_", "(_", "page", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cube_", "=_", "np_", "._", "load_", "(_", "page", "fobj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "anno", "data_", "=_", "np_", "._", "zeros_", "(_", "[_", "result_", "._", "zhi", "gh_", "-_", "result_", "._", "zl", "ow_", ",_", "result_", "._", "yh", "igh", "_", "-_", "result_", "._", "ylo", "w_", ",_", "result_", "._", "xh", "igh", "_", "-_", "result_", "._", "xlo", "w_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "vec", "\\u", "func_", "=_", "np_", "._", "vectorize", "_", "(_", "lambda_", "x_", ":_", "0_", "if_", "x_", ">_", "30_", "else_", "125_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "anno", "data_", "=_", "vec", "\\u", "func_", "(_", "cube_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "np_", "._", "nonzero_", "(_", "anno", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'", "http", "://", "%", "s", "/", "ca", "/", "%", "s", "/", "np", "z", "/", "%", "s", "/", "%", "s", ",%", "s", "/", "%", "s", ",%", "s", "/", "%", "s", ",%", "s", "/'_", "%_", "(_", "result_", "._", "baseurl_", ",_", "result_", "._", "token_", ",_", "result_", "._", "resolution_", ",_", "result_", "._", "xlo", "w_", ",_", "result_", "._", "xh", "igh", "_", ",_", "result_", "._", "ylo", "w_", ",_", "result_", "._", "yh", "igh", "_", ",_", "result_", "._", "zl", "ow_", ",_", "result_", "._", "zhi", "gh_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Encode", " ", "the", " ", "voxel", "ist", " ", "an", " ", "pickle_", "\\u\\u\\uNL\\u\\u\\u_", "fileobj_", "=_", "c", "String", "IO_", "._", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "np_", "._", "save_", "(_", "fileobj_", ",_", "anno", "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_", "print_", "\"", "Post", "ing", " ", "to", "\"_", ",_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Build", " ", "the", " ", "post", " ", "request_", "\\u\\u\\uNL\\u\\u\\u_", "req_", "=_", "urllib2_", "._", "Request_", "(_", "url_", ",_", "cd", "z_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "urllib2_", "._", "urlopen_", "(_", "req_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "the", "\\u", "page_", "=_", "response_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"", "Don", "e", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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 ]
Imprecise assert
Miserlou/django-easy-split/easy_split/tests/test_daily_report.py
[ { "content": " def testExperimentGroupParticipantFinder(self):\n days = [datetime.combine(date.today() + timedelta(days=i), time(hour=12))\n for i in range(-7, 0)]\n \n experiment = Experiment(name=\"experiment1\")\n experiment.save()\n experiment.state = Experiment.ENABLED_STATE\n experiment.save()\n experiment.start_date = days[2].date()\n experiment.save()\n \n other_experiment = Experiment(name=\"experiment2\")\n other_experiment.save()\n other_experiment.state = Experiment.DISABLED_STATE\n other_experiment.save()\n other_experiment.start_date = days[0].date()\n other_experiment.end_date = days[4].date()\n other_experiment.save()\n \n anonymous_visitors = [AnonymousVisitor.objects.create() for i in range(10)]\n \n experiment_participant_groups = [\n [\n self.create_participant(anonymous_visitor=anonymous_visitors[0],\n experiment=experiment,\n enrollment_date=days[2],\n group=Participant.TEST_GROUP),\n self.create_participant(anonymous_visitor=anonymous_visitors[1],\n experiment=experiment,\n enrollment_date=days[2],\n group=Participant.CONTROL_GROUP),\n self.create_participant(anonymous_visitor=anonymous_visitors[3],\n experiment=experiment,\n enrollment_date=days[3],\n group=Participant.TEST_GROUP),\n self.create_participant(anonymous_visitor=anonymous_visitors[4],\n experiment=experiment,\n enrollment_date=days[4],\n group=Participant.CONTROL_GROUP),\n self.create_participant(anonymous_visitor=anonymous_visitors[6],\n experiment=experiment,\n enrollment_date=days[6],\n group=Participant.TEST_GROUP)\n ],\n [\n self.create_participant(anonymous_visitor=anonymous_visitors[0],\n experiment=other_experiment,\n enrollment_date=days[0],\n group=Participant.CONTROL_GROUP),\n self.create_participant(anonymous_visitor=anonymous_visitors[2],\n experiment=other_experiment,\n enrollment_date=days[0],\n group=Participant.TEST_GROUP),\n self.create_participant(anonymous_visitor=anonymous_visitors[5],\n experiment=other_experiment,\n enrollment_date=days[4],\n group=Participant.TEST_GROUP)\n ]\n ]\n \n ex1day2 = find_experiment_group_participants(Participant.TEST_GROUP, experiment, days[2])\n ex1day2visitors = [p.anonymous_visitor for p in ex1day2]\n self.assertTrue(anonymous_visitors[0] in ex1day2visitors)\n self.assertEquals(1, len(ex1day2visitors))\n \n ex1day4test = find_experiment_group_participants(Participant.TEST_GROUP, experiment, days[4])\n ex1day4testvisitors = [p.anonymous_visitor for p in ex1day4test]\n self.assertTrue(anonymous_visitors[0] in ex1day4testvisitors)\n self.assertTrue(anonymous_visitors[3] in ex1day4testvisitors)\n self.assertEquals(2, len(ex1day4testvisitors))\n \n ex1day4control = find_experiment_group_participants(Participant.CONTROL_GROUP, experiment, days[4])\n ex1day4controlvisitors = [p.anonymous_visitor for p in ex1day4control]\n self.assertTrue(anonymous_visitors[1] in ex1day4controlvisitors)\n self.assertTrue(anonymous_visitors[4] in ex1day4controlvisitors)\n self.assertEquals(2, len(ex1day4controlvisitors))\n \n ex2day5test = find_experiment_group_participants(Participant.TEST_GROUP, other_experiment, days[5])\n ex2day5testvisitors = [p.anonymous_visitor for p in ex2day5test]\n self.assertTrue(anonymous_visitors[2] in ex2day5testvisitors)\n self.assertTrue(anonymous_visitors[5] in ex2day5testvisitors)\n self.assertEquals(2, len(ex2day5testvisitors))", "metadata": "root.TestDailyReports.testExperimentGroupParticipantFinder", "header": "['class', 'TestDailyReports', '(', 'TestCase', ')', ':', '___EOS___']", "index": 252 }, { "content": " def testGetConversionData(self):\n days = [datetime.combine(date.today() + timedelta(days=i), time(hour=12))\n for i in range(-7, 0)]\n \n yesterday = date.today() - timedelta(days=1)\n experiment = Experiment(name=\"experiment1\")\n experiment.save()\n experiment.state = Experiment.ENABLED_STATE\n experiment.save()\n experiment.start_date = yesterday\n experiment.save()\n \n goal_types = [GoalType.objects.create(name=\"%s\" % i) for i in range(4)]\n \n report = DailyConversionReport.objects.create(experiment=experiment,\n date=yesterday,\n overall_test_conversion=17,\n overall_control_conversion=12,\n test_group_size=139,\n control_group_size=142,\n confidence=87.3)\n \n DailyConversionReportGoalData.objects.create(report=report,\n goal_type=goal_types[0],\n test_conversion=11,\n control_conversion=0,\n confidence=65.3)\n DailyConversionReportGoalData.objects.create(report=report,\n goal_type=goal_types[1],\n test_conversion=0,\n control_conversion=21,\n confidence=None)\n DailyConversionReportGoalData.objects.create(report=report,\n goal_type=goal_types[2],\n test_conversion=23,\n control_conversion=21,\n confidence=100)\n \n data = get_conversion_data(experiment, yesterday)\n \n self.assertEquals(data['date'], yesterday)\n self.assertTrue(\"totals\" in data)\n self.assertTrue(\"goal_types\" in data)\n self.assertEquals(4, len(data[\"goal_types\"].keys()))\n \n for goal_type in goal_types[0:3]:\n self.assertTrue(goal_type.name in data[\"goal_types\"])\n \n goal_type_data = data[\"goal_types\"][goal_type.name]\n self.assertTrue(\"test_count\" in goal_type_data)\n self.assertTrue(\"control_count\" in goal_type_data)\n self.assertTrue(\"test_rate\" in goal_type_data)\n self.assertTrue(\"control_rate\" in goal_type_data)\n self.assertTrue(\"improvement\" in goal_type_data)\n self.assertTrue(\"confidence\" in goal_type_data)\n \n self.assertEquals(None, data[\"goal_types\"][goal_types[3].name])\n \n self.assertEquals(139, data[\"test_group_size\"])\n self.assertEquals(142, data[\"control_group_size\"])\n \n totals = data[\"totals\"]\n \n expected_test_rate = 17. / 139. * 100.\n expected_control_rate = 12. / 142. * 100.\n expected_improvement = (expected_test_rate - expected_control_rate) / expected_control_rate * 100.\n \n self.assertAlmostEquals(expected_test_rate, totals[\"test_rate\"])\n self.assertAlmostEquals(expected_control_rate, totals[\"control_rate\"])\n self.assertAlmostEquals(expected_improvement, totals[\"improvement\"])\n self.assertAlmostEquals(87.3, totals[\"confidence\"])\n self.assertEquals(17, totals[\"test_count\"])\n self.assertEquals(12, totals[\"control_count\"])\n \n self.assertEquals(0, data[\"goal_types\"][goal_types[0].name][\"control_rate\"])\n self.assertAlmostEquals(11./139*100., data[\"goal_types\"][goal_types[0].name][\"test_rate\"])\n self.assertEquals(None, data[\"goal_types\"][goal_types[0].name][\"improvement\"])\n self.assertAlmostEquals(65.3, data[\"goal_types\"][goal_types[0].name][\"confidence\"])\n self.assertEquals(11, data[\"goal_types\"][goal_types[0].name][\"test_count\"])\n self.assertEquals(0, data[\"goal_types\"][goal_types[0].name][\"control_count\"])\n \n self.assertAlmostEquals(21./142*100., data[\"goal_types\"][goal_types[1].name][\"control_rate\"])\n self.assertEquals(None, data[\"goal_types\"][goal_types[1].name][\"confidence\"])\n self.assertEquals(None, data[\"goal_types\"][goal_types[1].name][\"improvement\"])\n \n self.assertAlmostEquals((23./139-21./142)/(21./142)*100.,\n data[\"goal_types\"][goal_types[2].name][\"improvement\"])", "metadata": "root.TestDailyReports.testGetConversionData", "header": "['class', 'TestDailyReports', '(', 'TestCase', ')', ':', '___EOS___']", "index": 335 } ]
[ { "span": "self.assertTrue(anonymous_visitors[0] in ex1day2visitors)", "start_line": 314, "start_column": 8, "end_line": 314, "end_column": 65 }, { "span": "self.assertTrue(anonymous_visitors[0] in ex1day4testvisitors)", "start_line": 319, "start_column": 8, "end_line": 319, "end_column": 69 }, { "span": "self.assertTrue(anonymous_visitors[3] in ex1day4testvisitors)", "start_line": 320, "start_column": 8, "end_line": 320, "end_column": 69 }, { "span": "self.assertTrue(anonymous_visitors[1] in ex1day4controlvisitors)", "start_line": 325, "start_column": 8, "end_line": 325, "end_column": 72 }, { "span": "self.assertTrue(anonymous_visitors[4] in ex1day4controlvisitors)", "start_line": 326, "start_column": 8, "end_line": 326, "end_column": 72 }, { "span": "self.assertTrue(anonymous_visitors[2] in ex2day5testvisitors)", "start_line": 331, "start_column": 8, "end_line": 331, "end_column": 69 }, { "span": "self.assertTrue(anonymous_visitors[5] in ex2day5testvisitors)", "start_line": 332, "start_column": 8, "end_line": 332, "end_column": 69 }, { "span": "self.assertTrue(\"totals\" in data)", "start_line": 376, "start_column": 8, "end_line": 376, "end_column": 41 }, { "span": "self.assertTrue(\"goal_types\" in data)", "start_line": 377, "start_column": 8, "end_line": 377, "end_column": 45 }, { "span": "self.assertTrue(goal_type.name in data[\"goal_types\"])", "start_line": 381, "start_column": 12, "end_line": 381, "end_column": 65 }, { "span": "self.assertTrue(\"test_count\" in goal_type_data)", "start_line": 384, "start_column": 12, "end_line": 384, "end_column": 59 }, { "span": "self.assertTrue(\"control_count\" in goal_type_data)", "start_line": 385, "start_column": 12, "end_line": 385, "end_column": 62 }, { "span": "self.assertTrue(\"test_rate\" in goal_type_data)", "start_line": 386, "start_column": 12, "end_line": 386, "end_column": 58 }, { "span": "self.assertTrue(\"control_rate\" in goal_type_data)", "start_line": 387, "start_column": 12, "end_line": 387, "end_column": 61 }, { "span": "self.assertTrue(\"improvement\" in goal_type_data)", "start_line": 388, "start_column": 12, "end_line": 388, "end_column": 60 }, { "span": "self.assertTrue(\"confidence\" in goal_type_data)", "start_line": 389, "start_column": 12, "end_line": 389, "end_column": 59 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Da", "il", "y", "Report", "s_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Experiment", "Group", "Participant", "Finder_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "days_", "=_", "[_", "datetime_", "._", "combine_", "(_", "date_", "._", "today_", "(_", ")_", "+_", "timedelta_", "(_", "days_", "=_", "i_", ")_", ",_", "time_", "(_", "hour_", "=_", "12_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "-_", "7_", ",_", "0_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "experiment_", "=_", "Experiment_", "(_", "name_", "=_", "\"", "experiment", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "._", "state_", "=_", "Experiment_", "._", "ENABLE", "D", "\\u", "STATE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "._", "start", "\\u", "date_", "=_", "days_", "[_", "2_", "]_", "._", "date_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "other", "\\u", "experiment_", "=_", "Experiment_", "(_", "name_", "=_", "\"", "experiment", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "experiment_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "experiment_", "._", "state_", "=_", "Experiment_", "._", "DISABLED", "\\u", "STATE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "experiment_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "experiment_", "._", "start", "\\u", "date_", "=_", "days_", "[_", "0_", "]_", "._", "date_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "experiment_", "._", "end", "\\u", "date_", "=_", "days_", "[_", "4_", "]_", "._", "date_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "experiment_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "anonym", "ous", "\\u", "visitor", "s_", "=_", "[_", "Ano", "nym", "ous", "Visitor_", "._", "objects_", "._", "create_", "(_", ")_", "for_", "i_", "in_", "range_", "(_", "10_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "experiment", "\\u", "participa", "nt", "\\u", "groups_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "create", "\\u", "participant_", "(_", "anonym", "ous", "\\u", "visitor_", "=_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "experiment_", "=_", "experiment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "enrollment", "\\u", "date_", "=_", "days_", "[_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "group_", "=_", "Participant", "_", "._", "TEST", "\\u", "GROUP_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "create", "\\u", "participant_", "(_", "anonym", "ous", "\\u", "visitor_", "=_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "experiment_", "=_", "experiment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "enrollment", "\\u", "date_", "=_", "days_", "[_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "group_", "=_", "Participant", "_", "._", "CONTR", "OL", "\\u", "GROUP_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "create", "\\u", "participant_", "(_", "anonym", "ous", "\\u", "visitor_", "=_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "3_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "experiment_", "=_", "experiment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "enrollment", "\\u", "date_", "=_", "days_", "[_", "3_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "group_", "=_", "Participant", "_", "._", "TEST", "\\u", "GROUP_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "create", "\\u", "participant_", "(_", "anonym", "ous", "\\u", "visitor_", "=_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "4_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "experiment_", "=_", "experiment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "enrollment", "\\u", "date_", "=_", "days_", "[_", "4_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "group_", "=_", "Participant", "_", "._", "CONTR", "OL", "\\u", "GROUP_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "create", "\\u", "participant_", "(_", "anonym", "ous", "\\u", "visitor_", "=_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "6_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "experiment_", "=_", "experiment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "enrollment", "\\u", "date_", "=_", "days_", "[_", "6_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "group_", "=_", "Participant", "_", "._", "TEST", "\\u", "GROUP_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "create", "\\u", "participant_", "(_", "anonym", "ous", "\\u", "visitor_", "=_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "experiment_", "=_", "other", "\\u", "experiment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "enrollment", "\\u", "date_", "=_", "days_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "group_", "=_", "Participant", "_", "._", "CONTR", "OL", "\\u", "GROUP_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "create", "\\u", "participant_", "(_", "anonym", "ous", "\\u", "visitor_", "=_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "experiment_", "=_", "other", "\\u", "experiment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "enrollment", "\\u", "date_", "=_", "days_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "group_", "=_", "Participant", "_", "._", "TEST", "\\u", "GROUP_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "create", "\\u", "participant_", "(_", "anonym", "ous", "\\u", "visitor_", "=_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "5_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "experiment_", "=_", "other", "\\u", "experiment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "enrollment", "\\u", "date_", "=_", "days_", "[_", "4_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "group_", "=_", "Participant", "_", "._", "TEST", "\\u", "GROUP_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ex", "1d", "ay", "2_", "=_", "find", "\\u", "experiment", "\\u", "group", "\\u", "participants_", "(_", "Participant", "_", "._", "TEST", "\\u", "GROUP_", ",_", "experiment_", ",_", "days_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ex", "1d", "ay", "2v", "isi", "tors_", "=_", "[_", "p_", "._", "anonym", "ous", "\\u", "visitor_", "for_", "p_", "in_", "ex", "1d", "ay", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "0_", "]_", "in_", "ex", "1d", "ay", "2v", "isi", "tors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "1_", ",_", "len_", "(_", "ex", "1d", "ay", "2v", "isi", "tors_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ex", "1d", "ay", "4", "test_", "=_", "find", "\\u", "experiment", "\\u", "group", "\\u", "participants_", "(_", "Participant", "_", "._", "TEST", "\\u", "GROUP_", ",_", "experiment_", ",_", "days_", "[_", "4_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ex", "1d", "ay", "4", "testv", "isi", "tors_", "=_", "[_", "p_", "._", "anonym", "ous", "\\u", "visitor_", "for_", "p_", "in_", "ex", "1d", "ay", "4", "test_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "0_", "]_", "in_", "ex", "1d", "ay", "4", "testv", "isi", "tors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "3_", "]_", "in_", "ex", "1d", "ay", "4", "testv", "isi", "tors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "2_", ",_", "len_", "(_", "ex", "1d", "ay", "4", "testv", "isi", "tors_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ex", "1d", "ay", "4c", "ontr", "ol_", "=_", "find", "\\u", "experiment", "\\u", "group", "\\u", "participants_", "(_", "Participant", "_", "._", "CONTR", "OL", "\\u", "GROUP_", ",_", "experiment_", ",_", "days_", "[_", "4_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ex", "1d", "ay", "4c", "ontr", "ol", "visitor", "s_", "=_", "[_", "p_", "._", "anonym", "ous", "\\u", "visitor_", "for_", "p_", "in_", "ex", "1d", "ay", "4c", "ontr", "ol_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "1_", "]_", "in_", "ex", "1d", "ay", "4c", "ontr", "ol", "visitor", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "4_", "]_", "in_", "ex", "1d", "ay", "4c", "ontr", "ol", "visitor", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "2_", ",_", "len_", "(_", "ex", "1d", "ay", "4c", "ontr", "ol", "visitor", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ex", "2d", "ay", "5", "test_", "=_", "find", "\\u", "experiment", "\\u", "group", "\\u", "participants_", "(_", "Participant", "_", "._", "TEST", "\\u", "GROUP_", ",_", "other", "\\u", "experiment_", ",_", "days_", "[_", "5_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ex", "2d", "ay", "5", "testv", "isi", "tors_", "=_", "[_", "p_", "._", "anonym", "ous", "\\u", "visitor_", "for_", "p_", "in_", "ex", "2d", "ay", "5", "test_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "2_", "]_", "in_", "ex", "2d", "ay", "5", "testv", "isi", "tors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "5_", "]_", "in_", "ex", "2d", "ay", "5", "testv", "isi", "tors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "2_", ",_", "len_", "(_", "ex", "2d", "ay", "5", "testv", "isi", "tors_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Da", "il", "y", "Report", "s_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Get", "Conversion", "Data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "days_", "=_", "[_", "datetime_", "._", "combine_", "(_", "date_", "._", "today_", "(_", ")_", "+_", "timedelta_", "(_", "days_", "=_", "i_", ")_", ",_", "time_", "(_", "hour_", "=_", "12_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "-_", "7_", ",_", "0_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "yesterday", "_", "=_", "date_", "._", "today_", "(_", ")_", "-_", "timedelta_", "(_", "days_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "=_", "Experiment_", "(_", "name_", "=_", "\"", "experiment", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "._", "state_", "=_", "Experiment_", "._", "ENABLE", "D", "\\u", "STATE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "._", "start", "\\u", "date_", "=_", "yesterday", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "goal", "\\u", "types_", "=_", "[_", "Goal", "Type_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "\"%", "s", "\"_", "%_", "i_", ")_", "for_", "i_", "in_", "range_", "(_", "4_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "report_", "=_", "Da", "il", "y", "Conversion", "Report_", "._", "objects_", "._", "create_", "(_", "experiment_", "=_", "experiment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "date_", "=_", "yesterday", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "over", "all", "\\u", "test\\u", "conversion_", "=_", "17_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "over", "all", "\\u", "control", "\\u", "conversion_", "=_", "12_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "group", "\\u", "size_", "=_", "139_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "control", "\\u", "group", "\\u", "size_", "=_", "142_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "confidence_", "=_", "87", ".3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Da", "il", "y", "Conversion", "Report", "Goal", "Data_", "._", "objects_", "._", "create_", "(_", "report_", "=_", "report_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "goal", "\\u", "type_", "=_", "goal", "\\u", "types_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "conversion_", "=_", "11_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "control", "\\u", "conversion_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "confidence_", "=_", "65.", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Da", "il", "y", "Conversion", "Report", "Goal", "Data_", "._", "objects_", "._", "create_", "(_", "report_", "=_", "report_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "goal", "\\u", "type_", "=_", "goal", "\\u", "types_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "conversion_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "control", "\\u", "conversion_", "=_", "21_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "confidence_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Da", "il", "y", "Conversion", "Report", "Goal", "Data_", "._", "objects_", "._", "create_", "(_", "report_", "=_", "report_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "goal", "\\u", "type_", "=_", "goal", "\\u", "types_", "[_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "conversion_", "=_", "23_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "control", "\\u", "conversion_", "=_", "21_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "confidence_", "=_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "get", "\\u", "conve", "rsi", "on", "\\u", "data_", "(_", "experiment_", ",_", "yesterday", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "data_", "[_", "'", "date", "'_", "]_", ",_", "yesterday", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "totals", "\"_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "goal", "\\u", "types", "\"_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "4_", ",_", "len_", "(_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "._", "keys_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "goal", "\\u", "type_", "in_", "goal", "\\u", "types_", "[_", "0_", ":_", "3_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "goal", "\\u", "type_", "._", "name_", "in_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "goal", "\\u", "type", "\\u", "data_", "=_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "type_", "._", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "test\\u", "count", "\"_", "in_", "goal", "\\u", "type", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "control", "\\u", "count", "\"_", "in_", "goal", "\\u", "type", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "test\\u", "rate", "\"_", "in_", "goal", "\\u", "type", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "control", "\\u", "rate", "\"_", "in_", "goal", "\\u", "type", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "improvement", "\"_", "in_", "goal", "\\u", "type", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "confidence", "\"_", "in_", "goal", "\\u", "type", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "None_", ",_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "3_", "]_", "._", "name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "139_", ",_", "data_", "[_", "\"", "test\\u", "group", "\\u", "size", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "142_", ",_", "data_", "[_", "\"", "control", "\\u", "group", "\\u", "size", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "totals_", "=_", "data_", "[_", "\"", "totals", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected", "\\u", "test\\u", "rate_", "=_", "17.", "_", "/_", "139", "._", "*_", "100._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "control", "\\u", "rate_", "=_", "12.", "_", "/_", "142", "._", "*_", "100._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "improvement", "_", "=_", "(_", "expected", "\\u", "test\\u", "rate_", "-_", "expected", "\\u", "control", "\\u", "rate_", ")_", "/_", "expected", "\\u", "control", "\\u", "rate_", "*_", "100._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equals_", "(_", "expected", "\\u", "test\\u", "rate_", ",_", "totals_", "[_", "\"", "test\\u", "rate", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equals_", "(_", "expected", "\\u", "control", "\\u", "rate_", ",_", "totals_", "[_", "\"", "control", "\\u", "rate", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equals_", "(_", "expected", "\\u", "improvement", "_", ",_", "totals_", "[_", "\"", "improvement", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equals_", "(_", "87", ".3_", ",_", "totals_", "[_", "\"", "confidence", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "17_", ",_", "totals_", "[_", "\"", "test\\u", "count", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "12_", ",_", "totals_", "[_", "\"", "control", "\\u", "count", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "0_", ",_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "0_", "]_", "._", "name_", "]_", "[_", "\"", "control", "\\u", "rate", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equals_", "(_", "11.", "_", "/_", "139_", "*_", "100._", ",_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "0_", "]_", "._", "name_", "]_", "[_", "\"", "test\\u", "rate", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "None_", ",_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "0_", "]_", "._", "name_", "]_", "[_", "\"", "improvement", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equals_", "(_", "65.", "3_", ",_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "0_", "]_", "._", "name_", "]_", "[_", "\"", "confidence", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "11_", ",_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "0_", "]_", "._", "name_", "]_", "[_", "\"", "test\\u", "count", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "0_", ",_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "0_", "]_", "._", "name_", "]_", "[_", "\"", "control", "\\u", "count", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equals_", "(_", "21.", "_", "/_", "142_", "*_", "100._", ",_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "1_", "]_", "._", "name_", "]_", "[_", "\"", "control", "\\u", "rate", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "None_", ",_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "1_", "]_", "._", "name_", "]_", "[_", "\"", "confidence", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "None_", ",_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "1_", "]_", "._", "name_", "]_", "[_", "\"", "improvement", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equals_", "(_", "(_", "23.", "_", "/_", "139_", "-_", "21.", "_", "/_", "142_", ")_", "/_", "(_", "21.", "_", "/_", "142_", ")_", "*_", "100._", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "2_", "]_", "._", "name_", "]_", "[_", "\"", "improvement", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
karesansui/karesansui/bin/restart_network_interface.py
[ { "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# This file is part of Karesansui.\n#\n# Copyright (C) 2012 HDE, Inc.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n#\n\nimport os\nimport sys\nimport logging\nimport fcntl\nfrom optparse import OptionParser\n\nfrom ksscommand import KssCommand, KssCommandException, KssCommandOptException\nimport __cmd__\n\ntry:\n import karesansui\n from karesansui import __version__\n from karesansui.lib.utils import load_locale, execute_command\n from karesansui.lib.const import NETWORK_COMMAND\n\nexcept ImportError, e:\n print >>sys.stderr, \"[Error] some packages not found. - %s\" % e\n sys.exit(1)\n\n_ = load_locale()\n\nusage = '%prog [options]'\n\n\n\n\nif __name__ == \"__main__\":\n target = RestartNetworkInterface()\n sys.exit(target.run())\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def getopts():\n optp = OptionParser(usage=usage, version=__version__)\n return optp.parse_args()", "metadata": "root.getopts", "header": "['module', '___EOS___']", "index": 49 }, { "content": "def chkopts(opts):\n return True", "metadata": "root.chkopts", "header": "['module', '___EOS___']", "index": 53 }, { "content": "class RestartNetworkInterface(KssCommand):\n", "metadata": "root.RestartNetworkInterface", "header": "['module', '___EOS___']", "index": 56 }, { "content": " def process(self):\n (opts, args) = getopts()\n chkopts(opts)\n self.up_progress(10)\n\n network_restart_cmd = (NETWORK_COMMAND,\n \"restart\",\n )\n (rc, res) = execute_command(network_restart_cmd)\n if rc != 0:\n raise KssCommandException('Failure restart network.')\n\n return True", "metadata": "root.RestartNetworkInterface.process", "header": "['class', 'RestartNetworkInterface', '(', 'KssCommand', ')', ':', '___EOS___']", "index": 58 } ]
[ { "span": "import os", "start_line": 26, "start_column": 0, "end_line": 26, "end_column": 9 }, { "span": "import logging", "start_line": 28, "start_column": 0, "end_line": 28, "end_column": 14 }, { "span": "import fcntl", "start_line": 29, "start_column": 0, "end_line": 29, "end_column": 12 }, { "span": "from ksscommand import KssCommand, KssCommandException, KssCommandOptException", "start_line": 32, "start_column": 0, "end_line": 32, "end_column": 78 }, { "span": "import karesansui", "start_line": 36, "start_column": 4, "end_line": 36, "end_column": 21 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "file", " ", "is", " ", "part", " ", "of", " ", "Kar", "esa", "nsu", "i", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2012", " ", "HD", "E", ",", " ", "Inc", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Permi", "ssion", " ", "is", " ", "here", "by", " ", "grant", "ed", ",", " ", "free", " ", "of", " ", "charge", ",", " ", "to", " ", "any", " ", "person", " ", "obtain", "ing", " ", "a", " ", "copy_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "this", " ", "software", " ", "and", " ", "associate", "d", " ", "documentation", " ", "files", " ", "(", "the", " ", "\"", "Sof", "twa", "re", "\")", ",", " ", "to", " ", "deal", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "the", " ", "Sof", "twa", "re", " ", "with", "out", " ", "restriction", ",", " ", "inclu", "ding", " ", "with", "out", " ", "limit", "ation", " ", "the", " ", "rights_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "use", ",", " ", "copy", ",", " ", "modif", "y", ",", " ", "merge", ",", " ", "publi", "sh", ",", " ", "distribute", ",", " ", "subli", "cens", "e", ",", " ", "and", "/", "or", " ", "sell", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "copie", "s", " ", "of", " ", "the", " ", "Sof", "twa", "re", ",", " ", "and", " ", "to", " ", "permit", " ", "person", "s", " ", "to", " ", "who", "m", " ", "the", " ", "Sof", "twa", "re", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fur", "nish", "ed", " ", "to", " ", "do", " ", "so", ",", " ", "subject", " ", "to", " ", "the", " ", "follow", "ing", " ", "condition", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "above", " ", "copyr", "ight", " ", "notice", " ", "and", " ", "this", " ", "permissi", "on", " ", "notice", " ", "sha", "ll", " ", "be", " ", "include", "d", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "all", " ", "copie", "s", " ", "or", " ", "substa", "nti", "al", " ", "porti", "ons", " ", "of", " ", "the", " ", "Sof", "twa", "re", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THE", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "\"", "AS", " ", "IS", "\",", " ", "WITH", "OUT", " ", "WAR", "RAN", "TY", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "EXPR", "ESS", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IMPL", "IED", ",", " ", "INC", "LU", "DING", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", " ", "THE", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", " ", "AND", " ", "NON", "INF", "RING", "EME", "NT", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "AUTHOR", "S", " ", "OR", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "CLA", "IM", ",", " ", "DA", "MAGE", "S", " ", "OR", " ", "OTHER", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "AN", " ", "ACTI", "ON", " ", "OF", " ", "CONTR", "ACT", ",", " ", "TOR", "T", " ", "OR", " ", "OTHER", "WI", "SE", ",", " ", "ARI", "SIN", "G", " ", "FROM", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "OUT", " ", "OF", " ", "OR", " ", "IN", " ", "CONNECTION", " ", "WITH", " ", "THE", " ", "SOFT", "WARE", " ", "OR", " ", "THE", " ", "USE", " ", "OR", " ", "OTHER", " ", "DEA", "LING", "S", " ", "IN_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THE", " ", "SOFT", "WARE", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "fcntl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "optparse_", "import_", "Optio", "n", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "ks", "sco", "mmand", "_", "import_", "Ks", "s", "Command_", ",_", "Ks", "s", "Command", "Exception_", ",_", "Ks", "s", "Command", "Opt", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "\\u\\u", "cmd", "\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "kar", "esa", "nsu", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kar", "esa", "nsu", "i_", "import_", "\\u\\u", "version\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kar", "esa", "nsu", "i_", "._", "lib_", "._", "utils_", "import_", "load", "\\u", "locale_", ",_", "execute", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kar", "esa", "nsu", "i_", "._", "lib_", "._", "const_", "import_", "NET", "WORK", "\\u", "COMMAND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "\"[", "Error", "]", " ", "some", " ", "package", "s", " ", "not", " ", "found", ".", " ", "-", " ", "%", "s", "\"_", "%_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u_", "=_", "load", "\\u", "locale_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "usage_", "=_", "'%", "prog", " ", "[", "options", "]'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target_", "=_", "Restart", "Network", "Interface_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "target_", "._", "run_", "(_", ")_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "getop", "ts_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opt", "p_", "=_", "Optio", "n", "Parser_", "(_", "usage_", "=_", "usage_", ",_", "version_", "=_", "\\u\\u", "version\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "opt", "p_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\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_", "chk", "opts_", "(_", "opts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Restart", "Network", "Interface_", "(_", "Ks", "s", "Command_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Restart", "Network", "Interface_", "(_", "Ks", "s", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "process_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "opts_", ",_", "args_", ")_", "=_", "getop", "ts_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chk", "opts_", "(_", "opts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "up", "\\u", "progress_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "network", "\\u", "restart", "\\u", "cmd_", "=_", "(_", "NET", "WORK", "\\u", "COMMAND_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "restart", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "rc_", ",_", "res_", ")_", "=_", "execute", "\\u", "command_", "(_", "network", "\\u", "restart", "\\u", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "rc_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
amrdraz/kodr/app/brython/www/src/Lib/test/test_timeit.py
[ { "content": " def test_main_exception(self):\n with captured_stderr() as error_stringio:\n s = self.run_main(switches=['1/0'])\n self.assert_exc_string(error_stringio.getvalue(), 'ZeroDivisionError')", "metadata": "root.TestTimeit.test_main_exception", "header": "['class', 'TestTimeit', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 290 }, { "content": " def test_main_exception_fixed_reps(self):\n with captured_stderr() as error_stringio:\n s = self.run_main(switches=['-n1', '1/0'])\n self.assert_exc_string(error_stringio.getvalue(), 'ZeroDivisionError')", "metadata": "root.TestTimeit.test_main_exception_fixed_reps", "header": "['class', 'TestTimeit', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 295 } ]
[ { "span": "s ", "start_line": 292, "start_column": 12, "end_line": 292, "end_column": 13 }, { "span": "s ", "start_line": 297, "start_column": 12, "end_line": 297, "end_column": 13 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Time", "it_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "main", "\\u", "exception_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "captured", "\\u", "stderr_", "(_", ")_", "as_", "error", "\\u", "string", "io_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "self_", "._", "run", "\\u", "main_", "(_", "switches_", "=_", "[_", "'", "1", "/", "0", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "\\u", "exc", "\\u", "string_", "(_", "error", "\\u", "string", "io_", "._", "getvalue_", "(_", ")_", ",_", "'", "Zero", "Divis", "ion", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Time", "it_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "main", "\\u", "exception", "\\u", "fixed", "\\u", "reps_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "captured", "\\u", "stderr_", "(_", ")_", "as_", "error", "\\u", "string", "io_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "self_", "._", "run", "\\u", "main_", "(_", "switches_", "=_", "[_", "'-", "n1", "'_", ",_", "'", "1", "/", "0", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "\\u", "exc", "\\u", "string_", "(_", "error", "\\u", "string", "io_", "._", "getvalue_", "(_", ")_", ",_", "'", "Zero", "Divis", "ion", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
aellerton/demo-allauth-bootstrap/allauthdemo/auth/admin.py
[ { "content": "from django.contrib import admin\n#from django.utils.html import format_html_join\n#from django.utils.safestring import mark_safe\n#from django.utils.encoding import python_2_unicode_compatible\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.contrib.auth.admin import UserAdmin\ntry:\n from django.utils.encoding import force_text\nexcept ImportError:\n from django.utils.encoding import force_unicode as force_text\n\nfrom .models import DemoUser, UserProfile\nfrom .forms import DemoUserAdminForm\n\n\n\n\nadmin.site.register(UserProfile, UserProfileAdmin)\n\n\n\n\n\n\n\n\n# *** NOTE ***\n# As the site uses email instead of username, I'm changing how a User object\n# displays or identifies itself in admin. The default in Django (file is\n# lib/python2.7/site-packages/django/contrib/auth/models.py) is\n#\n# def __str__(self):\n# return self.get_username()\n#\n# def natural_key(self):\n# return (self.get_username(),)\n#\n# I'm overriding that a cheap way. I'm not sure if I should replace the entire\n# User object ... might be better.\n#\n#User.__unicode__ = lambda(u): u.email\n#User.natural_key = lambda(u): (u.email,)\n\n#admin.site.unregister(DjangoDefaultUser)\nadmin.site.register(DemoUser, DemoUserAdmin)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class UserProfileAdmin(admin.ModelAdmin):\n search_fields = ('user', 'dob')\n ordering = ('user',)\n list_select_related = ('user',)", "metadata": "root.UserProfileAdmin", "header": "['module', '___EOS___']", "index": 15 }, { "content": "class UserProfileAdminInline(admin.TabularInline):\n model = UserProfile", "metadata": "root.UserProfileAdminInline", "header": "['module', '___EOS___']", "index": 24 }, { "content": "class DemoUserAdmin(UserAdmin):\n \"\"\"The project uses a custom User model, so it uses a custom User admin model.\n\n Some related notes at:\n https://github.com/dabapps/django-email-as-username/blob/master/emailusernames/admin.py\n\n And:\n .../lib/python2.7/site-packages/django/contrib/auth/admin.py\n \"\"\"\n\n inlines = [\n UserProfileAdminInline,\n ]\n\n #readonly_fields = ('private_uuid', 'public_id')\n\n fieldsets = (\n (None, {'fields': ('email', 'password')}),\n (_('Personal info'), {'fields': ('first_name', 'last_name', 'display_name')}),\n (_('Permissions'), {'fields': ('is_active', 'is_staff', 'is_superuser',\n 'groups', 'user_permissions')}),\n (_('Important dates'), {'fields': ('last_login', 'date_joined')}),\n #(_('Ids'), {'fields': ('private_uuid', 'public_id')}),\n )\n\n add_fieldsets = (\n (None, {\n 'classes': ('wide',),\n 'fields': ('email', 'password1', 'password2')}\n ),\n )\n list_display = ('email', 'first_name', 'last_name', 'display_name', 'is_staff')\n search_fields = ('first_name', 'last_name', 'display_name', 'email')\n ordering = ('email',)\n\n form = DemoUserAdminForm", "metadata": "root.DemoUserAdmin", "header": "['module', '___EOS___']", "index": 28 } ]
[ { "span": "from django.utils.encoding import force_text", "start_line": 7, "start_column": 4, "end_line": 7, "end_column": 48 }, { "span": "from django.utils.encoding import force_unicode as force_text", "start_line": 9, "start_column": 4, "end_line": 9, "end_column": 65 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "contrib_", "import_", "admin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "from", " ", "django", ".", "util", "s", ".", "html", " ", "import", " ", "format\\u", "html", "\\u", "join_", "\\u\\u\\uNL\\u\\u\\u_", "#", "from", " ", "django", ".", "util", "s", ".", "safe", "string", " ", "import", " ", "mark", "\\u", "safe_", "\\u\\u\\uNL\\u\\u\\u_", "#", "from", " ", "django", ".", "util", "s", ".", "encoding", " ", "import", " ", "python", "\\u", "2", "\\u", "unicode", "\\u", "compatible_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "translation_", "import_", "uge", "ttext", "\\u", "lazy_", "as_", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "._", "admin_", "import_", "User", "Admin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "django_", "._", "utils_", "._", "encoding_", "import_", "force", "\\u", "text_", "\\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_", "._", "encoding_", "import_", "force", "\\u", "unicode_", "as_", "force", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "._", "models_", "import_", "Demo", "User_", ",_", "User", "Profile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "forms_", "import_", "Demo", "User", "Admi", "n", "Form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "admin_", "._", "site_", "._", "register_", "(_", "User", "Profile_", ",_", "User", "Profil", "e", "Admin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "***", " ", "NOTE", " ", "***", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "As", " ", "the", " ", "site", " ", "use", "s", " ", "email", " ", "inst", "ead", " ", "of", " ", "user", "name", ",", " ", "I", "'", "m", " ", "chang", "ing", " ", "how", " ", "a", " ", "User", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "display", "s", " ", "or", " ", "identifi", "es", " ", "its", "elf", " ", "in", " ", "admin", ".", " ", "The", " ", "default", " ", "in", " ", "Dj", "ang", "o", " ", "(", "file", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "lib", "/", "python", "2.7", "/", "site", "-", "package", "s", "/", "django", "/", "contrib", "/", "auth", "/", "model", "s", ".", "py", ")", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "def", " ", "\\u\\u", "str", "\\u\\u", "(", "self", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "return", " ", "self", ".", "get", "\\u", "user", "name", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "def", " ", "natur", "al", "\\u", "key", "(", "self", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "return", " ", "(", "self", ".", "get", "\\u", "user", "name", "()", ",)", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "I", "'", "m", " ", "overrid", "ing", " ", "tha", "t", " ", "a", " ", "che", "ap", " ", "way", ".", " ", "I", "'", "m", " ", "not", " ", "sure", " ", "if", " ", "I", " ", "shou", "ld", " ", "replace", " ", "the", " ", "entire", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "User", " ", "object", " ", "...", " ", "mig", "ht", " ", "be", " ", "bett", "er", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "User", ".\\u", "\\u", "unicode", "\\u\\u", " ", "=", " ", "lambda", "(", "u", "):", " ", "u", ".", "email_", "\\u\\u\\uNL\\u\\u\\u_", "#", "User", ".", "natur", "al", "\\u", "key", " ", "=", " ", "lambda", "(", "u", "):", " ", "(", "u", ".", "email", ",)", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "admin", ".", "site", ".", "unregister", "(", "Dj", "ang", "o", "Default", "User", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "admin_", "._", "site_", "._", "register_", "(_", "Demo", "User_", ",_", "Demo", "User", "Admin_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "User", "Profil", "e", "Admin_", "(_", "admin_", "._", "Model", "Admin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "search", "\\u", "fields_", "=_", "(_", "'", "user", "'_", ",_", "'", "dob", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ordering_", "=_", "(_", "'", "user", "'_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list", "\\u", "select", "\\u", "related_", "=_", "(_", "'", "user", "'_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "User", "Profil", "e", "Admi", "n", "Inline_", "(_", "admin_", "._", "Tab", "ular", "Inline_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "User", "Profile_", "\\u\\u\\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_", "Demo", "User", "Admin_", "(_", "User", "Admin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "The", " ", "project", " ", "use", "s", " ", "a", " ", "custom", " ", "User", " ", "model", ",", " ", "so", " ", "it", " ", "use", "s", " ", "a", " ", "custom", " ", "User", " ", "admin", " ", "model", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Some", " ", "relate", "d", " ", "note", "s", " ", "at", ":", "\\", "10", ";", " ", " ", " ", " ", "https", "://", "git", "hub", ".", "com", "/", "dab", "apps", "/", "django", "-", "email", "-", "as", "-", "user", "name", "/", "blob", "/", "master", "/", "email", "usernames", "/", "admin", ".", "py", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "And", ":", "\\", "10", ";", " ", " ", " ", " ", "...", "/", "lib", "/", "python", "2.7", "/", "site", "-", "package", "s", "/", "django", "/", "contrib", "/", "auth", "/", "admin", ".", "py", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "inlines_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "User", "Profil", "e", "Admi", "n", "Inline_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "read", "only", "\\u", "fields", " ", "=", " ", "('", "private", "\\u", "uuid", "',", " ", "'", "public", "\\u", "id", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fieldsets_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "None_", ",_", "{_", "'", "fields", "'_", ":_", "(_", "'", "email", "'_", ",_", "'", "password", "'_", ")_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\\u_", "(_", "'", "Persona", "l", " ", "info", "'_", ")_", ",_", "{_", "'", "fields", "'_", ":_", "(_", "'", "first", "\\u", "name", "'_", ",_", "'", "last", "\\u", "name", "'_", ",_", "'", "display", "\\u", "name", "'_", ")_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\\u_", "(_", "'", "Permi", "ssion", "s", "'_", ")_", ",_", "{_", "'", "fields", "'_", ":_", "(_", "'", "is", "\\u", "active", "'_", ",_", "'", "is", "\\u", "sta", "ff", "'_", ",_", "'", "is", "\\u", "super", "user", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ",_", "'", "user", "\\u", "permissi", "ons", "'_", ")_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\\u_", "(_", "'", "Importa", "nt", " ", "dates", "'_", ")_", ",_", "{_", "'", "fields", "'_", ":_", "(_", "'", "last", "\\u", "login", "'_", ",_", "'", "date", "\\u", "joine", "d", "'_", ")_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#(", "\\u(", "'", "Id", "s", "')", ",", " ", "{", "'", "fields", "':", " ", "('", "private", "\\u", "uuid", "',", " ", "'", "public", "\\u", "id", "')", "})", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "add", "\\u", "fieldsets_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "None_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "classe", "s", "'_", ":_", "(_", "'", "wide", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fields", "'_", ":_", "(_", "'", "email", "'_", ",_", "'", "password", "1", "'_", ",_", "'", "password", "2", "'_", ")_", "}_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list", "\\u", "display_", "=_", "(_", "'", "email", "'_", ",_", "'", "first", "\\u", "name", "'_", ",_", "'", "last", "\\u", "name", "'_", ",_", "'", "display", "\\u", "name", "'_", ",_", "'", "is", "\\u", "sta", "ff", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "search", "\\u", "fields_", "=_", "(_", "'", "first", "\\u", "name", "'_", ",_", "'", "last", "\\u", "name", "'_", ",_", "'", "display", "\\u", "name", "'_", ",_", "'", "email", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ordering_", "=_", "(_", "'", "email", "'_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "form_", "=_", "Demo", "User", "Admi", "n", "Form_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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,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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 ]
Unused import
rwalk333/straw/aws_config/configure/configure_kafka.py
[ { "content": "#!/usr/bin/python3\n#\n# Configure Kafka on ec2 instances\n#\n\nimport boto3, os, sys\nfrom botocore.exceptions import ClientError as BotoClientError\nfrom time import sleep\nsys.path.append(\"..\")\nfrom create_clusters import get_tag, keyfile\n\n# configuration\nmy_instances_filters = [{ 'Name': 'instance-state-name', 'Values': ['running']}, {'Name':'tag-value', 'Values':[get_tag('kafka-node')]}]\n\nif __name__==\"__main__\":\n \n # find all the host nodes\n ec2 = boto3.resource('ec2')\n hosts = []\n private_ips = []\n reservations = ec2.instances.filter( Filters = my_instances_filters )\n for instance in reservations:\n print(\"ID: {0:<15}\\tIP: {1:<15}\".format(instance.instance_id, instance.public_ip_address))\n hosts.append(instance.public_ip_address)\n private_ips.append(instance.private_ip_address)\n\n if len(hosts) != len(private_ips):\n raise(RuntimeError(\"Host and private ips not consistent!\"))\n\n if len(hosts) == 0:\n raise(RuntimeError(\"No hosts found.\"))\n\n #######################################################################\n # ZOOKEEPER\n ####################################################################### \n # just a little hacking to inject some settings into the templates\n # TODO: parallelize this to save some boot time\n print(\"Starting zookeeper configuration...\")\n zooid = 1\n for h in hosts:\n cmd_str = []\n with open(\"templates/zoo.cfg.tmp\", \"w\") as tmpfile:\n with open(\"templates/zoo.cfg\",\"r\") as f:\n # copy over the template\n for l in f:\n tmpfile.write(l)\n\n # append the server settings\n host_strings= [\"server.{0}={1}:2888:3888\".format(i+1,private_ips[i]) for i in range(len(hosts))]\n for s in host_strings:\n tmpfile.write(s + \"\\n\")\n cmd_str.append(\"scp -i {0} {1} ubuntu@{2}:zoo.cfg\".format(keyfile, tmpfile.name, h))\n cmd_str.append(\"ssh -i {0} ubuntu@{1} sudo mv zoo.cfg /etc/zookeeper/conf/zoo.cfg\".format(keyfile, h))\n\n # Assign the zookeeper ids\n cmd_str.append(\"ssh -i {0} ubuntu@{1} \\\" echo 'echo {2} > /var/lib/zookeeper/myid' | sudo -s\\\" \".format(keyfile, h, zooid))\n zooid+=1\n\n # execute the remote commands\n for cmd in cmd_str:\n print(cmd)\n res=os.system(cmd)\n if res!=0:\n raise(RuntimeError(\"Something went wrong executing {0} Got exit: {1}\".format(cmd, res)))\n\n # start each zookeeper\n cmd_str = [\"ssh -i {0} ubuntu@{1} sudo service zookeeper restart\".format(keyfile, h) for h in hosts]\n for cmd in cmd_str:\n print(cmd)\n res=os.system(cmd)\n if res!=0:\n raise(RuntimeError(\"Something went wrong executing {0} Got exit: {1}\".format(cmd, res))) \n\n #######################################################################\n # Kafka\n #######################################################################\n print(\"Starting kafka configuration...\")\n broker_id = 0\n kafka_start_script = \"templates/kafka-server-start.sh\"\n for i,h in enumerate(hosts):\n cmd_str = []\n with open(\"templates/kafka.server.properties.tmp\", \"w\") as tmpfile:\n with open(\"templates/kafka.server.properties\",\"r\") as f:\n # copy over the template\n for l in f:\n tmpfile.write(l)\n\n # advertise host's private IP\n # tmpfile.write(\"advertised.host.name: {0}\\n\".format(h))\n \n # add zookeeper info\n host_strings= [\"{0}:2181\".format(private_ips[i]) for i in range(len(hosts))]\n tmpfile.write(\"zookeeper.connect={0}\\n\".format(\",\".join(host_strings)))\n \n # set broker id\n tmpfile.write(\"broker.id={0}\\n\".format(broker_id))\n broker_id+=1\n \n # add commands to queue\n cmd_str.append(\"scp -i {0} {1} ubuntu@{2}:server.properties\".format(keyfile, tmpfile.name, h))\n cmd_str.append(\"ssh -i {0} ubuntu@{1} sudo mv server.properties /usr/local/kafka/config/server.properties\".format(keyfile, h))\n cmd_str.append(\"scp -i {0} {1} ubuntu@{2}:kafka-server-start.sh\".format(keyfile, kafka_start_script, h))\n cmd_str.append(\"ssh -i {0} ubuntu@{1} sudo mv kafka-server-start.sh /usr/local/kafka/bin/kafka-server-start.sh \".format(keyfile, h))\n\n # execute the remote commands\n for cmd in cmd_str:\n print(cmd)\n res=os.system(cmd)\n if res!=0:\n raise(RuntimeError(\"Something went wrong executing {0} Got exit: {1}\".format(cmd, res)))\n\n # start each kafka\n cmd_str = [\"ssh -i {0} ubuntu@{1} \\\"nohup sudo /usr/local/kafka/bin/kafka-server-start.sh /usr/local/kafka/config/server.properties < /dev/null > std.out 2> std.err &\\\"\".format(keyfile, h) for h in hosts]\n\n for cmd in cmd_str:\n print(cmd)\n res=os.system(cmd)\n if res!=0:\n raise(RuntimeError(\"Something went wrong executing {0} Got exit: {1}\".format(cmd, res)))\n\n\n # create the documents and queries topics on one of the Kafka nodes\n \n h = hosts[0]\n cmd_str = [\"ssh -i {0} ubuntu@{1} /usr/local/kafka/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor {2} --partitions {3} --topic documents\".format(keyfile, h, 2, 5), \"ssh -i {0} ubuntu@{1} /usr/local/kafka/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor {2} --partitions {3} --topic queries\".format(keyfile, h, 3, 1)]\n \n for cmd in cmd_str:\n print(cmd)\n res=os.system(cmd)\n if res!=0:\n raise(RuntimeError(\"Something went wrong executing {0} Got exit: {1}\".format(cmd, res)))\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from botocore.exceptions import ClientError as BotoClientError", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 62 }, { "span": "from time import sleep", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 22 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python", "3_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Configure", " ", "Ka", "fk", "a", " ", "on", " ", "ec", "2", " ", "instances_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "boto3_", ",_", "os_", ",_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "botocore", "_", "._", "exceptions_", "import_", "Client", "Error_", "as_", "Bot", "o", "Client", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "time_", "import_", "sleep_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "\"..\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "create", "\\u", "clusters_", "import_", "get", "\\u", "tag_", ",_", "keyfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "configuration_", "\\u\\u\\uNL\\u\\u\\u_", "my", "\\u", "instance", "s", "\\u", "filters_", "=_", "[_", "{_", "'", "Name", "'_", ":_", "'", "instance", "-", "state", "-", "name", "'_", ",_", "'", "Value", "s", "'_", ":_", "[_", "'", "runn", "ing", "'_", "]_", "}_", ",_", "{_", "'", "Name", "'_", ":_", "'", "tag", "-", "value", "'_", ",_", "'", "Value", "s", "'_", ":_", "[_", "get", "\\u", "tag_", "(_", "'", "kaf", "ka", "-", "node", "'_", ")_", "]_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "find", " ", "all", " ", "the", " ", "host", " ", "nodes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ec2_", "=_", "boto3_", "._", "resource_", "(_", "'", "ec", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hosts_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "private", "\\u", "ips_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reservations_", "=_", "ec2_", "._", "instances_", "._", "filter_", "(_", "Filters_", "=_", "my", "\\u", "instance", "s", "\\u", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "instance_", "in_", "reservations_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "ID", ":", " ", "{", "0", ":", "<", "15", "}\\\\", "t", "IP", ":", " ", "{", "1", ":", "<", "15", "}\"_", "._", "format_", "(_", "instance_", "._", "instance", "\\u", "id_", ",_", "instance_", "._", "public", "\\u", "ip", "\\u", "address_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hosts_", "._", "append_", "(_", "instance_", "._", "public", "\\u", "ip", "\\u", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "private", "\\u", "ips_", "._", "append_", "(_", "instance_", "._", "private", "\\u", "ip", "\\u", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "hosts_", ")_", "!=_", "len_", "(_", "private", "\\u", "ips_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "(_", "Run", "time", "Error_", "(_", "\"", "Host", " ", "and", " ", "private", " ", "ips", " ", "not", " ", "consistent", "!\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "hosts_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "(_", "Run", "time", "Error_", "(_", "\"", "No", " ", "host", "s", " ", "found", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#####", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "ZOO", "KEEP", "ER_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#####", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "just", " ", "a", " ", "litt", "le", " ", "hack", "ing", " ", "to", " ", "inject", " ", "some", " ", "settings", " ", "int", "o", " ", "the", " ", "templates_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "paralleliz", "e", " ", "this", " ", "to", " ", "save", " ", "some", " ", "boot", " ", "time_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "\"", "Start", "ing", " ", "zookeeper", " ", "configura", "tion", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zoo", "id_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "h_", "in_", "hosts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd", "\\u", "str_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "\"", "template", "s", "/", "zoo", ".", "cfg", ".", "tmp", "\"_", ",_", "\"", "w", "\"_", ")_", "as_", "tmpfile_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "\"", "template", "s", "/", "zoo", ".", "cfg", "\"_", ",_", "\"", "r", "\"_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "copy", " ", "over", " ", "the", " ", "template_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "l_", "in_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "tmpfile_", "._", "write_", "(_", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "append", " ", "the", " ", "server", " ", "settings_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "host", "\\u", "strings_", "=_", "[_", "\"", "server", ".", "{", "0", "}=", "{", "1", "}:", "288", "8", ":", "388", "8", "\"_", "._", "format_", "(_", "i_", "+_", "1_", ",_", "private", "\\u", "ips_", "[_", "i_", "]_", ")_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "hosts_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "s_", "in_", "host", "\\u", "strings_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "tmpfile_", "._", "write_", "(_", "s_", "+_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmd", "\\u", "str_", "._", "append_", "(_", "\"", "scp", " ", "-", "i", " ", "{", "0", "}", " ", "{", "1", "}", " ", "ubu", "ntu", "@{", "2", "}:", "zoo", ".", "cfg", "\"_", "._", "format_", "(_", "keyfile_", ",_", "tmpfile_", "._", "name_", ",_", "h_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd", "\\u", "str_", "._", "append_", "(_", "\"", "ssh", " ", "-", "i", " ", "{", "0", "}", " ", "ubu", "ntu", "@{", "1", "}", " ", "sudo", " ", "mv", " ", "zoo", ".", "cfg", " ", "/", "etc", "/", "zookeeper", "/", "conf", "/", "zoo", ".", "cfg", "\"_", "._", "format_", "(_", "keyfile_", ",_", "h_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Assign", " ", "the", " ", "zookeeper", " ", "ids_", "\\u\\u\\uNL\\u\\u\\u_", "cmd", "\\u", "str_", "._", "append_", "(_", "\"", "ssh", " ", "-", "i", " ", "{", "0", "}", " ", "ubu", "ntu", "@{", "1", "}", " ", "\\\\\"", " ", "echo", " ", "'", "echo", " ", "{", "2", "}", " ", ">", " ", "/", "var", "/", "lib", "/", "zookeeper", "/", "myid", "'", " ", "|", " ", "sudo", " ", "-", "s", "\\\\\"", " ", "\"_", "._", "format_", "(_", "keyfile_", ",_", "h_", ",_", "zoo", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zoo", "id_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "execute", " ", "the", " ", "remote", " ", "commands_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "cmd_", "in_", "cmd", "\\u", "str_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "os_", "._", "system_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "(_", "Run", "time", "Error_", "(_", "\"", "Some", "thing", " ", "wen", "t", " ", "wrong", " ", "executi", "ng", " ", "{", "0", "}", " ", " ", "Got", " ", "exit", ":", " ", "{", "1", "}\"_", "._", "format_", "(_", "cmd_", ",_", "res_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "start", " ", "each", " ", "zookeeper", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmd", "\\u", "str_", "=_", "[_", "\"", "ssh", " ", "-", "i", " ", "{", "0", "}", " ", "ubu", "ntu", "@{", "1", "}", " ", "sudo", " ", "service", " ", "zookeeper", " ", "restart", "\"_", "._", "format_", "(_", "keyfile_", ",_", "h_", ")_", "for_", "h_", "in_", "hosts_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "cmd_", "in_", "cmd", "\\u", "str_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "os_", "._", "system_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "(_", "Run", "time", "Error_", "(_", "\"", "Some", "thing", " ", "wen", "t", " ", "wrong", " ", "executi", "ng", " ", "{", "0", "}", " ", " ", "Got", " ", "exit", ":", " ", "{", "1", "}\"_", "._", "format_", "(_", "cmd_", ",_", "res_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#####", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Ka", "fk", "a_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#####", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "\"", "Start", "ing", " ", "kaf", "ka", " ", "configura", "tion", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broker", "\\u", "id_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kaf", "ka", "\\u", "start", "\\u", "script_", "=_", "\"", "template", "s", "/", "kaf", "ka", "-", "server", "-", "start", ".", "sh", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "h_", "in_", "enumerate_", "(_", "hosts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd", "\\u", "str_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "\"", "template", "s", "/", "kaf", "ka", ".", "server", ".", "proper", "ties", ".", "tmp", "\"_", ",_", "\"", "w", "\"_", ")_", "as_", "tmpfile_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "\"", "template", "s", "/", "kaf", "ka", ".", "server", ".", "proper", "ties", "\"_", ",_", "\"", "r", "\"_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "copy", " ", "over", " ", "the", " ", "template_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "l_", "in_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "tmpfile_", "._", "write_", "(_", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "advertise", " ", "host", "'", "s", " ", "private", " ", "IP_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tmpfile", ".", "write", "(\"", "advertise", "d", ".", "host", ".", "name", ":", " ", "{", "0", "}\\\\", "n", "\".", "format", "(", "h", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "zookeeper", " ", "info_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "host", "\\u", "strings_", "=_", "[_", "\"{", "0", "}:", "218", "1", "\"_", "._", "format_", "(_", "private", "\\u", "ips_", "[_", "i_", "]_", ")_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "hosts_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmpfile_", "._", "write_", "(_", "\"", "zookeeper", ".", "connect", "={", "0", "}\\\\", "n", "\"_", "._", "format_", "(_", "\",\"_", "._", "join_", "(_", "host", "\\u", "strings_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", " ", "broker", " ", "id_", "\\u\\u\\uNL\\u\\u\\u_", "tmpfile_", "._", "write_", "(_", "\"", "broker", ".", "id", "={", "0", "}\\\\", "n", "\"_", "._", "format_", "(_", "broker", "\\u", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broker", "\\u", "id_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "command", "s", " ", "to", " ", "queue_", "\\u\\u\\uNL\\u\\u\\u_", "cmd", "\\u", "str_", "._", "append_", "(_", "\"", "scp", " ", "-", "i", " ", "{", "0", "}", " ", "{", "1", "}", " ", "ubu", "ntu", "@{", "2", "}:", "server", ".", "proper", "ties", "\"_", "._", "format_", "(_", "keyfile_", ",_", "tmpfile_", "._", "name_", ",_", "h_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd", "\\u", "str_", "._", "append_", "(_", "\"", "ssh", " ", "-", "i", " ", "{", "0", "}", " ", "ubu", "ntu", "@{", "1", "}", " ", "sudo", " ", "mv", " ", "server", ".", "proper", "ties", " ", "/", "usr", "/", "local", "/", "kaf", "ka", "/", "config", "/", "server", ".", "proper", "ties", "\"_", "._", "format_", "(_", "keyfile_", ",_", "h_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd", "\\u", "str_", "._", "append_", "(_", "\"", "scp", " ", "-", "i", " ", "{", "0", "}", " ", "{", "1", "}", " ", "ubu", "ntu", "@{", "2", "}:", "kaf", "ka", "-", "server", "-", "start", ".", "sh", "\"_", "._", "format_", "(_", "keyfile_", ",_", "kaf", "ka", "\\u", "start", "\\u", "script_", ",_", "h_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd", "\\u", "str_", "._", "append_", "(_", "\"", "ssh", " ", "-", "i", " ", "{", "0", "}", " ", "ubu", "ntu", "@{", "1", "}", " ", "sudo", " ", "mv", " ", "kaf", "ka", "-", "server", "-", "start", ".", "sh", " ", "/", "usr", "/", "local", "/", "kaf", "ka", "/", "bin", "/", "kaf", "ka", "-", "server", "-", "start", ".", "sh", " ", "\"_", "._", "format_", "(_", "keyfile_", ",_", "h_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "execute", " ", "the", " ", "remote", " ", "commands_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "cmd_", "in_", "cmd", "\\u", "str_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "os_", "._", "system_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "(_", "Run", "time", "Error_", "(_", "\"", "Some", "thing", " ", "wen", "t", " ", "wrong", " ", "executi", "ng", " ", "{", "0", "}", " ", " ", "Got", " ", "exit", ":", " ", "{", "1", "}\"_", "._", "format_", "(_", "cmd_", ",_", "res_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "start", " ", "each", " ", "kaf", "ka_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmd", "\\u", "str_", "=_", "[_", "\"", "ssh", " ", "-", "i", " ", "{", "0", "}", " ", "ubu", "ntu", "@{", "1", "}", " ", "\\\\\"", "noh", "up", " ", "sudo", " ", "/", "usr", "/", "local", "/", "kaf", "ka", "/", "bin", "/", "kaf", "ka", "-", "server", "-", "start", ".", "sh", " ", " ", "/", "usr", "/", "local", "/", "kaf", "ka", "/", "config", "/", "server", ".", "proper", "ties", " ", "<", " ", "/", "dev", "/", "null", " ", ">", " ", "std", ".", "out", " ", "2", ">", " ", "std", ".", "err", " ", "&", "\\\\\"\"_", "._", "format_", "(_", "keyfile_", ",_", "h_", ")_", "for_", "h_", "in_", "hosts_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "cmd_", "in_", "cmd", "\\u", "str_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "os_", "._", "system_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "(_", "Run", "time", "Error_", "(_", "\"", "Some", "thing", " ", "wen", "t", " ", "wrong", " ", "executi", "ng", " ", "{", "0", "}", " ", " ", "Got", " ", "exit", ":", " ", "{", "1", "}\"_", "._", "format_", "(_", "cmd_", ",_", "res_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "the", " ", "document", "s", " ", "and", " ", "querie", "s", " ", "topic", "s", " ", "on", " ", "one", " ", "of", " ", "the", " ", "Ka", "fk", "a", " ", "nodes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "h_", "=_", "hosts_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd", "\\u", "str_", "=_", "[_", "\"", "ssh", " ", "-", "i", " ", "{", "0", "}", " ", "ubu", "ntu", "@{", "1", "}", " ", "/", "usr", "/", "local", "/", "kaf", "ka", "/", "bin", "/", "kaf", "ka", "-", "topic", "s", ".", "sh", " ", "--", "create", " ", "--", "zookeeper", " ", "local", "host", ":", "218", "1", " ", "--", "replication", "-", "factor", " ", "{", "2", "}", " ", "--", "partit", "ion", "s", " ", "{", "3", "}", " ", "--", "topic", " ", "document", "s", "\"_", "._", "format_", "(_", "keyfile_", ",_", "h_", ",_", "2_", ",_", "5_", ")_", ",_", "\"", "ssh", " ", "-", "i", " ", "{", "0", "}", " ", "ubu", "ntu", "@{", "1", "}", " ", "/", "usr", "/", "local", "/", "kaf", "ka", "/", "bin", "/", "kaf", "ka", "-", "topic", "s", ".", "sh", " ", "--", "create", " ", "--", "zookeeper", " ", "local", "host", ":", "218", "1", " ", "--", "replication", "-", "factor", " ", "{", "2", "}", " ", "--", "partit", "ion", "s", " ", "{", "3", "}", " ", "--", "topic", " ", "querie", "s", "\"_", "._", "format_", "(_", "keyfile_", ",_", "h_", ",_", "3_", ",_", "1_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "cmd_", "in_", "cmd", "\\u", "str_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "os_", "._", "system_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "(_", "Run", "time", "Error_", "(_", "\"", "Some", "thing", " ", "wen", "t", " ", "wrong", " ", "executi", "ng", " ", "{", "0", "}", " ", " ", "Got", " ", "exit",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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 local variable
tienfuc/gdcmdtools/gdcmdtools/put.py
[ { "content": " def gas_pack(self):\n map_type_ext = {\"server_js\": \"js\", \"html\": \"html\"}\n json_packed = {}\n try:\n with open(self.source_file, \"rb\") as fr1:\n jsons = json.loads(fr1.read())\n\n path = os.path.split(self.source_file)[0]\n for j in jsons[\"files\"]:\n file_name = os.path.join(path, \"%s.%s\" % (\n j[\"name\"], map_type_ext[j[\"type\"]]))\n with open(file_name, \"rb\") as fr2:\n file_content = fr2.read()\n\n j[\"source\"] = file_content\n\n new_json = \"%s.packed\" % self.source_file\n with open(new_json, \"wb+\") as fw:\n fw.write(json.dumps(jsons, indent=4))\n except:\n return False\n else:\n return True", "metadata": "root.GDPut.gas_pack", "header": "['class', 'GDPut', ':', '___EOS___']", "index": 160 }, { "content": " def ft_put(self):\n if not self.check_csv():\n raise Exception(\n \"The delimiter of the source csv file is not '%s'\" %\n self.csv_delimiter)\n\n # save new csv file with latlng data\n if self.ft_location_column and self.ft_latlng_column:\n target_file = self.csv_save_latlng()\n table = self.create_ft(target_file)\n else:\n table = self.create_ft(self.source_file)\n #logger.debug('body=%s' % body)\n\n # table columns are created, get tableId\n service_response = self.ft_service.table().insert(body=table).execute()\n #logger.debug(\"service_response=%s\" % service_response)\n table_id = service_response[\"tableId\"]\n\n # move to target folder\n if self.folder_id is not None:\n new_parent = {'id': self.folder_id}\n\n try:\n self.service.parents().insert(fileId=table_id, body=new_parent).execute()\n except apiclient.errors.HttpError as error:\n raise Exception('An error occurred: %s' % error)\n\n # remove from root folder\n try:\n self.service.parents().delete(fileId=table_id, parentId=self.root).execute()\n except apiclient.errors.HttpError as error:\n raise Exception('Atable_idn error occurred: %s' % error)\n\n if self.ft_location_column and self.ft_latlng_column:\n url = self.ft_put_body(table_id, target_file)\n else:\n url = self.ft_put_body(table_id, self.source_file)\n\n if self.permission is not None:\n pass_action = {\n \"name\":\"insert\",\n \"param\":self.permission}\n\n perm = GDPerm(table_id, pass_action)\n result = perm.run()\n logger.debug(result)\n\n ft_url = \"https://www.google.com/fusiontables/data?docid=%s\" % table_id\n\n return service_response", "metadata": "root.GDPut.ft_put", "header": "['class', 'GDPut', ':', '___EOS___']", "index": 324 }, { "content": " def ft_put_body(self, table_id, target_file):\n params = urllib.urlencode({'isStrict': \"false\"})\n URI = \"https://www.googleapis.com/upload/fusiontables/v1/tables/%s/import?%s\" % (\n table_id, params)\n METHOD = \"POST\"\n\n with open(target_file) as ft_file:\n # get the rows\n # ft_file.next()\n rows = ft_file.read()\n i_newline = rows.index('\\n') + 1\n rows = rows[i_newline:]\n # weird issue here: the URI should be encoded with UTF-8 if body is\n # UTF-8 too.\n utf8_body = rows.decode('utf-8').encode('utf-8')\n # logger.debug(utf8_body)\n try:\n response, content = self.http.request(\n URI.encode('utf-8'), METHOD, body=utf8_body)\n except:\n raise Exception('Failed at calling http.request(%s, %s, %s)'\n % (URI.encode('utf-8'), METHOD, utf8_body))\n\n content = json.loads(content)\n # logger.debug(content)", "metadata": "root.GDPut.ft_put_body", "header": "['class', 'GDPut', ':', '___EOS___']", "index": 376 } ]
[ { "span": "json_packed ", "start_line": 162, "start_column": 8, "end_line": 162, "end_column": 19 }, { "span": "url ", "start_line": 359, "start_column": 12, "end_line": 359, "end_column": 15 }, { "span": "url ", "start_line": 361, "start_column": 12, "end_line": 361, "end_column": 15 }, { "span": "ft_url ", "start_line": 372, "start_column": 8, "end_line": 372, "end_column": 14 }, { "span": "content ", "start_line": 399, "start_column": 12, "end_line": 399, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "GD", "Put", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "gas", "\\u", "pack_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "map", "\\u", "type", "\\u", "ext_", "=_", "{_", "\"", "server", "\\u", "js", "\"_", ":_", "\"", "js", "\"_", ",_", "\"", "html", "\"_", ":_", "\"", "html", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "packed_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "self_", "._", "source", "\\u", "file_", ",_", "\"", "rb", "\"_", ")_", "as_", "fr", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jsons", "_", "=_", "json_", "._", "loads_", "(_", "fr", "1_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "path_", "=_", "os_", "._", "path_", "._", "split_", "(_", "self_", "._", "source", "\\u", "file_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", "in_", "jsons", "_", "[_", "\"", "files", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "file", "\\u", "name_", "=_", "os_", "._", "path_", "._", "join_", "(_", "path_", ",_", "\"%", "s", ".", "%", "s", "\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "j_", "[_", "\"", "name", "\"_", "]_", ",_", "map", "\\u", "type", "\\u", "ext_", "[_", "j_", "[_", "\"", "type", "\"_", "]_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "file", "\\u", "name_", ",_", "\"", "rb", "\"_", ")_", "as_", "fr", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "file", "\\u", "content_", "=_", "fr", "2_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "j_", "[_", "\"", "source", "\"_", "]_", "=_", "file", "\\u", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "\\u", "json_", "=_", "\"%", "s", ".", "pack", "ed", "\"_", "%_", "self_", "._", "source", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "new", "\\u", "json_", ",_", "\"", "wb", "+\"_", ")_", "as_", "fw_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "fw_", "._", "write_", "(_", "json_", "._", "dumps_", "(_", "jsons", "_", ",_", "indent_", "=_", "4_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GD", "Put", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ft", "\\u", "put_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "check", "\\u", "csv_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "The", " ", "delimiter", " ", "of", " ", "the", " ", "source", " ", "csv", " ", "file", " ", "is", " ", "not", " ", "'%", "s", "'\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "csv", "\\u", "delimiter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "save", " ", "new", " ", "csv", " ", "file", " ", "with", " ", "lat", "ln", "g", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "ft", "\\u", "location", "\\u", "column_", "and_", "self_", "._", "ft", "\\u", "lat", "ln", "g", "\\u", "column_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target", "\\u", "file_", "=_", "self_", "._", "csv", "\\u", "save", "\\u", "lat", "lng_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "=_", "self_", "._", "create", "\\u", "ft_", "(_", "target", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "table_", "=_", "self_", "._", "create", "\\u", "ft_", "(_", "self_", "._", "source", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "logg", "er", ".", "debug", "('", "body", "=", "%", "s", "'", " ", "%", " ", "body", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "table", " ", "column", "s", " ", "are", " ", "created", ",", " ", "get", " ", "table", "Id_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "service", "\\u", "response_", "=_", "self_", "._", "ft", "\\u", "service_", "._", "table_", "(_", ")_", "._", "insert_", "(_", "body_", "=_", "table_", ")_", "._", "execute_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "logg", "er", ".", "debug", "(\"", "service", "\\u", "response", "=", "%", "s", "\"", " ", "%", " ", "service", "\\u", "response", ")_", "\\u\\u\\uNL\\u\\u\\u_", "table", "\\u", "id_", "=_", "service", "\\u", "response_", "[_", "\"", "table", "Id", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "move", " ", "to", " ", "target", " ", "folder_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "folder", "\\u", "id_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "parent_", "=_", "{_", "'", "id", "'_", ":_", "self_", "._", "folder", "\\u", "id_", "}_", "\\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_", "._", "service_", "._", "parents_", "(_", ")_", "._", "insert_", "(_", "file", "Id_", "=_", "table", "\\u", "id_", ",_", "body_", "=_", "new", "\\u", "parent_", ")_", "._", "execute_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "apiclient_", "._", "errors_", "._", "Http", "Error_", "as_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "An", " ", "error", " ", "occur", "red", ":", " ", "%", "s", "'_", "%_", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "remove", " ", "from", " ", "root", " ", "folder_", "\\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 ", " _", "self_", "._", "service_", "._", "parents_", "(_", ")_", "._", "delete_", "(_", "file", "Id_", "=_", "table", "\\u", "id_", ",_", "parent", "Id_", "=_", "self_", "._", "root_", ")_", "._", "execute_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "apiclient_", "._", "errors_", "._", "Http", "Error_", "as_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "At", "able", "\\u", "idn", " ", "error", " ", "occur", "red", ":", " ", "%", "s", "'_", "%_", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "ft", "\\u", "location", "\\u", "column_", "and_", "self_", "._", "ft", "\\u", "lat", "ln", "g", "\\u", "column_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "self_", "._", "ft", "\\u", "put", "\\u", "body_", "(_", "table", "\\u", "id_", ",_", "target", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "self_", "._", "ft", "\\u", "put", "\\u", "body_", "(_", "table", "\\u", "id_", ",_", "self_", "._", "source", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "permission_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass", "\\u", "action_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "\"", "insert", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "param", "\"_", ":_", "self_", "._", "permission_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "perm_", "=_", "GD", "Perm", "_", "(_", "table", "\\u", "id_", ",_", "pass", "\\u", "action_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "perm_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "debug_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ft", "\\u", "url_", "=_", "\"", "https", "://", "www", ".", "google", ".", "com", "/", "fusion", "tables", "/", "data", "?", "docid", "=", "%", "s", "\"_", "%_", "table", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "service", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GD", "Put", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ft", "\\u", "put", "\\u", "body_", "(_", "self_", ",_", "table", "\\u", "id_", ",_", "target", "\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "=_", "urllib_", "._", "urlencode_", "(_", "{_", "'", "is", "Stri", "ct", "'_", ":_", "\"", "fal", "se", "\"_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "URI_", "=_", "\"", "https", "://", "www", ".", "google", "apis", ".", "com", "/", "upload", "/", "fusion", "tables", "/", "v1", "/", "tables", "/", "%", "s", "/", "import", "?", "%", "s", "\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "table", "\\u", "id_", ",_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "METHOD_", "=_", "\"", "POST", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "open_", "(_", "target", "\\u", "file_", ")_", "as_", "ft", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "the", " ", "rows_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ft", "\\u", "file", ".", "next", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rows_", "=_", "ft", "\\u", "file_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i", "\\u", "newline_", "=_", "rows_", "._", "index_", "(_", "'\\\\", "n", "'_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rows_", "=_", "rows_", "[_", "i", "\\u", "newline_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "weird", " ", "issue", " ", "here", ":", " ", "the", " ", "URI", " ", "shou", "ld", " ", "be", " ", "encode", "d", " ", "with", " ", "UT", "F", "-", "8", " ", "if", " ", "body", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "UT", "F", "-", "8", " ", "too", "._", "\\u\\u\\uNL\\u\\u\\u_", "utf", "8", "\\u", "body_", "=_", "rows_", "._", "decode_", "(_", "'", "utf", "-", "8", "'_", ")_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "er", ".", "debug", "(", "utf", "8", "\\u", "body", ")_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", ",_", "content_", "=_", "self_", "._", "http_", "._", "request_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "URI_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", ",_", "METHOD_", ",_", "body_", "=_", "utf", "8", "\\u", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "Fail", "ed", " ", "at", " ", "calling", " ", "http", ".", "request", "(%", "s", ",", " ", "%", "s", ",", " ", "%", "s", ")'_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "(_", "URI_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", ",_", "METHOD_", ",_", "utf", "8", "\\u", "body_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "content_", "=_", "json_", "._", "loads_", "(_", "content_", ")_", "\\u\\u\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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
openelections/openelections-core/openelex/us/ga/load.py
[ { "content": "import re\nimport csv\nimport xlrd\nimport unicodecsv\n\nfrom openelex.base.load import BaseLoader\nfrom openelex.models import RawResult\nfrom openelex.lib.text import ocd_type_id, slugify\nfrom .datasource import Datasource\n\n\"\"\"\nJust getting things stubbed out for GA\n\"\"\"\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class LoadResults(object):\n \"\"\"Entry point for data loading.\n\n Determines appropriate loader for file and triggers load process.\n\n \"\"\"\n", "metadata": "root.LoadResults", "header": "['module', '___EOS___']", "index": 14 }, { "content": " def run(self, mapping):\n loader = GABaseLoader()\n loader.run(mapping)", "metadata": "root.LoadResults.run", "header": "['class', 'LoadResults', '(', 'object', ')', ':', '___EOS___']", "index": 21 }, { "content": "class GABaseLoader(BaseLoader):\n datasource = Datasource()\n\n # We'll want to flesh these out...\n target_offices = set([])\n\n district_offices = set([])\n\n\n", "metadata": "root.GABaseLoader", "header": "['module', '___EOS___']", "index": 26 }, { "content": " def _skip_row(self, row):\n \"\"\"\n Should this row be skipped?\n\n This should be implemented in subclasses.\n \"\"\"\n return False", "metadata": "root.GABaseLoader._skip_row", "header": "['class', 'GABaseLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 34 }, { "content": " def _votes(self, val):\n \"\"\"\n Returns cleaned version of votes or 0 if it's a non-numeric value.\n \"\"\"\n if type(val) is str:\n if val.strip() == '':\n return 0\n\n try:\n return int(float(val))\n except ValueError:\n # Count'y convert value from string\n return 0", "metadata": "root.GABaseLoader._votes", "header": "['class', 'GABaseLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 42 }, { "content": " def _base_kwargs(self, row):\n \"Build base set of kwargs for RawResult\"\n # TODO: Can this just be called once?\n kwargs = self._build_common_election_kwargs()\n return kwargs", "metadata": "root.GABaseLoader._base_kwargs", "header": "['class', 'GABaseLoader', '(', 'BaseLoader', ')', ':', '___EOS___']", "index": 56 } ]
[ { "span": "import re", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 9 }, { "span": "import csv", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 10 }, { "span": "import xlrd", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 11 }, { "span": "import unicodecsv", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 17 }, { "span": "from openelex.models import RawResult", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 37 }, { "span": "from openelex.lib.text import ocd_type_id, slugify", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 50 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "csv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "xlr", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unicode", "csv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "opene", "lex_", "._", "base_", "._", "load_", "import_", "Base", "Loader_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "opene", "lex_", "._", "models_", "import_", "Ra", "w", "Result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "opene", "lex_", "._", "lib_", "._", "text_", "import_", "oc", "d\\u", "type", "\\u", "id_", ",_", "slugify_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "datasource_", "import_", "Datas", "ource_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Ju", "st", " ", "getti", "ng", " ", "thing", "s", " ", "stubbe", "d", " ", "out", " ", "for", " ", "GA", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Load", "Results_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Entr", "y", " ", "point", " ", "for", " ", "data", " ", "load", "ing", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Det", "erm", "ine", "s", " ", "appropr", "iate", " ", "load", "er", " ", "for", " ", "file", " ", "and", " ", "trigger", "s", " ", "load", " ", "process", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Load", "Results_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "run_", "(_", "self_", ",_", "mapping_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loader_", "=_", "GA", "Base", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loader_", "._", "run_", "(_", "mapping_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "GA", "Base", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "datasource_", "=_", "Datas", "ource_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", "'", "ll", " ", "want", " ", "to", " ", "fle", "sh", " ", "these", " ", "out", "..._", "\\u\\u\\uNL\\u\\u\\u_", "target", "\\u", "office", "s_", "=_", "set_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "district", "\\u", "office", "s_", "=_", "set_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "GA", "Base", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "skip", "\\u", "row_", "(_", "self_", ",_", "row_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Sho", "ul", "d", " ", "this", " ", "row", " ", "be", " ", "skip", "ped", "?", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "shou", "ld", " ", "be", " ", "implemented", " ", "in", " ", "subclasses", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GA", "Base", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "votes_", "(_", "self_", ",_", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "clean", "ed", " ", "version", " ", "of", " ", "vote", "s", " ", "or", " ", "0", " ", "if", " ", "it", "'", "s", " ", "a", " ", "non", "-", "numeri", "c", " ", "value", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "(_", "val_", ")_", "is_", "str_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "val_", "._", "strip_", "(_", ")_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "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_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "int_", "(_", "float_", "(_", "val_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Count", "'", "y", " ", "convert", " ", "value", " ", "from", " ", "string_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GA", "Base", "Loader_", "(_", "Base", "Loader_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "base", "\\u", "kwargs_", "(_", "self_", ",_", "row_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Build", " ", "base", " ", "set", " ", "of", " ", "kwarg", "s", " ", "for", " ", "Ra", "w", "Result", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Can", " ", "this", " ", "just", " ", "be", " ", "call", "ed", " ", "onc", "e", "?", "_", "\\u\\u\\uNL\\u\\u\\u_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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Constant in conditional expression or statement
fp7-ofelia/ocf/ofam/src/src/foam/api/admin.py
[ { "content": " def gapi_CreateSliver(self, slice_urn, credentials, rspec, users, force_approval=False, options=None):\t\n #GENI API imports\n from foam.geni.db import GeniDB, UnknownSlice, UnknownNode\n import foam.geni.approval\n import foam.geni.ofeliaapproval\n import sfa\n user_info = users\n try:\n if True:\n #self.recordAction(\"createsliver\", credentials, slice_urn)\n try:\n self._log.debug(\"Parsed user cert with URN (%(urn)s) and email (%(email)s)\" % users)\n except Exception, e:\n self._log.exception(\"UNFILTERED EXCEPTION\")\n user_info[\"urn\"] = None\n user_info[\"email\"] = None\n sliver = foam.geni.lib.createSliver(slice_urn, credentials, rspec, user_info)\n style = ConfigDB.getConfigItemByKey(\"geni.approval.approve-on-creation\").getValue()\n if style == foam.geni.approval.NEVER:\n approve = False\n elif style == foam.geni.approval.ALWAYS:\n approve = True\n else:\n approve = foam.geni.ofeliaapproval.of_analyzeForApproval(sliver)\n if approve or force_approval:\n pid = foam.task.approveSliver(sliver.getURN(), AUTO_SLIVER_PRIORITY)\n self._log.debug(\"task.py launched for approve-sliver (PID: %d)\" % pid)\t\n data = GeniDB.getSliverData(sliver.getURN(), True)\n foam.task.emailCreateSliver(data)\n return self.successResult(GeniDB.getManifest(sliver.getURN()))\n return\t\t\n except foam.geni.lib.RspecParseError, e:\n self._log.info(str(e))\n e._foam_logged = True\n raise e\n except foam.geni.lib.RspecValidationError, e:\n self._log.info(str(e))\n e._foam_logged = True\n raise e\n except foam.geni.lib.DuplicateSliver, ds:\n self._log.info(\"Attempt to create multiple slivers for slice [%s]\" % (ds.slice_urn))\n ds._foam_logged = True\n raise ds\n except foam.geni.lib.UnknownComponentManagerID, ucm:\n raise Fault(\"UnknownComponentManager\", \"Component Manager ID specified in %s does not match this aggregate.\" % (ucm.cid))\n except (foam.geni.lib.UnmanagedComponent, UnknownNode), uc:\n self._log.info(\"Attempt to request unknown component %s\" % (uc.cid))\n f = Fault(\"UnmanagedComponent\", \"DPID in component %s is unknown to this aggregate.\" % (uc.cid))\n f._foam_logged = True\n raise f\n except Exception, e:\n self._log.exception(\"Exception\")\n raise e", "metadata": "root.AdminAPIv1.gapi_CreateSliver", "header": "['class', 'AdminAPIv1', '(', 'Dispatcher', ')', ':', '___EOS___']", "index": 663 }, { "content": " def gapi_DeleteSliver(self, slice_urn, credentials, options=None):\n #GENI API imports\n from foam.geni.db import GeniDB, UnknownSlice, UnknownNode\n import foam.geni.approval\n import foam.geni.ofeliaapproval\n import sfa\n try:\n if True:\n #self.recordAction(\"deletesliver\", credentials, slice_urn)\n if GeniDB.getSliverURN(slice_urn) is None:\n raise Fault(\"DeleteSliver\", \"Sliver for slice URN (%s) does not exist\" % (slice_urn))\n return self.errorResult(12, \"\") #not sure if this is needed\n sliver_urn = GeniDB.getSliverURN(slice_urn)\n data = GeniDB.getSliverData(sliver_urn, True)\n foam.geni.lib.deleteSliver(sliver_urn = sliver_urn)\n foam.task.emailGAPIDeleteSliver(data)\n return self.successResult(True)\n return self.successResult(False)\t\n except UnknownSlice, x:\n self._log.info(\"Attempt to delete unknown sliver for slice URN %s\" % (slice_urn))\n x._foam_logged = True\n raise x \n except Exception, e:\n self._log.exception(\"Exception\")\n raise e", "metadata": "root.AdminAPIv1.gapi_DeleteSliver", "header": "['class', 'AdminAPIv1', '(', 'Dispatcher', ')', ':', '___EOS___']", "index": 717 } ]
[ { "span": "True:", "start_line": 671, "start_column": 9, "end_line": 671, "end_column": 13 }, { "span": "True:", "start_line": 724, "start_column": 9, "end_line": 724, "end_column": 13 } ]
[]
1
true
[ "[CLS]_", "Constant_", "in_", "conditional", "_", "expression_", "or_", "statement_", "[SEP]_", "class_", "Admi", "n", "API", "v1_", "(_", "Dispatcher_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "gap", "i", "\\u", "Creat", "e", "Sli", "ver_", "(_", "self_", ",_", "slice", "\\u", "urn_", ",_", "credentials_", ",_", "rsp", "ec_", ",_", "users_", ",_", "force", "\\u", "approval", "_", "=_", "False_", ",_", "options_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "GEN", "I", " ", "API", " ", "imports_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "foa", "m_", "._", "geni", "_", "._", "db_", "import_", "Gen", "i", "DB_", ",_", "Un", "know", "n", "Slice_", ",_", "Un", "know", "n", "Node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "foa", "m_", "._", "geni", "_", "._", "approval", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "foa", "m_", "._", "geni", "_", "._", "of", "eli", "aa", "ppro", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sfa", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "info_", "=_", "users_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "record", "Action", "(\"", "create", "sli", "ver", "\",", " ", "cred", "ential", "s", ",", " ", "slice", "\\u", "urn", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "log_", "._", "debug_", "(_", "\"", "Pars", "ed", " ", "user", " ", "cert", " ", "with", " ", "URN", " ", "(%", "(", "urn", ")", "s", ")", " ", "and", " ", "email", " ", "(%", "(", "email", ")", "s", ")\"_", "%_", "users_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "log_", "._", "exception_", "(_", "\"", "UN", "FILTER", "ED", " ", "EXCEPTION", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "info_", "[_", "\"", "urn", "\"_", "]_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "info_", "[_", "\"", "email", "\"_", "]_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sli", "ver_", "=_", "foa", "m_", "._", "geni", "_", "._", "lib_", "._", "create", "Sli", "ver_", "(_", "slice", "\\u", "urn_", ",_", "credentials_", ",_", "rsp", "ec_", ",_", "user", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "style_", "=_", "Config", "DB_", "._", "get", "Config", "Item", "By", "Key_", "(_", "\"", "geni", ".", "approval", ".", "approve", "-", "on", "-", "creati", "on", "\"_", ")_", "._", "get", "Value_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "style_", "==_", "foa", "m_", "._", "geni", "_", "._", "approval", "_", "._", "NE", "VER_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "approve", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "style_", "==_", "foa", "m_", "._", "geni", "_", "._", "approval", "_", "._", "ALWAYS", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "approve", "_", "=_", "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 ", " _", "approve", "_", "=_", "foa", "m_", "._", "geni", "_", "._", "of", "eli", "aa", "ppro", "val_", "._", "of", "\\u", "analyze", "For", "Approval", "_", "(_", "sli", "ver_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "approve", "_", "or_", "force", "\\u", "approval", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pid_", "=_", "foa", "m_", "._", "task_", "._", "approve", "Sli", "ver_", "(_", "sli", "ver_", "._", "get", "URN", "_", "(_", ")_", ",_", "AUTO", "\\u", "SLI", "VER", "\\u", "PRIORITY", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "log_", "._", "debug_", "(_", "\"", "task", ".", "py", " ", "launched", " ", "for", " ", "approve", "-", "sli", "ver", " ", "(", "PID", ":", " ", "%", "d", ")\"_", "%_", "pid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "=_", "Gen", "i", "DB_", "._", "get", "Sli", "ver", "Data_", "(_", "sli", "ver_", "._", "get", "URN", "_", "(_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "foa", "m_", "._", "task_", "._", "email", "Creat", "e", "Sli", "ver_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "success", "Result_", "(_", "Gen", "i", "DB_", "._", "get", "Manifest", "_", "(_", "sli", "ver_", "._", "get", "URN", "_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "foa", "m_", "._", "geni", "_", "._", "lib_", "._", "Rs", "pec", "Pars", "e", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "log_", "._", "info_", "(_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "._", "\\u", "foa", "m", "\\u", "logged", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "foa", "m_", "._", "geni", "_", "._", "lib_", "._", "Rs", "pec", "Validat", "ion", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "log_", "._", "info_", "(_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "._", "\\u", "foa", "m", "\\u", "logged", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "foa", "m_", "._", "geni", "_", "._", "lib_", "._", "Duplicate", "Sli", "ver_", ",_", "ds_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "log_", "._", "info_", "(_", "\"", "Atte", "mpt", " ", "to", " ", "create", " ", "multiple", " ", "sli", "vers", " ", "for", " ", "slice", " ", "[", "%", "s", "]\"_", "%_", "(_", "ds_", "._", "slice", "\\u", "urn_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ds_", "._", "\\u", "foa", "m", "\\u", "logged", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "ds_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "foa", "m_", "._", "geni", "_", "._", "lib_", "._", "Un", "know", "n", "Compo", "nent", "Manager", "ID_", ",_", "uc", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Fault_", "(_", "\"", "Un", "know", "n", "Compo", "nent", "Manager", "\"_", ",_", "\"", "Compo", "nent", " ", "Manager", " ", "ID", " ", "specified", " ", "in", " ", "%", "s", " ", "doe", "s", " ", "not", " ", "match", " ", "this", " ", "aggre", "gate", ".\"_", "%_", "(_", "uc", "m_", "._", "cid_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "foa", "m_", "._", "geni", "_", "._", "lib_", "._", "Unma", "nage", "d", "Component_", ",_", "Un", "know", "n", "Node_", ")_", ",_", "uc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "log_", "._", "info_", "(_", "\"", "Atte", "mpt", " ", "to", " ", "request", " ", "unknown", " ", "component", " ", "%", "s", "\"_", "%_", "(_", "uc_", "._", "cid_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "Fault_", "(_", "\"", "Unma", "nage", "d", "Compo", "nent", "\"_", ",_", "\"", "DP", "ID", " ", "in", " ", "component", " ", "%", "s", " ", "is", " ", "unknown", " ", "to", " ", "this", " ", "aggre", "gate", ".\"_", "%_", "(_", "uc_", "._", "cid_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "\\u", "foa", "m", "\\u", "logged", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "log_", "._", "exception_", "(_", "\"", "Except", "ion", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Admi", "n", "API", "v1_", "(_", "Dispatcher_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "gap", "i", "\\u", "Delete", "Sli", "ver_", "(_", "self_", ",_", "slice", "\\u", "urn_", ",_", "credentials_", ",_", "options_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "GEN", "I", " ", "API", " ", "imports_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "foa", "m_", "._", "geni", "_", "._", "db_", "import_", "Gen", "i", "DB_", ",_", "Un", "know", "n", "Slice_", ",_", "Un", "know", "n", "Node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "foa", "m_", "._", "geni", "_", "._", "approval", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "foa", "m_", "._", "geni", "_", "._", "of", "eli", "aa", "ppro", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sfa", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "record", "Action", "(\"", "delete", "sli", "ver", "\",", " ", "cred", "ential", "s", ",", " ", "slice", "\\u", "urn", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "Gen", "i", "DB_", "._", "get", "Sli", "ver", "URN", "_", "(_", "slice", "\\u", "urn_", ")_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Fault_", "(_", "\"", "Delete", "Sli", "ver", "\"_", ",_", "\"", "Sli", "ver", " ", "for", " ", "slice", " ", "URN", " ", "(%", "s", ")", " ", "doe", "s", " ", "not", " ", "exist", "\"_", "%_", "(_", "slice", "\\u", "urn_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "error", "Result_", "(_", "12_", ",_", "\"\"_", ")_", "#", "not", " ", "sure", " ", "if", " ", "this", " ", "is", " ", "needed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sli", "ver", "\\u", "urn_", "=_", "Gen", "i", "DB_", "._", "get", "Sli", "ver", "URN", "_", "(_", "slice", "\\u", "urn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "Gen", "i", "DB_", "._", "get", "Sli", "ver", "Data_", "(_", "sli", "ver", "\\u", "urn_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "foa", "m_", "._", "geni", "_", "._", "lib_", "._", "delete", "Sli", "ver_", "(_", "sli", "ver", "\\u", "urn_", "=_", "sli", "ver", "\\u", "urn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "foa", "m_", "._", "task_", "._", "email", "GAP", "ID", "ele", "te", "Sli", "ver_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "success", "Result_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "success", "Result_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Un", "know", "n", "Slice_", ",_", "x_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "log_", "._", "info_", "(_", "\"", "Atte", "mpt", " ", "to", " ", "delete", " ", "unknown", " ", "sli", "ver", " ", "for", " ", "slice", " ", "URN", " ", "%", "s", "\"_", "%_", "(_", "slice", "\\u", "urn_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "._", "\\u", "foa", "m", "\\u", "logged", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "log_", "._", "exception_", "(_", "\"", "Except", "ion", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "e_", "\\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, 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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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 ]
Unused local variable
jmcnamara/XlsxWriter/xlsxwriter/test/comparison/test_hyperlink04.py
[ { "content": " def test_create_file(self):\n \"\"\"Test the creation of a simple XlsxWriter file with hyperlinks.\"\"\"\n\n workbook = Workbook(self.got_filename)\n\n # Turn off default URL format for testing.\n workbook.default_url_format = None\n\n worksheet1 = workbook.add_worksheet()\n worksheet2 = workbook.add_worksheet()\n worksheet3 = workbook.add_worksheet('Data Sheet')\n\n worksheet1.write_url('A1', \"internal:Sheet2!A1\")\n worksheet1.write_url('A3', \"internal:Sheet2!A1:A5\")\n worksheet1.write_url('A5', \"internal:'Data Sheet'!D5\", None, 'Some text')\n worksheet1.write_url('E12', \"internal:Sheet1!J1\")\n worksheet1.write_url('G17', \"internal:Sheet2!A1\", None, 'Some text')\n worksheet1.write_url('A18', \"internal:Sheet2!A1\", None, None, 'Tool Tip 1')\n worksheet1.write_url('A20', \"internal:Sheet2!A1\", None, 'More text', 'Tool Tip 2')\n\n workbook.close()\n\n self.assertExcelEqual()", "metadata": "root.TestCompareXLSXFiles.test_create_file", "header": "['class', 'TestCompareXLSXFiles', '(', 'ExcelComparisonTest', ')', ':', '___EOS___']", "index": 29 }, { "content": " def test_create_file_write(self):\n \"\"\"Test the creation of a simple XlsxWriter file with hyperlinks with write()\"\"\"\n\n workbook = Workbook(self.got_filename)\n\n # Turn off default URL format for testing.\n workbook.default_url_format = None\n\n worksheet1 = workbook.add_worksheet()\n worksheet2 = workbook.add_worksheet()\n worksheet3 = workbook.add_worksheet('Data Sheet')\n\n worksheet1.write('A1', \"internal:Sheet2!A1\")\n worksheet1.write('A3', \"internal:Sheet2!A1:A5\")\n worksheet1.write('A5', \"internal:'Data Sheet'!D5\", None, 'Some text')\n worksheet1.write('E12', \"internal:Sheet1!J1\")\n worksheet1.write('G17', \"internal:Sheet2!A1\", None, 'Some text')\n worksheet1.write('A18', \"internal:Sheet2!A1\", None, None, 'Tool Tip 1')\n worksheet1.write('A20', \"internal:Sheet2!A1\", None, 'More text', 'Tool Tip 2')\n\n workbook.close()\n\n self.assertExcelEqual()", "metadata": "root.TestCompareXLSXFiles.test_create_file_write", "header": "['class', 'TestCompareXLSXFiles', '(', 'ExcelComparisonTest', ')', ':', '___EOS___']", "index": 53 } ]
[ { "span": "worksheet2 ", "start_line": 38, "start_column": 8, "end_line": 38, "end_column": 18 }, { "span": "worksheet3 ", "start_line": 39, "start_column": 8, "end_line": 39, "end_column": 18 }, { "span": "worksheet2 ", "start_line": 62, "start_column": 8, "end_line": 62, "end_column": 18 }, { "span": "worksheet3 ", "start_line": 63, "start_column": 8, "end_line": 63, "end_column": 18 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Compare", "XL", "SX", "Files_", "(_", "Exce", "l", "Compari", "son", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "create", "\\u", "file_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "the", " ", "creati", "on", " ", "of", " ", "a", " ", "simple", " ", "Xl", "sx", "Write", "r", " ", "file", " ", "with", " ", "hyperlink", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "workbook_", "=_", "Workbook", "_", "(_", "self_", "._", "got", "\\u", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Turn", " ", "off", " ", "default", " ", "URL", " ", "format", " ", "for", " ", "testi", "ng", "._", "\\u\\u\\uNL\\u\\u\\u_", "workbook_", "._", "default", "\\u", "url", "\\u", "format_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "worksheet", "1_", "=_", "workbook_", "._", "add", "\\u", "worksheet_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worksheet", "2_", "=_", "workbook_", "._", "add", "\\u", "worksheet_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worksheet", "3_", "=_", "workbook_", "._", "add", "\\u", "worksheet_", "(_", "'", "Data", " ", "She", "et", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "worksheet", "1_", "._", "write", "\\u", "url_", "(_", "'", "A1", "'_", ",_", "\"", "internal", ":", "She", "et", "2", "!", "A1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worksheet", "1_", "._", "write", "\\u", "url_", "(_", "'", "A3", "'_", ",_", "\"", "internal", ":", "She", "et", "2", "!", "A1", ":", "A5", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worksheet", "1_", "._", "write", "\\u", "url_", "(_", "'", "A5", "'_", ",_", "\"", "internal", ":'", "Data", " ", "She", "et", "'!", "D5", "\"_", ",_", "None_", ",_", "'", "Some", " ", "text", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worksheet", "1_", "._", "write", "\\u", "url_", "(_", "'", "E1", "2", "'_", ",_", "\"", "internal", ":", "She", "et", "1", "!", "J", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worksheet", "1_", "._", "write", "\\u", "url_", "(_", "'", "G1", "7", "'_", ",_", "\"", "internal", ":", "She", "et", "2", "!", "A1", "\"_", ",_", "None_", ",_", "'", "Some", " ", "text", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worksheet", "1_", "._", "write", "\\u", "url_", "(_", "'", "A1", "8", "'_", ",_", "\"", "internal", ":", "She", "et", "2", "!", "A1", "\"_", ",_", "None_", ",_", "None_", ",_", "'", "Tool", " ", "Tip", " ", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worksheet", "1_", "._", "write", "\\u", "url_", "(_", "'", "A2", "0", "'_", ",_", "\"", "internal", ":", "She", "et", "2", "!", "A1", "\"_", ",_", "None_", ",_", "'", "Mor", "e", " ", "text", "'_", ",_", "'", "Tool", " ", "Tip", " ", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "workbook_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Exce", "l", "Equal_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Compare", "XL", "SX", "Files_", "(_", "Exce", "l", "Compari", "son", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "create", "\\u", "file", "\\u", "write_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "the", " ", "creati", "on", " ", "of", " ", "a", " ", "simple", " ", "Xl", "sx", "Write", "r", " ", "file", " ", "with", " ", "hyperlink", "s", " ", "with", " ", "write", "()\"", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "workbook_", "=_", "Workbook", "_", "(_", "self_", "._", "got", "\\u", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Turn", " ", "off", " ", "default", " ", "URL", " ", "format", " ", "for", " ", "testi", "ng", "._", "\\u\\u\\uNL\\u\\u\\u_", "workbook_", "._", "default", "\\u", "url", "\\u", "format_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "worksheet", "1_", "=_", "workbook_", "._", "add", "\\u", "worksheet_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worksheet", "2_", "=_", "workbook_", "._", "add", "\\u", "worksheet_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worksheet", "3_", "=_", "workbook_", "._", "add", "\\u", "worksheet_", "(_", "'", "Data", " ", "She", "et", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "worksheet", "1_", "._", "write_", "(_", "'", "A1", "'_", ",_", "\"", "internal", ":", "She", "et", "2", "!", "A1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worksheet", "1_", "._", "write_", "(_", "'", "A3", "'_", ",_", "\"", "internal", ":", "She", "et", "2", "!", "A1", ":", "A5", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worksheet", "1_", "._", "write_", "(_", "'", "A5", "'_", ",_", "\"", "internal", ":'", "Data", " ", "She", "et", "'!", "D5", "\"_", ",_", "None_", ",_", "'", "Some", " ", "text", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worksheet", "1_", "._", "write_", "(_", "'", "E1", "2", "'_", ",_", "\"", "internal", ":", "She", "et", "1", "!", "J", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worksheet", "1_", "._", "write_", "(_", "'", "G1", "7", "'_", ",_", "\"", "internal", ":", "She", "et", "2", "!", "A1", "\"_", ",_", "None_", ",_", "'", "Some", " ", "text", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worksheet", "1_", "._", "write_", "(_", "'", "A1", "8", "'_", ",_", "\"", "internal", ":", "She", "et", "2", "!", "A1", "\"_", ",_", "None_", ",_", "None_", ",_", "'", "Tool", " ", "Tip", " ", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worksheet", "1_", "._", "write_", "(_", "'", "A2", "0", "'_", ",_", "\"", "internal", ":", "She", "et", "2", "!", "A1", "\"_", ",_", "None_", ",_", "'", "Mor", "e", " ", "text", "'_", ",_", "'", "Tool", " ", "Tip", " ", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "workbook_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Exce", "l", "Equal_", "(_", ")_" ]
[ 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, 0, 1, 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, 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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 ]
Imprecise assert
PyTables/PyTables/tables/tests/test_links.py
[ { "content": " def _createFile(self):\n self.h5file.create_array('/', 'arr1', [1, 2])\n group1 = self.h5file.create_group('/', 'group1')\n arr2 = self.h5file.create_array(group1, 'arr2', [1, 2, 3])\n lgroup1 = self.h5file.create_hard_link('/', 'lgroup1', '/group1')\n self.assertTrue(lgroup1 is not None)\n larr1 = self.h5file.create_hard_link(group1, 'larr1', '/arr1')\n self.assertTrue(larr1 is not None)\n larr2 = self.h5file.create_hard_link('/', 'larr2', arr2)\n self.assertTrue(larr2 is not None)", "metadata": "root.HardLinkTestCase._createFile", "header": "['class', 'HardLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 34 }, { "content": " def test02_removeLeaf(self):\n \"\"\"Removing a hard link to a Leaf.\"\"\"\n\n # First delete the initial link\n self.h5file.root.arr1.remove()\n self.assertTrue('/arr1' not in self.h5file)\n # The second link should still be there\n if common.verbose:\n print(\"Remaining link:\", self.h5file.root.group1.larr1)\n self.assertTrue('/group1/larr1' in self.h5file)\n # Remove the second link\n self.h5file.root.group1.larr1.remove()\n self.assertTrue('/group1/larr1' not in self.h5file)", "metadata": "root.HardLinkTestCase.test02_removeLeaf", "header": "['class', 'HardLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 72 }, { "content": " def test03_removeGroup(self):\n \"\"\"Removing a hard link to a Group.\"\"\"\n\n if common.verbose:\n print(\"Original object tree:\", self.h5file)\n # First delete the initial link\n self.h5file.root.group1._f_remove(force=True)\n self.assertTrue('/group1' not in self.h5file)\n # The second link should still be there\n if common.verbose:\n print(\"Remaining link:\", self.h5file.root.lgroup1)\n print(\"Object tree:\", self.h5file)\n self.assertTrue('/lgroup1' in self.h5file)\n # Remove the second link\n self.h5file.root.lgroup1._g_remove(recursive=True)\n self.assertTrue('/lgroup1' not in self.h5file)\n if common.verbose:\n print(\"Final object tree:\", self.h5file)", "metadata": "root.HardLinkTestCase.test03_removeGroup", "header": "['class', 'HardLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 86 }, { "content": " def _createFile(self):\n self.h5file.create_array('/', 'arr1', [1, 2])\n group1 = self.h5file.create_group('/', 'group1')\n arr2 = self.h5file.create_array(group1, 'arr2', [1, 2, 3])\n lgroup1 = self.h5file.create_soft_link('/', 'lgroup1', '/group1')\n self.assertTrue(lgroup1 is not None)\n larr1 = self.h5file.create_soft_link(group1, 'larr1', '/arr1')\n self.assertTrue(larr1 is not None)\n larr2 = self.h5file.create_soft_link('/', 'larr2', arr2)\n self.assertTrue(larr2 is not None)", "metadata": "root.SoftLinkTestCase._createFile", "header": "['class', 'SoftLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 113 }, { "content": " def test02_remove(self):\n \"\"\"Removing a soft link.\"\"\"\n\n # First delete the referred link\n self.h5file.root.arr1.remove()\n self.assertTrue('/arr1' not in self.h5file)\n # The soft link should still be there (but dangling)\n if common.verbose:\n print(\"Dangling link:\", self.h5file.root.group1.larr1)\n self.assertTrue('/group1/larr1' in self.h5file)\n # Remove the soft link itself\n self.h5file.root.group1.larr1.remove()\n self.assertTrue('/group1/larr1' not in self.h5file)", "metadata": "root.SoftLinkTestCase.test02_remove", "header": "['class', 'SoftLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 145 }, { "content": " def test03_copy(self):\n \"\"\"Copying a soft link.\"\"\"\n\n # Copy the link into another location\n root = self.h5file.root\n lgroup1 = root.lgroup1\n lgroup2 = lgroup1.copy('/', 'lgroup2')\n self.assertTrue('/lgroup1' in self.h5file)\n self.assertTrue('/lgroup2' in self.h5file)\n self.assertTrue('lgroup2' in root._v_children)\n self.assertTrue('lgroup2' in root._v_links)\n if common.verbose:\n print(\"Copied link:\", lgroup2)\n # Remove the first link\n lgroup1.remove()\n self._checkEqualityGroup(self.h5file.root.group1,\n self.h5file.root.lgroup2())", "metadata": "root.SoftLinkTestCase.test03_copy", "header": "['class', 'SoftLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 159 }, { "content": " def test03_overwrite(self):\n \"\"\"Overwrite a soft link.\"\"\"\n\n # Copy the link into another location\n root = self.h5file.root\n lgroup1 = root.lgroup1\n lgroup2 = lgroup1.copy('/', 'lgroup2')\n lgroup2 = lgroup1.copy('/', 'lgroup2', overwrite=True)\n self.assertTrue('/lgroup1' in self.h5file)\n self.assertTrue('/lgroup2' in self.h5file)\n self.assertTrue('lgroup2' in root._v_children)\n self.assertTrue('lgroup2' in root._v_links)\n if common.verbose:\n print(\"Copied link:\", lgroup2)\n # Remove the first link\n lgroup1.remove()\n self._checkEqualityGroup(self.h5file.root.group1,\n self.h5file.root.lgroup2())", "metadata": "root.SoftLinkTestCase.test03_overwrite", "header": "['class', 'SoftLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 177 }, { "content": " def test04_move(self):\n \"\"\"Moving a soft link.\"\"\"\n\n # Move the link into another location\n lgroup1 = self.h5file.root.lgroup1\n group2 = self.h5file.create_group('/', 'group2')\n lgroup1.move(group2, 'lgroup2')\n lgroup2 = self.h5file.root.group2.lgroup2\n if common.verbose:\n print(\"Moved link:\", lgroup2)\n self.assertTrue('/lgroup1' not in self.h5file)\n self.assertTrue('/group2/lgroup2' in self.h5file)\n self._checkEqualityGroup(self.h5file.root.group1,\n self.h5file.root.group2.lgroup2())", "metadata": "root.SoftLinkTestCase.test04_move", "header": "['class', 'SoftLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 196 }, { "content": " def test05_rename(self):\n \"\"\"Renaming a soft link.\"\"\"\n\n # Rename the link\n lgroup1 = self.h5file.root.lgroup1\n lgroup1.rename('lgroup2')\n lgroup2 = self.h5file.root.lgroup2\n if common.verbose:\n print(\"Moved link:\", lgroup2)\n self.assertTrue('/lgroup1' not in self.h5file)\n self.assertTrue('/lgroup2' in self.h5file)\n self._checkEqualityGroup(self.h5file.root.group1,\n self.h5file.root.lgroup2())", "metadata": "root.SoftLinkTestCase.test05_rename", "header": "['class', 'SoftLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 211 }, { "content": " def test06a_relative_path(self):\n \"\"\"Using soft links with relative paths.\"\"\"\n\n # Create new group\n self.h5file.create_group('/group1', 'group3')\n # ... and relative link\n lgroup3 = self.h5file.create_soft_link(\n '/group1', 'lgroup3', 'group3')\n if common.verbose:\n print(\"Relative path link:\", lgroup3)\n self.assertTrue('/group1/lgroup3' in self.h5file)\n self._checkEqualityGroup(self.h5file.root.group1.group3,\n self.h5file.root.group1.lgroup3())", "metadata": "root.SoftLinkTestCase.test06a_relative_path", "header": "['class', 'SoftLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 225 }, { "content": " def test06b_relative_path(self):\n \"\"\"Using soft links with relative paths (./ version)\"\"\"\n\n # Create new group\n self.h5file.create_group('/group1', 'group3')\n # ... and relative link\n lgroup3 = self.h5file.create_soft_link(\n '/group1', 'lgroup3', './group3')\n if common.verbose:\n print(\"Relative path link:\", lgroup3)\n self.assertTrue('/group1/lgroup3' in self.h5file)\n self._checkEqualityGroup(self.h5file.root.group1.group3,\n self.h5file.root.group1.lgroup3())", "metadata": "root.SoftLinkTestCase.test06b_relative_path", "header": "['class', 'SoftLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 239 }, { "content": " def test09_link_to_link(self):\n \"\"\"Checking linked links.\"\"\"\n\n # Create a link to another existing link\n lgroup2 = self.h5file.create_soft_link(\n '/', 'lgroup2', '/lgroup1')\n # Dereference it once:\n self.assertTrue(lgroup2() is self.h5file.get_node('/lgroup1'))\n if common.verbose:\n print(\"First dereference is correct:\", lgroup2())\n # Dereference it twice:\n self.assertTrue(lgroup2()() is self.h5file.get_node('/group1'))\n if common.verbose:\n print(\"Second dereference is correct:\", lgroup2()())", "metadata": "root.SoftLinkTestCase.test09_link_to_link", "header": "['class', 'SoftLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 279 }, { "content": " def test10_copy_link_to_file(self):\n \"\"\"Checking copying a link to another file.\"\"\"\n\n fname = tempfile.mktemp(\".h5\")\n h5f = tables.open_file(fname, \"a\")\n h5f.create_array('/', 'arr1', [1, 2])\n h5f.create_group('/', 'group1')\n lgroup1 = self.h5file.root.lgroup1\n lgroup1_ = lgroup1.copy(h5f.root, 'lgroup1')\n self.assertTrue('/lgroup1' in self.h5file)\n self.assertTrue('/lgroup1' in h5f)\n self.assertTrue(lgroup1_ in h5f)\n if common.verbose:\n print(\"Copied link:\", lgroup1_, 'in:', lgroup1_._v_file.filename)\n h5f.close()\n os.remove(fname)", "metadata": "root.SoftLinkTestCase.test10_copy_link_to_file", "header": "['class', 'SoftLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 294 }, { "content": " def test11_direct_attribute_access(self):\n \"\"\"Check direct get/set attributes via link-->target.attribute\"\"\"\n\n larr1 = self.h5file.get_node('/lgroup1/larr1')\n arr1 = self.h5file.get_node('/arr1')\n # get\n self.assertTrue(larr1.shape == (2,))\n self.assertTrue(larr1[:] == [1, 2])\n # set\n larr1[0] = -1\n self.assertTrue(arr1[:] == [-1, 2])", "metadata": "root.SoftLinkTestCase.test11_direct_attribute_access", "header": "['class', 'SoftLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 311 }, { "content": " def test12_access_child_node_attributes(self):\n \"\"\"Check get/set attributes via link-->target.child.attribute\"\"\"\n\n lgroup1 = self.h5file.get_node('/lgroup1')\n arr2 = self.h5file.get_node('/group1/arr2')\n # get child attribute\n self.assertTrue(lgroup1.arr2[:] == [1, 2, 3])\n # set child attribute\n lgroup1.arr2[0] = -1\n self.assertTrue(arr2[:] == [-1, 2, 3])", "metadata": "root.SoftLinkTestCase.test12_access_child_node_attributes", "header": "['class', 'SoftLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 323 }, { "content": " def test13_direct_attribute_access_via_chained_softlinks(self):\n \"\"\"Check get/set access via link2-->link1-->target.child.attribute\"\"\"\n\n lgroup1 = self.h5file.get_node('/lgroup1')\n arr2 = self.h5file.get_node('/group1/arr2')\n # multiple chained links\n l_lgroup1 = self.h5file.create_soft_link('/', 'l_lgroup1', '/lgroup1')\n # get child attribute\n self.assertTrue(l_lgroup1.arr2[:] == [1, 2, 3])\n # set child attribute\n l_lgroup1.arr2[0] = -1\n self.assertTrue(arr2[:] == [-1, 2, 3])", "metadata": "root.SoftLinkTestCase.test13_direct_attribute_access_via_chained_softlinks", "header": "['class', 'SoftLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 334 }, { "content": " def test14_child_of_softlink_to_group(self):\n \"\"\"Create an array whose parent is a softlink to another group\"\"\"\n\n group1 = self.h5file.get_node('/group1')\n lgroup1 = self.h5file.get_node('/lgroup1')\n new_arr = self.h5file.create_array(lgroup1, 'new_arr', obj=[1, 2, 3])\n new_arr2 = self.h5file.get_node('/group1/new_arr')\n self.assertTrue(new_arr2[:] == [1, 2, 3])", "metadata": "root.SoftLinkTestCase.test14_child_of_softlink_to_group", "header": "['class', 'SoftLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 347 }, { "content": " def _createFile(self):\n self.h5file.create_array('/', 'arr1', [1, 2])\n group1 = self.h5file.create_group('/', 'group1')\n self.h5file.create_array(group1, 'arr2', [1, 2, 3])\n\n # The external file\n extarr1 = self.exth5file.create_array('/', 'arr1', [1, 2])\n self.assertTrue(extarr1 is not None)\n extgroup1 = self.exth5file.create_group('/', 'group1')\n extarr2 = self.exth5file.create_array(extgroup1, 'arr2', [1, 2, 3])\n\n # Create external links\n lgroup1 = self.h5file.create_external_link(\n '/', 'lgroup1', '%s:/group1' % self.extfname)\n self.assertTrue(lgroup1 is not None)\n larr1 = self.h5file.create_external_link(\n group1, 'larr1', '%s:/arr1' % self.extfname)\n self.assertTrue(larr1 is not None)\n larr2 = self.h5file.create_external_link('/', 'larr2', extarr2)\n self.assertTrue(larr2 is not None)\n\n # Re-open the external file in 'r'ead-only mode\n self.exth5file.close()\n self.exth5file = tables.open_file(self.extfname, \"r\")", "metadata": "root.ExternalLinkTestCase._createFile", "header": "['class', 'ExternalLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 395 }, { "content": " def test02_remove(self):\n \"\"\"Removing an external link.\"\"\"\n\n # Re-open the external file in 'a'ppend mode\n self.exth5file.close()\n self.exth5file = tables.open_file(self.extfname, \"a\")\n\n # First delete the referred link\n self.exth5file.root.arr1.remove()\n self.assertTrue('/arr1' not in self.exth5file)\n\n # The external link should still be there (but dangling)\n if common.verbose:\n print(\"Dangling link:\", self.h5file.root.group1.larr1)\n self.assertTrue('/group1/larr1' in self.h5file)\n\n # Remove the external link itself\n self.h5file.root.group1.larr1.remove()\n self.assertTrue('/group1/larr1' not in self.h5file)", "metadata": "root.ExternalLinkTestCase.test02_remove", "header": "['class', 'ExternalLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 441 }, { "content": " def test03_copy(self):\n \"\"\"Copying an external link.\"\"\"\n\n # Copy the link into another location\n root = self.h5file.root\n lgroup1 = root.lgroup1\n lgroup2 = lgroup1.copy('/', 'lgroup2')\n self.assertTrue('/lgroup1' in self.h5file)\n self.assertTrue('/lgroup2' in self.h5file)\n self.assertTrue('lgroup2' in root._v_children)\n self.assertTrue('lgroup2' in root._v_links)\n if common.verbose:\n print(\"Copied link:\", lgroup2)\n\n # Remove the first link\n lgroup1.remove()\n self._checkEqualityGroup(self.exth5file.root.group1,\n self.h5file.root.lgroup2())", "metadata": "root.ExternalLinkTestCase.test03_copy", "header": "['class', 'ExternalLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 461 }, { "content": " def test03_overwrite(self):\n \"\"\"Overwrite an external link.\"\"\"\n\n # Copy the link into another location\n root = self.h5file.root\n lgroup1 = root.lgroup1\n lgroup2 = lgroup1.copy('/', 'lgroup2')\n lgroup2 = lgroup1.copy('/', 'lgroup2', overwrite=True)\n self.assertTrue('/lgroup1' in self.h5file)\n self.assertTrue('/lgroup2' in self.h5file)\n self.assertTrue('lgroup2' in root._v_children)\n self.assertTrue('lgroup2' in root._v_links)\n if common.verbose:\n print(\"Copied link:\", lgroup2)\n\n # Remove the first link\n lgroup1.remove()\n self._checkEqualityGroup(self.exth5file.root.group1,\n self.h5file.root.lgroup2())", "metadata": "root.ExternalLinkTestCase.test03_overwrite", "header": "['class', 'ExternalLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 480 }, { "content": " def test04_move(self):\n \"\"\"Moving an external link.\"\"\"\n\n # Move the link into another location\n lgroup1 = self.h5file.root.lgroup1\n group2 = self.h5file.create_group('/', 'group2')\n lgroup1.move(group2, 'lgroup2')\n lgroup2 = self.h5file.root.group2.lgroup2\n if common.verbose:\n print(\"Moved link:\", lgroup2)\n self.assertTrue('/lgroup1' not in self.h5file)\n self.assertTrue('/group2/lgroup2' in self.h5file)\n self._checkEqualityGroup(self.exth5file.root.group1,\n self.h5file.root.group2.lgroup2())", "metadata": "root.ExternalLinkTestCase.test04_move", "header": "['class', 'ExternalLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 500 }, { "content": " def test05_rename(self):\n \"\"\"Renaming an external link.\"\"\"\n\n # Rename the link\n lgroup1 = self.h5file.root.lgroup1\n lgroup1.rename('lgroup2')\n lgroup2 = self.h5file.root.lgroup2\n if common.verbose:\n print(\"Moved link:\", lgroup2)\n self.assertTrue('/lgroup1' not in self.h5file)\n self.assertTrue('/lgroup2' in self.h5file)\n self._checkEqualityGroup(self.exth5file.root.group1,\n self.h5file.root.lgroup2())", "metadata": "root.ExternalLinkTestCase.test05_rename", "header": "['class', 'ExternalLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 515 }, { "content": " def test09_umount(self):\n \"\"\"Checking `umount()` method.\"\"\"\n\n link = self.h5file.root.lgroup1\n self.assertTrue(link.extfile is None)\n\n # Dereference a external node (and hence, 'mount' a file)\n enode = link()\n self.assertTrue(enode is not None)\n self.assertTrue(link.extfile is not None)\n\n # Umount the link\n link.umount()\n self.assertTrue(link.extfile is None)", "metadata": "root.ExternalLinkTestCase.test09_umount", "header": "['class', 'ExternalLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 558 }, { "content": " def test10_copy_link_to_file(self):\n \"\"\"Checking copying a link to another file.\"\"\"\n\n h5fname2 = tempfile.mktemp(\".h5\")\n try:\n with tables.open_file(h5fname2, \"a\") as h5file2:\n h5file2.create_array('/', 'arr1', [1, 2])\n h5file2.create_group('/', 'group1')\n lgroup1 = self.h5file.root.lgroup1\n lgroup1_ = lgroup1.copy(h5file2.root, 'lgroup1')\n self.assertTrue('/lgroup1' in self.h5file)\n self.assertTrue('/lgroup1' in h5file2)\n self.assertTrue(lgroup1_ in h5file2)\n if common.verbose:\n print(\"Copied link:\", lgroup1_, 'in:',\n lgroup1_._v_file.filename)\n finally:\n if os.path.exists(h5fname2):\n os.remove(h5fname2)", "metadata": "root.ExternalLinkTestCase.test10_copy_link_to_file", "header": "['class', 'ExternalLinkTestCase', '(', 'common', '.', 'TempFileMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 573 } ]
[ { "span": "self.assertTrue(lgroup1 is not None)", "start_line": 39, "start_column": 8, "end_line": 39, "end_column": 44 }, { "span": "self.assertTrue(larr1 is not None)", "start_line": 41, "start_column": 8, "end_line": 41, "end_column": 42 }, { "span": "self.assertTrue(larr2 is not None)", "start_line": 43, "start_column": 8, "end_line": 43, "end_column": 42 }, { "span": "self.assertTrue('/arr1' not in self.h5file)", "start_line": 77, "start_column": 8, "end_line": 77, "end_column": 51 }, { "span": "self.assertTrue('/group1/larr1' in self.h5file)", "start_line": 81, "start_column": 8, "end_line": 81, "end_column": 55 }, { "span": "self.assertTrue('/group1/larr1' not in self.h5file)", "start_line": 84, "start_column": 8, "end_line": 84, "end_column": 59 }, { "span": "self.assertTrue('/group1' not in self.h5file)", "start_line": 93, "start_column": 8, "end_line": 93, "end_column": 53 }, { "span": "self.assertTrue('/lgroup1' in self.h5file)", "start_line": 98, "start_column": 8, "end_line": 98, "end_column": 50 }, { "span": "self.assertTrue('/lgroup1' not in self.h5file)", "start_line": 101, "start_column": 8, "end_line": 101, "end_column": 54 }, { "span": "self.assertTrue(lgroup1 is not None)", "start_line": 118, "start_column": 8, "end_line": 118, "end_column": 44 }, { "span": "self.assertTrue(larr1 is not None)", "start_line": 120, "start_column": 8, "end_line": 120, "end_column": 42 }, { "span": "self.assertTrue(larr2 is not None)", "start_line": 122, "start_column": 8, "end_line": 122, "end_column": 42 }, { "span": "self.assertTrue('/arr1' not in self.h5file)", "start_line": 150, "start_column": 8, "end_line": 150, "end_column": 51 }, { "span": "self.assertTrue('/group1/larr1' in self.h5file)", "start_line": 154, "start_column": 8, "end_line": 154, "end_column": 55 }, { "span": "self.assertTrue('/group1/larr1' not in self.h5file)", "start_line": 157, "start_column": 8, "end_line": 157, "end_column": 59 }, { "span": "self.assertTrue('/lgroup1' in self.h5file)", "start_line": 166, "start_column": 8, "end_line": 166, "end_column": 50 }, { "span": "self.assertTrue('/lgroup2' in self.h5file)", "start_line": 167, "start_column": 8, "end_line": 167, "end_column": 50 }, { "span": "self.assertTrue('lgroup2' in root._v_children)", "start_line": 168, "start_column": 8, "end_line": 168, "end_column": 54 }, { "span": "self.assertTrue('lgroup2' in root._v_links)", "start_line": 169, "start_column": 8, "end_line": 169, "end_column": 51 }, { "span": "self.assertTrue('/lgroup1' in self.h5file)", "start_line": 185, "start_column": 8, "end_line": 185, "end_column": 50 }, { "span": "self.assertTrue('/lgroup2' in self.h5file)", "start_line": 186, "start_column": 8, "end_line": 186, "end_column": 50 }, { "span": "self.assertTrue('lgroup2' in root._v_children)", "start_line": 187, "start_column": 8, "end_line": 187, "end_column": 54 }, { "span": "self.assertTrue('lgroup2' in root._v_links)", "start_line": 188, "start_column": 8, "end_line": 188, "end_column": 51 }, { "span": "self.assertTrue('/lgroup1' not in self.h5file)", "start_line": 206, "start_column": 8, "end_line": 206, "end_column": 54 }, { "span": "self.assertTrue('/group2/lgroup2' in self.h5file)", "start_line": 207, "start_column": 8, "end_line": 207, "end_column": 57 }, { "span": "self.assertTrue('/lgroup1' not in self.h5file)", "start_line": 220, "start_column": 8, "end_line": 220, "end_column": 54 }, { "span": "self.assertTrue('/lgroup2' in self.h5file)", "start_line": 221, "start_column": 8, "end_line": 221, "end_column": 50 }, { "span": "self.assertTrue('/group1/lgroup3' in self.h5file)", "start_line": 235, "start_column": 8, "end_line": 235, "end_column": 57 }, { "span": "self.assertTrue('/group1/lgroup3' in self.h5file)", "start_line": 249, "start_column": 8, "end_line": 249, "end_column": 57 }, { "span": "self.assertTrue(lgroup2() is self.h5file.get_node('/lgroup1'))", "start_line": 286, "start_column": 8, "end_line": 286, "end_column": 70 }, { "span": "self.assertTrue(lgroup2()() is self.h5file.get_node('/group1'))", "start_line": 290, "start_column": 8, "end_line": 290, "end_column": 71 }, { "span": "self.assertTrue('/lgroup1' in self.h5file)", "start_line": 303, "start_column": 8, "end_line": 303, "end_column": 50 }, { "span": "self.assertTrue('/lgroup1' in h5f)", "start_line": 304, "start_column": 8, "end_line": 304, "end_column": 42 }, { "span": "self.assertTrue(lgroup1_ in h5f)", "start_line": 305, "start_column": 8, "end_line": 305, "end_column": 40 }, { "span": "self.assertTrue(larr1.shape == (2,))", "start_line": 317, "start_column": 8, "end_line": 317, "end_column": 44 }, { "span": "self.assertTrue(larr1[:] == [1, 2])", "start_line": 318, "start_column": 8, "end_line": 318, "end_column": 43 }, { "span": "self.assertTrue(arr1[:] == [-1, 2])", "start_line": 321, "start_column": 8, "end_line": 321, "end_column": 43 }, { "span": "self.assertTrue(lgroup1.arr2[:] == [1, 2, 3])", "start_line": 329, "start_column": 8, "end_line": 329, "end_column": 53 }, { "span": "self.assertTrue(arr2[:] == [-1, 2, 3])", "start_line": 332, "start_column": 8, "end_line": 332, "end_column": 46 }, { "span": "self.assertTrue(l_lgroup1.arr2[:] == [1, 2, 3])", "start_line": 342, "start_column": 8, "end_line": 342, "end_column": 55 }, { "span": "self.assertTrue(arr2[:] == [-1, 2, 3])", "start_line": 345, "start_column": 8, "end_line": 345, "end_column": 46 }, { "span": "self.assertTrue(new_arr2[:] == [1, 2, 3])", "start_line": 354, "start_column": 8, "end_line": 354, "end_column": 49 }, { "span": "self.assertTrue(extarr1 is not None)", "start_line": 402, "start_column": 8, "end_line": 402, "end_column": 44 }, { "span": "self.assertTrue(lgroup1 is not None)", "start_line": 409, "start_column": 8, "end_line": 409, "end_column": 44 }, { "span": "self.assertTrue(larr1 is not None)", "start_line": 412, "start_column": 8, "end_line": 412, "end_column": 42 }, { "span": "self.assertTrue(larr2 is not None)", "start_line": 414, "start_column": 8, "end_line": 414, "end_column": 42 }, { "span": "self.assertTrue('/arr1' not in self.exth5file)", "start_line": 450, "start_column": 8, "end_line": 450, "end_column": 54 }, { "span": "self.assertTrue('/group1/larr1' in self.h5file)", "start_line": 455, "start_column": 8, "end_line": 455, "end_column": 55 }, { "span": "self.assertTrue('/group1/larr1' not in self.h5file)", "start_line": 459, "start_column": 8, "end_line": 459, "end_column": 59 }, { "span": "self.assertTrue('/lgroup1' in self.h5file)", "start_line": 468, "start_column": 8, "end_line": 468, "end_column": 50 }, { "span": "self.assertTrue('/lgroup2' in self.h5file)", "start_line": 469, "start_column": 8, "end_line": 469, "end_column": 50 }, { "span": "self.assertTrue('lgroup2' in root._v_children)", "start_line": 470, "start_column": 8, "end_line": 470, "end_column": 54 }, { "span": "self.assertTrue('lgroup2' in root._v_links)", "start_line": 471, "start_column": 8, "end_line": 471, "end_column": 51 }, { "span": "self.assertTrue('/lgroup1' in self.h5file)", "start_line": 488, "start_column": 8, "end_line": 488, "end_column": 50 }, { "span": "self.assertTrue('/lgroup2' in self.h5file)", "start_line": 489, "start_column": 8, "end_line": 489, "end_column": 50 }, { "span": "self.assertTrue('lgroup2' in root._v_children)", "start_line": 490, "start_column": 8, "end_line": 490, "end_column": 54 }, { "span": "self.assertTrue('lgroup2' in root._v_links)", "start_line": 491, "start_column": 8, "end_line": 491, "end_column": 51 }, { "span": "self.assertTrue('/lgroup1' not in self.h5file)", "start_line": 510, "start_column": 8, "end_line": 510, "end_column": 54 }, { "span": "self.assertTrue('/group2/lgroup2' in self.h5file)", "start_line": 511, "start_column": 8, "end_line": 511, "end_column": 57 }, { "span": "self.assertTrue('/lgroup1' not in self.h5file)", "start_line": 524, "start_column": 8, "end_line": 524, "end_column": 54 }, { "span": "self.assertTrue('/lgroup2' in self.h5file)", "start_line": 525, "start_column": 8, "end_line": 525, "end_column": 50 }, { "span": "self.assertTrue(link.extfile is None)", "start_line": 562, "start_column": 8, "end_line": 562, "end_column": 45 }, { "span": "self.assertTrue(enode is not None)", "start_line": 566, "start_column": 8, "end_line": 566, "end_column": 42 }, { "span": "self.assertTrue(link.extfile is not None)", "start_line": 567, "start_column": 8, "end_line": 567, "end_column": 49 }, { "span": "self.assertTrue(link.extfile is None)", "start_line": 571, "start_column": 8, "end_line": 571, "end_column": 45 }, { "span": "self.assertTrue('/lgroup1' in self.h5file)", "start_line": 583, "start_column": 16, "end_line": 583, "end_column": 58 }, { "span": "self.assertTrue('/lgroup1' in h5file2)", "start_line": 584, "start_column": 16, "end_line": 584, "end_column": 54 }, { "span": "self.assertTrue(lgroup1_ in h5file2)", "start_line": 585, "start_column": 16, "end_line": 585, "end_column": 52 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Hard", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "create", "File_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "h5file", "_", "._", "create", "\\u", "array_", "(_", "'/'_", ",_", "'", "arr", "1", "'_", ",_", "[_", "1_", ",_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "group1_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "group_", "(_", "'/'_", ",_", "'", "group", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arr", "2_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "array_", "(_", "group1_", ",_", "'", "arr", "2", "'_", ",_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "1_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "hard", "\\u", "link_", "(_", "'/'_", ",_", "'", "lg", "roup", "1", "'_", ",_", "'/", "group", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "lg", "roup", "1_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lar", "r1_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "hard", "\\u", "link_", "(_", "group1_", ",_", "'", "lar", "r1", "'_", ",_", "'/", "arr", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "lar", "r1_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lar", "r2_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "hard", "\\u", "link_", "(_", "'/'_", ",_", "'", "lar", "r2", "'_", ",_", "arr", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "lar", "r2_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hard", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test0", "2", "\\u", "remove", "Leaf_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Remo", "ving", " ", "a", " ", "hard", " ", "link", " ", "to", " ", "a", " ", "Lea", "f", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fi", "rst", " ", "delete", " ", "the", " ", "initial", " ", "link_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "h5file", "_", "._", "root_", "._", "arr", "1_", "._", "remove_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "arr", "1", "'_", "not_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "second", " ", "link", " ", "shou", "ld", " ", "still", " ", "be", " ", "there", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "common_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Rema", "inin", "g", " ", "link", ":\"_", ",_", "self_", "._", "h5file", "_", "._", "root_", "._", "group1_", "._", "lar", "r1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "group", "1", "/", "lar", "r1", "'_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Remove", " ", "the", " ", "second", " ", "link_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "h5file", "_", "._", "root_", "._", "group1_", "._", "lar", "r1_", "._", "remove_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "group", "1", "/", "lar", "r1", "'_", "not_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hard", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test0", "3", "\\u", "remove", "Group_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Remo", "ving", " ", "a", " ", "hard", " ", "link", " ", "to", " ", "a", " ", "Group", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "common_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Origina", "l", " ", "object", " ", "tree", ":\"_", ",_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fi", "rst", " ", "delete", " ", "the", " ", "initial", " ", "link_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "h5file", "_", "._", "root_", "._", "group1_", "._", "\\u", "f", "\\u", "remove_", "(_", "force_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "group", "1", "'_", "not_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "second", " ", "link", " ", "shou", "ld", " ", "still", " ", "be", " ", "there", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "common_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Rema", "inin", "g", " ", "link", ":\"_", ",_", "self_", "._", "h5file", "_", "._", "root_", "._", "lg", "roup", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Object", " ", "tree", ":\"_", ",_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "lg", "roup", "1", "'_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Remove", " ", "the", " ", "second", " ", "link_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "h5file", "_", "._", "root_", "._", "lg", "roup", "1_", "._", "\\u", "g", "\\u", "remove_", "(_", "recursive_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "lg", "roup", "1", "'_", "not_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "common_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Final", " ", "object", " ", "tree", ":\"_", ",_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sof", "t", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "create", "File_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "h5file", "_", "._", "create", "\\u", "array_", "(_", "'/'_", ",_", "'", "arr", "1", "'_", ",_", "[_", "1_", ",_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "group1_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "group_", "(_", "'/'_", ",_", "'", "group", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arr", "2_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "array_", "(_", "group1_", ",_", "'", "arr", "2", "'_", ",_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "1_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "soft", "\\u", "link_", "(_", "'/'_", ",_", "'", "lg", "roup", "1", "'_", ",_", "'/", "group", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "lg", "roup", "1_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lar", "r1_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "soft", "\\u", "link_", "(_", "group1_", ",_", "'", "lar", "r1", "'_", ",_", "'/", "arr", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "lar", "r1_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lar", "r2_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "soft", "\\u", "link_", "(_", "'/'_", ",_", "'", "lar", "r2", "'_", ",_", "arr", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "lar", "r2_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sof", "t", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test0", "2", "\\u", "remove_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Remo", "ving", " ", "a", " ", "soft", " ", "link", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fi", "rst", " ", "delete", " ", "the", " ", "referred", " ", "link_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "h5file", "_", "._", "root_", "._", "arr", "1_", "._", "remove_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "arr", "1", "'_", "not_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "soft", " ", "link", " ", "shou", "ld", " ", "still", " ", "be", " ", "there", " ", "(", "but", " ", "dan", "glin", "g", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "common_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Dan", "glin", "g", " ", "link", ":\"_", ",_", "self_", "._", "h5file", "_", "._", "root_", "._", "group1_", "._", "lar", "r1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "group", "1", "/", "lar", "r1", "'_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Remove", " ", "the", " ", "soft", " ", "link", " ", "its", "elf_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "h5file", "_", "._", "root_", "._", "group1_", "._", "lar", "r1_", "._", "remove_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "group", "1", "/", "lar", "r1", "'_", "not_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sof", "t", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test0", "3", "\\u", "copy_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Copy", "ing", " ", "a", " ", "soft", " ", "link", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", " ", "the", " ", "link", " ", "int", "o", " ", "anot", "her", " ", "location_", "\\u\\u\\uNL\\u\\u\\u_", "root_", "=_", "self_", "._", "h5file", "_", "._", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "1_", "=_", "root_", "._", "lg", "roup", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "2_", "=_", "lg", "roup", "1_", "._", "copy_", "(_", "'/'_", ",_", "'", "lg", "roup", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "lg", "roup", "1", "'_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "lg", "roup", "2", "'_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "lg", "roup", "2", "'_", "in_", "root_", "._", "\\u", "v", "\\u", "children_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "lg", "roup", "2", "'_", "in_", "root_", "._", "\\u", "v", "\\u", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "common_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Copie", "d", " ", "link", ":\"_", ",_", "lg", "roup", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Remove", " ", "the", " ", "first", " ", "link_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lg", "roup", "1_", "._", "remove_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "Equali", "ty", "Group_", "(_", "self_", "._", "h5file", "_", "._", "root_", "._", "group1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "h5file", "_", "._", "root_", "._", "lg", "roup", "2_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sof", "t", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test0", "3", "\\u", "overwrite_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Over", "write", " ", "a", " ", "soft", " ", "link", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", " ", "the", " ", "link", " ", "int", "o", " ", "anot", "her", " ", "location_", "\\u\\u\\uNL\\u\\u\\u_", "root_", "=_", "self_", "._", "h5file", "_", "._", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "1_", "=_", "root_", "._", "lg", "roup", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "2_", "=_", "lg", "roup", "1_", "._", "copy_", "(_", "'/'_", ",_", "'", "lg", "roup", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "2_", "=_", "lg", "roup", "1_", "._", "copy_", "(_", "'/'_", ",_", "'", "lg", "roup", "2", "'_", ",_", "overwrite_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "lg", "roup", "1", "'_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "lg", "roup", "2", "'_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "lg", "roup", "2", "'_", "in_", "root_", "._", "\\u", "v", "\\u", "children_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "lg", "roup", "2", "'_", "in_", "root_", "._", "\\u", "v", "\\u", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "common_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Copie", "d", " ", "link", ":\"_", ",_", "lg", "roup", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Remove", " ", "the", " ", "first", " ", "link_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lg", "roup", "1_", "._", "remove_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "Equali", "ty", "Group_", "(_", "self_", "._", "h5file", "_", "._", "root_", "._", "group1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "h5file", "_", "._", "root_", "._", "lg", "roup", "2_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sof", "t", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test0", "4", "\\u", "move_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Movi", "ng", " ", "a", " ", "soft", " ", "link", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Move", " ", "the", " ", "link", " ", "int", "o", " ", "anot", "her", " ", "location_", "\\u\\u\\uNL\\u\\u\\u_", "lg", "roup", "1_", "=_", "self_", "._", "h5file", "_", "._", "root_", "._", "lg", "roup", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "group2_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "group_", "(_", "'/'_", ",_", "'", "group", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "1_", "._", "move_", "(_", "group2_", ",_", "'", "lg", "roup", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "2_", "=_", "self_", "._", "h5file", "_", "._", "root_", "._", "group2_", "._", "lg", "roup", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "common_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Move", "d", " ", "link", ":\"_", ",_", "lg", "roup", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "lg", "roup", "1", "'_", "not_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "group", "2", "/", "lg", "roup", "2", "'_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "Equali", "ty", "Group_", "(_", "self_", "._", "h5file", "_", "._", "root_", "._", "group1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "h5file", "_", "._", "root_", "._", "group2_", "._", "lg", "roup", "2_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sof", "t", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test0", "5", "\\u", "rename_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Ren", "amin", "g", " ", "a", " ", "soft", " ", "link", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Rename", " ", "the", " ", "link_", "\\u\\u\\uNL\\u\\u\\u_", "lg", "roup", "1_", "=_", "self_", "._", "h5file", "_", "._", "root_", "._", "lg", "roup", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "1_", "._", "rename_", "(_", "'", "lg", "roup", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "2_", "=_", "self_", "._", "h5file", "_", "._", "root_", "._", "lg", "roup", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "common_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Move", "d", " ", "link", ":\"_", ",_", "lg", "roup", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "lg", "roup", "1", "'_", "not_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "lg", "roup", "2", "'_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "Equali", "ty", "Group_", "(_", "self_", "._", "h5file", "_", "._", "root_", "._", "group1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "h5file", "_", "._", "root_", "._", "lg", "roup", "2_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sof", "t", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test0", "6a", "\\u", "relative", "\\u", "path_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Us", "ing", " ", "soft", " ", "link", "s", " ", "with", " ", "relative", " ", "path", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "new", " ", "group_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "h5file", "_", "._", "create", "\\u", "group_", "(_", "'/", "group", "1", "'_", ",_", "'", "group", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "...", " ", "and", " ", "relative", " ", "link_", "\\u\\u\\uNL\\u\\u\\u_", "lg", "roup", "3_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "soft", "\\u", "link_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'/", "group", "1", "'_", ",_", "'", "lg", "roup", "3", "'_", ",_", "'", "group", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "common_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Relative", " ", "path", " ", "link", ":\"_", ",_", "lg", "roup", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "group", "1", "/", "lg", "roup", "3", "'_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "Equali", "ty", "Group_", "(_", "self_", "._", "h5file", "_", "._", "root_", "._", "group1_", "._", "group", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "h5file", "_", "._", "root_", "._", "group1_", "._", "lg", "roup", "3_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sof", "t", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test0", "6b", "\\u", "relative", "\\u", "path_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Us", "ing", " ", "soft", " ", "link", "s", " ", "with", " ", "relative", " ", "path", "s", " ", "(.", "/", " ", "version", ")\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "new", " ", "group_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "h5file", "_", "._", "create", "\\u", "group_", "(_", "'/", "group", "1", "'_", ",_", "'", "group", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "...", " ", "and", " ", "relative", " ", "link_", "\\u\\u\\uNL\\u\\u\\u_", "lg", "roup", "3_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "soft", "\\u", "link_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'/", "group", "1", "'_", ",_", "'", "lg", "roup", "3", "'_", ",_", "'./", "group", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "common_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Relative", " ", "path", " ", "link", ":\"_", ",_", "lg", "roup", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "group", "1", "/", "lg", "roup", "3", "'_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "Equali", "ty", "Group_", "(_", "self_", "._", "h5file", "_", "._", "root_", "._", "group1_", "._", "group", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "h5file", "_", "._", "root_", "._", "group1_", "._", "lg", "roup", "3_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sof", "t", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test0", "9", "\\u", "link", "\\u", "to", "\\u", "link_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Check", "ing", " ", "linked", " ", "link", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "a", " ", "link", " ", "to", " ", "anot", "her", " ", "exist", "ing", " ", "link_", "\\u\\u\\uNL\\u\\u\\u_", "lg", "roup", "2_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "soft", "\\u", "link_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'/'_", ",_", "'", "lg", "roup", "2", "'_", ",_", "'/", "lg", "roup", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Der", "efer", "ence", " ", "it", " ", "onc", "e", ":_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "lg", "roup", "2_", "(_", ")_", "is_", "self_", "._", "h5file", "_", "._", "get", "\\u", "node_", "(_", "'/", "lg", "roup", "1", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "common_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Fi", "rst", " ", "dereferenc", "e", " ", "is", " ", "correct", ":\"_", ",_", "lg", "roup", "2_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Der", "efer", "ence", " ", "it", " ", "twi", "ce", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "lg", "roup", "2_", "(_", ")_", "(_", ")_", "is_", "self_", "._", "h5file", "_", "._", "get", "\\u", "node_", "(_", "'/", "group", "1", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "common_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Second", " ", "dereferenc", "e", " ", "is", " ", "correct", ":\"_", ",_", "lg", "roup", "2_", "(_", ")_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sof", "t", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "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", "10", "\\u", "copy", "\\u", "link", "\\u", "to", "\\u", "file_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Check", "ing", " ", "copy", "ing", " ", "a", " ", "link", " ", "to", " ", "anot", "her", " ", "file", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fname_", "=_", "tempfile_", "._", "mktemp_", "(_", "\".", "h5", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h5", "f_", "=_", "tables_", "._", "open", "\\u", "file_", "(_", "fname_", ",_", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h5", "f_", "._", "create", "\\u", "array_", "(_", "'/'_", ",_", "'", "arr", "1", "'_", ",_", "[_", "1_", ",_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h5", "f_", "._", "create", "\\u", "group_", "(_", "'/'_", ",_", "'", "group", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "1_", "=_", "self_", "._", "h5file", "_", "._", "root_", "._", "lg", "roup", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "1", "\\u_", "=_", "lg", "roup", "1_", "._", "copy_", "(_", "h5", "f_", "._", "root_", ",_", "'", "lg", "roup", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "lg", "roup", "1", "'_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "lg", "roup", "1", "'_", "in_", "h5", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "lg", "roup", "1", "\\u_", "in_", "h5", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "common_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Copie", "d", " ", "link", ":\"_", ",_", "lg", "roup", "1", "\\u_", ",_", "'", "in", ":'_", ",_", "lg", "roup", "1", "\\u_", "._", "\\u", "v", "\\u", "file_", "._", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "h5", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "remove_", "(_", "fname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sof", "t", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "11", "\\u", "direct", "\\u", "attribute", "\\u", "access_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Check", " ", "direct", " ", "get", "/", "set", " ", "attribute", "s", " ", "via", " ", "link", "-->", "target", ".", "attribute", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lar", "r1_", "=_", "self_", "._", "h5file", "_", "._", "get", "\\u", "node_", "(_", "'/", "lg", "roup", "1", "/", "lar", "r1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arr", "1_", "=_", "self_", "._", "h5file", "_", "._", "get", "\\u", "node_", "(_", "'/", "arr", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "lar", "r1_", "._", "shape_", "==_", "(_", "2_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "lar", "r1_", "[_", ":_", "]_", "==_", "[_", "1_", ",_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "lar", "r1_", "[_", "0_", "]_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "arr", "1_", "[_", ":_", "]_", "==_", "[_", "-_", "1_", ",_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sof", "t", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "1", "2", "\\u", "access", "\\u", "child", "\\u", "node", "\\u", "attributes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Check", " ", "get", "/", "set", " ", "attribute", "s", " ", "via", " ", "link", "-->", "target", ".", "child", ".", "attribute", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lg", "roup", "1_", "=_", "self_", "._", "h5file", "_", "._", "get", "\\u", "node_", "(_", "'/", "lg", "roup", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arr", "2_", "=_", "self_", "._", "h5file", "_", "._", "get", "\\u", "node_", "(_", "'/", "group", "1", "/", "arr", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "child", " ", "attribute_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "lg", "roup", "1_", "._", "arr", "2_", "[_", ":_", "]_", "==_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set", " ", "child", " ", "attribute_", "\\u\\u\\uNL\\u\\u\\u_", "lg", "roup", "1_", "._", "arr", "2_", "[_", "0_", "]_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "arr", "2_", "[_", ":_", "]_", "==_", "[_", "-_", "1_", ",_", "2_", ",_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sof", "t", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "13", "\\u", "direct", "\\u", "attribute", "\\u", "access", "\\u", "via", "\\u", "chained", "\\u", "soft", "links_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Check", " ", "get", "/", "set", " ", "access", " ", "via", " ", "link", "2", "-->", "link", "1", "-->", "target", ".", "child", ".", "attribute", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lg", "roup", "1_", "=_", "self_", "._", "h5file", "_", "._", "get", "\\u", "node_", "(_", "'/", "lg", "roup", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arr", "2_", "=_", "self_", "._", "h5file", "_", "._", "get", "\\u", "node_", "(_", "'/", "group", "1", "/", "arr", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "multiple", " ", "chained", " ", "links_", "\\u\\u\\uNL\\u\\u\\u_", "l\\u", "lg", "roup", "1_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "soft", "\\u", "link_", "(_", "'/'_", ",_", "'", "l\\u", "lg", "roup", "1", "'_", ",_", "'/", "lg", "roup", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "child", " ", "attribute_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "l\\u", "lg", "roup", "1_", "._", "arr", "2_", "[_", ":_", "]_", "==_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set", " ", "child", " ", "attribute_", "\\u\\u\\uNL\\u\\u\\u_", "l\\u", "lg", "roup", "1_", "._", "arr", "2_", "[_", "0_", "]_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "arr", "2_", "[_", ":_", "]_", "==_", "[_", "-_", "1_", ",_", "2_", ",_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sof", "t", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "14", "\\u", "child", "\\u", "of", "\\u", "soft", "link", "\\u", "to", "\\u", "group_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Creat", "e", " ", "an", " ", "array", " ", "who", "se", " ", "parent", " ", "is", " ", "a", " ", "soft", "link", " ", "to", " ", "anot", "her", " ", "group", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "group1_", "=_", "self_", "._", "h5file", "_", "._", "get", "\\u", "node_", "(_", "'/", "group", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "1_", "=_", "self_", "._", "h5file", "_", "._", "get", "\\u", "node_", "(_", "'/", "lg", "roup", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "arr_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "array_", "(_", "lg", "roup", "1_", ",_", "'", "new", "\\u", "arr", "'_", ",_", "obj_", "=_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "arr", "2_", "=_", "self_", "._", "h5file", "_", "._", "get", "\\u", "node_", "(_", "'/", "group", "1", "/", "new", "\\u", "arr", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "new", "\\u", "arr", "2_", "[_", ":_", "]_", "==_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "create", "File_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "h5file", "_", "._", "create", "\\u", "array_", "(_", "'/'_", ",_", "'", "arr", "1", "'_", ",_", "[_", "1_", ",_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "group1_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "group_", "(_", "'/'_", ",_", "'", "group", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "h5file", "_", "._", "create", "\\u", "array_", "(_", "group1_", ",_", "'", "arr", "2", "'_", ",_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "external", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "ext", "arr", "1_", "=_", "self_", "._", "ext", "h5file", "_", "._", "create", "\\u", "array_", "(_", "'/'_", ",_", "'", "arr", "1", "'_", ",_", "[_", "1_", ",_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ext", "arr", "1_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ext", "group1_", "=_", "self_", "._", "ext", "h5file", "_", "._", "create", "\\u", "group_", "(_", "'/'_", ",_", "'", "group", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ext", "arr", "2_", "=_", "self_", "._", "ext", "h5file", "_", "._", "create", "\\u", "array_", "(_", "ext", "group1_", ",_", "'", "arr", "2", "'_", ",_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "external", " ", "links_", "\\u\\u\\uNL\\u\\u\\u_", "lg", "roup", "1_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "external", "\\u", "link_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'/'_", ",_", "'", "lg", "roup", "1", "'_", ",_", "'%", "s", ":/", "group", "1", "'_", "%_", "self_", "._", "ext", "fname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "lg", "roup", "1_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lar", "r1_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "external", "\\u", "link_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "group1_", ",_", "'", "lar", "r1", "'_", ",_", "'%", "s", ":/", "arr", "1", "'_", "%_", "self_", "._", "ext", "fname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "lar", "r1_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lar", "r2_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "external", "\\u", "link_", "(_", "'/'_", ",_", "'", "lar", "r2", "'_", ",_", "ext", "arr", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "lar", "r2_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Re", "-", "open", " ", "the", " ", "external", " ", "file", " ", "in", " ", "'", "r", "'", "ead", "-", "only", " ", "mode_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ext", "h5file", "_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ext", "h5file", "_", "=_", "tables_", "._", "open", "\\u", "file_", "(_", "self_", "._", "ext", "fname_", ",_", "\"", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test0", "2", "\\u", "remove_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Remo", "ving", " ", "an", " ", "external", " ", "link", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Re", "-", "open", " ", "the", " ", "external", " ", "file", " ", "in", " ", "'", "a", "'", "ppe", "nd", " ", "mode_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ext", "h5file", "_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ext", "h5file", "_", "=_", "tables_", "._", "open", "\\u", "file_", "(_", "self_", "._", "ext", "fname_", ",_", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fi", "rst", " ", "delete", " ", "the", " ", "referred", " ", "link_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ext", "h5file", "_", "._", "root_", "._", "arr", "1_", "._", "remove_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "arr", "1", "'_", "not_", "in_", "self_", "._", "ext", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "external", " ", "link", " ", "shou", "ld", " ", "still", " ", "be", " ", "there", " ", "(", "but", " ", "dan", "glin", "g", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "common_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Dan", "glin", "g", " ", "link", ":\"_", ",_", "self_", "._", "h5file", "_", "._", "root_", "._", "group1_", "._", "lar", "r1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "group", "1", "/", "lar", "r1", "'_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remove", " ", "the", " ", "external", " ", "link", " ", "its", "elf_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "h5file", "_", "._", "root_", "._", "group1_", "._", "lar", "r1_", "._", "remove_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "group", "1", "/", "lar", "r1", "'_", "not_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test0", "3", "\\u", "copy_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Copy", "ing", " ", "an", " ", "external", " ", "link", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", " ", "the", " ", "link", " ", "int", "o", " ", "anot", "her", " ", "location_", "\\u\\u\\uNL\\u\\u\\u_", "root_", "=_", "self_", "._", "h5file", "_", "._", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "1_", "=_", "root_", "._", "lg", "roup", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "2_", "=_", "lg", "roup", "1_", "._", "copy_", "(_", "'/'_", ",_", "'", "lg", "roup", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "lg", "roup", "1", "'_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "lg", "roup", "2", "'_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "lg", "roup", "2", "'_", "in_", "root_", "._", "\\u", "v", "\\u", "children_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "lg", "roup", "2", "'_", "in_", "root_", "._", "\\u", "v", "\\u", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "common_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Copie", "d", " ", "link", ":\"_", ",_", "lg", "roup", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remove", " ", "the", " ", "first", " ", "link_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lg", "roup", "1_", "._", "remove_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "Equali", "ty", "Group_", "(_", "self_", "._", "ext", "h5file", "_", "._", "root_", "._", "group1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "h5file", "_", "._", "root_", "._", "lg", "roup", "2_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test0", "3", "\\u", "overwrite_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Over", "write", " ", "an", " ", "external", " ", "link", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", " ", "the", " ", "link", " ", "int", "o", " ", "anot", "her", " ", "location_", "\\u\\u\\uNL\\u\\u\\u_", "root_", "=_", "self_", "._", "h5file", "_", "._", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "1_", "=_", "root_", "._", "lg", "roup", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "2_", "=_", "lg", "roup", "1_", "._", "copy_", "(_", "'/'_", ",_", "'", "lg", "roup", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "2_", "=_", "lg", "roup", "1_", "._", "copy_", "(_", "'/'_", ",_", "'", "lg", "roup", "2", "'_", ",_", "overwrite_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "lg", "roup", "1", "'_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "lg", "roup", "2", "'_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "lg", "roup", "2", "'_", "in_", "root_", "._", "\\u", "v", "\\u", "children_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "lg", "roup", "2", "'_", "in_", "root_", "._", "\\u", "v", "\\u", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "common_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Copie", "d", " ", "link", ":\"_", ",_", "lg", "roup", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remove", " ", "the", " ", "first", " ", "link_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lg", "roup", "1_", "._", "remove_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "Equali", "ty", "Group_", "(_", "self_", "._", "ext", "h5file", "_", "._", "root_", "._", "group1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "h5file", "_", "._", "root_", "._", "lg", "roup", "2_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test0", "4", "\\u", "move_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Movi", "ng", " ", "an", " ", "external", " ", "link", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Move", " ", "the", " ", "link", " ", "int", "o", " ", "anot", "her", " ", "location_", "\\u\\u\\uNL\\u\\u\\u_", "lg", "roup", "1_", "=_", "self_", "._", "h5file", "_", "._", "root_", "._", "lg", "roup", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "group2_", "=_", "self_", "._", "h5file", "_", "._", "create", "\\u", "group_", "(_", "'/'_", ",_", "'", "group", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "1_", "._", "move_", "(_", "group2_", ",_", "'", "lg", "roup", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "2_", "=_", "self_", "._", "h5file", "_", "._", "root_", "._", "group2_", "._", "lg", "roup", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "common_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Move", "d", " ", "link", ":\"_", ",_", "lg", "roup", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "lg", "roup", "1", "'_", "not_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "group", "2", "/", "lg", "roup", "2", "'_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "Equali", "ty", "Group_", "(_", "self_", "._", "ext", "h5file", "_", "._", "root_", "._", "group1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "h5file", "_", "._", "root_", "._", "group2_", "._", "lg", "roup", "2_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test0", "5", "\\u", "rename_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Ren", "amin", "g", " ", "an", " ", "external", " ", "link", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Rename", " ", "the", " ", "link_", "\\u\\u\\uNL\\u\\u\\u_", "lg", "roup", "1_", "=_", "self_", "._", "h5file", "_", "._", "root_", "._", "lg", "roup", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "1_", "._", "rename_", "(_", "'", "lg", "roup", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "2_", "=_", "self_", "._", "h5file", "_", "._", "root_", "._", "lg", "roup", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "common_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Move", "d", " ", "link", ":\"_", ",_", "lg", "roup", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "lg", "roup", "1", "'_", "not_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "lg", "roup", "2", "'_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "Equali", "ty", "Group_", "(_", "self_", "._", "ext", "h5file", "_", "._", "root_", "._", "group1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "h5file", "_", "._", "root_", "._", "lg", "roup", "2_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test0", "9", "\\u", "umount", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Check", "ing", " ", "`", "umount", "()`", " ", "method", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "link_", "=_", "self_", "._", "h5file", "_", "._", "root_", "._", "lg", "roup", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "link_", "._", "ext", "file_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Der", "efer", "ence", " ", "a", " ", "external", " ", "node", " ", "(", "and", " ", "hen", "ce", ",", " ", "'", "mount", "'", " ", "a", " ", "file", ")_", "\\u\\u\\uNL\\u\\u\\u_", "eno", "de_", "=_", "link_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "eno", "de_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "link_", "._", "ext", "file_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Um", "ount", " ", "the", " ", "link_", "\\u\\u\\uNL\\u\\u\\u_", "link_", "._", "umount", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "link_", "._", "ext", "file_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Link", "Test", "Case_", "(_", "common_", "._", "Temp", "File", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "10", "\\u", "copy", "\\u", "link", "\\u", "to", "\\u", "file_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Check", "ing", " ", "copy", "ing", " ", "a", " ", "link", " ", "to", " ", "anot", "her", " ", "file", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "h5", "fname", "2_", "=_", "tempfile_", "._", "mktemp_", "(_", "\".", "h5", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "tables_", "._", "open", "\\u", "file_", "(_", "h5", "fname", "2_", ",_", "\"", "a", "\"_", ")_", "as_", "h5file", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h5file", "2_", "._", "create", "\\u", "array_", "(_", "'/'_", ",_", "'", "arr", "1", "'_", ",_", "[_", "1_", ",_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h5file", "2_", "._", "create", "\\u", "group_", "(_", "'/'_", ",_", "'", "group", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "1_", "=_", "self_", "._", "h5file", "_", "._", "root_", "._", "lg", "roup", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lg", "roup", "1", "\\u_", "=_", "lg", "roup", "1_", "._", "copy_", "(_", "h5file", "2_", "._", "root_", ",_", "'", "lg", "roup", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "lg", "roup", "1", "'_", "in_", "self_", "._", "h5file", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'/", "lg", "roup", "1", "'_", "in_", "h5file", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "lg", "roup", "1", "\\u_", "in_", "h5file", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "common_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "(_", "\"", "Copie", "d", " ", "link", ":\"_", ",_", "lg", "roup", "1", "\\u_", ",_", "'", "in", ":'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lg", "roup", "1", "\\u_", "._", "\\u", "v", "\\u", "file_", "._", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "os_", "._", "path_", "._", "exists_", "(_", "h5", "fname", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "remove_", "(_", "h5", "fname", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 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 ]
Missing call to `__init__` during object initialization
CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.5/extras/completion/py/maya/api/OpenMaya.py
[ { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnBase.__init__", "header": "['class', 'MFnBase', '(', 'object', ')', ':', '___EOS___']", "index": 714 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MDGModifier.__init__", "header": "['class', 'MDGModifier', '(', 'object', ')', ':', '___EOS___']", "index": 3933 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MArgParser.__init__", "header": "['class', 'MArgParser', '(', 'object', ')', ':', '___EOS___']", "index": 6781 }, { "content": "class MFnComponent(MFnBase):\n \"\"\"\n This is the base class for all function sets which deal with\n component objects.\n \n __init__()\n Initializes a new, empty MFnComponent object\n __init__(MObject component)\n Initializes a new MFnComponent function set, attached to the specified component.\n \"\"\"\n \n \n \n \n \n \n \n \n \n componentType = None\n \n elementCount = None\n \n hasWeights = None\n \n isComplete = None\n \n isEmpty = None\n \n __new__ = None", "metadata": "root.MFnComponent", "header": "['module', '___EOS___']", "index": 12872 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnComponent.__init__", "header": "['class', 'MFnComponent', '(', 'MFnBase', ')', ':', '___EOS___']", "index": 12885 }, { "content": "class MDagModifier(MDGModifier):\n \"\"\"\n Used to change the structure of the DAG\n \"\"\"\n \n \n \n \n \n \n \n \n \n __new__ = None", "metadata": "root.MDagModifier", "header": "['module', '___EOS___']", "index": 12928 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MDagModifier.__init__", "header": "['class', 'MDagModifier', '(', 'MDGModifier', ')', ':', '___EOS___']", "index": 12935 }, { "content": "class MFnData(MFnBase):\n \"\"\"\n Base class for dependency graph data function sets.\n \"\"\"\n \n \n \n \n \n __new__ = None\n \n \n kAny = 23\n \n \n kComponentList = 12\n \n \n kDoubleArray = 7\n \n \n kDynArrayAttrs = 18\n \n \n kDynSweptGeometry = 19\n \n \n kFloatArray = 8\n \n \n kIntArray = 9\n \n \n kInvalid = 0\n \n \n kLast = 24\n \n \n kLattice = 14\n \n \n kMatrix = 5\n \n \n kMesh = 13\n \n \n kNId = 22\n \n \n kNObject = 21\n \n \n kNumeric = 1\n \n \n kNurbsCurve = 15\n \n \n kNurbsSurface = 16\n \n \n kPlugin = 2\n \n \n kPluginGeometry = 3\n \n \n kPointArray = 10\n \n \n kSphere = 17\n \n \n kString = 4\n \n \n kStringArray = 6\n \n \n kSubdSurface = 20\n \n \n kVectorArray = 11", "metadata": "root.MFnData", "header": "['module', '___EOS___']", "index": 12983 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnData.__init__", "header": "['class', 'MFnData', '(', 'MFnBase', ')', ':', '___EOS___']", "index": 12990 }, { "content": "class MFnPlugin(MFnBase):\n \"\"\"\n Register and deregister plug-in services with Maya.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n version = None\n \n __new__ = None", "metadata": "root.MFnPlugin", "header": "['module', '___EOS___']", "index": 13076 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnPlugin.__init__", "header": "['class', 'MFnPlugin', '(', 'MFnBase', ')', ':', '___EOS___']", "index": 13083 }, { "content": "class MArgDatabase(MArgParser):\n \"\"\"\n Command argument list parser which extends MArgParser with the\n ability to return arguments and objects as MSelectionLists\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n __new__ = None", "metadata": "root.MArgDatabase", "header": "['module', '___EOS___']", "index": 13168 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MArgDatabase.__init__", "header": "['class', 'MArgDatabase', '(', 'MArgParser', ')', ':', '___EOS___']", "index": 13176 }, { "content": "class MFnDependencyNode(MFnBase):\n \"\"\"\n Function set for operating on dependency nodes.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n isDefaultNode = None\n \n isFromReferencedFile = None\n \n isLocked = None\n \n isShared = None\n \n namespace = None\n \n pluginName = None\n \n typeId = None\n \n typeName = None\n \n __new__ = None\n \n \n kExtensionAttr = 3\n \n \n kInvalidAttr = 4\n \n \n kLocalDynamicAttr = 1\n \n \n kNormalAttr = 2\n \n \n kTimerInvalidState = 3\n \n \n kTimerMetric_callback = 0\n \n \n kTimerMetric_callbackNotViaAPI = 6\n \n \n kTimerMetric_callbackViaAPI = 5\n \n \n kTimerMetric_compute = 1\n \n \n kTimerMetric_computeDuringCallback = 7\n \n \n kTimerMetric_computeNotDuringCallback = 8\n \n \n kTimerMetric_dirty = 2\n \n \n kTimerMetric_draw = 3\n \n \n kTimerMetric_fetch = 4\n \n \n kTimerOff = 0\n \n \n kTimerOn = 1\n \n \n kTimerType_count = 2\n \n \n kTimerType_inclusive = 1\n \n \n kTimerType_self = 0\n \n \n kTimerUninitialized = 2", "metadata": "root.MFnDependencyNode", "header": "['module', '___EOS___']", "index": 13221 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnDependencyNode.__init__", "header": "['class', 'MFnDependencyNode', '(', 'MFnBase', ')', ':', '___EOS___']", "index": 13228 }, { "content": "class MFnAttribute(MFnBase):\n \"\"\"\n Base class for attribute functionsets.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n affectsAppearance = None\n \n affectsWorldSpace = None\n \n array = None\n \n cached = None\n \n channelBox = None\n \n connectable = None\n \n disconnectBehavior = None\n \n dynamic = None\n \n extension = None\n \n hidden = None\n \n indeterminant = None\n \n indexMatters = None\n \n internal = None\n \n keyable = None\n \n name = None\n \n parent = None\n \n readable = None\n \n renderSource = None\n \n shortName = None\n \n storable = None\n \n usedAsColor = None\n \n usedAsFilename = None\n \n usesArrayDataBuilder = None\n \n worldSpace = None\n \n writable = None\n \n __new__ = None\n \n \n kDelete = 0\n \n \n kNothing = 2\n \n \n kReset = 1", "metadata": "root.MFnAttribute", "header": "['module', '___EOS___']", "index": 13619 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnAttribute.__init__", "header": "['class', 'MFnAttribute', '(', 'MFnBase', ')', ':', '___EOS___']", "index": 13626 }, { "content": "class MFnEnumAttribute(MFnAttribute):\n \"\"\"\n Functionset for creating and working with enumeration attributes.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n default = None\n \n __new__ = None", "metadata": "root.MFnEnumAttribute", "header": "['module', '___EOS___']", "index": 13736 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnEnumAttribute.__init__", "header": "['class', 'MFnEnumAttribute', '(', 'MFnAttribute', ')', ':', '___EOS___']", "index": 13743 }, { "content": "class MFnDoubleIndexedComponent(MFnComponent):\n \"\"\"\n This function set allows you to create, edit, and query double indexed\n components. Double indexed components store 2 dimensional index values.\n \n __init__()\n Initializes a new, empty MFnDoubleIndexedComponent object\n \n __init__(MObject component)\n Initializes a new MFnDoubleIndexedComponent function set, attached\n to the specified component.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n __new__ = None", "metadata": "root.MFnDoubleIndexedComponent", "header": "['module', '___EOS___']", "index": 13812 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnDoubleIndexedComponent.__init__", "header": "['class', 'MFnDoubleIndexedComponent', '(', 'MFnComponent', ')', ':', '___EOS___']", "index": 13827 }, { "content": "class MFnGenericAttribute(MFnAttribute):\n \"\"\"\n Functionset for creating and working with attributes which can accept several different types of data.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n __new__ = None", "metadata": "root.MFnGenericAttribute", "header": "['module', '___EOS___']", "index": 13917 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnGenericAttribute.__init__", "header": "['class', 'MFnGenericAttribute', '(', 'MFnAttribute', ')', ':', '___EOS___']", "index": 13924 }, { "content": "class MFnLightDataAttribute(MFnAttribute):\n \"\"\"\n Functionset for creating and working with light data attributes.\n \"\"\"\n \n \n \n \n \n \n \n \n \n default = None\n \n __new__ = None", "metadata": "root.MFnLightDataAttribute", "header": "['module', '___EOS___']", "index": 13991 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnLightDataAttribute.__init__", "header": "['class', 'MFnLightDataAttribute', '(', 'MFnAttribute', ')', ':', '___EOS___']", "index": 13998 }, { "content": "class MFnMatrixAttribute(MFnAttribute):\n \"\"\"\n Functionset for creating and working with matrix attributes.\n \"\"\"\n \n \n \n \n \n \n \n default = None\n \n __new__ = None\n \n \n kDouble = 1\n \n \n kFloat = 0", "metadata": "root.MFnMatrixAttribute", "header": "['module', '___EOS___']", "index": 14027 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnMatrixAttribute.__init__", "header": "['class', 'MFnMatrixAttribute', '(', 'MFnAttribute', ')', ':', '___EOS___']", "index": 14034 }, { "content": "class MFnPointArrayData(MFnData):\n \"\"\"\n Function set for node data consisting of an array of MPoints.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n __new__ = None", "metadata": "root.MFnPointArrayData", "header": "['module', '___EOS___']", "index": 14061 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnPointArrayData.__init__", "header": "['class', 'MFnPointArrayData', '(', 'MFnData', ')', ':', '___EOS___']", "index": 14084 }, { "content": "class MFnMessageAttribute(MFnAttribute):\n \"\"\"\n Functionset for creating and working with message attributes.\n \"\"\"\n \n \n \n \n \n \n \n __new__ = None", "metadata": "root.MFnMessageAttribute", "header": "['module', '___EOS___']", "index": 14143 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnMessageAttribute.__init__", "header": "['class', 'MFnMessageAttribute', '(', 'MFnAttribute', ')', ':', '___EOS___']", "index": 14150 }, { "content": "class MFnTripleIndexedComponent(MFnComponent):\n \"\"\"\n This function set allows you to create, edit, and query triple indexed\n components. Triple indexed components store 3 dimensional index values.\n \n __init__()\n Initializes a new, empty MFnTripleIndexedComponent object\n \n __init__(MObject component)\n Initializes a new MFnTripleIndexedComponent function set, attached\n to the specified component.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n __new__ = None", "metadata": "root.MFnTripleIndexedComponent", "header": "['module', '___EOS___']", "index": 14169 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnTripleIndexedComponent.__init__", "header": "['class', 'MFnTripleIndexedComponent', '(', 'MFnComponent', ')', ':', '___EOS___']", "index": 14184 }, { "content": "class MFnNumericAttribute(MFnAttribute):\n \"\"\"\n Functionset for creating and working with numeric attributes.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n default = None\n \n __new__ = None", "metadata": "root.MFnNumericAttribute", "header": "['module', '___EOS___']", "index": 14275 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnNumericAttribute.__init__", "header": "['class', 'MFnNumericAttribute', '(', 'MFnAttribute', ')', ':', '___EOS___']", "index": 14282 }, { "content": "class MFnStringData(MFnData):\n \"\"\"\n Function set for string node data.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n __new__ = None", "metadata": "root.MFnStringData", "header": "['module', '___EOS___']", "index": 14439 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnStringData.__init__", "header": "['class', 'MFnStringData', '(', 'MFnData', ')', ':', '___EOS___']", "index": 14446 }, { "content": "class MFnStringArrayData(MFnData):\n \"\"\"\n Function set for node data consisting of an array of string.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n __new__ = None", "metadata": "root.MFnStringArrayData", "header": "['module', '___EOS___']", "index": 14481 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnStringArrayData.__init__", "header": "['class', 'MFnStringArrayData', '(', 'MFnData', ')', ':', '___EOS___']", "index": 14504 }, { "content": "class MFnComponentListData(MFnData):\n \"\"\"\n MFnComponentListData allows the creation and manipulation of component list\n (represented as MObjects) data objects for use in the dependency graph.\n \n __init__()\n Initializes a new, empty MFnComponentListData object.\n \n __init__(MObject)\n Initializes a new MFnComponentListData function set, attached\n to the specified object.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n __new__ = None", "metadata": "root.MFnComponentListData", "header": "['module', '___EOS___']", "index": 14555 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnComponentListData.__init__", "header": "['class', 'MFnComponentListData', '(', 'MFnData', ')', ':', '___EOS___']", "index": 14570 }, { "content": "class MFnTypedAttribute(MFnAttribute):\n \"\"\"\n Functionset for creating and working typed attributes.\n \"\"\"\n \n \n \n \n \n \n \n \n \n default = None\n \n __new__ = None", "metadata": "root.MFnTypedAttribute", "header": "['module', '___EOS___']", "index": 14657 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnTypedAttribute.__init__", "header": "['class', 'MFnTypedAttribute', '(', 'MFnAttribute', ')', ':', '___EOS___']", "index": 14664 }, { "content": "class MFnUInt64ArrayData(MFnData):\n \"\"\"\n Function set for node data consisting of an array of MUint64.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n __new__ = None", "metadata": "root.MFnUInt64ArrayData", "header": "['module', '___EOS___']", "index": 14693 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnUInt64ArrayData.__init__", "header": "['class', 'MFnUInt64ArrayData', '(', 'MFnData', ')', ':', '___EOS___']", "index": 14716 }, { "content": "class MFnSingleIndexedComponent(MFnComponent):\n \"\"\"\n This function set allows you to create, edit, and query single indexed components.\n Single indexed components store 1 dimensional index values.\n \n __init__()\n Initializes a new, empty MFnSingleIndexedComponent object\n \n __init__(MObject component)\n Initializes a new MFnSingleIndexedComponent function set, attached to the specified component.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n __new__ = None", "metadata": "root.MFnSingleIndexedComponent", "header": "['module', '___EOS___']", "index": 14775 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnSingleIndexedComponent.__init__", "header": "['class', 'MFnSingleIndexedComponent', '(', 'MFnComponent', ')', ':', '___EOS___']", "index": 14789 }, { "content": "class MFnDagNode(MFnDependencyNode):\n \"\"\"\n Function set for operating on DAG nodes.\n \n __init__()\n Initializes a new, empty MFnDagNode functionset.\n \n __init__(MObject)\n Initializes a new MFnDagNode functionset and attaches it to a\n DAG node.\n \n __init__(MDagPath)\n Initializes a new MFnDagNode functionset and attaches it to a\n DAG path.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n boundingBox = None\n \n inModel = None\n \n inUnderWorld = None\n \n isInstanceable = None\n \n isIntermediateObject = None\n \n objectColor = None\n \n useObjectColor = None\n \n __new__ = None\n \n \n kNextPos = 255", "metadata": "root.MFnDagNode", "header": "['module', '___EOS___']", "index": 14873 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnDagNode.__init__", "header": "['class', 'MFnDagNode', '(', 'MFnDependencyNode', ')', ':', '___EOS___']", "index": 14891 }, { "content": "class MFnDoubleArrayData(MFnData):\n \"\"\"\n Function set for node data consisting of an array of doubles.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n __new__ = None", "metadata": "root.MFnDoubleArrayData", "header": "['module', '___EOS___']", "index": 15175 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnDoubleArrayData.__init__", "header": "['class', 'MFnDoubleArrayData', '(', 'MFnData', ')', ':', '___EOS___']", "index": 15198 }, { "content": "class MFnVectorArrayData(MFnData):\n \"\"\"\n Function set for node data consisting of an array of MVectors.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n __new__ = None", "metadata": "root.MFnVectorArrayData", "header": "['module', '___EOS___']", "index": 15257 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnVectorArrayData.__init__", "header": "['class', 'MFnVectorArrayData', '(', 'MFnData', ')', ':', '___EOS___']", "index": 15280 }, { "content": "class MFnNumericData(MFnData):\n \"\"\"\n Function set for non-simple numeric node data.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n __new__ = None\n \n \n k2Double = 14\n \n \n k2Float = 11\n \n \n k2Int = 8\n \n \n k2Long = 8\n \n \n k2Short = 5\n \n \n k3Double = 15\n \n \n k3Float = 12\n \n \n k3Int = 9\n \n \n k3Long = 9\n \n \n k3Short = 6\n \n \n k4Double = 16\n \n \n kAddr = 17\n \n \n kBoolean = 1\n \n \n kByte = 2\n \n \n kChar = 3\n \n \n kDouble = 13\n \n \n kFloat = 10\n \n \n kInt = 7\n \n \n kInvalid = 0\n \n \n kLast = 18\n \n \n kLong = 7\n \n \n kShort = 4", "metadata": "root.MFnNumericData", "header": "['module', '___EOS___']", "index": 15339 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnNumericData.__init__", "header": "['class', 'MFnNumericData', '(', 'MFnData', ')', ':', '___EOS___']", "index": 15346 }, { "content": "class MFnGeometryData(MFnData):\n \"\"\"\n This class is the function set for geometry data.\n \n Geometry data adds matrix and grouping (set) information to regular\n data and is used to pass geometry types such as mesh, lattice, and\n NURBS shape data through DG connections.\n \n __init__()\n Initializes a new, empty MFnGeometryData object\n \n __init__(MObject)\n Initializes a new MFnGeometryData function set, attached\n to the specified object.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n isIdentity = None\n \n isNotIdentity = None\n \n matrix = None\n \n objectGroupCount = None\n \n __new__ = None", "metadata": "root.MFnGeometryData", "header": "['module', '___EOS___']", "index": 15455 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnGeometryData.__init__", "header": "['class', 'MFnGeometryData', '(', 'MFnData', ')', ':', '___EOS___']", "index": 15473 }, { "content": "class MFnUnitAttribute(MFnAttribute):\n \"\"\"\n Functionset for creating and working with angle, distance and time attributes.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n default = None\n \n __new__ = None\n \n \n kAngle = 1\n \n \n kDistance = 2\n \n \n kInvalid = 0\n \n \n kLast = 4\n \n \n kTime = 3", "metadata": "root.MFnUnitAttribute", "header": "['module', '___EOS___']", "index": 15608 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnUnitAttribute.__init__", "header": "['class', 'MFnUnitAttribute', '(', 'MFnAttribute', ')', ':', '___EOS___']", "index": 15615 }, { "content": "class MFnIntArrayData(MFnData):\n \"\"\"\n Function set for node data consisting of an array of ints.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n __new__ = None", "metadata": "root.MFnIntArrayData", "header": "['module', '___EOS___']", "index": 15755 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnIntArrayData.__init__", "header": "['class', 'MFnIntArrayData', '(', 'MFnData', ')', ':', '___EOS___']", "index": 15778 }, { "content": "class MFnCompoundAttribute(MFnAttribute):\n \"\"\"\n Functionset for creating and working with compound attributes.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n __new__ = None", "metadata": "root.MFnCompoundAttribute", "header": "['module', '___EOS___']", "index": 15837 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnCompoundAttribute.__init__", "header": "['class', 'MFnCompoundAttribute', '(', 'MFnAttribute', ')', ':', '___EOS___']", "index": 15844 }, { "content": "class MFnMatrixData(MFnData):\n \"\"\"\n Function set for matrix node data.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n __new__ = None", "metadata": "root.MFnMatrixData", "header": "['module', '___EOS___']", "index": 15903 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnMatrixData.__init__", "header": "['class', 'MFnMatrixData', '(', 'MFnData', ')', ':', '___EOS___']", "index": 15910 }, { "content": "class MFnMeshData(MFnGeometryData):\n \"\"\"\n MFnMeshData allows the creation and manipulation of Mesh\n data objects for use in the dependency graph.\n \n __init__()\n Initializes a new, empty MFnMeshData object\n \n __init__(MObject)\n Initializes a new MFnMeshData function set, attached\n to the specified object.\n \"\"\"\n \n \n \n \n \n \n \n __new__ = None", "metadata": "root.MFnMeshData", "header": "['module', '___EOS___']", "index": 15961 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnMeshData.__init__", "header": "['class', 'MFnMeshData', '(', 'MFnGeometryData', ')', ':', '___EOS___']", "index": 15976 }, { "content": "class MFnTransform(MFnDagNode):\n \"\"\"\n Function set for operating on transform nodes.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n __new__ = None\n \n \n kRotateMaxX = 13\n \n \n kRotateMaxY = 15\n \n \n kRotateMaxZ = 17\n \n \n kRotateMinX = 12\n \n \n kRotateMinY = 14\n \n \n kRotateMinZ = 16\n \n \n kScaleMaxX = 1\n \n \n kScaleMaxY = 3\n \n \n kScaleMaxZ = 5\n \n \n kScaleMinX = 0\n \n \n kScaleMinY = 2\n \n \n kScaleMinZ = 4\n \n \n kShearMaxXY = 7\n \n \n kShearMaxXZ = 9\n \n \n kShearMaxYZ = 11\n \n \n kShearMinXY = 6\n \n \n kShearMinXZ = 8\n \n \n kShearMinYZ = 10\n \n \n kTranslateMaxX = 19\n \n \n kTranslateMaxY = 21\n \n \n kTranslateMaxZ = 23\n \n \n kTranslateMinX = 18\n \n \n kTranslateMinY = 20\n \n \n kTranslateMinZ = 22", "metadata": "root.MFnTransform", "header": "['module', '___EOS___']", "index": 15998 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnTransform.__init__", "header": "['class', 'MFnTransform', '(', 'MFnDagNode', ')', ':', '___EOS___']", "index": 16005 }, { "content": "class MFnNurbsCurveData(MFnGeometryData):\n \"\"\"\n MFnNurbsCurveData allows the creation and manipulation of Nurbs Curve\n data objects for use in the dependency graph.\n \n __init__()\n Initializes a new, empty MFnNurbsCurveData object\n \n __init__(MObject)\n Initializes a new MFnNurbsCurveData function set, attached\n to the specified object.\n \"\"\"\n \n \n \n \n \n \n \n __new__ = None", "metadata": "root.MFnNurbsCurveData", "header": "['module', '___EOS___']", "index": 16392 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnNurbsCurveData.__init__", "header": "['class', 'MFnNurbsCurveData', '(', 'MFnGeometryData', ')', ':', '___EOS___']", "index": 16407 }, { "content": "class MFnMesh(MFnDagNode):\n \"\"\"\n Function set for operation on meshes (polygonal surfaces).\n \n __init__()\n Initializes a new, empty MFnMesh object.\n \n __init__(MDagPath path)\n Initializes a new MFnMesh object and attaches it to the DAG path\n of a mesh node.\n \n __init__(MObject nodeOrData)\n Initializes a new MFnMesh object and attaches it to a mesh\n node or mesh data object.\n \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n checkSamePointTwice = None\n \n displayColors = None\n \n numColorSets = None\n \n numEdges = None\n \n numFaceVertices = None\n \n numNormals = None\n \n numPolygons = None\n \n numUVSets = None\n \n numVertices = None\n \n __new__ = None\n \n \n kAlpha = 1\n \n \n kDifference = 2\n \n \n kInstanceUnspecified = -1\n \n \n kInternalPoint = 1\n \n \n kIntersectTolerance = 1e-06\n \n \n kIntersection = 3\n \n \n kInvalid = 2\n \n \n kOnEdge = 0\n \n \n kPointTolerance = 1e-10\n \n \n kRGB = 3\n \n \n kRGBA = 4\n \n \n kUnion = 1", "metadata": "root.MFnMesh", "header": "['module', '___EOS___']", "index": 16429 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnMesh.__init__", "header": "['class', 'MFnMesh', '(', 'MFnDagNode', ')', ':', '___EOS___']", "index": 16447 }, { "content": "class MFnNurbsSurfaceData(MFnGeometryData):\n \"\"\"\n MFnNurbsSurfaceData allows the creation and manipulation of Nurbs Surface\n data objects for use in the dependency graph.\n \n __init__()\n Initializes a new, empty MFnNurbsSurfaceData object\n \n __init__(MObject)\n Initializes a new MFnNurbsSurfaceData function set, attached\n to the specified object.\n \"\"\"\n \n \n \n \n \n \n \n __new__ = None", "metadata": "root.MFnNurbsSurfaceData", "header": "['module', '___EOS___']", "index": 19149 }, { "content": " def __init__(*args, **kwargs):\n \"\"\"\n x.__init__(...) initializes x; see help(type(x)) for signature\n \"\"\"\n \n pass", "metadata": "root.MFnNurbsSurfaceData.__init__", "header": "['class', 'MFnNurbsSurfaceData', '(', 'MFnGeometryData', ')', ':', '___EOS___']", "index": 19164 } ]
[ { "span": "class MFnComponent(MFnBase):", "start_line": 12872, "start_column": 0, "end_line": 12872, "end_column": 28 }, { "span": "class MDagModifier(MDGModifier):", "start_line": 12928, "start_column": 0, "end_line": 12928, "end_column": 32 }, { "span": "class MFnData(MFnBase):", "start_line": 12983, "start_column": 0, "end_line": 12983, "end_column": 23 }, { "span": "class MFnPlugin(MFnBase):", "start_line": 13076, "start_column": 0, "end_line": 13076, "end_column": 25 }, { "span": "class MArgDatabase(MArgParser):", "start_line": 13168, "start_column": 0, "end_line": 13168, "end_column": 31 }, { "span": "class MFnDependencyNode(MFnBase):", "start_line": 13221, "start_column": 0, "end_line": 13221, "end_column": 33 }, { "span": "class MFnAttribute(MFnBase):", "start_line": 13619, "start_column": 0, "end_line": 13619, "end_column": 28 }, { "span": "class MFnEnumAttribute(MFnAttribute):", "start_line": 13736, "start_column": 0, "end_line": 13736, "end_column": 37 }, { "span": "class MFnDoubleIndexedComponent(MFnComponent):", "start_line": 13812, "start_column": 0, "end_line": 13812, "end_column": 46 }, { "span": "class MFnGenericAttribute(MFnAttribute):", "start_line": 13917, "start_column": 0, "end_line": 13917, "end_column": 40 }, { "span": "class MFnLightDataAttribute(MFnAttribute):", "start_line": 13991, "start_column": 0, "end_line": 13991, "end_column": 42 }, { "span": "class MFnMatrixAttribute(MFnAttribute):", "start_line": 14027, "start_column": 0, "end_line": 14027, "end_column": 39 }, { "span": "class MFnPointArrayData(MFnData):", "start_line": 14061, "start_column": 0, "end_line": 14061, "end_column": 33 }, { "span": "class MFnMessageAttribute(MFnAttribute):", "start_line": 14143, "start_column": 0, "end_line": 14143, "end_column": 40 }, { "span": "class MFnTripleIndexedComponent(MFnComponent):", "start_line": 14169, "start_column": 0, "end_line": 14169, "end_column": 46 }, { "span": "class MFnNumericAttribute(MFnAttribute):", "start_line": 14275, "start_column": 0, "end_line": 14275, "end_column": 40 }, { "span": "class MFnStringData(MFnData):", "start_line": 14439, "start_column": 0, "end_line": 14439, "end_column": 29 }, { "span": "class MFnStringArrayData(MFnData):", "start_line": 14481, "start_column": 0, "end_line": 14481, "end_column": 34 }, { "span": "class MFnComponentListData(MFnData):", "start_line": 14555, "start_column": 0, "end_line": 14555, "end_column": 36 }, { "span": "class MFnTypedAttribute(MFnAttribute):", "start_line": 14657, "start_column": 0, "end_line": 14657, "end_column": 38 }, { "span": "class MFnUInt64ArrayData(MFnData):", "start_line": 14693, "start_column": 0, "end_line": 14693, "end_column": 34 }, { "span": "class MFnSingleIndexedComponent(MFnComponent):", "start_line": 14775, "start_column": 0, "end_line": 14775, "end_column": 46 }, { "span": "class MFnDagNode(MFnDependencyNode):", "start_line": 14873, "start_column": 0, "end_line": 14873, "end_column": 36 }, { "span": "class MFnDoubleArrayData(MFnData):", "start_line": 15175, "start_column": 0, "end_line": 15175, "end_column": 34 }, { "span": "class MFnVectorArrayData(MFnData):", "start_line": 15257, "start_column": 0, "end_line": 15257, "end_column": 34 }, { "span": "class MFnNumericData(MFnData):", "start_line": 15339, "start_column": 0, "end_line": 15339, "end_column": 30 }, { "span": "class MFnGeometryData(MFnData):", "start_line": 15455, "start_column": 0, "end_line": 15455, "end_column": 31 }, { "span": "class MFnUnitAttribute(MFnAttribute):", "start_line": 15608, "start_column": 0, "end_line": 15608, "end_column": 37 }, { "span": "class MFnIntArrayData(MFnData):", "start_line": 15755, "start_column": 0, "end_line": 15755, "end_column": 31 }, { "span": "class MFnCompoundAttribute(MFnAttribute):", "start_line": 15837, "start_column": 0, "end_line": 15837, "end_column": 41 }, { "span": "class MFnMatrixData(MFnData):", "start_line": 15903, "start_column": 0, "end_line": 15903, "end_column": 29 }, { "span": "class MFnMeshData(MFnGeometryData):", "start_line": 15961, "start_column": 0, "end_line": 15961, "end_column": 35 }, { "span": "class MFnTransform(MFnDagNode):", "start_line": 15998, "start_column": 0, "end_line": 15998, "end_column": 31 }, { "span": "class MFnNurbsCurveData(MFnGeometryData):", "start_line": 16392, "start_column": 0, "end_line": 16392, "end_column": 41 }, { "span": "class MFnMesh(MFnDagNode):", "start_line": 16429, "start_column": 0, "end_line": 16429, "end_column": 26 }, { "span": "class MFnNurbsSurfaceData(MFnGeometryData):", "start_line": 19149, "start_column": 0, "end_line": 19149, "end_column": 43 } ]
[ { "span": "def __init__(*args, **kwargs):", "start_line": 714, "start_column": 4, "end_line": 714, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 3933, "start_column": 4, "end_line": 3933, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 6781, "start_column": 4, "end_line": 6781, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 12885, "start_column": 4, "end_line": 12885, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 12935, "start_column": 4, "end_line": 12935, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 12990, "start_column": 4, "end_line": 12990, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 13083, "start_column": 4, "end_line": 13083, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 13176, "start_column": 4, "end_line": 13176, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 13228, "start_column": 4, "end_line": 13228, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 13626, "start_column": 4, "end_line": 13626, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 13743, "start_column": 4, "end_line": 13743, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 13827, "start_column": 4, "end_line": 13827, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 13924, "start_column": 4, "end_line": 13924, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 13998, "start_column": 4, "end_line": 13998, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 14034, "start_column": 4, "end_line": 14034, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 14084, "start_column": 4, "end_line": 14084, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 14150, "start_column": 4, "end_line": 14150, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 14184, "start_column": 4, "end_line": 14184, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 14282, "start_column": 4, "end_line": 14282, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 14446, "start_column": 4, "end_line": 14446, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 14504, "start_column": 4, "end_line": 14504, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 14570, "start_column": 4, "end_line": 14570, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 14664, "start_column": 4, "end_line": 14664, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 14716, "start_column": 4, "end_line": 14716, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 14789, "start_column": 4, "end_line": 14789, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 14891, "start_column": 4, "end_line": 14891, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 15198, "start_column": 4, "end_line": 15198, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 15280, "start_column": 4, "end_line": 15280, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 15346, "start_column": 4, "end_line": 15346, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 15473, "start_column": 4, "end_line": 15473, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 15615, "start_column": 4, "end_line": 15615, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 15778, "start_column": 4, "end_line": 15778, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 15844, "start_column": 4, "end_line": 15844, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 15910, "start_column": 4, "end_line": 15910, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 15976, "start_column": 4, "end_line": 15976, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 16005, "start_column": 4, "end_line": 16005, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 16407, "start_column": 4, "end_line": 16407, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 16447, "start_column": 4, "end_line": 16447, "end_column": 34 }, { "span": "def __init__(*args, **kwargs):", "start_line": 19164, "start_column": 4, "end_line": 19164, "end_column": 34 } ]
1
false
[ "[CLS]_", "Missing", "_", "call_", "to_", " _", "`_", "\\u\\u", "init\\u\\u_", "`_", "dur", "ing_", "object_", "initialization", "_", "[SEP]_", "class_", "MF", "n", "Base_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MD", "GM", "odi", "fier", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MA", "rg", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Component_", "(_", "MF", "n", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "the", " ", "base", " ", "class", " ", "for", " ", "all", " ", "function", " ", "sets", " ", "whi", "ch", " ", "deal", " ", "with", "\\", "10", ";", " ", " ", " ", " ", "component", " ", "object", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u()", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", ",", " ", "empty", " ", "MF", "n", "Compo", "nent", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u", "(", "MO", "bject", " ", "component", ")", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", " ", "MF", "n", "Compo", "nent", " ", "function", " ", "set", ",", " ", "attache", "d", " ", "to", " ", "the", " ", "specified", " ", "component", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "component", "Type_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "element", "Count_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "has", "Weights_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "is", "Complete_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "is", "Empty_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Component_", "(_", "MF", "n", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MD", "ag", "Modifier_", "(_", "MD", "GM", "odi", "fier", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Us", "ed", " ", "to", " ", "change", " ", "the", " ", "structure", " ", "of", " ", "the", " ", "DAG", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MD", "ag", "Modifier_", "(_", "MD", "GM", "odi", "fier", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Data_", "(_", "MF", "n", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Base", " ", "class", " ", "for", " ", "dependen", "cy", " ", "graph", " ", "data", " ", "function", " ", "sets", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Any_", "=_", "23_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Compo", "nent", "List_", "=_", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Doub", "le", "Array_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Dyn", "Array", "Attrs_", "=_", "18_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Dyn", "Swe", "pt", "Geometry_", "=_", "19_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Float", "Array_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Int", "Array_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Invalid_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Last_", "=_", "24_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Lattice", "_", "=_", "14_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Matrix_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Mesh_", "=_", "13_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "NI", "d_", "=_", "22_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "NO", "bject_", "=_", "21_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Numeric_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Nu", "rb", "s", "Curve_", "=_", "15_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Nu", "rb", "s", "Surface_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Plugin_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Plug", "in", "Geometry_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Point", "Array_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Sphere", "_", "=_", "17_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "String_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "String", "Array_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Subd", "Surface_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Vector", "Array_", "=_", "11_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Data_", "(_", "MF", "n", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Plugin_", "(_", "MF", "n", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Register", " ", "and", " ", "dere", "gister", " ", "plug", "-", "in", " ", "service", "s", " ", "with", " ", "Maya", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "version_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Plugin_", "(_", "MF", "n", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MA", "rg", "Database_", "(_", "MA", "rg", "Parser_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Command", " ", "argu", "ment", " ", "list", " ", "parser", " ", "whi", "ch", " ", "extend", "s", " ", "MA", "rg", "Parser", " ", "with", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "abilit", "y", " ", "to", " ", "return", " ", "argu", "ment", "s", " ", "and", " ", "object", "s", " ", "as", " ", "MS", "election", "List", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MA", "rg", "Database_", "(_", "MA", "rg", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Dependenc", "y", "Node_", "(_", "MF", "n", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", " ", "set", " ", "for", " ", "operati", "ng", " ", "on", " ", "dependen", "cy", " ", "nodes", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\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\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "is", "Default", "Node_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "is", "Fro", "m", "Reference", "d", "File_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "is", "Locke", "d_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "is", "Share", "d_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "namespace_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plugin", "Name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "type", "Id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "type", "Name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Ext", "ensi", "on", "Attr_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Inva", "lid", "Attr_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Local", "Dynamic", "Attr_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Normal", "Attr_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Time", "r", "Inva", "lid", "State_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Time", "r", "Met", "ric", "\\u", "callback_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Time", "r", "Met", "ric", "\\u", "callback", "Not", "Via", "API_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Time", "r", "Met", "ric", "\\u", "callback", "Via", "API_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Time", "r", "Met", "ric", "\\u", "compute_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Time", "r", "Met", "ric", "\\u", "compute", "Dur", "ing", "Callback_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Time", "r", "Met", "ric", "\\u", "compute", "Not", "Dur", "ing", "Callback_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Time", "r", "Met", "ric", "\\u", "dirty_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Time", "r", "Met", "ric", "\\u", "draw_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Time", "r", "Met", "ric", "\\u", "fetch_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Time", "r", "Off_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Time", "r", "On_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Time", "r", "Type", "\\u", "count_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Time", "r", "Type", "\\u", "inclu", "sive", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Time", "r", "Type", "\\u", "self_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Time", "r", "Unin", "itialized", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Dependenc", "y", "Node_", "(_", "MF", "n", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Attribute_", "(_", "MF", "n", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Base", " ", "class", " ", "for", " ", "attribute", " ", "function", "sets", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "affect", "s", "Appearance", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "affect", "s", "Wor", "ld", "Space_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "array_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cached_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "channel", "Box_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "connect", "able_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "discon", "nect", "Behavior_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dynamic_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "extension_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "hidden_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "inde", "termina", "nt_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "index", "Matt", "ers_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "internal_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "key", "able_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parent_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "readable_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "render", "Source_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "short", "Name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stor", "able_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "used", "As", "Color_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "used", "As", "Filename_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "use", "s", "Array", "Data", "Builder_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "world", "Space_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "writable_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Delete_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Not", "hing_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Reset_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Attribute_", "(_", "MF", "n", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Enum", "Attribute_", "(_", "MF", "n", "Attribute_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", "set", " ", "for", " ", "creati", "ng", " ", "and", " ", "working", " ", "with", " ", "enumerati", "on", " ", "attribute", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "default_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Enum", "Attribute_", "(_", "MF", "n", "Attribute_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Doub", "le", "Indexe", "d", "Component_", "(_", "MF", "n", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "function", " ", "set", " ", "allow", "s", " ", "you", " ", "to", " ", "create", ",", " ", "edit", ",", " ", "and", " ", "query", " ", "double", " ", "indexe", "d", "\\", "10", ";", " ", " ", " ", " ", "component", "s", ".", " ", "Doub", "le", " ", "indexe", "d", " ", "component", "s", " ", "store", " ", "2", " ", "dimension", "al", " ", "index", " ", "values", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u()", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", ",", " ", "empty", " ", "MF", "n", "Doub", "le", "Indexe", "d", "Compo", "nent", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u", "(", "MO", "bject", " ", "component", ")", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", " ", "MF", "n", "Doub", "le", "Indexe", "d", "Compo", "nent", " ", "function", " ", "set", ",", " ", "attache", "d", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "the", " ", "specified", " ", "component", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Doub", "le", "Indexe", "d", "Component_", "(_", "MF", "n", "Component_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Gene", "ric", "Attribute_", "(_", "MF", "n", "Attribute_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", "set", " ", "for", " ", "creati", "ng", " ", "and", " ", "working", " ", "with", " ", "attribute", "s", " ", "whi", "ch", " ", "can", " ", "accept", " ", "sever", "al", " ", "different", " ", "types", " ", "of", " ", "data", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Gene", "ric", "Attribute_", "(_", "MF", "n", "Attribute_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Light", "Data", "Attribute_", "(_", "MF", "n", "Attribute_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", "set", " ", "for", " ", "creati", "ng", " ", "and", " ", "working", " ", "with", " ", "light", " ", "data", " ", "attribute", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "default_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Light", "Data", "Attribute_", "(_", "MF", "n", "Attribute_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Matrix", "Attribute_", "(_", "MF", "n", "Attribute_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", "set", " ", "for", " ", "creati", "ng", " ", "and", " ", "working", " ", "with", " ", "matrix", " ", "attribute", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "default_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Double_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Float_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Matrix", "Attribute_", "(_", "MF", "n", "Attribute_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Point", "Array", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", " ", "set", " ", "for", " ", "node", " ", "data", " ", "consi", "stin", "g", " ", "of", " ", "an", " ", "array", " ", "of", " ", "MP", "oint", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Point", "Array", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Messag", "e", "Attribute_", "(_", "MF", "n", "Attribute_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", "set", " ", "for", " ", "creati", "ng", " ", "and", " ", "working", " ", "with", " ", "message", " ", "attribute", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Messag", "e", "Attribute_", "(_", "MF", "n", "Attribute_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Triple", "Indexe", "d", "Component_", "(_", "MF", "n", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "function", " ", "set", " ", "allow", "s", " ", "you", " ", "to", " ", "create", ",", " ", "edit", ",", " ", "and", " ", "query", " ", "triple", " ", "indexe", "d", "\\", "10", ";", " ", " ", " ", " ", "component", "s", ".", " ", "Triple", " ", "indexe", "d", " ", "component", "s", " ", "store", " ", "3", " ", "dimension", "al", " ", "index", " ", "values", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u()", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", ",", " ", "empty", " ", "MF", "n", "Triple", "Indexe", "d", "Compo", "nent", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u", "(", "MO", "bject", " ", "component", ")", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", " ", "MF", "n", "Triple", "Indexe", "d", "Compo", "nent", " ", "function", " ", "set", ",", " ", "attache", "d", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "the", " ", "specified", " ", "component", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Triple", "Indexe", "d", "Component_", "(_", "MF", "n", "Component_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Numer", "ic", "Attribute_", "(_", "MF", "n", "Attribute_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", "set", " ", "for", " ", "creati", "ng", " ", "and", " ", "working", " ", "with", " ", "numeri", "c", " ", "attribute", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "default_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Numer", "ic", "Attribute_", "(_", "MF", "n", "Attribute_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "String", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", " ", "set", " ", "for", " ", "string", " ", "node", " ", "data", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "String", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "String", "Array", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", " ", "set", " ", "for", " ", "node", " ", "data", " ", "consi", "stin", "g", " ", "of", " ", "an", " ", "array", " ", "of", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "String", "Array", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Compo", "nent", "List", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "MF", "n", "Compo", "nent", "List", "Data", " ", "allow", "s", " ", "the", " ", "creati", "on", " ", "and", " ", "manipulati", "on", " ", "of", " ", "component", " ", "list", "\\", "10", ";", " ", " ", " ", " ", "(", "represent", "ed", " ", "as", " ", "MO", "bject", "s", ")", " ", "data", " ", "object", "s", " ", "for", " ", "use", " ", "in", " ", "the", " ", "dependen", "cy", " ", "graph", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u()", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", ",", " ", "empty", " ", "MF", "n", "Compo", "nent", "List", "Data", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u", "(", "MO", "bject", ")", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", " ", "MF", "n", "Compo", "nent", "List", "Data", " ", "function", " ", "set", ",", " ", "attache", "d", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "the", " ", "specified", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Compo", "nent", "List", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Type", "d", "Attribute_", "(_", "MF", "n", "Attribute_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", "set", " ", "for", " ", "creati", "ng", " ", "and", " ", "working", " ", "typed", " ", "attribute", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "default_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Type", "d", "Attribute_", "(_", "MF", "n", "Attribute_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "UI", "nt", "64", "Array", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", " ", "set", " ", "for", " ", "node", " ", "data", " ", "consi", "stin", "g", " ", "of", " ", "an", " ", "array", " ", "of", " ", "MU", "int", "64.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "UI", "nt", "64", "Array", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Sing", "le", "Indexe", "d", "Component_", "(_", "MF", "n", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "function", " ", "set", " ", "allow", "s", " ", "you", " ", "to", " ", "create", ",", " ", "edit", ",", " ", "and", " ", "query", " ", "single", " ", "indexe", "d", " ", "component", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "Sing", "le", " ", "indexe", "d", " ", "component", "s", " ", "store", " ", "1", " ", "dimension", "al", " ", "index", " ", "values", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u()", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", ",", " ", "empty", " ", "MF", "n", "Sing", "le", "Indexe", "d", "Compo", "nent", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u", "(", "MO", "bject", " ", "component", ")", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", " ", "MF", "n", "Sing", "le", "Indexe", "d", "Compo", "nent", " ", "function", " ", "set", ",", " ", "attache", "d", " ", "to", " ", "the", " ", "specified", " ", "component", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Sing", "le", "Indexe", "d", "Component_", "(_", "MF", "n", "Component_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Da", "g", "Node_", "(_", "MF", "n", "Dependenc", "y", "Node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", " ", "set", " ", "for", " ", "operati", "ng", " ", "on", " ", "DAG", " ", "nodes", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u()", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", ",", " ", "empty", " ", "MF", "n", "Da", "g", "Node", " ", "function", "set", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u", "(", "MO", "bject", ")", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", " ", "MF", "n", "Da", "g", "Node", " ", "function", "set", " ", "and", " ", "attache", "s", " ", "it", " ", "to", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "DAG", " ", "node", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u", "(", "MD", "ag", "Path", ")", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", " ", "MF", "n", "Da", "g", "Node", " ", "function", "set", " ", "and", " ", "attache", "s", " ", "it", " ", "to", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "DAG", " ", "path", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\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\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "bound", "ing", "Box_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "in", "Model_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "in", "Under", "World_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "is", "Insta", "nce", "able_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "is", "Intermediat", "e", "Object_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "object", "Color_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "use", "Object", "Color_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Ne", "xt", "Pos_", "=_", "255_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Da", "g", "Node_", "(_", "MF", "n", "Dependenc", "y", "Node_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Doub", "le", "Array", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", " ", "set", " ", "for", " ", "node", " ", "data", " ", "consi", "stin", "g", " ", "of", " ", "an", " ", "array", " ", "of", " ", "double", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Doub", "le", "Array", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Vector", "Array", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", " ", "set", " ", "for", " ", "node", " ", "data", " ", "consi", "stin", "g", " ", "of", " ", "an", " ", "array", " ", "of", " ", "MV", "ector", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Vector", "Array", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Numer", "ic", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", " ", "set", " ", "for", " ", "non", "-", "simple", " ", "numeri", "c", " ", "node", " ", "data", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k2", "Double_", "=_", "14_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k2", "Float_", "=_", "11_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k2", "Int_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k2", "Long_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k2", "Short_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k3", "Double_", "=_", "15_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k3", "Float_", "=_", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k3", "Int_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k3", "Long_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k3", "Short_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "4", "Double_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Addr_", "=_", "17_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Boolean_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Byte_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Char_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Double_", "=_", "13_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Float_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Int_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Invalid_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Last_", "=_", "18_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Long_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Short_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Numer", "ic", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Geometr", "y", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "class", " ", "is", " ", "the", " ", "function", " ", "set", " ", "for", " ", "geom", "etry", " ", "data", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Geometr", "y", " ", "data", " ", "adds", " ", "matrix", " ", "and", " ", "grouping", " ", "(", "set", ")", " ", "informati", "on", " ", "to", " ", "regular", "\\", "10", ";", " ", " ", " ", " ", "data", " ", "and", " ", "is", " ", "used", " ", "to", " ", "pass", " ", "geom", "etry", " ", "types", " ", "suc", "h", " ", "as", " ", "mesh", ",", " ", "latt", "ice", ",", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "NU", "RB", "S", " ", "shape", " ", "data", " ", "through", " ", "DG", " ", "connections", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u()", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", ",", " ", "empty", " ", "MF", "n", "Geometr", "y", "Data", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u", "(", "MO", "bject", ")", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", " ", "MF", "n", "Geometr", "y", "Data", " ", "function", " ", "set", ",", " ", "attache", "d", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "the", " ", "specified", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "is", "Identity_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "is", "Not", "Identity_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "matrix_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "object", "Group", "Count_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Geometr", "y", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Unit", "Attribute_", "(_", "MF", "n", "Attribute_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", "set", " ", "for", " ", "creati", "ng", " ", "and", " ", "working", " ", "with", " ", "angle", ",", " ", "distance", " ", "and", " ", "time", " ", "attribute", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "default_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Angle_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Distance_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Invalid_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Last_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Time_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Unit", "Attribute_", "(_", "MF", "n", "Attribute_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Int", "Array", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", " ", "set", " ", "for", " ", "node", " ", "data", " ", "consi", "stin", "g", " ", "of", " ", "an", " ", "array", " ", "of", " ", "ints", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Int", "Array", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Compo", "und", "Attribute_", "(_", "MF", "n", "Attribute_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", "set", " ", "for", " ", "creati", "ng", " ", "and", " ", "working", " ", "with", " ", "compo", "und", " ", "attribute", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Compo", "und", "Attribute_", "(_", "MF", "n", "Attribute_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Matrix", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", " ", "set", " ", "for", " ", "matrix", " ", "node", " ", "data", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Matrix", "Data_", "(_", "MF", "n", "Data_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Mesh", "Data_", "(_", "MF", "n", "Geometr", "y", "Data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "MF", "n", "Mesh", "Data", " ", "allow", "s", " ", "the", " ", "creati", "on", " ", "and", " ", "manipulati", "on", " ", "of", " ", "Mesh", "\\", "10", ";", " ", " ", " ", " ", "data", " ", "object", "s", " ", "for", " ", "use", " ", "in", " ", "the", " ", "dependen", "cy", " ", "graph", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u()", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", ",", " ", "empty", " ", "MF", "n", "Mesh", "Data", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u", "(", "MO", "bject", ")", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", " ", "MF", "n", "Mesh", "Data", " ", "function", " ", "set", ",", " ", "attache", "d", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "the", " ", "specified", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Mesh", "Data_", "(_", "MF", "n", "Geometr", "y", "Data_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Transform_", "(_", "MF", "n", "Da", "g", "Node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", " ", "set", " ", "for", " ", "operati", "ng", " ", "on", " ", "transform", " ", "nodes", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uN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\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Rotate", "Max", "X_", "=_", "13_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Rotate", "Max", "Y_", "=_", "15_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Rotate", "Max", "Z_", "=_", "17_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Rotate", "Min", "X_", "=_", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Rotate", "Min", "Y_", "=_", "14_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Rotate", "Min", "Z_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Scale", "Max", "X_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Scale", "Max", "Y_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Scale", "Max", "Z_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Scale", "Min", "X_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Scale", "Min", "Y_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Scale", "Min", "Z_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "She", "ar", "Max", "XY_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "She", "ar", "Max", "XZ", "_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "She", "ar", "Max", "YZ", "_", "=_", "11_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "She", "ar", "Min", "XY_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "She", "ar", "Min", "XZ", "_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "She", "ar", "Min", "YZ", "_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Translate", "Max", "X_", "=_", "19_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Translate", "Max", "Y_", "=_", "21_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Translate", "Max", "Z_", "=_", "23_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Translate", "Min", "X_", "=_", "18_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Translate", "Min", "Y_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Translate", "Min", "Z_", "=_", "22_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Transform_", "(_", "MF", "n", "Da", "g", "Node_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Nu", "rb", "s", "Curve", "Data_", "(_", "MF", "n", "Geometr", "y", "Data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "MF", "n", "Nu", "rb", "s", "Curve", "Data", " ", "allow", "s", " ", "the", " ", "creati", "on", " ", "and", " ", "manipulati", "on", " ", "of", " ", "Nu", "rb", "s", " ", "Curve", "\\", "10", ";", " ", " ", " ", " ", "data", " ", "object", "s", " ", "for", " ", "use", " ", "in", " ", "the", " ", "dependen", "cy", " ", "graph", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u()", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", ",", " ", "empty", " ", "MF", "n", "Nu", "rb", "s", "Curve", "Data", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u", "(", "MO", "bject", ")", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", " ", "MF", "n", "Nu", "rb", "s", "Curve", "Data", " ", "function", " ", "set", ",", " ", "attache", "d", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "the", " ", "specified", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Nu", "rb", "s", "Curve", "Data_", "(_", "MF", "n", "Geometr", "y", "Data_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Mesh_", "(_", "MF", "n", "Da", "g", "Node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", " ", "set", " ", "for", " ", "operati", "on", " ", "on", " ", "mesh", "es", " ", "(", "poly", "gon", "al", " ", "surfaces", ").", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u()", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", ",", " ", "empty", " ", "MF", "n", "Mesh", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u", "(", "MD", "ag", "Path", " ", "path", ")", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", " ", "MF", "n", "Mesh", " ", "object", " ", "and", " ", "attache", "s", " ", "it", " ", "to", " ", "the", " ", "DAG", " ", "path", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "a", " ", "mesh", " ", "node", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u", "(", "MO", "bject", " ", "node", "Or", "Data", ")", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", " ", "MF", "n", "Mesh", " ", "object", " ", "and", " ", "attache", "s", " ", "it", " ", "to", " ", "a", " ", "mesh", "\\", "10", ";", " ", " ", " ", " ", "node", " ", "or", " ", "mesh", " ", "data", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u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u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "check", "Sam", "e", "Point", "Twi", "ce_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "display", "Colors_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "num", "Color", "Sets_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "num", "Edges_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "num", "Face", "Vertices_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "num", "Normal", "s_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "num", "Polygon", "s_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "num", "UV", "Sets_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "num", "Vertices_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "new\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Alpha_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Difference", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Insta", "nce", "Uns", "pecifi", "ed_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Intern", "al", "Point_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Intersect", "Tolerance", "_", "=_", "1e-0", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Intersection", "_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Invalid_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "On", "Edge_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Point", "Tolerance", "_", "=_", "1e-10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "RGB_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "RGB", "A_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Union_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "n", "Mesh_", "(_", "MF", "n", "Da", "g", "Node_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "MF", "n", "Nu", "rb", "s", "Surf", "ace", "Data_", "(_", "MF", "n", "Geometr", "y", "Data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "MF", "n", "Nu", "rb", "s", "Surf", "ace", "Data", " ", "allow", "s", " ", "the", " ", "creati", "on", " ", "and", " ", "manipulati", "on", " ", "of", " ", "Nu", "rb", "s", " ", "Surf", "ace", "\\", "10", ";", " ", " ", " ", " ", "data", " ", "object", "s", " ", "for", " ", "use", " ", "in", " ", "the", " ", "dependen", "cy", " ", "graph", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u()", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", ",", " ", "empty", " ", "MF", "n", "Nu", "rb", "s", "Surf", "ace", "Data", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\u\\u", "init", "\\u\\u", "(", "MO", "bject", ")", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "es", " ", "a", " ", "new", " ", "MF", "n", "Nu", "rb", "s", "Surf", "ace", "Data", " ", "function", " ", "set", ",", " ", "attache", "d", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "the", " ", "specified", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u", "new\\u\\u_", "=_", "None_", "[SEP]_", "class_", "MF", "n", "Nu", "rb", "s", "Surf", "ace", "Data_", "(_", "MF", "n", "Geometr", "y", "Data_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "init", "\\u\\u", "(...)", " ", "initialize", "s", " ", "x", ";", " ", "see", " ", "help", "(", "type", "(", "x", "))", " ", "for", " ", "signa", "ture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 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, 4, 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, 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 ]
Implicit string concatenation in a list
coursera/dataduct/dataduct/database/tests/test_database.py
[ { "content": " def test_database_recreate_table_dependencies(self):\n \"\"\"Recreating table dependencies\n \"\"\"\n view = create_view(\n \"\"\"CREATE VIEW view AS (\n SELECT id1 FROM second_table\n );\"\"\")\n database = Database(relations=[self.first_table_dependent,\n self.second_table, view])\n\n result = ['ALTER TABLE first_table ADD FOREIGN KEY (id2) '\n 'REFERENCES second_table (id2)',\n 'DROP VIEW IF EXISTS view CASCADE',\n 'CREATE VIEW view AS ( SELECT id1 FROM second_table )']\n compare_scripts(\n database.recreate_table_dependencies('second_table', False),\n result)\n eq_(database.recreate_table_dependencies('first_table', False).sql(),\n ';')", "metadata": "root.TestDatabase.test_database_recreate_table_dependencies", "header": "['class', 'TestDatabase', '(', 'TestCase', ')', ':', '___EOS___']", "index": 201 } ]
[ { "span": "'ALTER TABLE first_table ADD FOREIGN KEY (id2) '\n 'REFERENCES second_table (id2)',", "start_line": 211, "start_column": 18, "end_line": 212, "end_column": 49 } ]
[]
1
true
[ "[CLS]_", "Implicit", "_", "string_", "concate", "nation_", "in_", "a_", "list_", "[SEP]_", "class_", "Test", "Database_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "databa", "se", "\\u", "recreate", "\\u", "table", "\\u", "dependencies_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Rec", "rea", "ting", " ", "table", " ", "dependen", "cies", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view_", "=_", "create", "\\u", "view_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "CREATE", " ", "VIEW", " ", "view", " ", "AS", " ", "(", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "id", "1", " ", "FROM", " ", "second", "\\u", "table", "\\", "10", ";", " ", " ", " ", " ", ");", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "database_", "=_", "Database_", "(_", "relations_", "=_", "[_", "self_", "._", "first", "\\u", "table", "\\u", "dependent", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "second", "\\u", "table_", ",_", "view_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "[_", "'", "ALT", "ER", " ", "TAB", "LE", " ", "first", "\\u", "table", " ", "ADD", " ", "FORE", "IGN", " ", "KEY", " ", "(", "id2", ")", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "REFERENCE", "S", " ", "second", "\\u", "table", " ", "(", "id2", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "DROP", " ", "VIEW", " ", "IF", " ", "EXIST", "S", " ", "view", " ", "CAS", "CA", "DE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "CREATE", " ", "VIEW", " ", "view", " ", "AS", " ", "(", " ", "SELECT", " ", "id", "1", " ", "FROM", " ", "second", "\\u", "table", " ", ")'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compare", "\\u", "scripts_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "database_", "._", "recreate", "\\u", "table", "\\u", "dependencies_", "(_", "'", "second", "\\u", "table", "'_", ",_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "database_", "._", "recreate", "\\u", "table", "\\u", "dependencies_", "(_", "'", "first", "\\u", "table", "'_", ",_", "False_", ")_", "._", "sql_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "';'_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/datastore/datastore_pb.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\n\n\n\"\"\"The Python datastore protocol buffer definition (old name).\"\"\"\n\n\n\n\n\n\n\n\nfrom google.appengine.datastore.action_pb import Action\nfrom google.appengine.datastore.entity_pb import CompositeIndex\nfrom google.appengine.datastore.entity_pb import EntityProto\nfrom google.appengine.datastore.entity_pb import Index\nfrom google.appengine.datastore.entity_pb import Path\nfrom google.appengine.datastore.entity_pb import Property\nfrom google.appengine.datastore.entity_pb import PropertyValue\nfrom google.appengine.datastore.entity_pb import Reference\nfrom google.appengine.datastore.snapshot_pb import Snapshot\n\nfrom google.appengine.api.api_base_pb import Integer64Proto\nfrom google.appengine.api.api_base_pb import StringProto\nfrom google.appengine.api.api_base_pb import VoidProto\nfrom google.appengine.datastore import datastore_v3_pb\nfrom google.appengine.datastore.datastore_v3_pb import *\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from google.appengine.datastore.action_pb import Action", "start_line": 30, "start_column": 0, "end_line": 30, "end_column": 55 }, { "span": "from google.appengine.datastore.entity_pb import CompositeIndex", "start_line": 31, "start_column": 0, "end_line": 31, "end_column": 63 }, { "span": "from google.appengine.datastore.entity_pb import EntityProto", "start_line": 32, "start_column": 0, "end_line": 32, "end_column": 60 }, { "span": "from google.appengine.datastore.entity_pb import Index", "start_line": 33, "start_column": 0, "end_line": 33, "end_column": 54 }, { "span": "from google.appengine.datastore.entity_pb import Path", "start_line": 34, "start_column": 0, "end_line": 34, "end_column": 53 }, { "span": "from google.appengine.datastore.entity_pb import Property", "start_line": 35, "start_column": 0, "end_line": 35, "end_column": 57 }, { "span": "from google.appengine.datastore.entity_pb import PropertyValue", "start_line": 36, "start_column": 0, "end_line": 36, "end_column": 62 }, { "span": "from google.appengine.datastore.entity_pb import Reference", "start_line": 37, "start_column": 0, "end_line": 37, "end_column": 58 }, { "span": "from google.appengine.datastore.snapshot_pb import Snapshot", "start_line": 38, "start_column": 0, "end_line": 38, "end_column": 59 }, { "span": "from google.appengine.api.api_base_pb import Integer64Proto", "start_line": 40, "start_column": 0, "end_line": 40, "end_column": 59 }, { "span": "from google.appengine.api.api_base_pb import StringProto", "start_line": 41, "start_column": 0, "end_line": 41, "end_column": 56 }, { "span": "from google.appengine.api.api_base_pb import VoidProto", "start_line": 42, "start_column": 0, "end_line": 42, "end_column": 54 }, { "span": "from google.appengine.datastore import datastore_v3_pb", "start_line": 43, "start_column": 0, "end_line": 43, "end_column": 54 } ]
[]
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_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "The", " ", "Pyth", "on", " ", "datast", "ore", " ", "protoc", "ol", " ", "buffer", " ", "definit", "ion", " ", "(", "old", " ", "name", ").\"\"\"_", "\\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_", "from_", "google_", "._", "appengine_", "._", "datastore_", "._", "action", "\\u", "pb_", "import_", "Action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "datastore_", "._", "entity", "\\u", "pb_", "import_", "Composit", "e", "Index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "datastore_", "._", "entity", "\\u", "pb_", "import_", "Entit", "y", "Proto_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "datastore_", "._", "entity", "\\u", "pb_", "import_", "Index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "datastore_", "._", "entity", "\\u", "pb_", "import_", "Path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "datastore_", "._", "entity", "\\u", "pb_", "import_", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "datastore_", "._", "entity", "\\u", "pb_", "import_", "Proper", "ty", "Value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "datastore_", "._", "entity", "\\u", "pb_", "import_", "Reference_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "datastore_", "._", "snapshot", "\\u", "pb_", "import_", "Snapshot_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "api_", "._", "api", "\\u", "base", "\\u", "pb_", "import_", "Integer", "64", "Proto_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "api_", "._", "api", "\\u", "base", "\\u", "pb_", "import_", "String", "Proto_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "api_", "._", "api", "\\u", "base", "\\u", "pb_", "import_", "Voi", "d", "Proto_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "datastore_", "import_", "datast", "ore", "\\u", "v", "3", "\\u", "pb_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "datastore_", "._", "datast", "ore", "\\u", "v", "3", "\\u", "pb_", "import_", "*_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 1, 1, 1, 1, 1, 2, 0, 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, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 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 ]
Unused import
saga-project/BigJob/examples/pilot-api/example-pilot-compute-data-cloud.py
[ { "content": "import sys\nimport os\nimport time\nimport logging\nimport uuid\n#logging.basicConfig(level=logging.DEBUG)\n\n#sys.path.append(os.path.join(os.path.dirname(__file__), \"../..\"))\nfrom pilot import PilotComputeService, PilotDataService, ComputeDataService, State\nfrom bigjob import logger \n\nCOORDINATION_URL = \"redis://localhost:6379\"\n\nif __name__ == \"__main__\": \n \n print COORDINATION_URL\n # create pilot data service (factory for data pilots (physical, distributed storage))\n # and pilot data\n pilot_data_service = PilotDataService(coordination_url=COORDINATION_URL)\n \n ###################################################################################################\n # Pick one of the Pilot Data Descriptions below \n \n pilot_data_description_aws={\n \"service_url\": \"s3://pilot-data-\" + str(uuid.uuid1()),\n \"size\": 100, \n #\"region\" : \"\", # or \"\" for DEFAULT/EAST\n \"access_key_id\":\"AKIAJPGNDJRYIG5LIEUA\",\n \"secret_access_key\":\"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\" \n }\n \n pilot_data_description_india = {\n \"service_url\": \"walrus://149.165.146.135/pilot-data-\" + str(uuid.uuid1()),\n #\"service_url\": \"ssh://localhost/tmp/pilot-data-\" + str(uuid.uuid1()),\n \"affinity_datacenter_label\": \"us-east\", \n \"affinity_machine_label\": \"\",\n \"access_key_id\":\"\",\n \"secret_access_key\":\"\"\n }\n \n \n pd = pilot_data_service.create_pilot(pilot_data_description=pilot_data_description_aws)\n \n \n # Create Data Unit Description\n #base_dir = \"../data1\"\n #url_list = os.listdir(base_dir)\n # make absolute paths\n #absolute_url_list = [os.path.join(base_dir, i) for i in url_list]\n data_unit_description = {\n \"file_urls\": [os.path.join(os.getcwd(), \"test.txt\")],\n \"affinity_datacenter_label\": \"us-east-1\", \n \"affinity_machine_label\": \"\"\n } \n \n # submit pilot data to a pilot store \n input_data_unit = pd.submit_data_unit(data_unit_description)\n input_data_unit.wait()\n \n logger.info(\"Data Unit URL: \" + input_data_unit.get_url())\n pilot_compute_service = PilotComputeService(coordination_url=COORDINATION_URL)\n \n pilot_compute_description_amazon_west = {\n \"service_url\": 'ec2+ssh://aws.amazon.com',\n \"number_of_processes\": 1, \n 'affinity_datacenter_label': \"us-google\", \n 'affinity_machine_label': \"\", \n # cloud specific attributes\n #\"vm_id\":\"ami-d7f742be\",\n \"vm_id\": \"ami-5c3b1b19\",\n \"vm_ssh_username\":\"ubuntu\",\n \"vm_ssh_keyname\":\"MyKey\",\n \"vm_ssh_keyfile\":\"/Users/luckow/.ssh/id_rsa\",\n \"vm_type\":\"t1.micro\",\n \"region\" : \"us-west-1\",\n \"access_key_id\":\"AKIAJPGNDJRYIG5LIEUA\",\n \"secret_access_key\":\"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\"\n \n }\n \n \n pilot_compute_description_euca_india = {\n \"service_url\": 'euca+ssh://149.165.146.135:8773/services/Eucalyptus',\n #\"service_url\": 'fork://localhost',\n \"number_of_processes\": 1,\n 'affinity_datacenter_label': \"us-east\", \n 'affinity_machine_label': \"\", \n #'working_directory': os.getcwd(),\n # cloud specific attributes\n \"vm_id\":\"emi-36913A82\",\n \"vm_ssh_username\":\"root\",\n \"vm_ssh_keyname\":\"luckow\",\n \"vm_ssh_keyfile\":\"/Users/luckow/.ssh/eucakey-india\",\n \"vm_type\":\"c1.xlarge\",\n \"access_key_id\":\"\",\n \"secret_access_key\":\"\"\n }\n \n pilotjob = pilot_compute_service.create_pilot(pilot_compute_description=pilot_compute_description_amazon_west)\n \n compute_data_service = ComputeDataService()\n compute_data_service.add_pilot_compute_service(pilot_compute_service)\n compute_data_service.add_pilot_data_service(pilot_data_service)\n \n # create empty data unit for output data\n output_data_unit_description = {\n \"file_urls\": [] \n }\n output_data_unit = pd.submit_data_unit(output_data_unit_description)\n output_data_unit.wait()\n \n # create compute unit\n compute_unit_description = {\n \"executable\": \"/bin/cat\",\n \"arguments\": [\"test.txt\"],\n \"number_of_processes\": 1,\n \"output\": \"stdout.txt\",\n \"error\": \"stderr.txt\", \n \"input_data\": [input_data_unit.get_url()],\n # Put files stdout.txt and stderr.txt into output data unit\n \"output_data\": [\n {\n output_data_unit.get_url(): \n [\"std*\"]\n }\n ] \n } \n \n compute_unit = compute_data_service.submit_compute_unit(compute_unit_description)\n logger.info(\"Finished setup of ComputeDataService. Waiting for scheduling of PD\")\n compute_data_service.wait()\n \n logger.debug(\"Output Data Unit: \" + str(output_data_unit.list()))\n \n logger.info(\"Terminate Pilot Compute/Data Service\")\n compute_data_service.cancel()\n pilot_data_service.cancel()\n pilot_compute_service.cancel()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import sys", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 10 }, { "span": "import time", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 11 }, { "span": "import logging", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 14 }, { "span": "from pilot import PilotComputeService, PilotDataService, ComputeDataService, State", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 82 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "logg", "ing", ".", "basic", "Config", "(", "level", "=", "logg", "ing", ".", "DEBU", "G", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "sys", ".", "path", ".", "append", "(", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "dir", "name", "(\\u", "\\u", "file", "\\u\\u)", ",", " ", "\"../..", "\"))", "_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pilot", "_", "import_", "Pilo", "t", "Compute", "Service_", ",_", "Pilo", "t", "Data", "Service_", ",_", "Compute", "Data", "Service_", ",_", "State_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "big", "job_", "import_", "logger_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "COORD", "INATION", "\\u", "URL_", "=_", "\"", "redis", "://", "local", "host", ":", "6379", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "COORD", "INATION", "\\u", "URL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "pilot", " ", "data", " ", "service", " ", "(", "factor", "y", " ", "for", " ", "data", " ", "pilot", "s", " ", "(", "physical", ",", " ", "distributed", " ", "storage", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "pilot", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "pilot", "\\u", "data\\u", "service_", "=_", "Pilo", "t", "Data", "Service_", "(_", "coordin", "ation", "\\u", "url_", "=_", "COORD", "INATION", "\\u", "URL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pick", " ", "one", " ", "of", " ", "the", " ", "Pilo", "t", " ", "Data", " ", "Descripti", "ons", " ", "belo", "w", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pilot", "\\u", "data\\u", "description", "\\u", "aws_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "service", "\\u", "url", "\"_", ":_", "\"", "s3", "://", "pilot", "-", "data", "-\"_", "+_", "str_", "(_", "uuid_", "._", "uuid1_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "size", "\"_", ":_", "100_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#\"", "region", "\"", " ", ":", " ", "\"\"", ",", " ", "#", " ", "or", " ", "\"\"", " ", "for", " ", "DEF", "AUL", "T", "/", "EAS", "T_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "access", "\\u", "key", "\\u", "id", "\"_", ":_", "\"", "AK", "IA", "JP", "GN", "DJ", "RY", "IG", "5", "LIE", "UA", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "secret", "\\u", "access", "\\u", "key", "\"_", ":_", "\"", "II", "1", "K", "6", "B1", "a", "A4", "I2", "30", "tx", "5", "RAL", "rd", "1", "v", "Ep", "7", "IX", "u", "Pk", "Wu", "6", "K", "5f", "x", "F", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pilot", "\\u", "data\\u", "description", "\\u", "india", "_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "service", "\\u", "url", "\"_", ":_", "\"", "wal", "rus", "://", "149", ".1", "65.", "146", ".1", "3", "5", "/", "pilot", "-", "data", "-\"_", "+_", "str_", "(_", "uuid_", "._", "uuid1_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#\"", "service", "\\u", "url", "\":", " ", "\"", "ssh", "://", "local", "host", "/", "tmp", "/", "pilot", "-", "data", "-\"", " ", "+", " ", "str", "(", "uuid", ".", "uuid", "1", "())", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "affinity", "\\u", "datacenter", "\\u", "label", "\"_", ":_", "\"", "us", "-", "east", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "affinity", "\\u", "machine", "\\u", "label", "\"_", ":_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "access", "\\u", "key", "\\u", "id", "\"_", ":_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "secret", "\\u", "access", "\\u", "key", "\"_", ":_", "\"\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pd_", "=_", "pilot", "\\u", "data\\u", "service_", "._", "create", "\\u", "pilot", "_", "(_", "pilot", "\\u", "data\\u", "description_", "=_", "pilot", "\\u", "data\\u", "description", "\\u", "aws_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "Data", " ", "Unit", " ", "Description_", "\\u\\u\\uNL\\u\\u\\u_", "#", "base", "\\u", "dir", " ", "=", " ", "\"..", "/", "data", "1", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "url", "\\u", "list", " ", "=", " ", "os", ".", "listd", "ir", "(", "base", "\\u", "dir", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "abs", "olute", " ", "paths_", "\\u\\u\\uNL\\u\\u\\u_", "#", "abs", "olute", "\\u", "url", "\\u", "list", " ", "=", " ", "[", "os", ".", "path", ".", "join", "(", "base", "\\u", "dir", ",", " ", "i", ")", " ", "for", " ", "i", " ", "in", " ", "url", "\\u", "list", "]_", "\\u\\u\\uNL\\u\\u\\u_", "data\\u", "unit", "\\u", "description_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "file", "\\u", "urls", "\"_", ":_", "[_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "getcwd_", "(_", ")_", ",_", "\"", "test", ".", "txt", "\"_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "affinity", "\\u", "datacenter", "\\u", "label", "\"_", ":_", "\"", "us", "-", "east", "-1", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "affinity", "\\u", "machine", "\\u", "label", "\"_", ":_", "\"\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "submit", " ", "pilot", " ", "data", " ", "to", " ", "a", " ", "pilot", " ", "store", " _", "\\u\\u\\uNL\\u\\u\\u_", "input", "\\u", "data\\u", "unit_", "=_", "pd_", "._", "submit", "\\u", "data\\u", "unit_", "(_", "data\\u", "unit", "\\u", "description_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input", "\\u", "data\\u", "unit_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "._", "info_", "(_", "\"", "Data", " ", "Unit", " ", "URL", ":", " ", "\"_", "+_", "input", "\\u", "data\\u", "unit_", "._", "get", "\\u", "url_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pilot", "\\u", "compute", "\\u", "service_", "=_", "Pilo", "t", "Compute", "Service_", "(_", "coordin", "ation", "\\u", "url_", "=_", "COORD", "INATION", "\\u", "URL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pilot", "\\u", "compute", "\\u", "description", "\\u", "amaz", "on", "\\u", "west", "_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "service", "\\u", "url", "\"_", ":_", "'", "ec", "2", "+", "ssh", "://", "aws", ".", "amaz", "on", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "number", "\\u", "of", "\\u", "process", "es", "\"_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "affinity", "\\u", "datacenter", "\\u", "label", "'_", ":_", "\"", "us", "-", "google", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "affinity", "\\u", "machine", "\\u", "label", "'_", ":_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "cloud", " ", "specific", " ", "attributes_", "\\u\\u\\uNL\\u\\u\\u_", "#\"", "vm", "\\u", "id", "\":\"", "ami", "-", "d7", "f7", "4", "2b", "e", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "vm", "\\u", "id", "\"_", ":_", "\"", "ami", "-", "5c", "3b", "1b", "1", "9", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "vm", "\\u", "ssh", "\\u", "user", "name", "\"_", ":_", "\"", "ubu", "ntu", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "vm", "\\u", "ssh", "\\u", "keyn", "ame", "\"_", ":_", "\"", "My", "Key", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "vm", "\\u", "ssh", "\\u", "keyfile", "\"_", ":_", "\"/", "User", "s", "/", "luck", "ow", "/.", "ssh", "/", "id", "\\u", "rsa", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "vm", "\\u", "type", "\"_", ":_", "\"", "t1", ".", "micro", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "region", "\"_", ":_", "\"", "us", "-", "west", "-1", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "access", "\\u", "key", "\\u", "id", "\"_", ":_", "\"", "AK", "IA", "JP", "GN", "DJ", "RY", "IG", "5", "LIE", "UA", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "secret", "\\u", "access", "\\u", "key", "\"_", ":_", "\"", "II", "1", "K", "6", "B1", "a", "A4", "I2", "30", "tx", "5", "RAL", "rd", "1", "v", "Ep", "7", "IX", "u", "Pk", "Wu", "6", "K", "5f", "x", "F", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pilot", "\\u", "compute", "\\u", "description", "\\u", "euc", "a", "\\u", "india", "_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "service", "\\u", "url", "\"_", ":_", "'", "euc", "a", "+", "ssh", "://", "149", ".1", "65.", "146", ".1", "3", "5", ":", "877", "3", "/", "service", "s", "/", "Euc", "aly", "ptu", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#\"", "service", "\\u", "url", "\":", " ", "'", "fork", "://", "local", "host", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "number", "\\u", "of", "\\u", "process", "es", "\"_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "affinity", "\\u", "datacenter", "\\u", "label", "'_", ":_", "\"", "us", "-", "east", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "affinity", "\\u", "machine", "\\u", "label", "'_", ":_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#'", "working", "\\u", "director", "y", "':", " ", "os", ".", "getc", "wd", "()", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "cloud", " ", "specific", " ", "attributes_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "vm", "\\u", "id", "\"_", ":_", "\"", "emi", "-", "369", "13", "A8", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "vm", "\\u", "ssh", "\\u", "user", "name", "\"_", ":_", "\"", "root", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "vm", "\\u", "ssh", "\\u", "keyn", "ame", "\"_", ":_", "\"", "luck", "ow", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "vm", "\\u", "ssh", "\\u", "keyfile", "\"_", ":_", "\"/", "User", "s", "/", "luck", "ow", "/.", "ssh", "/", "euc", "ake", "y", "-", "india", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "vm", "\\u", "type", "\"_", ":_", "\"", "c1", ".", "xla", "rge", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "access", "\\u", "key", "\\u", "id", "\"_", ":_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "secret", "\\u", "access", "\\u", "key", "\"_", ":_", "\"\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pilot", "job_", "=_", "pilot", "\\u", "compute", "\\u", "service_", "._", "create", "\\u", "pilot", "_", "(_", "pilot", "\\u", "compute", "\\u", "description_", "=_", "pilot", "\\u", "compute", "\\u", "description", "\\u", "amaz", "on", "\\u", "west", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "compute", "\\u", "data\\u", "service_", "=_", "Compute", "Data", "Service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compute", "\\u", "data\\u", "service_", "._", "add", "\\u", "pilot", "\\u", "compute", "\\u", "service_", "(_", "pilot", "\\u", "compute", "\\u", "service_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compute", "\\u", "data\\u", "service_", "._", "add", "\\u", "pilot", "\\u", "data\\u", "service_", "(_", "pilot", "\\u", "data\\u", "service_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "empty", " ", "data", " ", "unit", " ", "for", " ", "output", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "output", "\\u", "data\\u", "unit", "\\u", "description_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "file", "\\u", "urls", "\"_", ":_", "[_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "data\\u", "unit_", "=_", "pd_", "._", "submit", "\\u", "data\\u", "unit_", "(_", "output", "\\u", "data\\u", "unit", "\\u", "description_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "data\\u", "unit_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "compute", " ", "unit_", "\\u\\u\\uNL\\u\\u\\u_", "compute", "\\u", "unit", "\\u", "description_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "executable", "\"_", ":_", "\"/", "bin", "/", "cat", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "argu", "ment", "s", "\"_", ":_", "[_", "\"", "test", ".", "txt", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "number", "\\u", "of", "\\u", "process", "es", "\"_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "output", "\"_", ":_", "\"", "stdout", ".", "txt", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "error", "\"_", ":_", "\"", "std", "err", ".", "txt", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "input", "\\u", "data", "\"_", ":_", "[_", "input", "\\u", "data\\u", "unit_", "._", "get", "\\u", "url_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Put", " ", "files", " ", "stdout", ".", "txt", " ", "and", " ", "std", "err", ".", "txt", " ", "int", "o", " ", "output", " ", "data", " ", "unit_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "output", "\\u", "data", "\"_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "output", "\\u", "data\\u", "unit_", "._", "get", "\\u", "url_", "(_", ")_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\"", "std", "*\"_", "]_", "\\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_", "compute", "\\u", "unit_", "=_", "compute", "\\u", "data\\u", "service_", "._", "submit", "\\u", "compute", "\\u", "unit_", "(_", "compute", "\\u", "unit", "\\u", "description_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "info_", "(_", "\"", "Finish", "ed", " ", "setup", " ", "of", " ", "Compute", "Data", "Service", ".", " ", "Wait", "ing", " ", "for", " ", "sched", "ulin", "g", " ", "of", " ", "PD", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compute", "\\u", "data\\u", "service_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "._", "debug_", "(_", "\"", "Output", " ", "Data", " ", "Unit", ":", " ", "\"_", "+_", "str_", "(_", "output", "\\u", "data\\u", "unit_", "._", "list_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "._", "info_", "(_", "\"", "Terminate", " ", "Pilo", "t", " ", "Compute", "/", "Data", " ", "Service", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compute", "\\u", "data\\u", "service_", "._", "cancel_", "(_", ")_", "\\u\\u\\uNEW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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Testing equality to None
operasoftware/tlsprober/cluster_start.py
[ { "content": "# Copyright 2010-2012 Opera Software ASA \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\nimport libinit\nimport probedb.standalone\nimport probedb.cluster.models as Cluster\nimport probedb.probedata2.models as Probe\nimport os,os.path,time,subprocess,datetime\nfrom optparse import OptionParser\nfrom probedb.cluster.models import ClusterAction\nfrom django.db import connection\n\n\"\"\"Main handler on each cluster, checks every 10 minutes for new tasks\"\"\"\n\ncomputername = os.environ.get('COMPUTERNAME',\"any\").lower()\nif computername == \"any\":\n\tcomputername = os.environ.get('HOSTNAME',\"any\").lower()\nif computername == \"any\":\n\traise Exception(\"Computername was empty\")\n\ncomputername = computername.partition('.')[0]\n\noptions_config = OptionParser()\n\noptions_config.add_option(\"--testbase2\", action=\"store_true\", dest=\"use_testbase2\")\noptions_config.add_option(\"--verbose\", action=\"store_true\", dest=\"verbose\")\noptions_config.add_option(\"--managed\", action=\"store_true\", dest=\"managed\")\noptions_config.add_option(\"--performance\", action=\"store_true\", dest=\"register_performance\")\n\n(options, args) = options_config.parse_args()\n\n\nwhile True:\n\tterminate = False\n\tmaster_configuration,created = Cluster.ClusterNode.objects.get_or_create(hostname = \"tlsprober-cluster\", defaults={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"probe_parameters\":\"not used\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t#\"result_parameters\":\"not used\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"active_node\":True,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\tconfiguration,created = Cluster.ClusterNode.objects.get_or_create(hostname = computername, defaults={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"probe_parameters\":\"--processes 40 --iterations 40\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t#\"result_parameters\":\"--processes 10 --iterations 100\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"active_node\":True,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\tconfiguration.save()\n\n\tfor run in Cluster.ClusterRun.objects.filter(enabled=True).order_by(\"-priority\", \"entered_date\").iterator():\n\t\t\"\"\"Find the active job with the highest priority in the queue\"\"\" \n\t\tif run.perform_run.probequeue_set.filter(state=Probe.ProbeQueue.PROBEQ_IDLE).count() == 0:\n\t\t\trun.enabled = False\n\t\t\trun.save()\n\t\t\tcontinue\n\t\t\n\t\tif run.perform_run.branch:\n\t\t\tterminate = True\n\t\t\n\t\tprocesses = []\n\t\tprocess_index = 0\n\t\ttopped_out = False\n\t\t\n\t\tcheck_queue_frequency = 1\n\t\tchecked_count = 0\n\t\tchecked_count_git = 0\n\t\tlast_count =Probe.ProbeQueue.objects.filter(part_of_run=run.perform_run_id,state=Probe.ProbeQueue.PROBEQ_IDLE).count()\n\t\tif last_count > 1000000:\n\t\t\tcheck_queue_frequency = 30\t\t\t\n\t\telif last_count > 50000:\n\t\t\tcheck_queue_frequency = 10\t\t\t\n\t\t\n\t\twhile (Cluster.ClusterRun.objects.filter(enabled=True, priority__gt=run.priority).count() == 0 and \n\t\t\tCluster.ClusterRun.objects.get(id = run.id).enabled):\n\t\t\tmaster_configuration = Cluster.ClusterNode.objects.get(hostname = \"tlsprober-cluster\")\n\t\t\tconfiguration= Cluster.ClusterNode.objects.get(hostname = computername)\n\t\t\tif not configuration.active_node or not master_configuration.active_node:\n\t\t\t\tbreak;\n\t\t\tconfiguration.save()\n\n\t\t\tif not processes:\n\t\t\t\tsubprocess.call([\"git\", \"pull\",])\n\t\t\t\tsubprocess.call([\"git\", \"submodule\", \"update\", \"--recursive\"])\n\t\t\t\tsubprocess.call([\"python\", \"build_certhandler.py\", \"build\",\"--build-lib\",\".\"], cwd=os.path.join(\"probedb\",\"certs\"))\n\n\t\t\tchecked_count += 1\n\t\t\tif checked_count >= check_queue_frequency:\n\t\t\t\tqlen =Probe.ProbeQueue.objects.filter(part_of_run=run.perform_run_id, state=Probe.ProbeQueue.PROBEQ_IDLE).count()\n\t\t\t\tif qlen <= 0 :\n\t\t\t\t\tbreak;\n\t\t\t\tif qlen < 50000:\n\t\t\t\t\tcheck_queue_frequency = 0\n\t\t\t\telif qlen < 1000000:\n\t\t\t\t\tcheck_queue_frequency = 10\n\t\t\t\t\t\n\t\t\t\tlast_count = qlen\t\t\t\n\n\t\t\t\tchecked_count = 0\n\t\t\t\t\n\t\t\tchecked_count_git += 1;\n\t\t\tif checked_count_git>= 10:\n\t\t\t\tsubprocess.call([\"git\", \"pull\",])\n\t\t\t\tsubprocess.call([\"git\", \"submodule\", \"update\", \"--recursive\"])\n\t\t\t\tsubprocess.call([\"python\", \"build_certhandler.py\", \"build\",\"--build-lib\",\".\"], cwd=os.path.join(\"probedb\",\"certs\"))\n\t\t\t\tchecked_count_git = 0;\n\n\t\t\t\n\t\t\trun_config = OptionParser()\n\t\t\t\n\t\t\trun_config.add_option(\"--processes\", action=\"store\", type=\"int\", dest=\"process_count\", default=1)\n\t\t\trun_config.add_option(\"--iterations\", action=\"store\", type=\"int\", dest=\"iteration_count\", default=40)\n\n\t\t\t(run_options, args) = run_config.parse_args(configuration.probe_parameters.split())\n\t\t\tif int(run_options.process_count) == 0:\n\t\t\t\tbreak\n\n\t\t\tstarted_proc = 0;\n\t\t\t\n\t\t\tQ = Cluster.ClusterAction.objects.filter(cluster_run=run)\n\t\t\tcurrent_time = datetime.datetime.now()\n\t\t\tdelta = datetime.timedelta(minutes=10)\n\n\t\t\t# Calculate process and iteration limits based on the actual \n\t\t\t# number of items left for the job\n\t\t\t# Early in the process the cluster will work slowly up to full \n\t\t\t# number of processes, to avoid overloading the database\n\t\t\t# towards the end, the number of processes will be reduced,\n\t\t\t# in parallel to reducing the number of iterations per process\n\t\t\t# to reduce the risk that one process will continue for a long \n\t\t\t# time while others have finished \n\t\t\tQ3 = Q.filter(completed_time__range=(current_time-delta,current_time-datetime.timedelta(minutes=5)))\n\t\t\tall_count_5min = Q3.count()\n\t\t\tif all_count_5min > 4:\n\t\t\t\n\t\t\t\tQ1 = Q.filter(completed_time__range=(current_time-delta,current_time))\n\t\t\t\tnode_count_10min = Q1.filter(cluster_node = configuration).count()\n\t\t\t\tall_count_10min = Q1.count()\n\t\t\t\t\n\t\t\t\tif node_count_10min > 4:\n\t\t\t\t\tfactor = all_count_10min/node_count_10min\n\t\t\t\t\titerations = int((last_count * factor)/ int(run_options.process_count))\n\n\t\t\t\t\tif run_options.iteration_count > iterations:\n\t\t\t\t\t\trun_options.iteration_count = max(15, iterations)\n\t\t\t\t\t\t\n\t\t\tproc_limit = int(run_options.process_count)\n\t\t\tif last_count < 10000 and proc_limit > 20 and run_options.iteration_count >50 :\n\t\t\t\trun_options.iteration_count = 15\n\t\t\t\t\n\t\t\tif last_count < 100000 and proc_limit > 50:\n\t\t\t\tproc_limit /= 3\n\t\t\t\tproc_limit = max(40,proc_limit)\n\t\t\t\tif last_count < run_options.iteration_count * proc_limit:\n\t\t\t\t\tproc_limit = max(min(40,proc_limit), min(40,last_count/ run_options.iteration_count, proc_limit))\n\n\t\t\tif last_count < proc_limit*run_options.iteration_count:\n\t\t\t\tproc_limit = max(10, last_count/run_options.iteration_count)\n\n\t\t\tif proc_limit > 80 and len(processes) >0 and len(processes)<80 and all_count_5min < 50:\n\t\t\t\ttime.sleep(120);\n\t\t\t\tcontinue;\n\n\t\t\tstart_proc = max(10,min(\n\t\t\t\t\t\t\t\t30 if proc_limit *0.75 > len(processes) or (proc_limit > 200 and len(processes) < 100) else 50 , \n\t\t\t\t\t\t\t\tproc_limit/10))\n\t\t\tif proc_limit >80 and len(processes)<30:\n\t\t\t\tstart_proc = 5\n\t\t\twhile len(processes) < proc_limit and started_proc<start_proc:\n\t\t\t\tprocess_index += 1\n\t\t\t\tnew_process = subprocess.Popen(\n\t\t\t\t\t\t\t\t\t\t\t([\"nice\"] if os.name == \"posix\" else []) +\n\t\t\t\t\t\t\t\t\t\t\t[\"python\", \"-O\", \n\t\t\t\t\t\t\t\t\t\t\t\t\"probe_lists.py\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"-n\", str(process_index),\n\t\t\t\t\t\t\t\t\t\t\t\t\"--run-id\", str(run.perform_run.id),\n\t\t\t\t\t\t\t\t\t\t\t\t\"--source\", '\"'+run.perform_run.source_name+'\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\"--description\", '\"'+run.perform_run.description+'\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\"--max\", str(run_options.iteration_count),\n\t\t\t\t\t\t\t\t\t\t\t\t]+\n\t\t\t\t\t\t\t\t\t\t\t\t([\"--performance\"] if options.verbose or options.register_performance else [])+\n\t\t\t\t\t\t\t\t\t\t\t\t([\"--testbase2\"] if options.use_testbase2 else [])+\n\t\t\t\t\t\t\t\t\t\t\t\t([\"--large_run\"] if last_count > 400000 else [])+\n\t\t\t\t\t\t\t\t\t\t\t\t([\"--small_run\"] if last_count < 50000 else [])\n\t\t\t\t\t\t\t\t\t\t\t\t, shell=False)\n\t\t\t\t\n\t\t\t\tstarted_proc += 1\n\t\t\t\tif new_process:\n\t\t\t\t\tprocesses.append(new_process)\n\t\t\t\t\tif options.verbose:\n\t\t\t\t\t\tprint \"started \", process_index, \" count \", len(processes), \"/\", proc_limit\n\t\t\t\ttime.sleep(0.5)\n\t\t\n\t\t\ttry:\n\t\t\t\tconnection.close()\n\t\t\texcept:\n\t\t\t\tpass\n\t\t\t\n\t\t\tif not topped_out and len(processes) >= int(run_options.process_count):\n\t\t\t\ttopped_out = True\n\t\t\t\n\t\t\t# Don't start too processes to quickly\n\t\t\tif (start_proc < 10 and not topped_out) or (proc_limit > 200 and len(processes) < proc_limit*0.90):\n\t\t\t\ttime.sleep(300)\n\t\t\telif last_count < 100000 and proc_limit > 20 and not topped_out:\n\t\t\t\ttime.sleep(240)\n\t\t\telif len(processes) >300 and len(processes) < proc_limit*0.95:\n\t\t\t\ttime.sleep(300)\n\t\t\telif len(processes) >200 and len(processes) < proc_limit*0.95:\n\t\t\t\ttime.sleep(60)\n\t\t\telse:\n\t\t\t\ttime.sleep(30 if len(processes) > proc_limit*0.95 else 15)\n\t\t\t\n\t\t\tif options.verbose:\n\t\t\t\tQ = ClusterAction.objects.filter(cluster_run=run)\n\t\t\t\tcurrent_time = datetime.datetime.now()\n\t\t\t\tdelta = datetime.timedelta(hours=1)\n\t\t\t\tQ1 = Q.filter(completed_time__range=(current_time-delta,current_time))\n\t\t\t\tall_count_hour = Q1.count() \n\t\t\t\tnode_count_hour = Q1.filter(cluster_node = configuration).count() \n\n\t\t\t\tdelta = datetime.timedelta(minutes=10)\n\t\t\t\tQ1 = Q.filter(completed_time__range=(current_time-delta,current_time))\n\t\t\t\tall_count_10min = Q1.count()*6 #recalc to per hour \n\t\t\t\tnode_count_10min = Q1.filter(cluster_node = configuration).count()*6 #recalc to per hour\n\n\t\t\t\tdelta = datetime.timedelta(minutes=1)\n\t\t\t\tQ1 = Q.filter(completed_time__range=(current_time-delta,current_time))\n\t\t\t\tall_count_1min = Q1.count()*60 #recalc to per hour \n\t\t\t\tnode_count_1min = Q1.filter(cluster_node = configuration).count()*60 #recalc to per hour\n\t\t\t\t\n\t\t\t\t#clean up queue\n\t\t\t\t#Probe.ProbeQueue.objects.filter(part_of_run=run.perform_run_id, state=Probe.ProbeQueue.PROBEQ_FINISHED).delete()\n\n\t\t\t\tprint \"Node: \", node_count_1min, \" \", node_count_10min, \" \", node_count_hour\n\t\t\t\tprint \"All: \", all_count_1min, \" \", all_count_10min, \" \", all_count_hour, \" (\", Probe.ProbeQueue.objects.filter(part_of_run=run.perform_run_id,state=Probe.ProbeQueue.PROBEQ_IDLE).count(), \" left)\"\n\t\t\t\n\t\t\tnext_process_list = []\n\t\t\t\n\t\t\tfor proc in processes:\n\t\t\t\tif proc.poll() == None:\n\t\t\t\t\tnext_process_list.append(proc)\n\t\t\t\n\t\t\tprocesses = next_process_list\n\t\t\t\t\n\t\t\t# Loop back and try the next one\n\t\t\n\t\twhile processes:\n\t\t\ttry:\n\t\t\t\tconnection.close()\n\t\t\texcept:\n\t\t\t\tpass\n\t\t\ttime.sleep(30)\n\t\t\tif options.verbose:\n\t\t\t\tQ = ClusterAction.objects.filter(cluster_run=run)\n\t\t\t\tcurrent_time = datetime.datetime.now()\n\t\t\t\tdelta = datetime.timedelta(hours=1)\n\t\t\t\tQ1 = Q.filter(completed_time__range=(current_time-delta,current_time))\n\t\t\t\tall_count_hour = Q1.count() \n\t\t\t\tnode_count_hour = Q1.filter(cluster_node = configuration).count() \n\n\t\t\t\tdelta = datetime.timedelta(minutes=10)\n\t\t\t\tQ1 = Q.filter(completed_time__range=(current_time-delta,current_time))\n\t\t\t\tall_count_10min = Q1.count()*6 #recalc to per hour \n\t\t\t\tnode_count_10min = Q1.filter(cluster_node = configuration).count()*6 #recalc to per hour\n\n\t\t\t\tdelta = datetime.timedelta(minutes=1)\n\t\t\t\tQ1 = Q.filter(completed_time__range=(current_time-delta,current_time))\n\t\t\t\tall_count_1min = Q1.count()*60 #recalc to per hour \n\t\t\t\tnode_count_1min = Q1.filter(cluster_node = configuration).count()*60 #recalc to per hour\n\t\t\t\t\n\t\t\t\t#clean up queue\n\t\t\t\t#Probe.ProbeQueue.objects.filter(part_of_run=run.perform_run_id, state=Probe.ProbeQueue.PROBEQ_FINISHED).delete()\n\n\t\t\t\tprint \"Node: \", node_count_1min, \" \", node_count_10min, \" \", node_count_hour\n\t\t\t\tprint \"All: \", all_count_1min, \" \", all_count_10min, \" \", all_count_hour, \" (\", Probe.ProbeQueue.objects.filter(part_of_run=run.perform_run_id, state=Probe.ProbeQueue.PROBEQ_IDLE).count(), \" left)\"\n\n\t\t\tnext_process_list = []\n\t\t\t\n\t\t\tfor proc in processes:\n\t\t\t\tif proc.poll() == None:\n\t\t\t\t\tnext_process_list.append(proc)\n\t\t\t\n\t\t\tprocesses = next_process_list\n\t\t\t\n\t\t\tif options.verbose:\n\t\t\t\tprint \"closing down: count \", len(processes), \"/\", run_options.process_count\n\t\t\t\t\n\t\t\t# Loop back and see if all has ended now\n\t\t\n\t\t\n\t\tif options.verbose:\n\t\t\tprint \"closed down:\"\n\t\t\t\n\t\tbreak; # need to trigger a new database retrieval\n\t\n\tif terminate:\n\t\tbreak;\n\t\n\tmaster_configuration = Cluster.ClusterNode.objects.get(hostname = \"tlsprober-cluster\")\n\tconfiguration= Cluster.ClusterNode.objects.get(hostname = computername)\n\tconfiguration.save()\n\trun_config = OptionParser()\n\t\n\trun_config.add_option(\"--processes\", action=\"store\", dest=\"process_count\", default=1)\n\trun_config.add_option(\"--iterations\", action=\"store\", dest=\"iteration_count\", default=40)\n\n\t(run_options, args) = run_config.parse_args(configuration.probe_parameters.split())\n\tif (not master_configuration.active_node or not configuration.active_node or \n\t\tint(run_options.process_count) == 0 or Cluster.ClusterRun.objects.filter(enabled=True).count() == 0):\n\t\tif options.managed and Cluster.ClusterRun.objects.filter(enabled=True).count() == 0:\n\t\t\tbreak;\n\t\tconnection.close()\n\t\ttime.sleep(60) # if there are no runs, sleep for 10 minutes\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "proc.poll() == None:", "start_line": 248, "start_column": 7, "end_line": 248, "end_column": 26 }, { "span": "proc.poll() == None:", "start_line": 288, "start_column": 7, "end_line": 288, "end_column": 26 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", " ", " ", "Copy", "right", " ", "2010", "-", "2012", " ", "Opera", " ", "Sof", "twa", "re", " ", "AS", "A", " _", "\\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_", "import_", "lib", "init_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "prob", "edb", "_", "._", "standalone", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "prob", "edb", "_", "._", "cluster_", "._", "models_", "as_", "Cluster_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "prob", "edb", "_", "._", "prob", "edat", "a2_", "._", "models_", "as_", "Probe", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", ",_", "os_", "._", "path_", ",_", "time_", ",_", "subprocess_", ",_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "optparse_", "import_", "Optio", "n", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "prob", "edb", "_", "._", "cluster_", "._", "models_", "import_", "Cluster", "Action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Main", " ", "handler", " ", "on", " ", "each", " ", "cluster", ",", " ", "checks", " ", "every", " ", "10", " ", "minute", "s", " ", "for", " ", "new", " ", "task", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "computer", "name_", "=_", "os_", "._", "environ_", "._", "get_", "(_", "'", "COMPUTE", "RNA", "ME", "'_", ",_", "\"", "any", "\"_", ")_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "computer", "name_", "==_", "\"", "any", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "computer", "name_", "=_", "os_", "._", "environ_", "._", "get_", "(_", "'", "HOSTNAME", "'_", ",_", "\"", "any", "\"_", ")_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "computer", "name_", "==_", "\"", "any", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "raise_", "Exception_", "(_", "\"", "Compute", "rnam", "e", " ", "was", " ", "empty", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "computer", "name_", "=_", "computer", "name_", "._", "partition_", "(_", "'.'_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "options", "\\u", "config_", "=_", "Optio", "n", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "options", "\\u", "config_", "._", "add", "\\u", "option_", "(_", "\"--", "testb", "ase", "2", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "use", "\\u", "testb", "ase", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options", "\\u", "config_", "._", "add", "\\u", "option_", "(_", "\"--", "verbo", "se", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "verbo", "se", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options", "\\u", "config_", "._", "add", "\\u", "option_", "(_", "\"--", "manage", "d", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "manage", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options", "\\u", "config_", "._", "add", "\\u", "option_", "(_", "\"--", "perform", "anc", "e", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "register", "\\u", "perform", "anc", "e", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "options_", ",_", "args_", ")_", "=_", "options", "\\u", "config_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "terminate_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "master", "\\u", "configuration_", ",_", "created_", "=_", "Cluster_", "._", "Cluster", "Node_", "._", "objects_", "._", "get", "\\u", "or", "\\u", "create_", "(_", "hostname_", "=_", "\"", "tls", "prob", "er", "-", "cluster", "\"_", ",_", "defaults_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "prob", "e\\u", "parameter", "s", "\"_", ":_", "\"", "not", " ", "used", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#\"", "result", "\\u", "parameter", "s", "\":\"", "not", " ", "used", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "active", "\\u", "node", "\"_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "configuration_", ",_", "created_", "=_", "Cluster_", "._", "Cluster", "Node_", "._", "objects_", "._", "get", "\\u", "or", "\\u", "create_", "(_", "hostname_", "=_", "computer", "name_", ",_", "defaults_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "prob", "e\\u", "parameter", "s", "\"_", ":_", "\"--", "process", "es", " ", "40", " ", "--", "iterati", "ons", " ", "40", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#\"", "result", "\\u", "parameter", "s", "\":\"", "--", "process", "es", " ", "10", " ", "--", "iterati", "ons", " ", "100", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "active", "\\u", "node", "\"_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "configuration_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "run_", "in_", "Cluster_", "._", "Cluster", "Run_", "._", "objects_", "._", "filter_", "(_", "enabled_", "=_", "True_", ")_", "._", "order", "\\u", "by_", "(_", "\"-", "priorit", "y", "\"_", ",_", "\"", "enter", "ed", "\\u", "date", "\"_", ")_", "._", "iterator_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Fin", "d", " ", "the", " ", "active", " ", "job", " ", "with", " ", "the", " ", "high", "est", " ", "priorit", "y", " ", "in", " ", "the", " ", "queue", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "run_", "._", "perform", "\\u", "run_", "._", "prob", "eque", "ue", "\\u", "set_", "._", "filter_", "(_", "state_", "=_", "Probe", "_", "._", "Probe", "Queue_", "._", "PROB", "EQ", "\\u", "IDLE", "_", ")_", "._", "count_", "(_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "run_", "._", "enabled_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run_", "._", "save_", "(_", ")_", "\\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_", "if_", "run_", "._", "perform", "\\u", "run_", "._", "branch_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "terminate_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "processes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process", "\\u", "index_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top", "ped", "\\u", "out_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "check", "\\u", "queue", "\\u", "frequency_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "checke", "d\\u", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "checke", "d\\u", "count", "\\u", "git_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "count_", "=_", "Probe", "_", "._", "Probe", "Queue_", "._", "objects_", "._", "filter_", "(_", "part", "\\u", "of", "\\u", "run_", "=_", "run_", "._", "perform", "\\u", "run", "\\u", "id_", ",_", "state_", "=_", "Probe", "_", "._", "Probe", "Queue_", "._", "PROB", "EQ", "\\u", "IDLE", "_", ")_", "._", "count_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "last", "\\u", "count_", ">_", "1000000_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "check", "\\u", "queue", "\\u", "frequency_", "=_", "30_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "last", "\\u", "count_", ">_", "50000_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "check", "\\u", "queue", "\\u", "frequency_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "(_", "Cluster_", "._", "Cluster", "Run_", "._", "objects_", "._", "filter_", "(_", "enabled_", "=_", "True_", ",_", "priorit", "y\\u\\u", "gt_", "=_", "run_", "._", "priority_", ")_", "._", "count_", "(_", ")_", "==_", "0_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "Cluster_", "._", "Cluster", "Run_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "run_", "._", "id_", ")_", "._", "enabled_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "master", "\\u", "configuration_", "=_", "Cluster_", "._", "Cluster", "Node_", "._", "objects_", "._", "get_", "(_", "hostname_", "=_", "\"", "tls", "prob", "er", "-", "cluster", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "configuration_", "=_", "Cluster_", "._", "Cluster", "Node_", "._", "objects_", "._", "get_", "(_", "hostname_", "=_", "computer", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "configuration_", "._", "active", "\\u", "node_", "or_", "not_", "master", "\\u", "configuration_", "._", "active", "\\u", "node_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "break_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "configuration_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "processes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "subprocess_", "._", "call_", "(_", "[_", "\"", "git", "\"_", ",_", "\"", "pull", "\"_", ",_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "call_", "(_", "[_", "\"", "git", "\"_", ",_", "\"", "submodule", "\"_", ",_", "\"", "update", "\"_", ",_", "\"--", "recurs", "ive", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "call_", "(_", "[_", "\"", "python", "\"_", ",_", "\"", "build", "\\u", "cert", "handler", ".", "py", "\"_", ",_", "\"", "build", "\"_", ",_", "\"--", "build", "-", "lib", "\"_", ",_", "\".\"_", "]_", ",_", "cwd_", "=_", "os_", "._", "path_", "._", "join_", "(_", "\"", "prob", "edb", "\"_", ",_", "\"", "cert", "s", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "checke", "d\\u", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "checke", "d\\u", "count_", ">=_", "check", "\\u", "queue", "\\u", "frequency_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "ql", "en_", "=_", "Probe", "_", "._", "Probe", "Queue_", "._", "objects_", "._", "filter_", "(_", "part", "\\u", "of", "\\u", "run_", "=_", "run_", "._", "perform", "\\u", "run", "\\u", "id_", ",_", "state_", "=_", "Probe", "_", "._", "Probe", "Queue_", "._", "PROB", "EQ", "\\u", "IDLE", "_", ")_", "._", "count_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ql", "en_", "<=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "break_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ql", "en_", "<_", "50000_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "check", "\\u", "queue", "\\u", "frequency_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "ql", "en_", "<_", "1000000_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "check", "\\u", "queue", "\\u", "frequency_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "last", "\\u", "count_", "=_", "ql", "en_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "checke", "d\\u", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "checke", "d\\u", "count", "\\u", "git_", "+=_", "1_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "checke", "d\\u", "count", "\\u", "git_", ">=_", "10_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "subprocess_", "._", "call_", "(_", "[_", "\"", "git", "\"_", ",_", "\"", "pull", "\"_", ",_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "call_", "(_", "[_", "\"", "git", "\"_", ",_", "\"", "submodule", "\"_", ",_", "\"", "update", "\"_", ",_", "\"--", "recurs", "ive", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "call_", "(_", "[_", "\"", "python", "\"_", ",_", "\"", "build", "\\u", "cert", "handler", ".", "py", "\"_", ",_", "\"", "build", "\"_", ",_", "\"--", "build", "-", "lib", "\"_", ",_", "\".\"_", "]_", ",_", "cwd_", "=_", "os_", "._", "path_", "._", "join_", "(_", "\"", "prob", "edb", "\"_", ",_", "\"", "cert", "s", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "checke", "d\\u", "count", "\\u", "git_", "=_", "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_", "run", "\\u", "config_", "=_", "Optio", "n", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "run", "\\u", "config_", "._", "add", "\\u", "option_", "(_", "\"--", "process", "es", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "dest_", "=_", "\"", "process", "\\u", "count", "\"_", ",_", "default_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run", "\\u", "config_", "._", "add", "\\u", "option_", "(_", "\"--", "iterati", "ons", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "dest_", "=_", "\"", "iterati", "on", "\\u", "count", "\"_", ",_", "default_", "=_", "40_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "run", "\\u", "options_", ",_", "args_", ")_", "=_", "run", "\\u", "config_", "._", "parse", "\\u", "args_", "(_", "configuration_", "._", "prob", "e\\u", "parameters_", "._", "split_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "int_", "(_", "run", "\\u", "options_", "._", "process", "\\u", "count_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "start", "ed", "\\u", "proc_", "=_", "0_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Q_", "=_", "Cluster_", "._", "Cluster", "Action_", "._", "objects_", "._", "filter_", "(_", "cluster", "\\u", "run_", "=_", "run_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "\\u", "time_", "=_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delta_", "=_", "datetime_", "._", "timedelta_", "(_", "minutes_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Calculat", "e", " ", "process", " ", "and", " ", "iterati", "on", " ", "limit", "s", " ", "based", " ", "on", " ", "the", " ", "actual", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "number", " ", "of", " ", "items", " ", "left", " ", "for", " ", "the", " ", "job_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Earl", "y", " ", "in", " ", "the", " ", "process", " ", "the", " ", "cluster", " ", "will", " ", "work", " ", "slow", "ly", " ", "up", " ", "to", " ", "full", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "number", " ", "of", " ", "process", "es", ",", " ", "to", " ", "avoid", " ", "overload", "ing", " ", "the", " ", "database_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "towards", " ", "the", " ", "end", ",", " ", "the", " ", "number", " ", "of", " ", "process", "es", " ", "will", " ", "be", " ", "reduce", "d", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "parall", "el", " ", "to", " ", "reduc", "ing", " ", "the", " ", "number", " ", "of", " ", "iterati", "ons", " ", "per", " ", "process_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "reduce", " ", "the", " ", "risk", " ", "tha", "t", " ", "one", " ", "process", " ", "will", " ", "continue", " ", "for", " ", "a", " ", "long", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "time", " ", "whi", "le", " ", "other", "s", " ", "have", " ", "finish", "ed", " _", "\\u\\u\\uNL\\u\\u\\u_", "Q", "3_", "=_", "Q_", "._", "filter_", "(_", "complete", "d\\u", "time", "\\u\\u", "range_", "=_", "(_", "current", "\\u", "time_", "-_", "delta_", ",_", "current", "\\u", "time_", "-_", "datetime_", "._", "timedelta_", "(_", "minutes_", "=_", "5_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "count", "\\u", "5", "min_", "=_", "Q", "3_", "._", "count_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "all", "\\u", "count", "\\u", "5", "min_", ">_", "4_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "Q1", "_", "=_", "Q_", "._", "filter_", "(_", "complete", "d\\u", "time", "\\u\\u", "range_", "=_", "(_", "current", "\\u", "time_", "-_", "delta_", ",_", "current", "\\u", "time_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "count", "\\u", "10", "min_", "=_", "Q1", "_", "._", "filter_", "(_", "cluster", "\\u", "node_", "=_", "configuration_", ")_", "._", "count_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "count", "\\u", "10", "min_", "=_", "Q1", "_", "._", "count_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "node", "\\u", "count", "\\u", "10", "min_", ">_", "4_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "factor_", "=_", "all", "\\u", "count", "\\u", "10", "min_", "/_", "node", "\\u", "count", "\\u", "10", "min_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iterations_", "=_", "int_", "(_", "(_", "last", "\\u", "count_", "*_", "factor_", ")_", "/_", "int_", "(_", "run", "\\u", "options_", "._", "process", "\\u", "count_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "run", "\\u", "options_", "._", "iterati", "on", "\\u", "count_", ">_", "iterations_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t_", "run", "\\u", "options_", "._", "iterati", "on", "\\u", "count_", "=_", "max_", "(_", "15_", ",_", "iterations_", ")_", "\\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_", "proc", "\\u", "limit_", "=_", "int_", "(_", "run", "\\u", "options_", "._", "process", "\\u", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "last", "\\u", "count_", "<_", "10000_", "and_", "proc", "\\u", "limit_", ">_", "20_", "and_", "run", "\\u", "options_", "._", "iterati", "on", "\\u", "count_", ">_", "50_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "run", "\\u", "options_", "._", "iterati", "on", "\\u", "count_", "=_", "15_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "last", "\\u", "count_", "<_", "100000_", "and_", "proc", "\\u", "limit_", ">_", "50_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "proc", "\\u", "limit_", "/=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proc", "\\u", "limit_", "=_", "max_", "(_", "40_", ",_", "proc", "\\u", "limit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "last", "\\u", "count_", "<_", "run", "\\u", "options_", "._", "iterati", "on", "\\u", "count_", "*_", "proc", "\\u", "limit_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "proc", "\\u", "limit_", "=_", "max_", "(_", "min_", "(_", "40_", ",_", "proc", "\\u", "limit_", ")_", ",_", "min_", "(_", "40_", ",_", "last", "\\u", "count_", "/_", "run", "\\u", "options_", "._", "iterati", "on", "\\u", "count_", ",_", "proc", "\\u", "limit_", ")_", ")_", "\\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_", "last", "\\u", "count_", "<_", "proc", "\\u", "limit_", "*_", "run", "\\u", "options_", "._", "iterati", "on", "\\u", "count_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "proc", "\\u", "limit_", "=_", "max_", "(_", "10_", ",_", "last", "\\u", "count_", "/_", "run", "\\u", "options_", "._", "iterati", "on", "\\u", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "proc", "\\u", "limit_", ">_", "80_", "and_", "len_", "(_", "processes_", ")_", ">_", "0_", "and_", "len_", "(_", "processes_", ")_", "<_", "80_", "and_", "all", "\\u", "count", "\\u", "5", "min_", "<_", "50_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "time_", "._", "sleep_", "(_", "120_", ")_", ";_", "\\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_", "start", "\\u", "proc_", "=_", "max_", "(_", "10_", ",_", "min_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "30_", "if_", "proc", "\\u", "limit_", "*_", "0.75_", ">_", "len_", "(_", "processes_", ")_", "or_", "(_", "proc", "\\u", "limit_", ">_", "200_", "and_", "len_", "(_", "processes_", ")_", "<_", "100_", ")_", "else_", "50_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "proc", "\\u", "limit_", "/_", "10_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "proc", "\\u", "limit_", ">_", "80_", "and_", "len_", "(_", "processes_", ")_", "<_", "30_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "start", "\\u", "proc_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "len_", "(_", "processes_", ")_", "<_", "proc", "\\u", "limit_", "and_", "start", "ed", "\\u", "proc_", "<_", "start", "\\u", "proc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "process", "\\u", "index_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "process_", "=_", "subprocess_", "._", "Popen_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "[_", "\"", "nice", "\"_", "]_", "if_", "os_", "._", "name_", "==_", "\"", "posix", "\"_", "else_", "[_", "]_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\"", "python", "\"_", ",_", "\"-", "O", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "prob", "e\\u", "lists", ".", "py", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"-", "n", "\"_", ",_", "str_", "(_", "process", "\\u", "index_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"--", "run", "-", "id", "\"_", ",_", "str_", "(_", "run_", "._", "perform", "\\u", "run_", "._", "id_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"--", "source", "\"_", ",_", "'\"'_", "+_", "run_", "._", "perform", "\\u", "run_", "._", "source", "\\u", "name_", "+_", "'\"'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"--", "description", "\"_", ",_", "'\"'_", "+_", "run_", "._", "perform", "\\u", "run_", "._", "description_", "+_", "'\"'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"--", "max", "\"_", ",_", "str_", "(_", "run", "\\u", "options_", "._", "iterati", "on", "\\u", "count_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "[_", "\"--", "perform", "anc", "e", "\"_", "]_", "if_", "options_", "._", "verbose_", "or_", "options_", "._", "register", "\\u", "performance_", "else_", "[_", "]_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "[_", "\"--", "testb", "ase", "2", "\"_", "]_", "if_", "options_", "._", "use", "\\u", "testb", "ase", "2_", "else_", "[_", "]_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "[_", "\"--", "large", "\\u", "run", "\"_", "]_", "if_", "last", "\\u", "count_", ">_", "40000", "0_", "else_", "[_", "]_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "[_", "\"--", "small", "\\u", "run", "\"_", "]_", "if_", "last", "\\u", "count_", "<_", "50000_", "else_", "[_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ",_", "shell_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "start", "ed", "\\u", "proc_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "new", "\\u", "process_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "processes_", "._", "append_", "(_", "new", "\\u", "process_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t_", "print_", "\"", "start", "ed", " ", "\"_", ",_", "process", "\\u", "index_", ",_", "\"", " ", "count", " ", "\"_", ",_", "len_", "(_", "processes_", ")_", ",_", "\"/\"_", ",_", "proc", "\\u", "limit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time_", "._", "sleep_", "(_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "connection_", "._", "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\t", "\t\t\t_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "top", "ped", "\\u", "out_", "and_", "len_", "(_", "processes_", ")_", ">=_", "int_", "(_", "run", "\\u", "options_", "._", "process", "\\u", "count_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "top", "ped", "\\u", "out_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Don", "'", "t", " ", "start", " ", "too", " ", "process", "es", " ", "to", " ", "quickl", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "start", "\\u", "proc_", "<_", "10_", "and_", "not_", "top", "ped", "\\u", "out_", ")_", "or_", "(_", "proc", "\\u", "limit_", ">_", "200_", "and_", "len_", "(_", "processes_", ")_", "<_", "proc", "\\u", "limit_", "*_", "0.90", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "time_", "._", "sleep_", "(_", "300_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "last", "\\u", "count_", "<_", "100000_", "and_", "proc", "\\u", "limit_", ">_", "20_", "and_", "not_", "top", "ped", "\\u", "out_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "time_", "._", "sleep_", "(_", "240_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "processes_", ")_", ">_", "300_", "and_", "len_", "(_", "processes_", ")_", "<_", "proc", "\\u", "limit_", "*_", "0.95_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "time_", "._", "sleep_", "(_", "300_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "processes_", ")_", ">_", "200_", "and_", "len_", "(_", "processes_", ")_", "<_", "proc", "\\u", "limit_", "*_", "0.95_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "time_", "._", "sleep_", "(_", "60_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "time_", "._", "sleep_", "(_", "30_", "if_", "len_", "(_", "processes_", ")_", ">_", "proc", "\\u", "limit_", "*_", "0.95_", "else_", "15_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "Q_", "=_", "Cluster", "Action_", "._", "objects_", "._", "filter_", "(_", "cluster", "\\u", "run_", "=_", "run_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "\\u", "time_", "=_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delta_", "=_", "datetime_", "._", "timedelta_", "(_", "hours_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Q1", "_", "=_", "Q_", "._", "filter_", "(_", "complete", "d\\u", "time", "\\u\\u", "range_", "=_", "(_", "current", "\\u", "time_", "-_", "delta_", ",_", "current", "\\u", "time_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "count", "\\u", "hour_", "=_", "Q1", "_", "._", "count_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "count", "\\u", "hour_", "=_", "Q1", "_", "._", "filter_", "(_", "cluster", "\\u", "node_", "=_", "configuration_", ")_", "._", "count_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "delta_", "=_", "datetime_", "._", "timedelta_", "(_", "minutes_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Q1", "_", "=_", "Q_", "._", "filter_", "(_", "complete", "d\\u", "time", "\\u\\u", "range_", "=_", "(_", "current", "\\u", "time_", "-_", "delta_", ",_", "current", "\\u", "time_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "count", "\\u", "10", "min_", "=_", "Q1", "_", "._", "count_", "(_", ")_", "*_", "6_", "#", "recalc", " ", "to", " ", "per", " ", "hour", " _", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "count", "\\u", "10", "min_", "=_", "Q1", "_", "._", "filter_", "(_", "cluster", "\\u", "node_", "=_", "configuration_", ")_", "._", "count_", "(_", ")_", "*_", "6_", "#", "recalc", " ", "to", " ", "per", " ", "hour_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "delta_", "=_", "datetime_", "._", "timedelta_", "(_", "minutes_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Q1", "_", "=_", "Q_", "._", "filter_", "(_", "complete", "d\\u", "time", "\\u\\u", "range_", "=_", "(_", "current", "\\u", "time_", "-_", "delta_", ",_", "current", "\\u", "time_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "count", "\\u", "1", "min_", "=_", "Q1", "_", "._", "count_", "(_", ")_", "*_", "60_", "#", "recalc", " ", "to", " ", "per", " ", "hour", " _", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "count", "\\u", "1", "min_", "=_", "Q1", "_", "._", "filter_", "(_", "cluster", "\\u", "node_", "=_", "configuration_", ")_", "._", "count_", "(_", ")_", "*_", "60_", "#", "recalc", " ", "to", " ", "per", " ", "hour_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "clean", " ", "up", " ", "queue_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Probe", ".", "Probe", "Queue", ".", "object", "s", ".", "filter", "(", "part", "\\u", "of", "\\u", "run", "=", "run", ".", "perform", "\\u", "run", "\\u", "id", ",", " ", "state", "=", "Probe", ".", "Probe", "Queue", ".", "PROB", "EQ", "\\u", "FINISH", "ED", ").", "delete", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"", "Node", ":", " ", "\"_", ",_", "node", "\\u", "count", "\\u", "1", "min_", ",_", "\"", " ", "\"_", ",_", "node", "\\u", "count", "\\u", "10", "min_", ",_", "\"", " ", "\"_", ",_", "node", "\\u", "count", "\\u", "hour_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "All", ":", " ", "\"_", ",_", "all", "\\u", "count", "\\u", "1", "min_", ",_", "\"", " ", "\"_", ",_", "all", "\\u", "count", "\\u", "10", "min_", ",_", "\"", " ", "\"_", ",_", "all", "\\u", "count", "\\u", "hour_", ",_", "\"", " ", "(\"_", ",_", "Probe", "_", "._", "Probe", "Queue_", "._", "objects_", "._", "filter_", "(_", "part", "\\u", "of", "\\u", "run_", "=_", "run_", "._", "perform", "\\u", "run", "\\u", "id_", ",_", "state_", "=_", "Probe", "_", "._", "Probe", "Queue_", "._", "PROB", "EQ", "\\u", "IDLE", "_", ")_", "._", "count_", "(_", ")_", ",_", "\"", " ", "left", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "next", "\\u", "process", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "proc_", "in_", "processes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "if_", "proc_", "._", "poll_", "(_", ")_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "next", "\\u", "process", "\\u", "list_", "._", "append_", "(_", "proc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "processes_", "=_", "next", "\\u", "process", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Loop", " ", "back", " ", "and", " ", "try", " ", "the", " ", "next", " ", "one_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "processes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "connection_", "._", "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\t", "\t\t\t_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time_", "._", "sleep_", "(_", "30_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "Q_", "=_", "Cluster", "Action_", "._", "objects_", "._", "filter_", "(_", "cluster", "\\u", "run_", "=_", "run_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "\\u", "time_", "=_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delta_", "=_", "datetime_", "._", "timedelta_", "(_", "hours_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Q1", "_", "=_", "Q_", "._", "filter_", "(_", "complete", "d\\u", "time", "\\u\\u", "range_", "=_", "(_", "current", "\\u", "time_", "-_", "delta_", ",_", "current", "\\u", "time_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "count", "\\u", "hour_", "=_", "Q1", "_", "._", "count_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "count", "\\u", "hour_", "=_", "Q1", "_", "._", "filter_", "(_", "cluster", "\\u", "node_", "=_", "configuration_", ")_", "._", "count_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "delta_", "=_", "datetime_", "._", "timedelta_", "(_", "minutes_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Q1", "_", "=_", "Q_", "._", "filter_", "(_", "complete", "d\\u", "time", "\\u\\u", "range_", "=_", "(_", "current", "\\u", "time_", "-_", "delta_", ",_", "current", "\\u", "time_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "count", "\\u", "10", "min_", "=_", "Q1", "_", "._", "count_", "(_", ")_", "*_", "6_", "#", "recalc", " ", "to", " ", "per", " ", "hour", " _", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "count", "\\u", "10", "min_", "=_", "Q1", "_", "._", "filter_", "(_", "cluster", "\\u", "node_", "=_", "configuration_", ")_", "._", "count_", "(_", ")_", "*_", "6_", "#", "recalc", " ", "to", " ", "per", " ", "hour_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "delta_", "=_", "datetime_", "._", "timedelta_", "(_", "minutes_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Q1", "_", "=_", "Q_", "._", "filter_", "(_", "complete", "d\\u", "time", "\\u\\u", "range_", "=_", "(_", "current", "\\u", "time_", "-_", "delta_", ",_", "current", "\\u", "time_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "count", "\\u", "1", "min_", "=_", "Q1", "_", "._", "count_", "(_", ")_", "*_", "60_", "#", "recalc", " ", "to", " ", "per", " ", "hour", " _", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "count", "\\u", "1", "min_", "=_", "Q1", "_", "._", "filter_", "(_", "cluster", "\\u", "node_", "=_", "configuration_", ")_", "._", "count_", "(_", ")_", "*_", "60_", "#", "recalc", " ", "to", " ", "per", " ", "hour_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "clean", " ", "up", " ", "queue_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Probe", ".", "Probe", "Queue", ".", "object", "s", ".", "filter", "(", "part", "\\u", "of", "\\u", "run", "=", "run", ".", "perform", "\\u", "run", "\\u", "id", ",", " ", "state", "=", "Probe", ".", "Probe", "Queue", ".", "PROB", "EQ", "\\u", "FINISH", "ED", ").", "delete", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"", "Node", ":", " ", "\"_", ",_", "node", "\\u", "count", "\\u", "1", "min_", ",_", "\"", " ", "\"_", ",_", "node", "\\u", "count", "\\u", "10", "min_", ",_", "\"", " ", "\"_", ",_", "node", "\\u", "count", "\\u", "hour_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "All", ":", " ", "\"_", ",_", "all", "\\u", "count", "\\u", "1", "min_", ",_", "\"", " ", "\"_", ",_", "all", "\\u", "count", "\\u", "10", "min_", ",_", "\"", " ", "\"_", ",_", "all", "\\u", "count", "\\u", "hour_", ",_", "\"", " ", "(\"_", ",_", "Probe", "_", "._", "Probe", "Queue_", "._", "objects_", "._", "filter_", "(_", "part", "\\u", "of", "\\u", "run_", "=_", "run_", "._", "perform", "\\u", "run", "\\u", "id_", ",_", "state_", "=_", "Probe", "_", "._", "Probe", "Queue_", "._", "PROB", "EQ", "\\u", "IDLE", "_", ")_", "._", "count_", "(_", ")_", ",_", "\"", " ", "left", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "next", "\\u", "process", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "proc_", "in_", "processes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "if_", "proc_", "._", "poll_", "(_", ")_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "next", "\\u", "process", "\\u", "list_", "._", "append_", "(_", "proc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "processes_", "=_", "next", "\\u", "process", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "print_", "\"", "clos", "ing", " ", "down", ":", " ", "count", " ", "\"_", ",_", "len_", "(_", "processes_", ")_", ",_", "\"/\"_", ",_", "run", "\\u", "options_", "._", "process", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Loop", " ", "back", " ", "and", " ", "see", " ", "if", " ", "all", " ", "has", " ", "ende", "d", " ", "now_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "print_", "\"", "close", "d", " ", "down", ":\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "break_", ";_", "#", " ", "need", " ", "to", " ", "trigger", " ", "a", " ", "new", " ", "databa", "se", " ", "retrie", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "terminate_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "break_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "master", "\\u", "configuration_", "=_", "Cluster_", "._", "Cluster", "Node_", "._", "objects_", "._", "get_", "(_", "hostname_", "=_", "\"", "tls", "prob", "er", "-", "cluster", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "configuration_", "=_", "Cluster_", "._", "Cluster", "Node_", "._", "objects_", "._", "get_", "(_", "hostname_", "=_", "computer", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "configuration_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run", "\\u", "config_", "=_", "Optio", "n", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "run", "\\u", "config_", "._", "add", "\\u", "option_", "(_", "\"--", "process", "es", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "process", "\\u", "count", "\"_", ",_", "default_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run", "\\u", "config_", "._", "add", "\\u", "option_", "(_", "\"--", "iterati", "ons", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "iterati", "on", "\\u", "count", "\"_", ",_", "default_", "=_", "40_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "run", "\\u", "options_", ",_", "args_", ")_", "=_", "run", "\\u", "config_", "._", "parse", "\\u", "args_", "(_", "configuration_", "._", "prob", "e\\u", "parameters_", "._", "split_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "not_", "master", "\\u", "configuration_", "._", "active", "\\u", "node_", "or_", "not_", "configuration_", "._", "active", "\\u", "node_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "int_", "(_", "run", "\\u", "options_", "._", "process", "\\u", "count_", ")_", "==_", "0_", "or_", "Cluster_", "._", "Cluster", "Run_", "._", "objects_", "._", "filter_", "(_", "enabled_", "=_", "True_", ")_", "._", "count_", "(_", ")_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "options_", "._", "managed_", "and_", "Cluster_", "._", "Cluster", "Run_", "._", "objects_", "._", "filter_", "(_", "enabled_", "=_", "True_", ")_", "._", "count_", "(_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "break_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "connection_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "60_", ")_", "#", " ", "if", " ", "there", " ", "are", " ", "no", " ", "runs", ",", " ", "sleep", " ", "for", " ", "10", " ", "minutes_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\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,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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 ]
Unused import
rizar/attention-lvcsr/libs/Theano/benchmark/convolution/opencv.py
[ { "content": "from __future__ import print_function\nimport sys, timeit\nimport numpy\nimport scikits.image.opencv\n\ntry:\n img_shape = int(sys.argv[1]), int(sys.argv[2])\n ker_shape = int(sys.argv[3]), int(sys.argv[4])\n dtype = sys.argv[5]\nexcept:\n print(\"Usage: %s <img rows> <img cols> <ker rows> <ker cols> <dtype> [nb_call]\" % sys.argv[0], file=sys.stderr)\n sys.exit(-1)\n\nnb_call = 1\nif len(sys.argv)>6:\n nb_call=int(sys.argv[6])\n\nT = timeit.Timer(\"f()\",\"\"\"\nimport scikits.image.opencv, sys, numpy\nimg_shape = int(sys.argv[1]), int(sys.argv[2])\nker_shape = int(sys.argv[3]), int(sys.argv[4])\ndtype = sys.argv[5]\n\nimg = numpy.ones(img_shape, dtype=dtype)\nker = numpy.ones(ker_shape, dtype=dtype)\n\ndef f():\n scikits.image.opencv.cvFilter2D(img, ker)\n\"\"\")\ntime = T.repeat(repeat=3, number=nb_call)\nprint(min(time), \"opencv\")\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import numpy", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 12 }, { "span": "import scikits.image.opencv", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 27 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "print", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", ",_", "timeit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "scikit", "s_", "._", "image_", "._", "opencv", "_", "\\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 ", " _", "img", "\\u", "shape_", "=_", "int_", "(_", "sys_", "._", "argv_", "[_", "1_", "]_", ")_", ",_", "int_", "(_", "sys_", "._", "argv_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ker", "\\u", "shape_", "=_", "int_", "(_", "sys_", "._", "argv_", "[_", "3_", "]_", ")_", ",_", "int_", "(_", "sys_", "._", "argv_", "[_", "4_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dtype_", "=_", "sys_", "._", "argv_", "[_", "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 ", " _", "print_", "(_", "\"", "Us", "age", ":", " ", "%", "s", " ", "<", "img", " ", "rows", ">", " ", "<", "img", " ", "cols", ">", " ", "<", "ker", " ", "rows", ">", " ", "<", "ker", " ", "cols", ">", " ", "<", "dt", "ype", ">", " ", "[", "nb", "\\u", "call", "]\"_", "%_", "sys_", "._", "argv_", "[_", "0_", "]_", ",_", "file_", "=_", "sys_", "._", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "nb", "\\u", "call_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "sys_", "._", "argv_", ")_", ">_", "6_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nb", "\\u", "call_", "=_", "int_", "(_", "sys_", "._", "argv_", "[_", "6_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "T_", "=_", "timeit_", "._", "Timer_", "(_", "\"", "f", "()\"_", ",_", "\"\"\"", "\\", "10", ";", "import", " ", "scikit", "s", ".", "image", ".", "opencv", ",", " ", "sys", ",", " ", "nump", "y", "\\", "10", ";", "img", "\\u", "shape", " ", "=", " ", " ", "int", "(", "sys", ".", "argv", "[", "1", "])", ",", " ", "int", "(", "sys", ".", "argv", "[", "2", "])", "\\", "10", ";", "ker", "\\u", "shape", " ", "=", " ", " ", "int", "(", "sys", ".", "argv", "[", "3", "])", ",", " ", "int", "(", "sys", ".", "argv", "[", "4", "])", "\\", "10", ";", "dt", "ype", " ", "=", " ", "sys", ".", "argv", "[", "5", "]", "\\", "10", ";", "\\", "10", ";", "img", " ", "=", " ", "nump", "y", ".", "ones", "(", "img", "\\u", "shape", ",", " ", "dt", "ype", "=", "dt", "ype", ")", "\\", "10", ";", "ker", " ", "=", " ", "nump", "y", ".", "ones", "(", "ker", "\\u", "shape", ",", " ", "dt", "ype", "=", "dt", "ype", ")", "\\", "10", ";", "\\", "10", ";", "def", " ", "f", "():", "\\", "10", ";", " ", " ", " ", " ", "scikit", "s", ".", "image", ".", "opencv", ".", "cv", "Filter", "2", "D", "(", "img", ",", " ", "ker", ")", "\\", "10", ";\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "=_", "T_", "._", "repeat_", "(_", "repeat_", "=_", "3_", ",_", "number_", "=_", "nb", "\\u", "call_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "min_", "(_", "time_", ")_", ",_", "\"", "opencv", "\"_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 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 ]
First argument to super() is not enclosing class
ckcollab/polished/polished/backends/simple.py
[ { "content": " def prepare(self):\n '''\n After changing git revisions, prepare the repository, make sure you call super!\n '''\n super(BaseBackend, self).prepare()", "metadata": "root.SimpleBackend.prepare", "header": "['class', 'SimpleBackend', '(', 'BaseBackend', ')', ':', '___EOS___']", "index": 16 }, { "content": " def prepare_page(self, *args, **kwargs):\n '''\n This is called after the page has been loaded, good time to do extra polishing\n '''\n super(BaseBackend, self).prepare_page(*args, **kwargs)", "metadata": "root.SimpleBackend.prepare_page", "header": "['class', 'SimpleBackend', '(', 'BaseBackend', ')', ':', '___EOS___']", "index": 22 }, { "content": " def cleanup(self):\n '''\n Cleanup after prepare() before the next retrieve, make sure you call super!\n '''\n super(BaseBackend, self).cleanup()", "metadata": "root.SimpleBackend.cleanup", "header": "['class', 'SimpleBackend', '(', 'BaseBackend', ')', ':', '___EOS___']", "index": 28 } ]
[ { "span": "super(BaseBackend, self).", "start_line": 20, "start_column": 8, "end_line": 20, "end_column": 32 }, { "span": "super(BaseBackend, self).", "start_line": 26, "start_column": 8, "end_line": 26, "end_column": 32 }, { "span": "super(BaseBackend, self).", "start_line": 32, "start_column": 8, "end_line": 32, "end_column": 32 } ]
[]
1
true
[ "[CLS]_", "First_", "argument_", "to_", "super_", "(_", ")_", "is_", "not_", "encl", "osin", "g_", "class_", "[SEP]_", "class_", "Simple", "Backend_", "(_", "Base", "Backend_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "prepare_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Af", "ter", " ", "chang", "ing", " ", "git", " ", "revis", "ion", "s", ",", " ", "prepar", "e", " ", "the", " ", "repos", "itor", "y", ",", " ", "make", " ", "sure", " ", "you", " ", "call", " ", "super", "!", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Base", "Backend_", ",_", "self_", ")_", "._", "prepare_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Backend_", "(_", "Base", "Backend_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "prepar", "e\\u", "page_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "call", "ed", " ", "after", " ", "the", " ", "page", " ", "has", " ", "bee", "n", " ", "load", "ed", ",", " ", "good", " ", "time", " ", "to", " ", "do", " ", "extra", " ", "polis", "hing", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Base", "Backend_", ",_", "self_", ")_", "._", "prepar", "e\\u", "page_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Backend_", "(_", "Base", "Backend_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cleanup_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Clean", "up", " ", "after", " ", "prepar", "e", "()", " ", "bef", "ore", " ", "the", " ", "next", " ", "retrieve", ",", " ", "make", " ", "sure", " ", "you", " ", "call", " ", "super", "!", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Base", "Backend_", ",_", "self_", ")_", "._", "cleanup_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2 ]
Unused import
open-cloud/xos/xos/synchronizers/base/steps/sync_controller_slice_privileges.py
[ { "content": "import os\nimport base64\nfrom collections import defaultdict\nfrom django.db.models import F, Q\nfrom xos.config import Config\nfrom synchronizers.base.openstacksyncstep import OpenStackSyncStep\nfrom synchronizers.base.syncstep import *\nfrom core.models.slice import Controller, SlicePrivilege \nfrom core.models.user import User\nfrom core.models.controlleruser import ControllerUser, ControllerSlicePrivilege\nfrom synchronizers.base.ansible import *\nfrom xos.logger import observer_logger as logger\nimport json\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class SyncControllerSlicePrivileges(OpenStackSyncStep):\n provides=[SlicePrivilege]\n requested_interval=0\n observes=ControllerSlicePrivilege\n playbook = 'sync_controller_users.yaml'\n\n\t\n", "metadata": "root.SyncControllerSlicePrivileges", "header": "['module', '___EOS___']", "index": 14 }, { "content": " def map_inputs(self, controller_slice_privilege):\n if not controller_slice_privilege.controller.admin_user:\n logger.info(\"controller %r has no admin_user, skipping\" % controller_slice_privilege.controller)\n return\n\n\ttemplate = os_template_env.get_template('sync_controller_users.yaml')\n roles = [controller_slice_privilege.slice_privilege.role.role]\n\t# setup user home slice roles at controller \n if not controller_slice_privilege.slice_privilege.user.site:\n raise Exception('Sliceless user %s'%controller_slice_privilege.slice_privilege.user.email)\n else:\n # look up tenant id for the user's slice at the controller\n #ctrl_slice_deployments = SliceDeployment.objects.filter(\n # slice_deployment__slice=controller_slice_privilege.user.slice,\n # controller=controller_slice_privilege.controller)\n\n #if ctrl_slice_deployments:\n # # need the correct tenant id for slice at the controller\n # tenant_id = ctrl_slice_deployments[0].tenant_id \n # tenant_name = ctrl_slice_deployments[0].slice_deployment.slice.login_base\n user_fields = {\n 'endpoint':controller_slice_privilege.controller.auth_url,\n 'endpoint_v3': controller_slice_privilege.controller.auth_url_v3,\n 'domain': controller_slice_privilege.controller.domain,\n\t\t 'name': controller_slice_privilege.slice_privilege.user.email,\n 'email': controller_slice_privilege.slice_privilege.user.email,\n 'password': controller_slice_privilege.slice_privilege.user.remote_password,\n 'admin_user': controller_slice_privilege.controller.admin_user,\n\t\t 'admin_password': controller_slice_privilege.controller.admin_password,\n 'ansible_tag':'%s@%s@%s'%(controller_slice_privilege.slice_privilege.user.email.replace('@','-at-'),controller_slice_privilege.slice_privilege.slice.name,controller_slice_privilege.controller.name),\n\t\t 'admin_tenant': controller_slice_privilege.controller.admin_tenant,\n\t\t 'roles':roles,\n\t\t 'tenant':controller_slice_privilege.slice_privilege.slice.name} \n return user_fields", "metadata": "root.SyncControllerSlicePrivileges.map_inputs", "header": "['class', 'SyncControllerSlicePrivileges', '(', 'OpenStackSyncStep', ')', ':', '___EOS___']", "index": 20 }, { "content": " def map_sync_outputs(self, controller_slice_privilege, res):\n controller_slice_privilege.role_id = res[0]['id']\n controller_slice_privilege.save()", "metadata": "root.SyncControllerSlicePrivileges.map_sync_outputs", "header": "['class', 'SyncControllerSlicePrivileges', '(', 'OpenStackSyncStep', ')', ':', '___EOS___']", "index": 55 }, { "content": " def delete_record(self, controller_slice_privilege):\n\tcontroller_register = json.loads(controller_slice_privilege.controller.backend_register)\n if (controller_register.get('disabled',False)):\n raise InnocuousException('Controller %s is disabled'%controller_slice_privilege.controller.name)\n\n if controller_slice_privilege.role_id:\n driver = self.driver.admin_driver(controller=controller_slice_privilege.controller)\n user = ControllerUser.objects.get(\n controller=controller_slice_privilege.controller, \n user=controller_slice_privilege.slice_privilege.user\n )\n slice = ControllerSlice.objects.get(\n controller=controller_slice_privilege.controller, \n user=controller_slice_privilege.slice_privilege.user\n )\n driver.delete_user_role(\n user.kuser_id, \n slice.tenant_id, \n controller_slice_privilege.slice_prvilege.role.role\n )", "metadata": "root.SyncControllerSlicePrivileges.delete_record", "header": "['class', 'SyncControllerSlicePrivileges', '(', 'OpenStackSyncStep', ')', ':', '___EOS___']", "index": 59 } ]
[ { "span": "import os", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 9 }, { "span": "import base64", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 13 }, { "span": "from collections import defaultdict", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 35 }, { "span": "from django.db.models import F, Q", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 33 }, { "span": "from xos.config import Config", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 29 }, { "span": "from core.models.slice import Controller, SlicePrivilege ", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 56 }, { "span": "from core.models.user import User", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 33 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "base64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "collections_", "import_", "defaultdict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "import_", "F_", ",_", "Q_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "xo", "s_", "._", "config_", "import_", "Config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "synchronize", "rs_", "._", "base_", "._", "openst", "ack", "sync", "step_", "import_", "Open", "Stack", "Sync", "Step_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "synchronize", "rs_", "._", "base_", "._", "sync", "step_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "models_", "._", "slice_", "import_", "Controller_", ",_", "Slice", "Privilege", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "models_", "._", "user_", "import_", "User_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "models_", "._", "controlle", "rus", "er_", "import_", "Controlle", "r", "User_", ",_", "Controlle", "r", "Slice", "Privilege", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "synchronize", "rs_", "._", "base_", "._", "ansible_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "xo", "s_", "._", "logger_", "import_", "observer", "\\u", "logger_", "as_", "logger_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Sync", "Controlle", "r", "Slice", "Privilege", "s_", "(_", "Open", "Stack", "Sync", "Step_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "provides_", "=_", "[_", "Slice", "Privilege", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request", "ed", "\\u", "interval_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "observe", "s_", "=_", "Controlle", "r", "Slice", "Privilege", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "playbook", "_", "=_", "'", "sync", "\\u", "controlle", "r", "\\u", "users", ".", "yaml", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Sync", "Controlle", "r", "Slice", "Privilege", "s_", "(_", "Open", "Stack", "Sync", "Step_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "map", "\\u", "inputs_", "(_", "self_", ",_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "controller_", "._", "admin", "\\u", "user_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "\"", "controlle", "r", " ", "%", "r", " ", "has", " ", "no", " ", "admin", "\\u", "user", ",", " ", "skip", "ping", "\"_", "%_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "controller_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "template_", "=_", "os", "\\u", "template", "\\u", "env_", "._", "get", "\\u", "template_", "(_", "'", "sync", "\\u", "controlle", "r", "\\u", "users", ".", "yaml", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "roles_", "=_", "[_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "slice", "\\u", "privilege", "_", "._", "role_", "._", "role_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "setup", " ", "user", " ", "home", " ", "slice", " ", "role", "s", " ", "at", " ", "controlle", "r", " _", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "slice", "\\u", "privilege", "_", "._", "user_", "._", "site_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "Slice", "less", " ", "user", " ", "%", "s", "'_", "%_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "slice", "\\u", "privilege", "_", "._", "user_", "._", "email_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "look", " ", "up", " ", "tenan", "t", " ", "id", " ", "for", " ", "the", " ", "user", "'", "s", " ", "slice", " ", "at", " ", "the", " ", "controller_", "\\u\\u\\uNL\\u\\u\\u_", "#", "ctrl", "\\u", "slice", "\\u", "deployments", " ", "=", " ", "Slice", "Deployment", ".", "object", "s", ".", "filter", "(_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "slice", "\\u", "deploy", "ment", "\\u\\u", "slice", "=", "controlle", "r", "\\u", "slice", "\\u", "privilege", ".", "user", ".", "slice", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "controlle", "r", "=", "controlle", "r", "\\u", "slice", "\\u", "privilege", ".", "controlle", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "ctrl", "\\u", "slice", "\\u", "deployments", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "need", " ", "the", " ", "correct", " ", "tenan", "t", " ", "id", " ", "for", " ", "slice", " ", "at", " ", "the", " ", "controller_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "tenan", "t", "\\u", "id", " ", "=", " ", "ctrl", "\\u", "slice", "\\u", "deployments", "[", "0", "].", "tenan", "t", "\\u", "id", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "tenan", "t", "\\u", "name", " ", "=", " ", "ctrl", "\\u", "slice", "\\u", "deployments", "[", "0", "].", "slice", "\\u", "deploy", "ment", ".", "slice", ".", "login", "\\u", "base_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "fields_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "endpoint", "'_", ":_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "controller_", "._", "auth", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "endpoint", "\\u", "v", "3", "'_", ":_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "controller_", "._", "auth", "\\u", "url", "\\u", "v3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "domain", "'_", ":_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "controller_", "._", "domain_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "slice", "\\u", "privilege", "_", "._", "user_", "._", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "slice", "\\u", "privilege", "_", "._", "user_", "._", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "slice", "\\u", "privilege", "_", "._", "user_", "._", "remote", "\\u", "password_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "admin", "\\u", "user", "'_", ":_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "controller_", "._", "admin", "\\u", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "admin", "\\u", "password", "'_", ":_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "controller_", "._", "admin", "\\u", "password_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ansi", "ble", "\\u", "tag", "'_", ":_", "'%", "s", "@", "%", "s", "@", "%", "s", "'_", "%_", "(_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "slice", "\\u", "privilege", "_", "._", "user_", "._", "email_", "._", "replace_", "(_", "'@'_", ",_", "'-", "at", "-'_", ")_", ",_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "slice", "\\u", "privilege", "_", "._", "slice_", "._", "name_", ",_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "controller_", "._", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "admin", "\\u", "tenan", "t", "'_", ":_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "controller_", "._", "admin", "\\u", "tenant_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "role", "s", "'_", ":_", "roles_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tenan", "t", "'_", ":_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "slice", "\\u", "privilege", "_", "._", "slice_", "._", "name_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "user", "\\u", "fields_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sync", "Controlle", "r", "Slice", "Privilege", "s_", "(_", "Open", "Stack", "Sync", "Step_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "map", "\\u", "sync", "\\u", "outputs_", "(_", "self_", ",_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", ",_", "res_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "role", "\\u", "id_", "=_", "res_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sync", "Controlle", "r", "Slice", "Privilege", "s_", "(_", "Open", "Stack", "Sync", "Step_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "record_", "(_", "self_", ",_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "controlle", "r", "\\u", "register_", "=_", "json_", "._", "loads_", "(_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "controller_", "._", "back", "end", "\\u", "register_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "controlle", "r", "\\u", "register_", "._", "get_", "(_", "'", "disable", "d", "'_", ",_", "False_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Inno", "cuo", "us", "Exception_", "(_", "'", "Controlle", "r", " ", "%", "s", " ", "is", " ", "disable", "d", "'_", "%_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "controller_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "role", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "driver_", "=_", "self_", "._", "driver_", "._", "admin", "\\u", "driver_", "(_", "controller_", "=_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "controller_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "Controlle", "r", "User_", "._", "objects_", "._", "get_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "controller_", "=_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "controller_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user_", "=_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "slice", "\\u", "privilege", "_", "._", "user_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "slice_", "=_", "Controlle", "r", "Slice_", "._", "objects_", "._", "get_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "controller_", "=_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "controller_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user_", "=_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "slice", "\\u", "privilege", "_", "._", "user_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "driver_", "._", "delete", "\\u", "user", "\\u", "role_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "user_", "._", "kus", "er", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "slice_", "._", "tenan", "t", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "controlle", "r", "\\u", "slice", "\\u", "privilege", "_", "._", "slice", "\\u", "prv", "ile", "ge_", "._", "role_", "._", "role_", "\\u\\u\\uNL\\u\\u\\u_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 0, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Imprecise assert
dchaplinsky/visual-logging/vlogging/tests/basic.py
[ { "content": " def test_nothing(self):\n s = str(vlogging.VisualRecord())\n self.assertTrue(\"<hr/>\" in s)", "metadata": "root.BasicTestCase.test_nothing", "header": "['class', 'BasicTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 11 }, { "content": " def test_text_only(self):\n s = str(vlogging.VisualRecord(title=\"title\", footnotes=\"footnotes\"))\n self.assertTrue(\"title\" in s)\n self.assertTrue(\"footnotes\" in s)\n self.assertTrue(\"<pre>\" in s)", "metadata": "root.BasicTestCase.test_text_only", "header": "['class', 'BasicTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 15 }, { "content": " def test_invalid_images(self):\n s = str(vlogging.VisualRecord(\n title=\"title\",\n imgs=\"foobar\",\n footnotes=\"footnotes\"))\n\n self.assertTrue(\"title\" in s)\n self.assertTrue(\"footnotes\" in s)\n self.assertTrue(\"<pre>\" in s)\n self.assertEqual(s.count(\"<img\"), 0)\n\n s = str(vlogging.VisualRecord(\n title=\"title\",\n imgs=[\"foobar\", 1, 2, dict()],\n footnotes=\"footnotes\"))\n\n self.assertTrue(\"title\" in s)\n self.assertTrue(\"footnotes\" in s)\n self.assertTrue(\"<pre>\" in s)\n self.assertEqual(s.count(\"<img\"), 0)", "metadata": "root.BasicTestCase.test_invalid_images", "header": "['class', 'BasicTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 24 }, { "content": " def test_pil(self):\n from PIL import Image\n\n pil_image = Image.open('vlogging/tests/lenna.jpg')\n s = str(vlogging.VisualRecord(\n title=\"title\",\n imgs=pil_image,\n footnotes=\"footnotes\"))\n\n self.assertTrue(\"title\" in s)\n self.assertTrue(\"footnotes\" in s)\n self.assertTrue(\"<pre>\" in s)\n self.assertTrue(\"image/png\" in s)\n self.assertEqual(s.count(\"<img\"), 1)\n\n s = str(vlogging.VisualRecord(\n title=\"title\",\n imgs=[pil_image],\n footnotes=\"footnotes\"))\n\n self.assertEqual(s.count(\"<img\"), 1)\n\n s = str(vlogging.VisualRecord(\n title=\"title\",\n imgs=[pil_image, pil_image],\n footnotes=\"footnotes\",\n fmt=\"jpeg\"))\n\n self.assertTrue(\"image/jpeg\" in s)\n self.assertEqual(s.count(\"<img\"), 2)", "metadata": "root.BasicTestCase.test_pil", "header": "['class', 'BasicTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 45 }, { "content": " def test_opencv(self):\n import cv2\n\n cv_image = cv2.imread('vlogging/tests/lenna.jpg')\n s = str(vlogging.VisualRecord(\n title=\"title\",\n imgs=cv_image,\n footnotes=\"footnotes\"))\n\n self.assertTrue(\"title\" in s)\n self.assertTrue(\"footnotes\" in s)\n self.assertTrue(\"<pre>\" in s)\n self.assertEqual(s.count(\"<img\"), 1)\n\n s = str(vlogging.VisualRecord(\n title=\"title\",\n imgs=[cv_image],\n footnotes=\"footnotes\"))\n\n self.assertEqual(s.count(\"<img\"), 1)\n\n s = str(vlogging.VisualRecord(\n title=\"title\",\n imgs=[cv_image, cv_image],\n footnotes=\"footnotes\"))\n\n self.assertEqual(s.count(\"<img\"), 2)", "metadata": "root.BasicTestCase.test_opencv", "header": "['class', 'BasicTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 76 }, { "content": " def test_pylab_basic(self):\n import matplotlib.pyplot as plt\n import numpy as np\n\n t = np.arange(0., 5., 0.2)\n\n plt.plot(t, t, 'r--', t, t ** 2, 'bs', t, t ** 3, 'g^')\n\n s = str(vlogging.VisualRecord(\n title=\"title\",\n imgs=plt,\n footnotes=\"footnotes\"))\n\n self.assertTrue(\"title\" in s)\n self.assertTrue(\"footnotes\" in s)\n self.assertTrue(\"<pre>\" in s)\n self.assertEqual(s.count(\"<img\"), 1)", "metadata": "root.BasicTestCase.test_pylab_basic", "header": "['class', 'BasicTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 104 }, { "content": " def test_pylab_figure(self):\n import matplotlib.pyplot as plt\n import numpy as np\n\n t = np.arange(0., 5., 0.2)\n\n fig = plt.figure()\n plt.plot(t, t, 'r--', t, t ** 2, 'bs', t, t ** 3, 'g^')\n\n s = str(vlogging.VisualRecord(\n title=\"title\",\n imgs=fig,\n footnotes=\"footnotes\"))\n\n self.assertTrue(\"title\" in s)\n self.assertTrue(\"footnotes\" in s)\n self.assertTrue(\"<pre>\" in s)\n self.assertEqual(s.count(\"<img\"), 1)", "metadata": "root.BasicTestCase.test_pylab_figure", "header": "['class', 'BasicTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 122 } ]
[ { "span": "self.assertTrue(\"<hr/>\" in s)", "start_line": 13, "start_column": 8, "end_line": 13, "end_column": 37 }, { "span": "self.assertTrue(\"title\" in s)", "start_line": 17, "start_column": 8, "end_line": 17, "end_column": 37 }, { "span": "self.assertTrue(\"footnotes\" in s)", "start_line": 18, "start_column": 8, "end_line": 18, "end_column": 41 }, { "span": "self.assertTrue(\"<pre>\" in s)", "start_line": 19, "start_column": 8, "end_line": 19, "end_column": 37 }, { "span": "self.assertTrue(\"title\" in s)", "start_line": 30, "start_column": 8, "end_line": 30, "end_column": 37 }, { "span": "self.assertTrue(\"footnotes\" in s)", "start_line": 31, "start_column": 8, "end_line": 31, "end_column": 41 }, { "span": "self.assertTrue(\"<pre>\" in s)", "start_line": 32, "start_column": 8, "end_line": 32, "end_column": 37 }, { "span": "self.assertTrue(\"title\" in s)", "start_line": 40, "start_column": 8, "end_line": 40, "end_column": 37 }, { "span": "self.assertTrue(\"footnotes\" in s)", "start_line": 41, "start_column": 8, "end_line": 41, "end_column": 41 }, { "span": "self.assertTrue(\"<pre>\" in s)", "start_line": 42, "start_column": 8, "end_line": 42, "end_column": 37 }, { "span": "self.assertTrue(\"title\" in s)", "start_line": 54, "start_column": 8, "end_line": 54, "end_column": 37 }, { "span": "self.assertTrue(\"footnotes\" in s)", "start_line": 55, "start_column": 8, "end_line": 55, "end_column": 41 }, { "span": "self.assertTrue(\"<pre>\" in s)", "start_line": 56, "start_column": 8, "end_line": 56, "end_column": 37 }, { "span": "self.assertTrue(\"image/png\" in s)", "start_line": 57, "start_column": 8, "end_line": 57, "end_column": 41 }, { "span": "self.assertTrue(\"image/jpeg\" in s)", "start_line": 73, "start_column": 8, "end_line": 73, "end_column": 42 }, { "span": "self.assertTrue(\"title\" in s)", "start_line": 85, "start_column": 8, "end_line": 85, "end_column": 37 }, { "span": "self.assertTrue(\"footnotes\" in s)", "start_line": 86, "start_column": 8, "end_line": 86, "end_column": 41 }, { "span": "self.assertTrue(\"<pre>\" in s)", "start_line": 87, "start_column": 8, "end_line": 87, "end_column": 37 }, { "span": "self.assertTrue(\"title\" in s)", "start_line": 117, "start_column": 8, "end_line": 117, "end_column": 37 }, { "span": "self.assertTrue(\"footnotes\" in s)", "start_line": 118, "start_column": 8, "end_line": 118, "end_column": 41 }, { "span": "self.assertTrue(\"<pre>\" in s)", "start_line": 119, "start_column": 8, "end_line": 119, "end_column": 37 }, { "span": "self.assertTrue(\"title\" in s)", "start_line": 136, "start_column": 8, "end_line": 136, "end_column": 37 }, { "span": "self.assertTrue(\"footnotes\" in s)", "start_line": 137, "start_column": 8, "end_line": 137, "end_column": 41 }, { "span": "self.assertTrue(\"<pre>\" in s)", "start_line": 138, "start_column": 8, "end_line": 138, "end_column": 37 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Basic", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "nothing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "str_", "(_", "vlo", "ggi", "ng_", "._", "Vis", "ual", "Record_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"<", "hr", "/>\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "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", "text", "\\u", "only_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "str_", "(_", "vlo", "ggi", "ng_", "._", "Vis", "ual", "Record_", "(_", "title_", "=_", "\"", "title", "\"_", ",_", "footnote", "s_", "=_", "\"", "footnote", "s", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "title", "\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "footnote", "s", "\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"<", "pre", ">\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "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", "invalid", "\\u", "images_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "str_", "(_", "vlo", "ggi", "ng_", "._", "Vis", "ual", "Record_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "title_", "=_", "\"", "title", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "imgs_", "=_", "\"", "fooba", "r", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "footnote", "s_", "=_", "\"", "footnote", "s", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "title", "\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "footnote", "s", "\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"<", "pre", ">\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "._", "count_", "(_", "\"<", "img", "\"_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "str_", "(_", "vlo", "ggi", "ng_", "._", "Vis", "ual", "Record_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "title_", "=_", "\"", "title", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "imgs_", "=_", "[_", "\"", "fooba", "r", "\"_", ",_", "1_", ",_", "2_", ",_", "dict_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "footnote", "s_", "=_", "\"", "footnote", "s", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "title", "\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "footnote", "s", "\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"<", "pre", ">\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "._", "count_", "(_", "\"<", "img", "\"_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "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", "pil", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "PIL_", "import_", "Image_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pil", "\\u", "image_", "=_", "Image_", "._", "open_", "(_", "'", "vlo", "ggi", "ng", "/", "tests", "/", "len", "na", ".", "jp", "g", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "str_", "(_", "vlo", "ggi", "ng_", "._", "Vis", "ual", "Record_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "title_", "=_", "\"", "title", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "imgs_", "=_", "pil", "\\u", "image_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "footnote", "s_", "=_", "\"", "footnote", "s", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "title", "\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "footnote", "s", "\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"<", "pre", ">\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "image", "/", "png", "\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "._", "count_", "(_", "\"<", "img", "\"_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "str_", "(_", "vlo", "ggi", "ng_", "._", "Vis", "ual", "Record_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "title_", "=_", "\"", "title", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "imgs_", "=_", "[_", "pil", "\\u", "image_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "footnote", "s_", "=_", "\"", "footnote", "s", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "._", "count_", "(_", "\"<", "img", "\"_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "str_", "(_", "vlo", "ggi", "ng_", "._", "Vis", "ual", "Record_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "title_", "=_", "\"", "title", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "imgs_", "=_", "[_", "pil", "\\u", "image_", ",_", "pil", "\\u", "image_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "footnote", "s_", "=_", "\"", "footnote", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fmt_", "=_", "\"", "jpeg", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "image", "/", "jpeg", "\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "._", "count_", "(_", "\"<", "img", "\"_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "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", "opencv", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "cv2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cv", "\\u", "image_", "=_", "cv2_", "._", "imread_", "(_", "'", "vlo", "ggi", "ng", "/", "tests", "/", "len", "na", ".", "jp", "g", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "str_", "(_", "vlo", "ggi", "ng_", "._", "Vis", "ual", "Record_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "title_", "=_", "\"", "title", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "imgs_", "=_", "cv", "\\u", "image_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "footnote", "s_", "=_", "\"", "footnote", "s", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "title", "\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "footnote", "s", "\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"<", "pre", ">\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "._", "count_", "(_", "\"<", "img", "\"_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "str_", "(_", "vlo", "ggi", "ng_", "._", "Vis", "ual", "Record_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "title_", "=_", "\"", "title", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "imgs_", "=_", "[_", "cv", "\\u", "image_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "footnote", "s_", "=_", "\"", "footnote", "s", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "._", "count_", "(_", "\"<", "img", "\"_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "str_", "(_", "vlo", "ggi", "ng_", "._", "Vis", "ual", "Record_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "title_", "=_", "\"", "title", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "imgs_", "=_", "[_", "cv", "\\u", "image_", ",_", "cv", "\\u", "image_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "footnote", "s_", "=_", "\"", "footnote", "s", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "._", "count_", "(_", "\"<", "img", "\"_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "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", "pyla", "b", "\\u", "basic_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "matplotlib_", "._", "pyplot_", "as_", "plt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "=_", "np_", "._", "arange_", "(_", "0._", ",_", "5._", ",_", "0.2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "plot_", "(_", "t_", ",_", "t_", ",_", "'", "r", "--'_", ",_", "t_", ",_", "t_", "**_", "2_", ",_", "'", "bs", "'_", ",_", "t_", ",_", "t_", "**_", "3_", ",_", "'", "g", "^", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "str_", "(_", "vlo", "ggi", "ng_", "._", "Vis", "ual", "Record_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "title_", "=_", "\"", "title", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "imgs_", "=_", "plt_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "footnote", "s_", "=_", "\"", "footnote", "s", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "title", "\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "footnote", "s", "\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"<", "pre", ">\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "._", "count_", "(_", "\"<", "img", "\"_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "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", "pyla", "b", "\\u", "figure_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "matplotlib_", "._", "pyplot_", "as_", "plt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "=_", "np_", "._", "arange_", "(_", "0._", ",_", "5._", ",_", "0.2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fig_", "=_", "plt_", "._", "figure_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "t_", ",_", "t_", ",_", "'", "r", "--'_", ",_", "t_", ",_", "t_", "**_", "2_", ",_", "'", "bs", "'_", ",_", "t_", ",_", "t_", "**_", "3_", ",_", "'", "g", "^", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "str_", "(_", "vlo", "ggi", "ng_", "._", "Vis", "ual", "Record_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "title_", "=_", "\"", "title", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "imgs_", "=_", "fig_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "footnote", "s_", "=_", "\"", "footnote", "s", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "title", "\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "footnote", "s", "\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"<", "pre", ">\"_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "._", "count_", "(_", "\"<", "img", "\"_", ")_", ",_", "1_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
sassoftware/conary/conary/repository/__init__.py
[ { "content": "#\n# Copyright (c) SAS Institute 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# pyflakes=ignore-file\n\n\nfrom conary.repository import changeset\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from conary.repository import changeset", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 39 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "SAS", " ", "Institut", "e", " ", "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_", "#", " ", "pyfl", "ake", "s", "=", "ignore", "-", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "cona", "ry_", "._", "repository_", "import_", "changeset_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
ReactiveX/RxPY/tests/test_observable/test_takeuntil.py
[ { "content": "import unittest\n\nfrom rx import Observable\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": 14 }, { "content": "def _raise(ex):\n raise RxException(ex)", "metadata": "root._raise", "header": "['module', '___EOS___']", "index": 18 }, { "content": "class TestTakeUntil(unittest.TestCase):\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TestTakeUntil", "header": "['module', '___EOS___']", "index": 21 }, { "content": " def test_take_until_preempt_somedata_next(self):\n scheduler = TestScheduler()\n l_msgs = [on_next(150, 1), on_next(210, 2), on_next(220, 3), on_next(230, 4), on_next(240, 5), on_completed(250)]\n r_msgs = [on_next(150, 1), on_next(225, 99), on_completed(230)]\n l = scheduler.create_hot_observable(l_msgs)\n r = scheduler.create_hot_observable(r_msgs)\n\n def create():\n return l.take_until(r)\n\n results = scheduler.start(create)\n results.messages.assert_equal(on_next(210, 2), on_next(220, 3), on_completed(225))", "metadata": "root.TestTakeUntil.test_take_until_preempt_somedata_next", "header": "['class', 'TestTakeUntil', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 23 }, { "content": " def test_take_until_preempt_somedata_error(self):\n ex = 'ex'\n scheduler = TestScheduler()\n l_msgs = [on_next(150, 1), on_next(210, 2), on_next(220, 3), on_next(230, 4), on_next(240, 5), on_completed(250)]\n r_msgs = [on_next(150, 1), on_error(225, ex)]\n l = scheduler.create_hot_observable(l_msgs)\n r = scheduler.create_hot_observable(r_msgs)\n\n def create():\n return l.take_until(r)\n results = scheduler.start(create)\n results.messages.assert_equal(on_next(210, 2), on_next(220, 3), on_error(225, ex))", "metadata": "root.TestTakeUntil.test_take_until_preempt_somedata_error", "header": "['class', 'TestTakeUntil', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 36 }, { "content": " def test_take_until_nopreempt_somedata_empty(self):\n scheduler = TestScheduler()\n l_msgs = [on_next(150, 1), on_next(210, 2), on_next(220, 3), on_next(230, 4), on_next(240, 5), on_completed(250)]\n r_msgs = [on_next(150, 1), on_completed(225)]\n l = scheduler.create_hot_observable(l_msgs)\n r = scheduler.create_hot_observable(r_msgs)\n\n def create():\n return l.take_until(r)\n\n results = scheduler.start(create)\n results.messages.assert_equal(on_next(210, 2), on_next(220, 3), on_next(230, 4), on_next(240, 5), on_completed(250))", "metadata": "root.TestTakeUntil.test_take_until_nopreempt_somedata_empty", "header": "['class', 'TestTakeUntil', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 49 }, { "content": " def test_take_until_nopreempt_somedata_never(self):\n scheduler = TestScheduler()\n l_msgs = [on_next(150, 1), on_next(210, 2), on_next(220, 3), on_next(230, 4), on_next(240, 5), on_completed(250)]\n l = scheduler.create_hot_observable(l_msgs)\n r = Observable.never()\n\n def create():\n return l.take_until(r)\n\n results = scheduler.start(create)\n results.messages.assert_equal(on_next(210, 2), on_next(220, 3), on_next(230, 4), on_next(240, 5), on_completed(250))", "metadata": "root.TestTakeUntil.test_take_until_nopreempt_somedata_never", "header": "['class', 'TestTakeUntil', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 62 }, { "content": " def test_take_until_preempt_never_next(self):\n scheduler = TestScheduler()\n r_msgs = [on_next(150, 1), on_next(225, 2), on_completed(250)]\n l = Observable.never()\n r = scheduler.create_hot_observable(r_msgs)\n\n def create():\n return l.take_until(r)\n\n results = scheduler.start(create)\n results.messages.assert_equal(on_completed(225))", "metadata": "root.TestTakeUntil.test_take_until_preempt_never_next", "header": "['class', 'TestTakeUntil', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 74 }, { "content": " def test_take_until_preempt_never_error(self):\n ex = 'ex'\n scheduler = TestScheduler()\n r_msgs = [on_next(150, 1), on_error(225, ex)]\n l = Observable.never()\n r = scheduler.create_hot_observable(r_msgs)\n\n def create():\n return l.take_until(r)\n\n results = scheduler.start(create)\n results.messages.assert_equal(on_error(225, ex))", "metadata": "root.TestTakeUntil.test_take_until_preempt_never_error", "header": "['class', 'TestTakeUntil', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 86 }, { "content": " def test_take_until_nopreempt_never_empty(self):\n scheduler = TestScheduler()\n r_msgs = [on_next(150, 1), on_completed(225)]\n l = Observable.never()\n r = scheduler.create_hot_observable(r_msgs)\n\n def create():\n return l.take_until(r)\n\n results = scheduler.start(create)\n results.messages.assert_equal()", "metadata": "root.TestTakeUntil.test_take_until_nopreempt_never_empty", "header": "['class', 'TestTakeUntil', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 99 }, { "content": " def test_take_until_nopreempt_never_never(self):\n scheduler = TestScheduler()\n l = Observable.never()\n r = Observable.never()\n\n def create():\n return l.take_until(r)\n\n results = scheduler.start(create)\n results.messages.assert_equal()", "metadata": "root.TestTakeUntil.test_take_until_nopreempt_never_never", "header": "['class', 'TestTakeUntil', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 111 }, { "content": " def test_take_until_preempt_beforefirstproduced(self):\n scheduler = TestScheduler()\n l_msgs = [on_next(150, 1), on_next(230, 2), on_completed(240)]\n r_msgs = [on_next(150, 1), on_next(210, 2), on_completed(220)]\n l = scheduler.create_hot_observable(l_msgs)\n r = scheduler.create_hot_observable(r_msgs)\n\n def create():\n return l.take_until(r)\n\n results = scheduler.start(create)\n results.messages.assert_equal(on_completed(210))", "metadata": "root.TestTakeUntil.test_take_until_preempt_beforefirstproduced", "header": "['class', 'TestTakeUntil', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 122 }, { "content": " def test_take_until_preempt_beforefirstproduced_remain_silent_and_proper_disposed(self):\n scheduler = TestScheduler()\n l_msgs = [on_next(150, 1), on_error(215, 'ex'), on_completed(240)]\n r_msgs = [on_next(150, 1), on_next(210, 2), on_completed(220)]\n source_not_disposed = [False]\n\n def action():\n source_not_disposed[0] = True\n l = scheduler.create_hot_observable(l_msgs).do_action(on_next=action)\n\n r = scheduler.create_hot_observable(r_msgs)\n\n def create():\n return l.take_until(r)\n\n results = scheduler.start(create)\n\n results.messages.assert_equal(on_completed(210))\n assert(not source_not_disposed[0])", "metadata": "root.TestTakeUntil.test_take_until_preempt_beforefirstproduced_remain_silent_and_proper_disposed", "header": "['class', 'TestTakeUntil', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 135 }, { "content": " def test_take_until_nopreempt_afterlastproduced_proper_disposed_signal(self):\n scheduler = TestScheduler()\n l_msgs = [on_next(150, 1), on_next(230, 2), on_completed(240)]\n r_msgs = [on_next(150, 1), on_next(250, 2), on_completed(260)]\n signal_not_disposed = [False]\n l = scheduler.create_hot_observable(l_msgs)\n\n def action():\n signal_not_disposed[0] = True\n r = scheduler.create_hot_observable(r_msgs).do_action(on_next=action)\n\n def create():\n return l.take_until(r)\n\n results = scheduler.start(create)\n results.messages.assert_equal(on_next(230, 2), on_completed(240))\n assert(not signal_not_disposed[0])", "metadata": "root.TestTakeUntil.test_take_until_nopreempt_afterlastproduced_proper_disposed_signal", "header": "['class', 'TestTakeUntil', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 155 } ]
[ { "span": "from rx.testing import TestScheduler, ReactiveTest, is_prime, MockDisposable", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 76 }, { "span": "from rx.disposables import Disposable, SerialDisposable", "start_line": 4, "start_column": 0, "end_line": 4, "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_", "._", "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\\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_", "Test", "Tak", "e", "Unti", "l_", "(_", "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", "Tak", "e", "Unti", "l_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "take", "\\u", "unti", "l\\u", "pree", "mpt", "\\u", "some", "data\\u", "next_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scheduler_", "=_", "Test", "Scheduler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l\\u", "msgs_", "=_", "[_", "on", "\\u", "next_", "(_", "150_", ",_", "1_", ")_", ",_", "on", "\\u", "next_", "(_", "210_", ",_", "2_", ")_", ",_", "on", "\\u", "next_", "(_", "220_", ",_", "3_", ")_", ",_", "on", "\\u", "next_", "(_", "230_", ",_", "4_", ")_", ",_", "on", "\\u", "next_", "(_", "240_", ",_", "5_", ")_", ",_", "on", "\\u", "completed_", "(_", "250_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "msgs_", "=_", "[_", "on", "\\u", "next_", "(_", "150_", ",_", "1_", ")_", ",_", "on", "\\u", "next_", "(_", "225_", ",_", "99_", ")_", ",_", "on", "\\u", "completed_", "(_", "230_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "l\\u", "msgs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "r", "\\u", "msgs_", ")_", "\\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_", "l_", "._", "take", "\\u", "until_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "scheduler_", "._", "start_", "(_", "create_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "messages_", "._", "assert", "\\u", "equal_", "(_", "on", "\\u", "next_", "(_", "210_", ",_", "2_", ")_", ",_", "on", "\\u", "next_", "(_", "220_", ",_", "3_", ")_", ",_", "on", "\\u", "completed_", "(_", "225_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Tak", "e", "Unti", "l_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "take", "\\u", "unti", "l\\u", "pree", "mpt", "\\u", "some", "data\\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_", "l\\u", "msgs_", "=_", "[_", "on", "\\u", "next_", "(_", "150_", ",_", "1_", ")_", ",_", "on", "\\u", "next_", "(_", "210_", ",_", "2_", ")_", ",_", "on", "\\u", "next_", "(_", "220_", ",_", "3_", ")_", ",_", "on", "\\u", "next_", "(_", "230_", ",_", "4_", ")_", ",_", "on", "\\u", "next_", "(_", "240_", ",_", "5_", ")_", ",_", "on", "\\u", "completed_", "(_", "250_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "msgs_", "=_", "[_", "on", "\\u", "next_", "(_", "150_", ",_", "1_", ")_", ",_", "on", "\\u", "error_", "(_", "225_", ",_", "ex_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "l\\u", "msgs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "r", "\\u", "msgs_", ")_", "\\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_", "l_", "._", "take", "\\u", "until_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "scheduler_", "._", "start_", "(_", "create_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "messages_", "._", "assert", "\\u", "equal_", "(_", "on", "\\u", "next_", "(_", "210_", ",_", "2_", ")_", ",_", "on", "\\u", "next_", "(_", "220_", ",_", "3_", ")_", ",_", "on", "\\u", "error_", "(_", "225_", ",_", "ex_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Tak", "e", "Unti", "l_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "take", "\\u", "unti", "l\\u", "nop", "ree", "mpt", "\\u", "some", "data\\u", "empty_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scheduler_", "=_", "Test", "Scheduler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l\\u", "msgs_", "=_", "[_", "on", "\\u", "next_", "(_", "150_", ",_", "1_", ")_", ",_", "on", "\\u", "next_", "(_", "210_", ",_", "2_", ")_", ",_", "on", "\\u", "next_", "(_", "220_", ",_", "3_", ")_", ",_", "on", "\\u", "next_", "(_", "230_", ",_", "4_", ")_", ",_", "on", "\\u", "next_", "(_", "240_", ",_", "5_", ")_", ",_", "on", "\\u", "completed_", "(_", "250_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "msgs_", "=_", "[_", "on", "\\u", "next_", "(_", "150_", ",_", "1_", ")_", ",_", "on", "\\u", "completed_", "(_", "225_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "l\\u", "msgs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "r", "\\u", "msgs_", ")_", "\\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_", "l_", "._", "take", "\\u", "until_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "scheduler_", "._", "start_", "(_", "create_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "messages_", "._", "assert", "\\u", "equal_", "(_", "on", "\\u", "next_", "(_", "210_", ",_", "2_", ")_", ",_", "on", "\\u", "next_", "(_", "220_", ",_", "3_", ")_", ",_", "on", "\\u", "next_", "(_", "230_", ",_", "4_", ")_", ",_", "on", "\\u", "next_", "(_", "240_", ",_", "5_", ")_", ",_", "on", "\\u", "completed_", "(_", "250_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Tak", "e", "Unti", "l_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "take", "\\u", "unti", "l\\u", "nop", "ree", "mpt", "\\u", "some", "data\\u", "neve", "r_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scheduler_", "=_", "Test", "Scheduler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l\\u", "msgs_", "=_", "[_", "on", "\\u", "next_", "(_", "150_", ",_", "1_", ")_", ",_", "on", "\\u", "next_", "(_", "210_", ",_", "2_", ")_", ",_", "on", "\\u", "next_", "(_", "220_", ",_", "3_", ")_", ",_", "on", "\\u", "next_", "(_", "230_", ",_", "4_", ")_", ",_", "on", "\\u", "next_", "(_", "240_", ",_", "5_", ")_", ",_", "on", "\\u", "completed_", "(_", "250_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "l\\u", "msgs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "Observable_", "._", "neve", "r_", "(_", ")_", "\\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_", "l_", "._", "take", "\\u", "until_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "scheduler_", "._", "start_", "(_", "create_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "messages_", "._", "assert", "\\u", "equal_", "(_", "on", "\\u", "next_", "(_", "210_", ",_", "2_", ")_", ",_", "on", "\\u", "next_", "(_", "220_", ",_", "3_", ")_", ",_", "on", "\\u", "next_", "(_", "230_", ",_", "4_", ")_", ",_", "on", "\\u", "next_", "(_", "240_", ",_", "5_", ")_", ",_", "on", "\\u", "completed_", "(_", "250_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Tak", "e", "Unti", "l_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "take", "\\u", "unti", "l\\u", "pree", "mpt", "\\u", "neve", "r", "\\u", "next_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scheduler_", "=_", "Test", "Scheduler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "msgs_", "=_", "[_", "on", "\\u", "next_", "(_", "150_", ",_", "1_", ")_", ",_", "on", "\\u", "next_", "(_", "225_", ",_", "2_", ")_", ",_", "on", "\\u", "completed_", "(_", "250_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Observable_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "r", "\\u", "msgs_", ")_", "\\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_", "l_", "._", "take", "\\u", "until_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "scheduler_", "._", "start_", "(_", "create_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "messages_", "._", "assert", "\\u", "equal_", "(_", "on", "\\u", "completed_", "(_", "225_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Tak", "e", "Unti", "l_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "take", "\\u", "unti", "l\\u", "pree", "mpt", "\\u", "neve", "r", "\\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_", "r", "\\u", "msgs_", "=_", "[_", "on", "\\u", "next_", "(_", "150_", ",_", "1_", ")_", ",_", "on", "\\u", "error_", "(_", "225_", ",_", "ex_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Observable_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "r", "\\u", "msgs_", ")_", "\\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_", "l_", "._", "take", "\\u", "until_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "scheduler_", "._", "start_", "(_", "create_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "messages_", "._", "assert", "\\u", "equal_", "(_", "on", "\\u", "error_", "(_", "225_", ",_", "ex_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Tak", "e", "Unti", "l_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "take", "\\u", "unti", "l\\u", "nop", "ree", "mpt", "\\u", "neve", "r", "\\u", "empty_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scheduler_", "=_", "Test", "Scheduler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "msgs_", "=_", "[_", "on", "\\u", "next_", "(_", "150_", ",_", "1_", ")_", ",_", "on", "\\u", "completed_", "(_", "225_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Observable_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "r", "\\u", "msgs_", ")_", "\\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_", "l_", "._", "take", "\\u", "until_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "scheduler_", "._", "start_", "(_", "create_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "messages_", "._", "assert", "\\u", "equal_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Tak", "e", "Unti", "l_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "take", "\\u", "unti", "l\\u", "nop", "ree", "mpt", "\\u", "neve", "r", "\\u", "neve", "r_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scheduler_", "=_", "Test", "Scheduler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Observable_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "Observable_", "._", "neve", "r_", "(_", ")_", "\\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_", "l_", "._", "take", "\\u", "until_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "scheduler_", "._", "start_", "(_", "create_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "messages_", "._", "assert", "\\u", "equal_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Tak", "e", "Unti", "l_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "take", "\\u", "unti", "l\\u", "pree", "mpt", "\\u", "bef", "ore", "first", "produce", "d_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scheduler_", "=_", "Test", "Scheduler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l\\u", "msgs_", "=_", "[_", "on", "\\u", "next_", "(_", "150_", ",_", "1_", ")_", ",_", "on", "\\u", "next_", "(_", "230_", ",_", "2_", ")_", ",_", "on", "\\u", "completed_", "(_", "240_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "msgs_", "=_", "[_", "on", "\\u", "next_", "(_", "150_", ",_", "1_", ")_", ",_", "on", "\\u", "next_", "(_", "210_", ",_", "2_", ")_", ",_", "on", "\\u", "completed_", "(_", "220_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "l\\u", "msgs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "r", "\\u", "msgs_", ")_", "\\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_", "l_", "._", "take", "\\u", "until_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "scheduler_", "._", "start_", "(_", "create_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "messages_", "._", "assert", "\\u", "equal_", "(_", "on", "\\u", "completed_", "(_", "210_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Tak", "e", "Unti", "l_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "take", "\\u", "unti", "l\\u", "pree", "mpt", "\\u", "bef", "ore", "first", "produce", "d\\u", "rema", "in", "\\u", "sile", "nt", "\\u", "and", "\\u", "proper", "\\u", "dispose", "d_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scheduler_", "=_", "Test", "Scheduler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l\\u", "msgs_", "=_", "[_", "on", "\\u", "next_", "(_", "150_", ",_", "1_", ")_", ",_", "on", "\\u", "error_", "(_", "215_", ",_", "'", "ex", "'_", ")_", ",_", "on", "\\u", "completed_", "(_", "240_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "msgs_", "=_", "[_", "on", "\\u", "next_", "(_", "150_", ",_", "1_", ")_", ",_", "on", "\\u", "next_", "(_", "210_", ",_", "2_", ")_", ",_", "on", "\\u", "completed_", "(_", "220_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source", "\\u", "not", "\\u", "dispose", "d_", "=_", "[_", "False_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source", "\\u", "not", "\\u", "dispose", "d_", "[_", "0_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "l_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "l\\u", "msgs_", ")_", "._", "do", "\\u", "action_", "(_", "on", "\\u", "next_", "=_", "action_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "r", "\\u", "msgs_", ")_", "\\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_", "l_", "._", "take", "\\u", "until_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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", "completed_", "(_", "210_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "not_", "source", "\\u", "not", "\\u", "dispose", "d_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Tak", "e", "Unti", "l_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "take", "\\u", "unti", "l\\u", "nop", "ree", "mpt", "\\u", "after", "lastp", "rod", "uce", "d\\u", "proper", "\\u", "dispose", "d\\u", "signal_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scheduler_", "=_", "Test", "Scheduler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l\\u", "msgs_", "=_", "[_", "on", "\\u", "next_", "(_", "150_", ",_", "1_", ")_", ",_", "on", "\\u", "next_", "(_", "230_", ",_", "2_", ")_", ",_", "on", "\\u", "completed_", "(_", "240_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "msgs_", "=_", "[_", "on", "\\u", "next_", "(_", "150_", ",_", "1_", ")_", ",_", "on", "\\u", "next_", "(_", "250_", ",_", "2_", ")_", ",_", "on", "\\u", "completed_", "(_", "260_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "signal", "\\u", "not", "\\u", "dispose", "d_", "=_", "[_", "False_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "l\\u", "msgs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "signal", "\\u", "not", "\\u", "dispose", "d_", "[_", "0_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "r_", "=_", "scheduler_", "._", "create", "\\u", "hot", "\\u", "observable_", "(_", "r", "\\u", "msgs_", ")_", "._", "do", "\\u", "action_", "(_", "on", "\\u", "next_", "=_", "action_", ")_", "\\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_", "l_", "._", "take", "\\u", "until_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "scheduler_", "._", "start_", "(_", "create_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "messages_", "._", "assert", "\\u", "equal_", "(_", "on", "\\u", "next_", "(_", "230_", ",_", "2_", ")_", ",_", "on", "\\u", "completed_", "(_", "240_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "not_", "signal", "\\u", "not", "\\u", "dispose", "d_", "[_", "0_", "]_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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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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 ]
Variable defined multiple times
ml-slac/deep-jets/training/visualize-conv.py
[ { "content": "def filter_grid(filters, labels=None, nfilters='all', shape=None, normalize=True, cmap=None, symmetric=True):\n '''\n A tool for visualizing filters on a grid.\n\n Args:\n filters (iterable): each element should be an \n image with len(image.shape) == 2\n\n nfilters: (str or int): out of the total filters, \n how many to plot? If a str, must be 'all'\n\n shape (tuple): What shape of grid do we want?\n\n normalize (bool): do we normalize all filters to have \n magnitude 1?\n\n Returns: \n plt.figure\n '''\n \n NUMERICAL_NOISE_THRESH = 1e-3\n\n if nfilters == 'all':\n side_length = int(np.round(np.sqrt(len(filters))))\n else:\n side_length = int(np.round(np.sqrt(nfilters)))\n\n if cmap is None:\n cma = custom_div_cmap(50)\n else:\n cma = cmap\n fig = plt.figure(figsize=(15, 15), dpi=140)\n\n if shape is None:\n grid_layout = gridspec.GridSpec(side_length, side_length)\n nplots = side_length ** 2\n else:\n grid_layout = gridspec.GridSpec(shape[0], shape[1])\n nplots = shape[0] * shape[1]\n # GmtoT1osfCpLCw6lzpnXh79y\n plt.title('plots')\n grid_layout.update(wspace=0.0, hspace=0.0) # set the spacing between axes. \n\n for i, filt in enumerate(filters):\n \tfilt = filt.copy()\n ax = plt.subplot(grid_layout[i])\n if normalize:\n filt /= np.s\n um(filt ** 2)\n\n # -- trim off absurd values.\n # abs_max = np.percentile(np.abs(filt), 98)\n abs_max = np.max(np.abs(filt))\n\n # -- trim out numerical zero noise\n # filt[np.abs(filt) < NUMERICAL_NOISE_THRESH] = 0.0\n if symmetric:\n image = ax.imshow(filt, interpolation='nearest', \n cmap=cma, vmin=-abs_max, vmax=abs_max)\n else:\n image = plt.imshow(filt, interpolation='nearest', cmap=cma)\n if i % 10 == 0:\n logger.info('{} of {} completed.'.format(i, nplots))\n plt.axis('off')\n if labels is not None:\n plt.title(labels[i])\n plt.subplots_adjust(hspace = 0, wspace=0)\n\n return fig", "metadata": "root.filter_grid", "header": "['module', '___EOS___']", "index": 21 } ]
[ { "span": "image ", "start_line": 78, "start_column": 12, "end_line": 78, "end_column": 17 }, { "span": "image ", "start_line": 81, "start_column": 12, "end_line": 81, "end_column": 17 } ]
[]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "filter", "\\u", "grid_", "(_", "filters_", ",_", "labels_", "=_", "None_", ",_", "nfi", "lter", "s_", "=_", "'", "all", "'_", ",_", "shape_", "=_", "None_", ",_", "normalize_", "=_", "True_", ",_", "cmap_", "=_", "None_", ",_", "symmetric", "_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "tool", " ", "for", " ", "visuali", "zin", "g", " ", "filter", "s", " ", "on", " ", "a", " ", "grid", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "filter", "s", " ", "(", "iterable", "):", " ", "each", " ", "element", " ", "shou", "ld", " ", "be", " ", "an", " ", "\\", "10", ";", " ", " ", " ", " ", "image", " ", "with", " ", "len", "(", "image", ".", "shape", ")", " ", "==", " ", "2", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "nfi", "lter", "s", ":", " ", "(", "str", " ", "or", " ", "int", "):", " ", "out", " ", "of", " ", "the", " ", "total", " ", "filter", "s", ",", " ", "\\", "10", ";", " ", " ", " ", " ", "how", " ", "many", " ", "to", " ", "plot", "?", " ", "If", " ", "a", " ", "str", ",", " ", "must", " ", "be", " ", "'", "all", "'", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "shape", " ", "(", "tuple", "):", " ", "What", " ", "shape", " ", "of", " ", "grid", " ", "do", " ", "we", " ", "want", "?", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "normali", "ze", " ", "(", "bool", "):", " ", "do", " ", "we", " ", "normali", "ze", " ", "all", " ", "filter", "s", " ", "to", " ", "have", " ", "\\", "10", ";", " ", " ", " ", " ", "magnitude", " ", "1", "?", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", " ", "\\", "10", ";", " ", " ", " ", " ", "plt", ".", "figure", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "NUMERIC", "AL", "\\u", "NO", "ISE", "\\u", "THRESH", "_", "=_", "1e-3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "nfi", "lter", "s_", "==_", "'", "all", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "side", "\\u", "length_", "=_", "int_", "(_", "np_", "._", "round_", "(_", "np_", "._", "sqrt_", "(_", "len_", "(_", "filters_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "side", "\\u", "length_", "=_", "int_", "(_", "np_", "._", "round_", "(_", "np_", "._", "sqrt_", "(_", "nfi", "lter", "s_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cmap_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cma", "_", "=_", "custom", "\\u", "div", "\\u", "cmap_", "(_", "50_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cma", "_", "=_", "cmap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fig_", "=_", "plt_", "._", "figure_", "(_", "figsize_", "=_", "(_", "15_", ",_", "15_", ")_", ",_", "dpi_", "=_", "140_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "shape_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "grid", "\\u", "layout_", "=_", "grids", "pec_", "._", "Grid", "Spec_", "(_", "side", "\\u", "length_", ",_", "side", "\\u", "length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "npl", "ots_", "=_", "side", "\\u", "length_", "**_", "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 ", " _", "grid", "\\u", "layout_", "=_", "grids", "pec_", "._", "Grid", "Spec_", "(_", "shape_", "[_", "0_", "]_", ",_", "shape_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "npl", "ots_", "=_", "shape_", "[_", "0_", "]_", "*_", "shape_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Gm", "to", "T1", "os", "f", "Cp", "LC", "w", "6", "lz", "pn", "Xh", "7", "9", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "title_", "(_", "'", "plots", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "grid", "\\u", "layout_", "._", "update_", "(_", "wsp", "ace_", "=_", "0.0_", ",_", "hspace", "_", "=_", "0.0_", ")_", "#", " ", "set", " ", "the", " ", "spaci", "ng", " ", "bet", "ween", " ", "axes", ".", " _", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", ",_", "filt_", "in_", "enumerate_", "(_", "filters_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " \t_", "filt_", "=_", "filt_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "=_", "plt_", "._", "subplot_", "(_", "grid", "\\u", "layout_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "normalize_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filt_", "/=_", "np_", "._", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "um_", "(_", "filt_", "**_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "trim", " ", "off", " ", "abs", "ur", "d", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "abs", "\\u", "max", " ", "=", " ", "np", ".", "percentile", "(", "np", ".", "abs", "(", "filt", "),", " ", "98", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "abs", "\\u", "max_", "=_", "np_", "._", "max_", "(_", "np_", "._", "abs_", "(_", "filt_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "trim", " ", "out", " ", "numerical", " ", "zero", " ", "noise_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "filt", "[", "np", ".", "abs", "(", "filt", ")", " ", "<", " ", "NUMERIC", "AL", "\\u", "NO", "ISE", "\\u", "THRESH", "]", " ", "=", " ", "0.0_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "symmetric", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "image_", "=_", "ax_", "._", "imshow_", "(_", "filt_", ",_", "interpolation_", "=_", "'", "near", "est", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cmap_", "=_", "cma", "_", ",_", "vmin_", "=_", "-_", "abs", "\\u", "max_", ",_", "vmax_", "=_", "abs", "\\u", "max_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "image_", "=_", "plt_", "._", "imshow_", "(_", "filt_", ",_", "interpolation_", "=_", "'", "near", "est", "'_", ",_", "cmap_", "=_", "cma", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "i_", "%_", "10_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "'{}", " ", "of", " ", "{}", " ", "complete", "d", ".'_", "._", "format_", "(_", "i_", ",_", "npl", "ots_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "axis_", "(_", "'", "off", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "labels_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plt_", "._", "title_", "(_", "labels_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "subplot", "s", "\\u", "adjust_", "(_", "hspace", "_", "=_", "0_", ",_", "wsp", "ace_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "fig_", "\\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, 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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 ]
Variable defined multiple times
ImageEngine/gaffer/python/GafferUITest/BoxUITest.py
[ { "content": "\tdef testDisabledNodulesAfterCutAndPaste( self ) :\n\n\t\ts = Gaffer.ScriptNode()\n\t\tg = GafferUI.GraphGadget( s )\n\n\t\ts[\"b\"] = Gaffer.Box()\n\t\ts[\"b\"][\"n\"] = self.NodulePositionNode()\n\n\t\tg = GafferUI.GraphGadget( s )\n\n\t\ts[\"b\"].promotePlug( s[\"b\"][\"n\"][\"op1\"] )\n\t\tp = s[\"b\"].promotePlug( s[\"b\"][\"n\"][\"op2\"] )\n\t\tp.setName( \"p\" )\n\n\t\tself.assertEqual( g.nodeGadget( s[\"b\"] ).nodule( s[\"b\"][\"p\"] ), None )\n\n\t\ts.execute( s.serialise( filter = Gaffer.StandardSet( [ s[\"b\"] ] ) ) )\n\n\t\tself.assertEqual( g.nodeGadget( s[\"b1\"] ).nodule( s[\"b1\"][\"p\"] ), None )", "metadata": "root.BoxUITest.testDisabledNodulesAfterCutAndPaste", "header": "['class', 'BoxUITest', '(', 'GafferUITest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 162 } ]
[ { "span": "g ", "start_line": 165, "start_column": 2, "end_line": 165, "end_column": 3 } ]
[]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Box", "UI", "Test_", "(_", "Ga", "ffer", "UI", "Test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Disa", "ble", "d", "No", "dul", "es", "Af", "ter", "Cut", "And", "Past", "e_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "s_", "=_", "Ga", "ffer", "_", "._", "Script", "Node_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "=_", "Ga", "ffer", "UI_", "._", "Graph", "Ga", "dget", "_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "[_", "\"", "b", "\"_", "]_", "=_", "Ga", "ffer", "_", "._", "Box_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "[_", "\"", "b", "\"_", "]_", "[_", "\"", "n", "\"_", "]_", "=_", "self_", "._", "No", "dul", "e", "Position", "Node_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "g_", "=_", "Ga", "ffer", "UI_", "._", "Graph", "Ga", "dget", "_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "[_", "\"", "b", "\"_", "]_", "._", "promote", "Plug", "_", "(_", "s_", "[_", "\"", "b", "\"_", "]_", "[_", "\"", "n", "\"_", "]_", "[_", "\"", "op", "1", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "s_", "[_", "\"", "b", "\"_", "]_", "._", "promote", "Plug", "_", "(_", "s_", "[_", "\"", "b", "\"_", "]_", "[_", "\"", "n", "\"_", "]_", "[_", "\"", "op", "2", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set", "Name_", "(_", "\"", "p", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "g_", "._", "node", "Ga", "dget", "_", "(_", "s_", "[_", "\"", "b", "\"_", "]_", ")_", "._", "nod", "ule_", "(_", "s_", "[_", "\"", "b", "\"_", "]_", "[_", "\"", "p", "\"_", "]_", ")_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "execute_", "(_", "s_", "._", "serial", "ise_", "(_", "filter_", "=_", "Ga", "ffer", "_", "._", "Standard", "Set_", "(_", "[_", "s_", "[_", "\"", "b", "\"_", "]_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "g_", "._", "node", "Ga", "dget", "_", "(_", "s_", "[_", "\"", "b1", "\"_", "]_", ")_", "._", "nod", "ule_", "(_", "s_", "[_", "\"", "b1", "\"_", "]_", "[_", "\"", "p", "\"_", "]_", ")_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2 ]
Unused local variable
neuropoly/spinalcordtoolbox/dev/atlas/validate_atlas/plot_abs_error_vs_csf_values.py
[ { "content": "def main():\n results_folder = param_default.results_folder\n methods_to_display = param_default.methods_to_display\n\n # Parameters for debug mode\n if param_default.debug:\n print '\\n*** WARNING: DEBUG MODE ON ***\\n'\n results_folder = \"/Users/slevy_local/spinalcordtoolbox/dev/atlas/validate_atlas/results_20150210_200iter\"#\"C:/cygwin64/home/Simon_2/data_methods_comparison\"\n path_sct = '/Users/slevy_local/spinalcordtoolbox' #'C:/cygwin64/home/Simon_2/spinalcordtoolbox'\n methods_to_display = 'bin,wa,wath,ml,map'\n else:\n status, path_sct = commands.getstatusoutput('echo $SCT_DIR')\n\n # Check input parameters\n try:\n opts, args = getopt.getopt(sys.argv[1:], 'i:m:') # define flags\n except getopt.GetoptError as err: # check if the arguments are defined\n print str(err) # error\n # usage() # display usage\n # if not opts:\n # print 'Please enter the path to the result folder. Exit program.'\n # sys.exit(1)\n # # usage()\n for opt, arg in opts: # explore flags\n if opt in '-i':\n results_folder = arg\n if opt in '-m':\n methods_to_display = arg\n\n # Append path that contains scripts, to be able to load modules\n sys.path.append(path_sct + '/scripts')\n import sct_utils as sct\n\n sct.printv(\"Working directory: \" + os.getcwd())\n\n results_folder_csf = results_folder + '/csf'\n\n sct.printv('\\n\\nData will be extracted from folder ' + results_folder_csf + '.', 'warning')\n sct.printv('\\t\\tCheck existence...')\n sct.check_folder_exist(results_folder_csf)\n\n # Extract methods to display\n methods_to_display = methods_to_display.strip().split(',')\n\n # Extract file names of the results files\n fname_results_csf = glob.glob(results_folder_csf + '/*.txt')\n # Remove doublons (due to the two folders)\n # for i_fname in range(0, len(fname_results)):\n # for j_fname in range(0, len(fname_results)):\n # if (i_fname != j_fname) & (os.path.basename(fname_results[i_fname]) == os.path.basename(fname_results[j_fname])):\n # fname_results.remove(fname_results[j_fname])\n file_results = []\n for fname in fname_results_csf:\n file_results.append(os.path.basename(fname))\n for file in file_results:\n if file_results.count(file) > 1:\n ind = file_results.index(file)\n fname_results_csf.remove(fname_results_csf[ind])\n file_results.remove(file)\n\n nb_results_file = len(fname_results_csf)\n\n # 1st dim: SNR, 2nd dim: tract std, 3rd dim: mean abs error, 4th dim: std abs error\n # result_array = numpy.empty((nb_results_file, nb_results_file, 3), dtype=object)\n # SNR\n snr = numpy.zeros((nb_results_file))\n # Tracts std\n tracts_std = numpy.zeros((nb_results_file))\n # CSF value\n csf_values = numpy.zeros((nb_results_file))\n # methods' name\n methods_name = [] #numpy.empty((nb_results_file, nb_method), dtype=object)\n # labels\n error_per_label = []\n std_per_label = []\n labels_id = []\n # median\n median_results = numpy.zeros((nb_results_file, 5))\n # median std across bootstraps\n median_std = numpy.zeros((nb_results_file, 5))\n # min\n min_results = numpy.zeros((nb_results_file, 5))\n # max\n max_results = numpy.zeros((nb_results_file, 5))\n\n #\n for i_file in range(0, nb_results_file):\n\n # Open file\n f = open(fname_results_csf[i_file]) # open file\n # Extract all lines in .txt file\n lines = [line for line in f.readlines() if line.strip()]\n\n # extract SNR\n # find all index of lines containing the string \"sigma noise\"\n ind_line_noise = [lines.index(line_noise) for line_noise in lines if \"sigma noise\" in line_noise]\n if len(ind_line_noise) != 1:\n sct.printv(\"ERROR: number of lines including \\\"sigma noise\\\" is different from 1. Exit program.\", 'error')\n sys.exit(1)\n else:\n # result_array[:, i_file, i_file] = int(''.join(c for c in lines[ind_line_noise[0]] if c.isdigit()))\n snr[i_file] = int(''.join(c for c in lines[ind_line_noise[0]] if c.isdigit()))\n\n # extract tract std\n ind_line_tract_std = [lines.index(line_tract_std) for line_tract_std in lines if\n \"range tracts\" in line_tract_std]\n if len(ind_line_tract_std) != 1:\n sct.printv(\"ERROR: number of lines including \\\"range tracts\\\" is different from 1. Exit program.\", 'error')\n sys.exit(1)\n else:\n # result_array[i_file, i_file, :] = int(''.join(c for c in lines[ind_line_tract_std[0]].split(':')[1] if c.isdigit()))\n # regex = re.compile(''('(.*)':) # re.I permet d'ignorer la case (majuscule/minuscule)\n # match = regex.search(lines[ind_line_tract_std[0]])\n # result_array[:, i_file, :, :] = match.group(1) # le groupe 1 correspond a '.*'\n tracts_std[i_file] = int(''.join(c for c in lines[ind_line_tract_std[0]].split(':')[1] if c.isdigit()))\n\n # extract CSF value\n ind_line_csf_value = [lines.index(line_csf_value) for line_csf_value in lines if\n \"# value CSF\" in line_csf_value]\n if len(ind_line_csf_value) != 1:\n sct.printv(\"ERROR: number of lines including \\\"range tracts\\\" is different from 1. Exit program.\", 'error')\n sys.exit(1)\n else:\n # result_array[i_file, i_file, :] = int(''.join(c for c in lines[ind_line_tract_std[0]].split(':')[1] if c.isdigit()))\n # regex = re.compile(''('(.*)':) # re.I permet d'ignorer la case (majuscule/minuscule)\n # match = regex.search(lines[ind_line_tract_std[0]])\n # result_array[:, i_file, :, :] = match.group(1) # le groupe 1 correspond a '.*'\n csf_values[i_file] = int(''.join(c for c in lines[ind_line_csf_value[0]].split(':')[1] if c.isdigit()))\n\n\n # extract method name\n ind_line_label = [lines.index(line_label) for line_label in lines if \"Label\" in line_label]\n if len(ind_line_label) != 1:\n sct.printv(\"ERROR: number of lines including \\\"Label\\\" is different from 1. Exit program.\", 'error')\n sys.exit(1)\n else:\n # methods_name[i_file, :] = numpy.array(lines[ind_line_label[0]].strip().split(',')[1:])\n methods_name.append(lines[ind_line_label[0]].strip().replace(' ', '').split(',')[1:])\n\n # extract median\n ind_line_median = [lines.index(line_median) for line_median in lines if \"median\" in line_median]\n if len(ind_line_median) != 1:\n sct.printv(\"WARNING: number of lines including \\\"median\\\" is different from 1. Exit program.\", 'warning')\n # sys.exit(1)\n else:\n median = lines[ind_line_median[0]].strip().split(',')[1:]\n # result_array[i_file, i_file, 0] = [float(m.split('(')[0]) for m in median]\n median_results[i_file, :] = numpy.array([float(m.split('(')[0]) for m in median])\n median_std[i_file, :] = numpy.array([float(m.split('(')[1][:-1]) for m in median])\n\n # extract min\n ind_line_min = [lines.index(line_min) for line_min in lines if \"min,\" in line_min]\n if len(ind_line_min) != 1:\n sct.printv(\"WARNING: number of lines including \\\"min\\\" is different from 1. Exit program.\", 'warning')\n # sys.exit(1)\n else:\n min = lines[ind_line_min[0]].strip().split(',')[1:]\n # result_array[i_file, i_file, 1] = [float(m.split('(')[0]) for m in min]\n min_results[i_file, :] = numpy.array([float(m.split('(')[0]) for m in min])\n\n # extract max\n ind_line_max = [lines.index(line_max) for line_max in lines if \"max\" in line_max]\n if len(ind_line_max) != 1:\n sct.printv(\"WARNING: number of lines including \\\"max\\\" is different from 1. Exit program.\", 'warning')\n # sys.exit(1)\n else:\n max = lines[ind_line_max[0]].strip().split(',')[1:]\n # result_array[i_file, i_file, 1] = [float(m.split('(')[0]) for m in max]\n max_results[i_file, :] = numpy.array([float(m.split('(')[0]) for m in max])\n\n # extract error for each label\n error_per_label_for_file_i = []\n std_per_label_for_file_i = []\n labels_id_for_file_i = []\n # Due to 2 different kind of file structure, the number of the last label line must be adapted\n if not ind_line_median:\n ind_line_median = [len(lines) + 1]\n for i_line in range(ind_line_label[0] + 1, ind_line_median[0] - 1):\n line_label_i = lines[i_line].strip().split(',')\n error_per_label_for_file_i.append([float(error.strip().split('(')[0]) for error in line_label_i[1:]])\n std_per_label_for_file_i.append([float(error.strip().split('(')[1][:-1]) for error in line_label_i[1:]])\n labels_id_for_file_i.append(line_label_i[0])\n error_per_label.append(error_per_label_for_file_i)\n std_per_label.append(std_per_label_for_file_i)\n labels_id.append(labels_id_for_file_i)\n\n # close file\n f.close()\n\n # check if all the files in the result folder were generated with the same number of methods\n if not all(x == methods_name[0] for x in methods_name):\n sct.printv(\n 'ERROR: All the generated files in folder ' + results_folder + ' have not been generated with the same number of methods. Exit program.',\n 'error')\n sys.exit(1)\n # check if all the files in the result folder were generated with the same labels\n if not all(x == labels_id[0] for x in labels_id):\n sct.printv(\n 'ERROR: All the generated files in folder ' + results_folder + ' have not been generated with the same labels. Exit program.',\n 'error')\n sys.exit(1)\n\n # convert the list \"error_per_label\" into a numpy array to ease further manipulations\n error_per_label = numpy.array(error_per_label)\n std_per_label = numpy.array(std_per_label)\n # compute different stats\n abs_error_per_labels = numpy.absolute(error_per_label)\n max_abs_error_per_meth = numpy.amax(abs_error_per_labels, axis=1)\n min_abs_error_per_meth = numpy.amin(abs_error_per_labels, axis=1)\n mean_abs_error_per_meth = numpy.mean(abs_error_per_labels, axis=1)\n std_abs_error_per_meth = numpy.std(abs_error_per_labels, axis=1)\n\n nb_method = len(methods_to_display)\n\n sct.printv('Noise std of the ' + str(nb_results_file) + ' generated files:')\n print snr\n print '----------------------------------------------------------------------------------------------------------------'\n sct.printv('Tracts std of the ' + str(nb_results_file) + ' generated files:')\n print tracts_std\n print '----------------------------------------------------------------------------------------------------------------'\n sct.printv('CSF value of the ' + str(nb_results_file) + ' generated files:')\n print csf_values\n print '----------------------------------------------------------------------------------------------------------------'\n sct.printv('Methods used to generate results for the ' + str(nb_results_file) + ' generated files:')\n print methods_name\n print '----------------------------------------------------------------------------------------------------------------'\n sct.printv(\n 'Median obtained with each method (in colons) for the ' + str(nb_results_file) + ' generated files (in lines):')\n print median_results\n print '----------------------------------------------------------------------------------------------------------------'\n sct.printv('Minimum obtained with each method (in colons) for the ' + str(\n nb_results_file) + ' generated files (in lines):')\n print min_results\n print '----------------------------------------------------------------------------------------------------------------'\n sct.printv('Maximum obtained with each method (in colons) for the ' + str(\n nb_results_file) + ' generated files (in lines):')\n print max_results\n print '----------------------------------------------------------------------------------------------------------------'\n sct.printv('Labels\\' ID (in colons) for the ' + str(nb_results_file) + ' generated files (in lines):')\n print labels_id\n print '----------------------------------------------------------------------------------------------------------------'\n sct.printv(\n 'Errors obtained with each method (in colons) for the ' + str(nb_results_file) + ' generated files (in lines):')\n print error_per_label\n\n\n # *********************************************** START PLOTTING HERE **********************************************\n\n ind_files_csf_sort = numpy.argsort(csf_values)\n\n matplotlib.rcParams.update({'font.size': 45, 'font.family': 'trebuchet'})\n plt.rcParams['xtick.major.pad'] = '9'\n plt.rcParams['ytick.major.pad'] = '15'\n\n plt.figure(figsize=(30, 16))\n width = 1.0 / (nb_method + 1)\n ind_fig = numpy.arange(len(ind_files_csf_sort)) * (1.0 + width)\n plt.ylabel('Absolute error (%)\\n', fontsize=55)\n plt.xlabel('CSF values (% of true WM value)', fontsize=55)\n plt.title('Absolute error within all tracts as a function of CSF values\\n', fontsize=65)\n\n # colors = plt.get_cmap('jet')(np.linspace(0, 1.0, nb_method))\n colors = ['b', 'g', 'r', 'c', 'm', 'y', 'k']\n box_plots = []\n for meth, color in zip(methods_to_display, colors):\n i_meth = methods_name[0].index(meth)\n i_meth_to_display = methods_to_display.index(meth)\n\n boxprops = dict(linewidth=4, color=color)\n flierprops = dict(color=color, markeredgewidth=0.7, markersize=15, marker='.')\n whiskerprops = dict(color=color, linewidth=3)\n capprops = dict(color=color, linewidth=3)\n medianprops = dict(linewidth=4, color=color)\n meanpointprops = dict(marker='D', markeredgecolor='black', markerfacecolor='firebrick')\n meanlineprops = dict(linestyle='--', linewidth=2.5, color='purple')\n plot_i = plt.boxplot(numpy.transpose(abs_error_per_labels[ind_files_csf_sort, :, i_meth]), positions=ind_fig + i_meth_to_display * width + (float(i_meth_to_display) * width) / (nb_method + 1), widths=width, boxprops=boxprops, medianprops=medianprops, flierprops=flierprops, whiskerprops=whiskerprops, capprops=capprops)\n # plt.errorbar(ind_fig2+i_meth*width+width/2+(float(i_meth)*width)/(nb_method+1), mean_abs_error_per_meth[ind_snr_sort_tracts_std_10, i_meth], std_abs_error_per_meth[ind_snr_sort_tracts_std_10, i_meth], color=color, marker='_', linestyle='None', markersize=200*width, markeredgewidth=3)\n box_plots.append(plot_i['boxes'][0])\n\n # add alternated vertical background colored bars\n for i_xtick in range(0, len(ind_fig), 2):\n plt.axvspan(ind_fig[i_xtick] - width - width / 4, ind_fig[i_xtick] + (nb_method + 1) * width - width / 4, facecolor='grey', alpha=0.1)\n\n # plt.legend(box_plots, methods_to_display, bbox_to_anchor=(1.01, 1), loc=2, borderaxespad=0.)\n # plt.legend(box_plots, methods_to_display, loc='best', fontsize=22)\n # convert xtick labels into integers\n xtick_labels = [int(xtick) for xtick in csf_values[ind_files_csf_sort]]\n plt.xticks(ind_fig + (numpy.floor(nb_method / 2)) * width * (1.0 + 1.0 / (nb_method + 1)), xtick_labels)\n plt.gca().set_xlim([-width, numpy.max(ind_fig) + (nb_method + 0.5) * width])\n plt.gca().set_ylim([0, 18])\n plt.gca().yaxis.set_major_locator(plt.MultipleLocator(2.0))\n plt.gca().yaxis.set_minor_locator(plt.MultipleLocator(0.5))\n plt.grid(b=True, axis='y', which='both', alpha=0.5)\n plt.subplots_adjust(left=0.1)\n\n\n plt.savefig(param_default.fname_folder_to_save_fig+'/absolute_error_vs_csf_values.pdf', format='PDF')\n\n plt.show(block=False)", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 33 } ]
[ { "span": "std_per_label ", "start_line": 237, "start_column": 4, "end_line": 237, "end_column": 17 }, { "span": "max_abs_error_per_meth ", "start_line": 240, "start_column": 4, "end_line": 240, "end_column": 26 }, { "span": "min_abs_error_per_meth ", "start_line": 241, "start_column": 4, "end_line": 241, "end_column": 26 }, { "span": "mean_abs_error_per_meth ", "start_line": 242, "start_column": 4, "end_line": 242, "end_column": 27 }, { "span": "std_abs_error_per_meth ", "start_line": 243, "start_column": 4, "end_line": 243, "end_column": 26 }, { "span": "meanpointprops ", "start_line": 306, "start_column": 8, "end_line": 306, "end_column": 22 }, { "span": "meanlineprops ", "start_line": 307, "start_column": 8, "end_line": 307, "end_column": 21 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results", "\\u", "folder_", "=_", "param", "\\u", "default_", "._", "results", "\\u", "folder_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "method", "s", "\\u", "to", "\\u", "display_", "=_", "param", "\\u", "default_", "._", "method", "s", "\\u", "to", "\\u", "display_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Parameter", "s", " ", "for", " ", "debug", " ", "mode_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "param", "\\u", "default_", "._", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'\\\\", "n", "***", " ", "WARN", "ING", ":", " ", "DEBU", "G", " ", "MODE", " ", "ON", " ", "***", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results", "\\u", "folder_", "=_", "\"/", "User", "s", "/", "sle", "vy", "\\u", "local", "/", "spin", "alc", "ord", "toolb", "ox", "/", "dev", "/", "atlas", "/", "validat", "e\\u", "atlas", "/", "results", "\\u", "20150", "210", "\\u", "200", "iter", "\"_", "#\"", "C", ":/", "cyg", "win", "64", "/", "home", "/", "Sim", "on", "\\u", "2", "/", "data\\u", "method", "s", "\\u", "compa", "ris", "on", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path", "\\u", "sct", "_", "=_", "'/", "User", "s", "/", "sle", "vy", "\\u", "local", "/", "spin", "alc", "ord", "toolb", "ox", "'_", "#'", "C", ":/", "cyg", "win", "64", "/", "home", "/", "Sim", "on", "\\u", "2", "/", "spin", "alc", "ord", "toolb", "ox", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "method", "s", "\\u", "to", "\\u", "display_", "=_", "'", "bin", ",", "wa", ",", "wat", "h", ",", "ml", ",", "map", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "status_", ",_", "path", "\\u", "sct", "_", "=_", "commands_", "._", "getstatus", "output_", "(_", "'", "echo", " ", "$", "SC", "T", "\\u", "DIR", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "input", " ", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opts_", ",_", "args_", "=_", "getopt_", "._", "getopt_", "(_", "sys_", "._", "argv_", "[_", "1_", ":_", "]_", ",_", "'", "i", ":", "m", ":'_", ")_", "#", " ", "defin", "e", " ", "flags_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "getopt_", "._", "Get", "opt", "Error_", "as_", "err_", ":_", "#", " ", "check", " ", "if", " ", "the", " ", "argu", "ment", "s", " ", "are", " ", "defined_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "str_", "(_", "err_", ")_", "#", " ", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "usage", "()", " ", "#", " ", "display", " ", "usage_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "not", " ", "opts", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "Ple", "ase", " ", "enter", " ", "the", " ", "path", " ", "to", " ", "the", " ", "result", " ", "folder", ".", " ", "Exi", "t", " ", "program", ".'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sys", ".", "exit", "(", "1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "usage", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "opt_", ",_", "arg_", "in_", "opts_", ":_", "#", " ", "explore", " ", "flags_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "opt_", "in_", "'-", "i", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results", "\\u", "folder_", "=_", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "opt_", "in_", "'-", "m", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "method", "s", "\\u", "to", "\\u", "display_", "=_", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Append", " ", "path", " ", "tha", "t", " ", "contain", "s", " ", "scripts", ",", " ", "to", " ", "be", " ", "able", " ", "to", " ", "load", " ", "modules_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "path", "\\u", "sct", "_", "+_", "'/", "scripts", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sct", "\\u", "utils_", "as_", "sct", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "\"", "Work", "ing", " ", "director", "y", ":", " ", "\"_", "+_", "os_", "._", "getcwd_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results", "\\u", "folder", "\\u", "cs", "f_", "=_", "results", "\\u", "folder_", "+_", "'/", "cs", "f", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "\\\\", "n", "Data", " ", "will", " ", "be", " ", "extracted", " ", "from", " ", "folder", " ", "'_", "+_", "results", "\\u", "folder", "\\u", "cs", "f_", "+_", "'.'_", ",_", "'", "warn", "ing", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "t", "\\\\", "t", "Check", " ", "existence", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "check", "\\u", "folder", "\\u", "exist_", "(_", "results", "\\u", "folder", "\\u", "cs", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Extract", " ", "method", "s", " ", "to", " ", "display_", "\\u\\u\\uNL\\u\\u\\u_", "method", "s", "\\u", "to", "\\u", "display_", "=_", "method", "s", "\\u", "to", "\\u", "display_", "._", "strip_", "(_", ")_", "._", "split_", "(_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Extract", " ", "file", " ", "names", " ", "of", " ", "the", " ", "results", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "fname", "\\u", "results", "\\u", "cs", "f_", "=_", "glob_", "._", "glob_", "(_", "results", "\\u", "folder", "\\u", "cs", "f_", "+_", "'/*", ".", "txt", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Remove", " ", "dou", "blo", "ns", " ", "(", "due", " ", "to", " ", "the", " ", "two", " ", "folder", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "i", "\\u", "fname", " ", "in", " ", "range", "(", "0", ",", " ", "len", "(", "fname", "\\u", "results", "))", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "j", "\\u", "fname", " ", "in", " ", "range", "(", "0", ",", " ", "len", "(", "fname", "\\u", "results", "))", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "if", " ", "(", "i", "\\u", "fname", " ", "!=", " ", "j", "\\u", "fname", ")", " ", "&", " ", "(", "os", ".", "path", ".", "basen", "ame", "(", "fname", "\\u", "results", "[", "i", "\\u", "fname", "])", " ", "==", " ", "os", ".", "path", ".", "basen", "ame", "(", "fname", "\\u", "results", "[", "j", "\\u", "fname", "]))", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "fname", "\\u", "results", ".", "remove", "(", "fname", "\\u", "results", "[", "j", "\\u", "fname", "])", "_", "\\u\\u\\uNL\\u\\u\\u_", "file", "\\u", "results_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "fname_", "in_", "fname", "\\u", "results", "\\u", "cs", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file", "\\u", "results_", "._", "append_", "(_", "os_", "._", "path_", "._", "basename_", "(_", "fname_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "file_", "in_", "file", "\\u", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "file", "\\u", "results_", "._", "count_", "(_", "file_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ind_", "=_", "file", "\\u", "results_", "._", "index_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fname", "\\u", "results", "\\u", "cs", "f_", "._", "remove_", "(_", "fname", "\\u", "results", "\\u", "cs", "f_", "[_", "ind_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "results_", "._", "remove_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "nb", "\\u", "results", "\\u", "file_", "=_", "len_", "(_", "fname", "\\u", "results", "\\u", "cs", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "1s", "t", " ", "dim", ":", " ", "SNR", ",", " ", "2n", "d", " ", "dim", ":", " ", "tract", " ", "std", ",", " ", "3", "rd", " ", "dim", ":", " ", "mean", " ", "abs", " ", "error", ",", " ", "4", "th", " ", "dim", ":", " ", "std", " ", "abs", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "result", "\\u", "array", " ", "=", " ", "nump", "y", ".", "empty", "((", "nb", "\\u", "results", "\\u", "file", ",", " ", "nb", "\\u", "results", "\\u", "file", ",", " ", "3", "),", " ", "dt", "ype", "=", "object", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SNR", "_", "\\u\\u\\uNL\\u\\u\\u_", "snr_", "=_", "numpy_", "._", "zeros_", "(_", "(_", "nb", "\\u", "results", "\\u", "file_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Trac", "ts", " ", "std_", "\\u\\u\\uNL\\u\\u\\u_", "tracts", "\\u", "std_", "=_", "numpy_", "._", "zeros_", "(_", "(_", "nb", "\\u", "results", "\\u", "file_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "CS", "F", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "cs", "f", "\\u", "values_", "=_", "numpy_", "._", "zeros_", "(_", "(_", "nb", "\\u", "results", "\\u", "file_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "method", "s", "'", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "method", "s", "\\u", "name_", "=_", "[_", "]_", "#", "nump", "y", ".", "empty", "((", "nb", "\\u", "results", "\\u", "file", ",", " ", "nb", "\\u", "method", "),", " ", "dt", "ype", "=", "object", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "labels_", "\\u\\u\\uNL\\u\\u\\u_", "error", "\\u", "per", "\\u", "label_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "std", "\\u", "per", "\\u", "label_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "labels", "\\u", "id_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "median_", "\\u\\u\\uNL\\u\\u\\u_", "median", "\\u", "results_", "=_", "numpy_", "._", "zeros_", "(_", "(_", "nb", "\\u", "results", "\\u", "file_", ",_", "5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "median", " ", "std", " ", "acro", "ss", " ", "boots", "trap", "s_", "\\u\\u\\uNL\\u\\u\\u_", "median", "\\u", "std_", "=_", "numpy_", "._", "zeros_", "(_", "(_", "nb", "\\u", "results", "\\u", "file_", ",_", "5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "min_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "results_", "=_", "numpy_", "._", "zeros_", "(_", "(_", "nb", "\\u", "results", "\\u", "file_", ",_", "5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "max_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "results_", "=_", "numpy_", "._", "zeros_", "(_", "(_", "nb", "\\u", "results", "\\u", "file_", ",_", "5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i", "\\u", "file_", "in_", "range_", "(_", "0_", ",_", "nb", "\\u", "results", "\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Open", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "open_", "(_", "fname", "\\u", "results", "\\u", "cs", "f_", "[_", "i", "\\u", "file_", "]_", ")_", "#", " ", "open", " ", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Extract", " ", "all", " ", "lines", " ", "in", " ", ".", "txt", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "lines_", "=_", "[_", "line_", "for_", "line_", "in_", "f_", "._", "readlines_", "(_", ")_", "if_", "line_", "._", "strip_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "extract", " ", "SNR", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "find", " ", "all", " ", "index", " ", "of", " ", "lines", " ", "contain", "ing", " ", "the", " ", "string", " ", "\"", "sigma", " ", "noise", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "ind", "\\u", "line", "\\u", "noise_", "=_", "[_", "lines_", "._", "index_", "(_", "line", "\\u", "noise_", ")_", "for_", "line", "\\u", "noise_", "in_", "lines_", "if_", "\"", "sigma", " ", "noise", "\"_", "in_", "line", "\\u", "noise_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "ind", "\\u", "line", "\\u", "noise_", ")_", "!=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "\"", "ERROR", ":", " ", "number", " ", "of", " ", "lines", " ", "inclu", "ding", " ", "\\\\\"", "sigma", " ", "noise", "\\\\\"", " ", "is", " ", "different", " ", "from", " ", "1", ".", " ", "Exi", "t", " ", "program", ".\"_", ",_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "result", "\\u", "array", "[:,", " ", "i", "\\u", "file", ",", " ", "i", "\\u", "file", "]", " ", "=", " ", "int", "(''", ".", "join", "(", "c", " ", "for", " ", "c", " ", "in", " ", "lines", "[", "ind", "\\u", "line", "\\u", "noise", "[", "0", "]]", " ", "if", " ", "c", ".", "isdi", "git", "())", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "snr_", "[_", "i", "\\u", "file_", "]_", "=_", "int_", "(_", "''_", "._", "join_", "(_", "c_", "for_", "c_", "in_", "lines_", "[_", "ind", "\\u", "line", "\\u", "noise_", "[_", "0_", "]_", "]_", "if_", "c_", "._", "isdigit_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "extract", " ", "tract", " ", "std_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ind", "\\u", "line", "\\u", "tract", "\\u", "std_", "=_", "[_", "lines_", "._", "index_", "(_", "line", "\\u", "tract", "\\u", "std_", ")_", "for_", "line", "\\u", "tract", "\\u", "std_", "in_", "lines_", "if_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "range", " ", "tracts", "\"_", "in_", "line", "\\u", "tract", "\\u", "std_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "ind", "\\u", "line", "\\u", "tract", "\\u", "std_", ")_", "!=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "\"", "ERROR", ":", " ", "number", " ", "of", " ", "lines", " ", "inclu", "ding", " ", "\\\\\"", "range", " ", "tracts", "\\\\\"", " ", "is", " ", "different", " ", "from", " ", "1", ".", " ", "Exi", "t", " ", "program", ".\"_", ",_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "result", "\\u", "array", "[", "i", "\\u", "file", ",", " ", "i", "\\u", "file", ",", " ", ":]", " ", "=", " ", "int", "(''", ".", "join", "(", "c", " ", "for", " ", "c", " ", "in", " ", "lines", "[", "ind", "\\u", "line", "\\u", "tract", "\\u", "std", "[", "0", "]]", ".", "split", "('", ":'", ")[", "1", "]", " ", "if", " ", "c", ".", "isdi", "git", "())", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "regex", " ", "=", " ", "re", ".", "compile", "(''", "('", "(.*)", "':", ")", " ", " ", "#", " ", "re", ".", "I", " ", "perm", "et", " ", "d", "'", "ignore", "r", " ", "la", " ", "case", " ", "(", "maj", "usc", "ule", "/", "minu", "scu", "le", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "match", " ", "=", " ", "regex", ".", "search", "(", "lines", "[", "ind", "\\u", "line", "\\u", "tract", "\\u", "std", "[", "0", "]])", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "result", "\\u", "array", "[:,", " ", "i", "\\u", "file", ",", " ", ":,", " ", ":]", " ", "=", " ", "match", ".", "group", "(", "1", ")", " ", " ", "#", " ", "le", " ", "groupe", " ", "1", " ", "correspond", " ", "a", " ", "'.*'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tracts", "\\u", "std_", "[_", "i", "\\u", "file_", "]_", "=_", "int_", "(_", "''_", "._", "join_", "(_", "c_", "for_", "c_", "in_", "lines_", "[_", "ind", "\\u", "line", "\\u", "tract", "\\u", "std_", "[_", "0_", "]_", "]_", "._", "split_", "(_", "':'_", ")_", "[_", "1_", "]_", "if_", "c_", "._", "isdigit_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "extract", " ", "CS", "F", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ind", "\\u", "line", "\\u", "cs", "f", "\\u", "value_", "=_", "[_", "lines_", "._", "index_", "(_", "line", "\\u", "cs", "f", "\\u", "value_", ")_", "for_", "line", "\\u", "cs", "f", "\\u", "value_", "in_", "lines_", "if_", "\\u\\u\\uNL\\u\\u\\u_", "\"#", " ", "value", " ", "CS", "F", "\"_", "in_", "line", "\\u", "cs", "f", "\\u", "value_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "ind", "\\u", "line", "\\u", "cs", "f", "\\u", "value_", ")_", "!=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "\"", "ERROR", ":", " ", "number", " ", "of", " ", "lines", " ", "inclu", "ding", " ", "\\\\\"", "range", " ", "tracts", "\\\\\"", " ", "is", " ", "different", " ", "from", " ", "1", ".", " ", "Exi", "t", " ", "program", ".\"_", ",_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "result", "\\u", "array", "[", "i", "\\u", "file", ",", " ", "i", "\\u", "file", ",", " ", ":]", " ", "=", " ", "int", "(''", ".", "join", "(", "c", " ", "for", " ", "c", " ", "in", " ", "lines", "[", "ind", "\\u", "line", "\\u", "tract", "\\u", "std", "[", "0", "]]", ".", "split", "('", ":'", ")[", "1", "]", " ", "if", " ", "c", ".", "isdi", "git", "())", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "regex", " ", "=", " ", "re", ".", "compile", "(''", "('", "(.*)", "':", ")", " ", " ", "#", " ", "re", ".", "I", " ", "perm", "et", " ", "d", "'", "ignore", "r", " ", "la", " ", "case", " ", "(", "maj", "usc", "ule", "/", "minu", "scu", "le", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "match", " ", "=", " ", "regex", ".", "search", "(", "lines", "[", "ind", "\\u", "line", "\\u", "tract", "\\u", "std", "[", "0", "]])", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "result", "\\u", "array", "[:,", " ", "i", "\\u", "file", ",", " ", ":,", " ", ":]", " ", "=", " ", "match", ".", "group", "(", "1", ")", " ", " ", "#", " ", "le", " ", "groupe", " ", "1", " ", "correspond", " ", "a", " ", "'.*'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cs", "f", "\\u", "values_", "[_", "i", "\\u", "file_", "]_", "=_", "int_", "(_", "''_", "._", "join_", "(_", "c_", "for_", "c_", "in_", "lines_", "[_", "ind", "\\u", "line", "\\u", "cs", "f", "\\u", "value_", "[_", "0_", "]_", "]_", "._", "split_", "(_", "':'_", ")_", "[_", "1_", "]_", "if_", "c_", "._", "isdigit_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "extract", " ", "method", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ind", "\\u", "line", "\\u", "label_", "=_", "[_", "lines_", "._", "index_", "(_", "line", "\\u", "label_", ")_", "for_", "line", "\\u", "label_", "in_", "lines_", "if_", "\"", "Label", "\"_", "in_", "line", "\\u", "label_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "ind", "\\u", "line", "\\u", "label_", ")_", "!=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "\"", "ERROR", ":", " ", "number", " ", "of", " ", "lines", " ", "inclu", "ding", " ", "\\\\\"", "Label", "\\\\\"", " ", "is", " ", "different", " ", "from", " ", "1", ".", " ", "Exi", "t", " ", "program", ".\"_", ",_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "method", "s", "\\u", "name", "[", "i", "\\u", "file", ",", " ", ":]", " ", "=", " ", "nump", "y", ".", "array", "(", "lines", "[", "ind", "\\u", "line", "\\u", "label", "[", "0", "]]", ".", "strip", "()", ".", "split", "('", ",'", ")[", "1", ":]", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "method", "s", "\\u", "name_", "._", "append_", "(_", "lines_", "[_", "ind", "\\u", "line", "\\u", "label_", "[_", "0_", "]_", "]_", "._", "strip_", "(_", ")_", "._", "replace_", "(_", "'", " ", "'_", ",_", "''_", ")_", "._", "split_", "(_", "','_", ")_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "extract", " ", "median_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ind", "\\u", "line", "\\u", "median_", "=_", "[_", "lines_", "._", "index_", "(_", "line", "\\u", "median_", ")_", "for_", "line", "\\u", "median_", "in_", "lines_", "if_", "\"", "median", "\"_", "in_", "line", "\\u", "median_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "ind", "\\u", "line", "\\u", "median_", ")_", "!=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "\"", "WARN", "ING", ":", " ", "number", " ", "of", " ", "lines", " ", "inclu", "ding", " ", "\\\\\"", "median", "\\\\\"", " ", "is", " ", "different", " ", "from", " ", "1", ".", " ", "Exi", "t", " ", "program", ".\"_", ",_", "'", "warn", "ing", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "sys", ".", "exit", "(", "1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "median_", "=_", "lines_", "[_", "ind", "\\u", "line", "\\u", "median_", "[_", "0_", "]_", "]_", "._", "strip_", "(_", ")_", "._", "split_", "(_", "','_", ")_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "result", "\\u", "array", "[", "i", "\\u", "file", ",", " ", "i", "\\u", "file", ",", " ", "0", "]", " ", "=", " ", "[", "float", "(", "m", ".", "split", "('", "('", ")[", "0", "])", " ", "for", " ", "m", " ", "in", " ", "median", "]_", "\\u\\u\\uNL\\u\\u\\u_", "median", "\\u", "results_", "[_", "i", "\\u", "file_", ",_", ":_", "]_", "=_", "numpy_", "._", "array_", "(_", "[_", "float_", "(_", "m_", "._", "split_", "(_", "'('_", ")_", "[_", "0_", "]_", ")_", "for_", "m_", "in_", "median_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "median", "\\u", "std_", "[_", "i", "\\u", "file_", ",_", ":_", "]_", "=_", "numpy_", "._", "array_", "(_", "[_", "float_", "(_", "m_", "._", "split_", "(_", "'('_", ")_", "[_", "1_", "]_", "[_", ":_", "-_", "1_", "]_", ")_", "for_", "m_", "in_", "median_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "extract", " ", "min_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ind", "\\u", "line", "\\u", "min_", "=_", "[_", "lines_", "._", "index_", "(_", "line", "\\u", "min_", ")_", "for_", "line", "\\u", "min_", "in_", "lines_", "if_", "\"", "min", ",\"_", "in_", "line", "\\u", "min_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "ind", "\\u", "line", "\\u", "min_", ")_", "!=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "\"", "WARN", "ING", ":", " ", "number", " ", "of", " ", "lines", " ", "inclu", "ding", " ", "\\\\\"", "min", "\\\\\"", " ", "is", " ", "different", " ", "from", " ", "1", ".", " ", "Exi", "t", " ", "program", ".\"_", ",_", "'", "warn", "ing", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "sys", ".", "exit", "(", "1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "min_", "=_", "lines_", "[_", "ind", "\\u", "line", "\\u", "min_", "[_", "0_", "]_", "]_", "._", "strip_", "(_", ")_", "._", "split_", "(_", "','_", ")_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "result", "\\u", "array", "[", "i", "\\u", "file", ",", " ", "i", "\\u", "file", ",", " ", "1", "]", " ", "=", " ", "[", "float", "(", "m", ".", "split", "('", "('", ")[", "0", "])", " ", "for", " ", "m", " ", "in", " ", "min", "]_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "results_", "[_", "i", "\\u", "file_", ",_", ":_", "]_", "=_", "numpy_", "._", "array_", "(_", "[_", "float_", "(_", "m_", "._", "split_", "(_", "'('_", ")_", "[_", "0_", "]_", ")_", "for_", "m_", "in_", "min_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "extract", " ", "max_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ind", "\\u", "line", "\\u", "max_", "=_", "[_", "lines_", "._", "index_", "(_", "line", "\\u", "max_", ")_", "for_", "line", "\\u", "max_", "in_", "lines_", "if_", "\"", "max", "\"_", "in_", "line", "\\u", "max_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "ind", "\\u", "line", "\\u", "max_", ")_", "!=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "\"", "WARN", "ING", ":", " ", "number", " ", "of", " ", "lines", " ", "inclu", "ding", " ", "\\\\\"", "max", "\\\\\"", " ", "is", " ", "different", " ", "from", " ", "1", ".", " ", "Exi", "t", " ", "program", ".\"_", ",_", "'", "warn", "ing", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "sys", ".", "exit", "(", "1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "max_", "=_", "lines_", "[_", "ind", "\\u", "line", "\\u", "max_", "[_", "0_", "]_", "]_", "._", "strip_", "(_", ")_", "._", "split_", "(_", "','_", ")_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "result", "\\u", "array", "[", "i", "\\u", "file", ",", " ", "i", "\\u", "file", ",", " ", "1", "]", " ", "=", " ", "[", "float", "(", "m", ".", "split", "('", "('", ")[", "0", "])", " ", "for", " ", "m", " ", "in", " ", "max", "]_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "results_", "[_", "i", "\\u", "file_", ",_", ":_", "]_", "=_", "numpy_", "._", "array_", "(_", "[_", "float_", "(_", "m_", "._", "split_", "(_", "'('_", ")_", "[_", "0_", "]_", ")_", "for_", "m_", "in_", "max_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "extract", " ", "error", " ", "for", " ", "each", " ", "label_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "error", "\\u", "per", "\\u", "label", "\\u", "for", "\\u", "file", "\\u", "i_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "std", "\\u", "per", "\\u", "label", "\\u", "for", "\\u", "file", "\\u", "i_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "labels", "\\u", "id", "\\u", "for", "\\u", "file", "\\u", "i_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Du", "e", " ", "to", " ", "2", " ", "different", " ", "kind", " ", "of", " ", "file", " ", "structure", ",", " ", "the", " ", "number", " ", "of", " ", "the", " ", "last", " ", "label", " ", "line", " ", "must", " ", "be", " ", "adapt", "ed_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "ind", "\\u", "line", "\\u", "median_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ind", "\\u", "line", "\\u", "median_", "=_", "[_", "len_", "(_", "lines_", ")_", "+_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i", "\\u", "line_", "in_", "range_", "(_", "ind", "\\u", "line", "\\u", "label_", "[_", "0_", "]_", "+_", "1_", ",_", "ind", "\\u", "line", "\\u", "median_", "[_", "0_", "]_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line", "\\u", "label", "\\u", "i_", "=_", "lines_", "[_", "i", "\\u", "line_", "]_", "._", "strip_", "(_", ")_", "._", "split_", "(_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "per", "\\u", "label", "\\u", "for", "\\u", "file", "\\u", "i_", "._", "append_", "(_", "[_", "float_", "(_", "error_", "._", "strip_", "(_", ")_", "._", "split_", "(_", "'('_", ")_", "[_", "0_", "]_", ")_", "for_", "error_", "in_", "line", "\\u", "label", "\\u", "i_", "[_", "1_", ":_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "std", "\\u", "per", "\\u", "label", "\\u", "for", "\\u", "file", "\\u", "i_", "._", "append_", "(_", "[_", "float_", "(_", "error_", "._", "strip_", "(_", ")_", "._", "split_", "(_", "'('_", ")_", "[_", "1_", "]_", "[_", ":_", "-_", "1_", "]_", ")_", "for_", "error_", "in_", "line", "\\u", "label", "\\u", "i_", "[_", "1_", ":_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "labels", "\\u", "id", "\\u", "for", "\\u", "file", "\\u", "i_", "._", "append_", "(_", "line", "\\u", "label", "\\u", "i_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "error", "\\u", "per", "\\u", "label_", "._", "append_", "(_", "error", "\\u", "per", "\\u", "label", "\\u", "for", "\\u", "file", "\\u", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "std", "\\u", "per", "\\u", "label_", "._", "append_", "(_", "std", "\\u", "per", "\\u", "label", "\\u", "for", "\\u", "file", "\\u", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "labels", "\\u", "id_", "._", "append_", "(_", "labels", "\\u", "id", "\\u", "for", "\\u", "file", "\\u", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "close", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "all", " ", "the", " ", "files", " ", "in", " ", "the", " ", "result", " ", "folder", " ", "wer", "e", " ", "generat", "ed", " ", "with", " ", "the", " ", "same", " ", "number", " ", "of", " ", "methods_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "all_", "(_", "x_", "==_", "method", "s", "\\u", "name_", "[_", "0_", "]_", "for_", "x_", "in_", "method", "s", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ERROR", ":", " ", "All", " ", "the", " ", "generat", "ed", " ", "files", " ", "in", " ", "folder", " ", "'_", "+_", "results", "\\u", "folder_", "+_", "'", " ", "have", " ", "not", " ", "bee", "n", " ", "generat", "ed", " ", "with", " ", "the", " ", "same", " ", "number", " ", "of", " ", "method", "s", ".", " ", "Exi", "t", " ", "program", ".'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "all", " ", "the", " ", "files", " ", "in", " ", "the", " ", "result", " ", "folder", " ", "wer", "e", " ", "generat", "ed", " ", "with", " ", "the", " ", "same", " ", "labels_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "all_", "(_", "x_", "==_", "labels", "\\u", "id_", "[_", "0_", "]_", "for_", "x_", "in_", "labels", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ERROR", ":", " ", "All", " ", "the", " ", "generat", "ed", " ", "files", " ", "in", " ", "folder", " ", "'_", "+_", "results", "\\u", "folder_", "+_", "'", " ", "have", " ", "not", " ", "bee", "n", " ", "generat", "ed", " ", "with", " ", "the", " ", "same", " ", "labels", ".", " ", "Exi", "t", " ", "program", ".'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "convert", " ", "the", " ", "list", " ", "\"", "error", "\\u", "per", "\\u", "label", "\"", " ", "int", "o", " ", "a", " ", "nump", "y", " ", "array", " ", "to", " ", "eas", "e", " ", "fur", "ther", " ", "manipulati", "ons_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "error", "\\u", "per", "\\u", "label_", "=_", "numpy_", "._", "array_", "(_", "error", "\\u", "per", "\\u", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "std", "\\u", "per", "\\u", "label_", "=_", "numpy_", "._", "array_", "(_", "std", "\\u", "per", "\\u", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "compute", " ", "different", " ", "stats_", "\\u\\u\\uNL\\u\\u\\u_", "abs", "\\u", "error", "\\u", "per", "\\u", "labels_", "=_", "numpy_", "._", "absolute_", "(_", "error", "\\u", "per", "\\u", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "abs", "\\u", "error", "\\u", "per", "\\u", "meth_", "=_", "numpy_", "._", "amax_", "(_", "abs", "\\u", "error", "\\u", "per", "\\u", "labels_", ",_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "min", "\\u", "abs", "\\u", "error", "\\u", "per", "\\u", "meth_", "=_", "numpy_", "._", "amin_", "(_", "abs", "\\u", "error", "\\u", "per", "\\u", "labels_", ",_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mean", "\\u", "abs", "\\u", "error", "\\u", "per", "\\u", "meth_", "=_", "numpy_", "._", "mean_", "(_", "abs", "\\u", "error", "\\u", "per", "\\u", "labels_", ",_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "std", "\\u", "abs", "\\u", "error", "\\u", "per", "\\u", "meth_", "=_", "numpy_", "._", "std_", "(_", "abs", "\\u", "error", "\\u", "per", "\\u", "labels_", ",_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "nb", "\\u", "method_", "=_", "len_", "(_", "method", "s", "\\u", "to", "\\u", "display_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'", "No", "ise", " ", "std", " ", "of", " ", "the", " ", "'_", "+_", "str_", "(_", "nb", "\\u", "results", "\\u", "file_", ")_", "+_", "'", " ", "generat", "ed", " ", "files", ":'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "snr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'-------", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "-------", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'", "Trac", "ts", " ", "std", " ", "of", " ", "the", " ", "'_", "+_", "str_", "(_", "nb", "\\u", "results", "\\u", "file_", ")_", "+_", "'", " ", "generat", "ed", " ", "files", ":'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "tracts", "\\u", "std_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'-------", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "-------", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'", "CS", "F", " ", "value", " ", "of", " ", "the", " ", "'_", "+_", "str_", "(_", "nb", "\\u", "results", "\\u", "file_", ")_", "+_", "'", " ", "generat", "ed", " ", "files", ":'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "cs", "f", "\\u", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'-------", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "-------", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'", "Meth", "ods", " ", "used", " ", "to", " ", "generat", "e", " ", "results", " ", "for", " ", "the", " ", "'_", "+_", "str_", "(_", "nb", "\\u", "results", "\\u", "file_", ")_", "+_", "'", " ", "generat", "ed", " ", "files", ":'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "method", "s", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'-------", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "-------", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Media", "n", " ", "obtain", "ed", " ", "with", " ", "each", " ", "method", " ", "(", "in", " ", "colon", "s", ")", " ", "for", " ", "the", " ", "'_", "+_", "str_", "(_", "nb", "\\u", "results", "\\u", "file_", ")_", "+_", "'", " ", "generat", "ed", " ", "files", " ", "(", "in", " ", "lines", "):'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "median", "\\u", "results_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'-------", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "-------", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'", "Mini", "mum", " ", "obtain", "ed", " ", "with", " ", "each", " ", "method", " ", "(", "in", " ", "colon", "s", ")", " ", "for", " ", "the", " ", "'_", "+_", "str_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "nb", "\\u", "results", "\\u", "file_", ")_", "+_", "'", " ", "generat", "ed", " ", "files", " ", "(", "in", " ", "lines", "):'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "min", "\\u", "results_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'-------", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "-------", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'", "Maxim", "um", " ", "obtain", "ed", " ", "with", " ", "each", " ", "method", " ", "(", "in", " ", "colon", "s", ")", " ", "for", " ", "the", " ", "'_", "+_", "str_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "nb", "\\u", "results", "\\u", "file_", ")_", "+_", "'", " ", "generat", "ed", " ", "files", " ", "(", "in", " ", "lines", "):'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "max", "\\u", "results_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'-------", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "-------", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'", "Label", "s", "\\\\'", " ", "ID", " ", "(", "in", " ", "colon", "s", ")", " ", "for", " ", "the", " ", "'_", "+_", "str_", "(_", "nb", "\\u", "results", "\\u", "file_", ")_", "+_", "'", " ", "generat", "ed", " ", "files", " ", "(", "in", " ", "lines", "):'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "labels", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'-------", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "-------", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Error", "s", " ", "obtain", "ed", " ", "with", " ", "each", " ", "method", " ", "(", "in", " ", "colon", "s", ")", " ", "for", " ", "the", " ", "'_", "+_", "str_", "(_", "nb", "\\u", "results", "\\u", "file_", ")_", "+_", "'", " ", "generat", "ed", " ", "files", " ", "(", "in", " ", "lines", "):'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "error", "\\u", "per", "\\u", "label_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "***********", "***********", "***********", "***********", "***", " ", "START", " ", "PLOT", "TIN", "G", " ", "HER", "E", " ", "***********", "***********", "***********", "***********", "**_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ind", "\\u", "files", "\\u", "cs", "f", "\\u", "sort_", "=_", "numpy_", "._", "argsort_", "(_", "cs", "f", "\\u", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "matplotlib_", "._", "rc", "Params_", "._", "update_", "(_", "{_", "'", "font", ".", "size", "'_", ":_", "45_", ",_", "'", "font", ".", "famil", "y", "'_", ":_", "'", "tre", "bu", "che", "t", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "rc", "Params_", "[_", "'", "xtick", ".", "major", ".", "pad", "'_", "]_", "=_", "'", "9", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "rc", "Params_", "[_", "'", "ytick", ".", "major", ".", "pad", "'_", "]_", "=_", "'", "15", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "figure_", "(_", "figsize_", "=_", "(_", "30_", ",_", "16_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "width_", "=_", "1.0_", "/_", "(_", "nb", "\\u", "method_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ind", "\\u", "fig_", "=_", "numpy_", "._", "arange_", "(_", "len_", "(_", "ind", "\\u", "files", "\\u", "cs", "f", "\\u", "sort_", ")_", ")_", "*_", "(_", "1.0_", "+_", "width_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylabel_", "(_", "'", "Abs", "olute", " ", "error", " ", "(%", ")\\\\", "n", "'_", ",_", "fontsize_", "=_", "55_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xlabel_", "(_", "'", "CS", "F", " ", "values", " ", "(%", " ", "of", " ", "true", " ", "WM", " ", "value", ")'_", ",_", "fontsize_", "=_", "55_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "title_", "(_", "'", "Abs", "olute", " ", "error", " ", "within", " ", "all", " ", "tracts", " ", "as", " ", "a", " ", "function", " ", "of", " ", "CS", "F", " ", "values", "\\\\", "n", "'_", ",_", "fontsize_", "=_", "65_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "colors", " ", "=", " ", "plt", ".", "get", "\\u", "cmap", "('", "jet", "')", "(", "np", ".", "lins", "pace", "(", "0", ",", " ", "1.0", ",", " ", "nb", "\\u", "method", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "colors_", "=_", "[_", "'", "b", "'_", ",_", "'", "g", "'_", ",_", "'", "r", "'_", ",_", "'", "c", "'_", ",_", "'", "m", "'_", ",_", "'", "y", "'_", ",_", "'", "k", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "box", "\\u", "plots_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "meth_", ",_", "color_", "in_", "zip_", "(_", "method", "s", "\\u", "to", "\\u", "display_", ",_", "colors_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i", "\\u", "meth_", "=_", "method", "s", "\\u", "name_", "[_", "0_", "]_", "._", "index_", "(_", "meth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i", "\\u", "meth", "\\u", "to", "\\u", "display_", "=_", "method", "s", "\\u", "to", "\\u", "display_", "._", "index_", "(_", "meth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "box", "props_", "=_", "dict_", "(_", "linewidth_", "=_", "4_", ",_", "color_", "=_", "color_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fli", "erp", "rop", "s_", "=_", "dict_", "(_", "color_", "=_", "color_", ",_", "marker", "edge", "width_", "=_", "0.7_", ",_", "markersize_", "=_", "15_", ",_", "marker_", "=_", "'.'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "whis", "ker", "props_", "=_", "dict_", "(_", "color_", "=_", "color_", ",_", "linewidth_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cap", "props_", "=_", "dict_", "(_", "color_", "=_", "color_", ",_", "linewidth_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "median", "props_", "=_", "dict_", "(_", "linewidth_", "=_", "4_", ",_", "color_", "=_", "color_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mean", "point", "props_", "=_", "dict_", "(_", "marker_", "=_", "'", "D", "'_", ",_", "marker", "edgecolor_", "=_", "'", "black", "'_", ",_", "marker", "facecolor_", "=_", "'", "fire", "brick", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mean", "line", "props_", "=_", "dict_", "(_", "linestyle_", "=_", "'--'_", ",_", "linewidth_", "=_", "2.5_", ",_", "color_", "=_", "'", "pur", "ple", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plot", "\\u", "i_", "=_", "plt_", "._", "box", "plot_", "(_", "numpy_", "._", "transpose_", "(_", "abs", "\\u", "error", "\\u", "per", "\\u", "labels_", "[_", "ind", "\\u", "files", "\\u", "cs", "f", "\\u", "sort_", ",_", ":_", ",_", "i", "\\u", "meth_", "]_", ")_", ",_", "positions_", "=_", "ind", "\\u", "fig_", "+_", "i", "\\u", "meth", "\\u", "to", "\\u", "display_", "*_", "width_", "+_", "(_", "float_", "(_", "i", "\\u", "meth", "\\u", "to", "\\u", "display_", ")_", "*_", "width_", ")_", "/_", "(_", "nb", "\\u", "method_", "+_", "1_", ")_", ",_", "widths_", "=_", "width_", ",_", "box", "props_", "=_", "box", "props_", ",_", "median", "props_", "=_", "median", "props_", ",_", "fli", "erp", "rop", "s_", "=_", "fli", "erp", "rop", "s_", ",_", "whis", "ker", "props_", "=_", "whis", "ker", "props_", ",_", "cap", "props_", "=_", "cap", "props_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "plt", ".", "error", "bar", "(", "ind", "\\u", "fig", "2", "+", "i", "\\u", "meth", "*", "widt", "h", "+", "widt", "h", "/", "2", "+(", "float", "(", "i", "\\u", "meth", ")*", "widt", "h", ")/(", "nb", "\\u", "method", "+", "1", "),", " ", "mean", "\\u", "abs", "\\u", "error", "\\u", "per", "\\u", "meth", "[", "ind", "\\u", "snr", "\\u", "sort", "\\u", "tracts", "\\u", "std", "\\u", "10", ",", " ", "i", "\\u", "meth", "],", " ", "std", "\\u", "abs", "\\u", "error", "\\u", "per", "\\u", "meth", "[", "ind", "\\u", "snr", "\\u", "sort", "\\u", "tracts", "\\u", "std", "\\u", "10", ",", " ", "i", "\\u", "meth", "],", " ", "color", "=", "color", ",", " ", "marker", "='", "\\u", "',", " ", "linestyle", "='", "Non", "e", "',", " ", "marker", "size", "=", "200", "*", "widt", "h", ",", " ", "marker", "edge", "widt", "h", "=", "3", ")_", "\\u\\u\\uNL\\u\\u\\u_", "box", "\\u", "plots_", "._", "append_", "(_", "plot", "\\u", "i_", "[_", "'", "box", "es", "'_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "alternat", "ed", " ", "vertical", " ", "background", " ", "colore", "d", " ", "bars_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i", "\\u", "xtick", "_", "in_", "range_", "(_", "0_", ",_", "len_", "(_", "ind", "\\u", "fig_", ")_", ",_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plt_", "._", "ax", "vsp", "an_", "(_", "ind", "\\u", "fig_", "[_", "i", "\\u", "xtick", "_", "]_", "-_", "width_", "-_", "width_", "/_", "4_", ",_", "ind", "\\u", "fig_", "[_", "i", "\\u", "xtick", "_", "]_", "+_", "(_", "nb", "\\u", "method_", "+_", "1_", ")_", "*_", "width_", "-_", "width_", "/_", "4_", ",_", "facecolor_", "=_", "'", "grey", "'_", ",_", "alpha_", "=_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "plt", ".", "legend", "(", "box", "\\u", "plots", ",", " ", "method", "s", "\\u", "to", "\\u", "display", ",", " ", "bbox", "\\u", "to", "\\u", "anchor", "=(", "1.01", ",", " ", "1", "),", " ", "loc", "=", "2", ",", " ", "border", "axes", "pad", "=", "0.", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "plt", ".", "legend", "(", "box", "\\u", "plots", ",", " ", "method", "s", "\\u", "to", "\\u", "display", ",", " ", "loc", "='", "best", "',", " ", "font", "size", "=", "2", "2", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "convert", " ", "xtick", " ", "labels", " ", "int", "o", " ", "integers_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "xtick", "\\u", "labels_", "=_", "[_", "int_", "(_", "xtick", "_", ")_", "for_", "xtick", "_", "in_", "cs", "f", "\\u", "values_", "[_", "ind", "\\u", "files", "\\u", "cs", "f", "\\u", "sort_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xticks_", "(_", "ind", "\\u", "fig_", "+_", "(_", "numpy_", "._", "floor_", "(_", "nb", "\\u", "method_", "/_", "2_", ")_", ")_", "*_", "width_", "*_", "(_", "1.0_", "+_", "1.0_", "/_", "(_", "nb", "\\u", "method_", "+_", "1_", ")_", ")_", ",_", "xtick", "\\u", "labels_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "gca_", "(_", ")_", "._", "set\\u", "xlim_", "(_", "[_", "-_", "width_", ",_", "numpy_", "._", "max_", "(_", "ind", "\\u", "fig_", ")_", "+_", "(_", "nb", "\\u", "method_", "+_", "0.5_", ")_", "*_", "width_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "gca_", "(_", ")_", "._", "set\\u", "ylim_", "(_", "[_", "0_", ",_", "18_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "gca_", "(_", ")_", "._", "yaxis_", "._", "set\\u", "major", "\\u", "locator_", "(_", "plt_", "._", "Multipl", "e", "Locator_", "(_", "2.0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "gca_", "(_", ")_", "._", "yaxis_", "._", "set\\u", "mino", "r", "\\u", "locator_", "(_", "plt_", "._", "Multipl", "e", "Locator_", "(_", "0.5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "grid_", "(_", "b_", "=_", "True_", ",_", "axis_", "=_", "'", "y", "'_", ",_", "which_", "=_", "'", "bot", "h", "'_", ",_", "alpha_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "subplot", "s", "\\u", "adjust_", "(_", "left_", "=_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "savefig_", "(_", "param", "\\u", "default_", "._", "fname", "\\u", "folder", "\\u", "to", "\\u", "save", "\\u", "fig_", "+_", "'/", "abs", "olute", "\\u", "error", "\\u", "vs", "\\u", "cs", "f", "\\u", "values", ".", "pdf", "'_", ",_", "format_", "=_", "'", "PD", "F", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "show_", "(_", "block_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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 ]
Imprecise assert
rcbops/glance-buildpackage/glance/tests/functional/test_cache_middleware.py
[ { "content": " def verify_no_images(self):\n path = \"http://%s:%d/v1/images\" % (\"0.0.0.0\", self.api_port)\n http = httplib2.Http()\n response, content = http.request(path, 'GET')\n self.assertEqual(response.status, 200)\n data = json.loads(content)\n self.assertTrue('images' in data)\n self.assertEqual(0, len(data['images']))", "metadata": "root.BaseCacheManageMiddlewareTest.verify_no_images", "header": "['class', 'BaseCacheManageMiddlewareTest', '(', 'object', ')', ':', '___EOS___']", "index": 213 }, { "content": " def verify_no_cached_images(self):\n \"\"\"\n Verify no images in the image cache\n \"\"\"\n path = \"http://%s:%d/v1/cached_images\" % (\"0.0.0.0\", self.api_port)\n http = httplib2.Http()\n response, content = http.request(path, 'GET')\n self.assertEqual(response.status, 200)\n\n data = json.loads(content)\n self.assertTrue('cached_images' in data)\n self.assertEqual(data['cached_images'], [])", "metadata": "root.BaseCacheManageMiddlewareTest.verify_no_cached_images", "header": "['class', 'BaseCacheManageMiddlewareTest', '(', 'object', ')', ':', '___EOS___']", "index": 244 }, { "content": " @skip_if_disabled\n def test_cache_manage_get_cached_images(self):\n \"\"\"\n Tests that cached images are queryable\n \"\"\"\n self.cleanup()\n self.start_servers(**self.__dict__.copy())\n\n api_port = self.api_port\n registry_port = self.registry_port\n\n self.verify_no_images()\n\n image_id = self.add_image(\"Image1\")\n\n # Verify image does not yet show up in cache (we haven't \"hit\"\n # it yet using a GET /images/1 ...\n self.verify_no_cached_images()\n\n # Grab the image\n path = \"http://%s:%d/v1/images/%s\" % (\"0.0.0.0\", self.api_port,\n image_id)\n http = httplib2.Http()\n response, content = http.request(path, 'GET')\n self.assertEqual(response.status, 200)\n\n # Verify image now in cache\n path = \"http://%s:%d/v1/cached_images\" % (\"0.0.0.0\", self.api_port)\n http = httplib2.Http()\n response, content = http.request(path, 'GET')\n self.assertEqual(response.status, 200)\n\n data = json.loads(content)\n self.assertTrue('cached_images' in data)\n\n cached_images = data['cached_images']\n self.assertEqual(1, len(cached_images))\n self.assertEqual(image_id, cached_images[0]['image_id'])\n self.assertEqual(0, cached_images[0]['hits'])\n\n # Hit the image\n path = \"http://%s:%d/v1/images/%s\" % (\"0.0.0.0\", self.api_port,\n image_id)\n http = httplib2.Http()\n response, content = http.request(path, 'GET')\n self.assertEqual(response.status, 200)\n\n # Verify image hits increased in output of manage GET\n path = \"http://%s:%d/v1/cached_images\" % (\"0.0.0.0\", self.api_port)\n http = httplib2.Http()\n response, content = http.request(path, 'GET')\n self.assertEqual(response.status, 200)\n\n data = json.loads(content)\n self.assertTrue('cached_images' in data)\n\n cached_images = data['cached_images']\n self.assertEqual(1, len(cached_images))\n self.assertEqual(image_id, cached_images[0]['image_id'])\n self.assertEqual(1, cached_images[0]['hits'])\n\n self.stop_servers()", "metadata": "root.BaseCacheManageMiddlewareTest.test_cache_manage_get_cached_images", "header": "['class', 'BaseCacheManageMiddlewareTest', '(', 'object', ')', ':', '___EOS___']", "index": 257 }, { "content": " @skip_if_disabled\n def test_cache_manage_delete_cached_images(self):\n \"\"\"\n Tests that cached images may be deleted\n \"\"\"\n self.cleanup()\n self.start_servers(**self.__dict__.copy())\n\n api_port = self.api_port\n registry_port = self.registry_port\n\n self.verify_no_images()\n\n ids = {}\n\n # Add a bunch of images...\n for x in xrange(0, 4):\n ids[x] = self.add_image(\"Image%s\" % str(x))\n\n # Verify no images in cached_images because no image has been hit\n # yet using a GET /images/<IMAGE_ID> ...\n self.verify_no_cached_images()\n\n # Grab the images, essentially caching them...\n for x in xrange(0, 4):\n path = \"http://%s:%d/v1/images/%s\" % (\"0.0.0.0\", self.api_port,\n ids[x])\n http = httplib2.Http()\n response, content = http.request(path, 'GET')\n self.assertEqual(response.status, 200,\n \"Failed to find image %s\" % ids[x])\n\n # Verify images now in cache\n path = \"http://%s:%d/v1/cached_images\" % (\"0.0.0.0\", self.api_port)\n http = httplib2.Http()\n response, content = http.request(path, 'GET')\n self.assertEqual(response.status, 200)\n\n data = json.loads(content)\n self.assertTrue('cached_images' in data)\n\n cached_images = data['cached_images']\n self.assertEqual(4, len(cached_images))\n\n for x in xrange(4, 0): # Cached images returned last modified order\n self.assertEqual(ids[x], cached_images[x]['image_id'])\n self.assertEqual(0, cached_images[x]['hits'])\n\n # Delete third image of the cached images and verify no longer in cache\n path = \"http://%s:%d/v1/cached_images/%s\" % (\"0.0.0.0\", self.api_port,\n ids[2])\n http = httplib2.Http()\n response, content = http.request(path, 'DELETE')\n self.assertEqual(response.status, 200)\n\n path = \"http://%s:%d/v1/cached_images\" % (\"0.0.0.0\", self.api_port)\n http = httplib2.Http()\n response, content = http.request(path, 'GET')\n self.assertEqual(response.status, 200)\n\n data = json.loads(content)\n self.assertTrue('cached_images' in data)\n\n cached_images = data['cached_images']\n self.assertEqual(3, len(cached_images))\n self.assertTrue(ids[2] not in [x['image_id'] for x in cached_images])\n\n # Delete all cached images and verify nothing in cache\n path = \"http://%s:%d/v1/cached_images\" % (\"0.0.0.0\", self.api_port)\n http = httplib2.Http()\n response, content = http.request(path, 'DELETE')\n self.assertEqual(response.status, 200)\n\n path = \"http://%s:%d/v1/cached_images\" % (\"0.0.0.0\", self.api_port)\n http = httplib2.Http()\n response, content = http.request(path, 'GET')\n self.assertEqual(response.status, 200)\n\n data = json.loads(content)\n self.assertTrue('cached_images' in data)\n\n cached_images = data['cached_images']\n self.assertEqual(0, len(cached_images))\n\n self.stop_servers()", "metadata": "root.BaseCacheManageMiddlewareTest.test_cache_manage_delete_cached_images", "header": "['class', 'BaseCacheManageMiddlewareTest', '(', 'object', ')', ':', '___EOS___']", "index": 320 }, { "content": " @skip_if_disabled\n def test_queue_and_prefetch(self):\n \"\"\"\n Tests that images may be queued and prefetched\n \"\"\"\n self.cleanup()\n self.start_servers(**self.__dict__.copy())\n\n api_port = self.api_port\n registry_port = self.registry_port\n\n cache_config_filepath = os.path.join(self.test_dir, 'etc',\n 'glance-cache.conf')\n cache_file_options = {\n 'image_cache_dir': self.api_server.image_cache_dir,\n 'image_cache_driver': self.image_cache_driver,\n 'registry_port': self.api_server.registry_port,\n 'log_file': os.path.join(self.test_dir, 'cache.log'),\n 'metadata_encryption_key': \"012345678901234567890123456789ab\"\n }\n with open(cache_config_filepath, 'w') as cache_file:\n cache_file.write(\"\"\"[DEFAULT]\ndebug = True\nverbose = True\nimage_cache_dir = %(image_cache_dir)s\nimage_cache_driver = %(image_cache_driver)s\nregistry_host = 0.0.0.0\nregistry_port = %(registry_port)s\nmetadata_encryption_key = %(metadata_encryption_key)s\nlog_file = %(log_file)s\n\"\"\" % cache_file_options)\n\n with open(cache_config_filepath.replace(\".conf\", \"-paste.ini\"),\n 'w') as paste_file:\n paste_file.write(\"\"\"[app:glance-pruner]\npaste.app_factory = glance.common.wsgi:app_factory\nglance.app_factory = glance.image_cache.pruner:Pruner\n\n[app:glance-prefetcher]\npaste.app_factory = glance.common.wsgi:app_factory\nglance.app_factory = glance.image_cache.prefetcher:Prefetcher\n\n[app:glance-cleaner]\npaste.app_factory = glance.common.wsgi:app_factory\nglance.app_factory = glance.image_cache.cleaner:Cleaner\n\n[app:glance-queue-image]\npaste.app_factory = glance.common.wsgi:app_factory\nglance.app_factory = glance.image_cache.queue_image:Queuer\n\"\"\")\n\n self.verify_no_images()\n\n ids = {}\n\n # Add a bunch of images...\n for x in xrange(0, 4):\n ids[x] = self.add_image(\"Image%s\" % str(x))\n\n # Queue the first image, verify no images still in cache after queueing\n # then run the prefetcher and verify that the image is then in the\n # cache\n path = \"http://%s:%d/v1/queued_images/%s\" % (\"0.0.0.0\", self.api_port,\n ids[0])\n http = httplib2.Http()\n response, content = http.request(path, 'PUT')\n self.assertEqual(response.status, 200)\n\n self.verify_no_cached_images()\n\n cmd = \"bin/glance-cache-prefetcher --config-file %s\" % \\\n cache_config_filepath\n\n exitcode, out, err = execute(cmd)\n\n self.assertEqual(0, exitcode)\n self.assertEqual('', out.strip(), out)\n\n # Verify first image now in cache\n path = \"http://%s:%d/v1/cached_images\" % (\"0.0.0.0\", self.api_port)\n http = httplib2.Http()\n response, content = http.request(path, 'GET')\n self.assertEqual(response.status, 200)\n\n data = json.loads(content)\n self.assertTrue('cached_images' in data)\n\n cached_images = data['cached_images']\n self.assertEqual(1, len(cached_images))\n self.assertTrue(ids[0] in [r['image_id']\n for r in data['cached_images']])\n\n self.stop_servers()", "metadata": "root.BaseCacheManageMiddlewareTest.test_queue_and_prefetch", "header": "['class', 'BaseCacheManageMiddlewareTest', '(', 'object', ')', ':', '___EOS___']", "index": 406 } ]
[ { "span": "self.assertTrue('images' in data)", "start_line": 219, "start_column": 8, "end_line": 219, "end_column": 41 }, { "span": "self.assertTrue('cached_images' in data)", "start_line": 254, "start_column": 8, "end_line": 254, "end_column": 48 }, { "span": "self.assertTrue('cached_images' in data)", "start_line": 290, "start_column": 8, "end_line": 290, "end_column": 48 }, { "span": "self.assertTrue('cached_images' in data)", "start_line": 311, "start_column": 8, "end_line": 311, "end_column": 48 }, { "span": "self.assertTrue('cached_images' in data)", "start_line": 359, "start_column": 8, "end_line": 359, "end_column": 48 }, { "span": "self.assertTrue('cached_images' in data)", "start_line": 381, "start_column": 8, "end_line": 381, "end_column": 48 }, { "span": "self.assertTrue(ids[2] not in [x['image_id'] for x in cached_images])", "start_line": 385, "start_column": 8, "end_line": 385, "end_column": 77 }, { "span": "self.assertTrue('cached_images' in data)", "start_line": 399, "start_column": 8, "end_line": 399, "end_column": 48 }, { "span": "self.assertTrue('cached_images' in data)", "start_line": 491, "start_column": 8, "end_line": 491, "end_column": 48 }, { "span": "self.assertTrue(ids[0] in [r['image_id']\n for r in data['cached_images']])", "start_line": 495, "start_column": 8, "end_line": 496, "end_column": 56 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Base", "Cache", "Manage", "Mid", "dle", "ware", "Test_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "verify", "\\u", "no", "\\u", "images_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", "=_", "\"", "http", "://", "%", "s", ":", "%", "d", "/", "v1", "/", "images", "\"_", "%_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "self_", "._", "api", "\\u", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http_", "=_", "httplib2_", "._", "Http_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", ",_", "content_", "=_", "http_", "._", "request_", "(_", "path_", ",_", "'", "GET", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "json_", "._", "loads_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "images", "'_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0_", ",_", "len_", "(_", "data_", "[_", "'", "images", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cache", "Manage", "Mid", "dle", "ware", "Test_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "verify", "\\u", "no", "\\u", "cache", "d\\u", "images_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Verify", " ", "no", " ", "images", " ", "in", " ", "the", " ", "image", " ", "cache", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "\"", "http", "://", "%", "s", ":", "%", "d", "/", "v1", "/", "cache", "d\\u", "images", "\"_", "%_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "self_", "._", "api", "\\u", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http_", "=_", "httplib2_", "._", "Http_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", ",_", "content_", "=_", "http_", "._", "request_", "(_", "path_", ",_", "'", "GET", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "json_", "._", "loads_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "cache", "d\\u", "images", "'_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "data_", "[_", "'", "cache", "d\\u", "images", "'_", "]_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cache", "Manage", "Mid", "dle", "ware", "Test_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "skip", "\\u", "if", "\\u", "disabled_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "cache", "\\u", "manage", "\\u", "get", "\\u", "cache", "d\\u", "images_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", "s", " ", "tha", "t", " ", "cache", "d", " ", "images", " ", "are", " ", "query", "able", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cleanup_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "start", "\\u", "servers_", "(_", "**_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "copy_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "api", "\\u", "port_", "=_", "self_", "._", "api", "\\u", "port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "registr", "y", "\\u", "port_", "=_", "self_", "._", "registr", "y", "\\u", "port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "verify", "\\u", "no", "\\u", "images_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "id_", "=_", "self_", "._", "add", "\\u", "image_", "(_", "\"", "Image", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Verify", " ", "image", " ", "doe", "s", " ", "not", " ", "ye", "t", " ", "show", " ", "up", " ", "in", " ", "cache", " ", "(", "we", " ", "have", "n", "'", "t", " ", "\"", "hit", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", " ", "ye", "t", " ", "usi", "ng", " ", "a", " ", "GET", " ", "/", "images", "/", "1", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "verify", "\\u", "no", "\\u", "cache", "d\\u", "images_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Grab", " ", "the", " ", "image_", "\\u\\u\\uNL\\u\\u\\u_", "path_", "=_", "\"", "http", "://", "%", "s", ":", "%", "d", "/", "v1", "/", "images", "/", "%", "s", "\"_", "%_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "self_", "._", "api", "\\u", "port_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http_", "=_", "httplib2_", "._", "Http_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", ",_", "content_", "=_", "http_", "._", "request_", "(_", "path_", ",_", "'", "GET", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Verify", " ", "image", " ", "now", " ", "in", " ", "cache_", "\\u\\u\\uNL\\u\\u\\u_", "path_", "=_", "\"", "http", "://", "%", "s", ":", "%", "d", "/", "v1", "/", "cache", "d\\u", "images", "\"_", "%_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "self_", "._", "api", "\\u", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http_", "=_", "httplib2_", "._", "Http_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", ",_", "content_", "=_", "http_", "._", "request_", "(_", "path_", ",_", "'", "GET", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "json_", "._", "loads_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "cache", "d\\u", "images", "'_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cache", "d\\u", "images_", "=_", "data_", "[_", "'", "cache", "d\\u", "images", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "len_", "(_", "cache", "d\\u", "images_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "image", "\\u", "id_", ",_", "cache", "d\\u", "images_", "[_", "0_", "]_", "[_", "'", "image", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0_", ",_", "cache", "d\\u", "images_", "[_", "0_", "]_", "[_", "'", "hits", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Hit", " ", "the", " ", "image_", "\\u\\u\\uNL\\u\\u\\u_", "path_", "=_", "\"", "http", "://", "%", "s", ":", "%", "d", "/", "v1", "/", "images", "/", "%", "s", "\"_", "%_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "self_", "._", "api", "\\u", "port_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http_", "=_", "httplib2_", "._", "Http_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", ",_", "content_", "=_", "http_", "._", "request_", "(_", "path_", ",_", "'", "GET", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Verify", " ", "image", " ", "hits", " ", "increase", "d", " ", "in", " ", "output", " ", "of", " ", "manage", " ", "GET_", "\\u\\u\\uNL\\u\\u\\u_", "path_", "=_", "\"", "http", "://", "%", "s", ":", "%", "d", "/", "v1", "/", "cache", "d\\u", "images", "\"_", "%_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "self_", "._", "api", "\\u", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http_", "=_", "httplib2_", "._", "Http_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", ",_", "content_", "=_", "http_", "._", "request_", "(_", "path_", ",_", "'", "GET", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "json_", "._", "loads_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "cache", "d\\u", "images", "'_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cache", "d\\u", "images_", "=_", "data_", "[_", "'", "cache", "d\\u", "images", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "len_", "(_", "cache", "d\\u", "images_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "image", "\\u", "id_", ",_", "cache", "d\\u", "images_", "[_", "0_", "]_", "[_", "'", "image", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "cache", "d\\u", "images_", "[_", "0_", "]_", "[_", "'", "hits", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "stop", "\\u", "servers_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cache", "Manage", "Mid", "dle", "ware", "Test_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "skip", "\\u", "if", "\\u", "disabled_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "cache", "\\u", "manage", "\\u", "delete", "\\u", "cache", "d\\u", "images_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", "s", " ", "tha", "t", " ", "cache", "d", " ", "images", " ", "may", " ", "be", " ", "delete", "d", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cleanup_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "start", "\\u", "servers_", "(_", "**_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "copy_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "api", "\\u", "port_", "=_", "self_", "._", "api", "\\u", "port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "registr", "y", "\\u", "port_", "=_", "self_", "._", "registr", "y", "\\u", "port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "verify", "\\u", "no", "\\u", "images_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ids_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "a", " ", "bunch", " ", "of", " ", "images", "..._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "xrange_", "(_", "0_", ",_", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ids_", "[_", "x_", "]_", "=_", "self_", "._", "add", "\\u", "image_", "(_", "\"", "Image", "%", "s", "\"_", "%_", "str_", "(_", "x_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Verify", " ", "no", " ", "images", " ", "in", " ", "cache", "d\\u", "images", " ", "bec", "aus", "e", " ", "no", " ", "image", " ", "has", " ", "bee", "n", " ", "hit_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ye", "t", " ", "usi", "ng", " ", "a", " ", "GET", " ", "/", "images", "/", "<", "IMA", "GE", "\\u", "ID", ">", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "verify", "\\u", "no", "\\u", "cache", "d\\u", "images_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Grab", " ", "the", " ", "images", ",", " ", "essential", "ly", " ", "caching", " ", "them", "..._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "xrange_", "(_", "0_", ",_", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", "=_", "\"", "http", "://", "%", "s", ":", "%", "d", "/", "v1", "/", "images", "/", "%", "s", "\"_", "%_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "self_", "._", "api", "\\u", "port_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ids_", "[_", "x_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http_", "=_", "httplib2_", "._", "Http_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", ",_", "content_", "=_", "http_", "._", "request_", "(_", "path_", ",_", "'", "GET", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status_", ",_", "200_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Fail", "ed", " ", "to", " ", "find", " ", "image", " ", "%", "s", "\"_", "%_", "ids_", "[_", "x_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Verify", " ", "images", " ", "now", " ", "in", " ", "cache_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "path_", "=_", "\"", "http", "://", "%", "s", ":", "%", "d", "/", "v1", "/", "cache", "d\\u", "images", "\"_", "%_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "self_", "._", "api", "\\u", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http_", "=_", "httplib2_", "._", "Http_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", ",_", "content_", "=_", "http_", "._", "request_", "(_", "path_", ",_", "'", "GET", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "json_", "._", "loads_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "cache", "d\\u", "images", "'_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cache", "d\\u", "images_", "=_", "data_", "[_", "'", "cache", "d\\u", "images", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "4_", ",_", "len_", "(_", "cache", "d\\u", "images_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "xrange_", "(_", "4_", ",_", "0_", ")_", ":_", "#", " ", "Cache", "d", " ", "images", " ", "return", "ed", " ", "last", " ", "modifi", "ed", " ", "order_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "ids_", "[_", "x_", "]_", ",_", "cache", "d\\u", "images_", "[_", "x_", "]_", "[_", "'", "image", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0_", ",_", "cache", "d\\u", "images_", "[_", "x_", "]_", "[_", "'", "hits", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Delete", " ", "third", " ", "image", " ", "of", " ", "the", " ", "cache", "d", " ", "images", " ", "and", " ", "verify", " ", "no", " ", "long", "er", " ", "in", " ", "cache_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "path_", "=_", "\"", "http", "://", "%", "s", ":", "%", "d", "/", "v1", "/", "cache", "d\\u", "images", "/", "%", "s", "\"_", "%_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "self_", "._", "api", "\\u", "port_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ids_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http_", "=_", "httplib2_", "._", "Http_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", ",_", "content_", "=_", "http_", "._", "request_", "(_", "path_", ",_", "'", "DELET", "E", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "path_", "=_", "\"", "http", "://", "%", "s", ":", "%", "d", "/", "v1", "/", "cache", "d\\u", "images", "\"_", "%_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "self_", "._", "api", "\\u", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http_", "=_", "httplib2_", "._", "Http_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", ",_", "content_", "=_", "http_", "._", "request_", "(_", "path_", ",_", "'", "GET", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "json_", "._", "loads_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "cache", "d\\u", "images", "'_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cache", "d\\u", "images_", "=_", "data_", "[_", "'", "cache", "d\\u", "images", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "3_", ",_", "len_", "(_", "cache", "d\\u", "images_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ids_", "[_", "2_", "]_", "not_", "in_", "[_", "x_", "[_", "'", "image", "\\u", "id", "'_", "]_", "for_", "x_", "in_", "cache", "d\\u", "images_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Delete", " ", "all", " ", "cache", "d", " ", "images", " ", "and", " ", "verify", " ", "not", "hing", " ", "in", " ", "cache_", "\\u\\u\\uNL\\u\\u\\u_", "path_", "=_", "\"", "http", "://", "%", "s", ":", "%", "d", "/", "v1", "/", "cache", "d\\u", "images", "\"_", "%_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "self_", "._", "api", "\\u", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http_", "=_", "httplib2_", "._", "Http_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", ",_", "content_", "=_", "http_", "._", "request_", "(_", "path_", ",_", "'", "DELET", "E", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "path_", "=_", "\"", "http", "://", "%", "s", ":", "%", "d", "/", "v1", "/", "cache", "d\\u", "images", "\"_", "%_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "self_", "._", "api", "\\u", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http_", "=_", "httplib2_", "._", "Http_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", ",_", "content_", "=_", "http_", "._", "request_", "(_", "path_", ",_", "'", "GET", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "json_", "._", "loads_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "cache", "d\\u", "images", "'_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cache", "d\\u", "images_", "=_", "data_", "[_", "'", "cache", "d\\u", "images", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0_", ",_", "len_", "(_", "cache", "d\\u", "images_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "stop", "\\u", "servers_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cache", "Manage", "Mid", "dle", "ware", "Test_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "skip", "\\u", "if", "\\u", "disabled_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "queue", "\\u", "and", "\\u", "prefetch", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", "s", " ", "tha", "t", " ", "images", " ", "may", " ", "be", " ", "queue", "d", " ", "and", " ", "prefetch", "ed", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cleanup_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "start", "\\u", "servers_", "(_", "**_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "copy_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "api", "\\u", "port_", "=_", "self_", "._", "api", "\\u", "port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "registr", "y", "\\u", "port_", "=_", "self_", "._", "registr", "y", "\\u", "port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cache", "\\u", "config", "\\u", "filepath_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "test\\u", "dir_", ",_", "'", "etc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gla", "nce", "-", "cache", ".", "conf", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache", "\\u", "file", "\\u", "options_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "\\u", "cache", "\\u", "dir", "'_", ":_", "self_", "._", "api", "\\u", "server_", "._", "image", "\\u", "cache", "\\u", "dir_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "\\u", "cache", "\\u", "driver", "'_", ":_", "self_", "._", "image", "\\u", "cache", "\\u", "driver_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "registr", "y", "\\u", "port", "'_", ":_", "self_", "._", "api", "\\u", "server_", "._", "registr", "y", "\\u", "port_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "log", "\\u", "file", "'_", ":_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "test\\u", "dir_", ",_", "'", "cache", ".", "log", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "metadata", "\\u", "encrypt", "ion", "\\u", "key", "'_", ":_", "\"", "0123456", "7890", "123456789012", "3456", "789", "ab", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "cache", "\\u", "config", "\\u", "filepath_", ",_", "'", "w", "'_", ")_", "as_", "cache", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cache", "\\u", "file_", "._", "write_", "(_", "\"\"\"[", "DEF", "AUL", "T", "]", "\\", "10", ";", "debug", " ", "=", " ", "Tru", "e", "\\", "10", ";", "verbo", "se", " ", "=", " ", "Tru", "e", "\\", "10", ";", "image", "\\u", "cache", "\\u", "dir", " ", "=", " ", "%", "(", "image", "\\u", "cache", "\\u", "dir", ")", "s", "\\", "10", ";", "image", "\\u", "cache", "\\u", "driver", " ", "=", " ", "%", "(", "image", "\\u", "cache", "\\u", "driver", ")", "s", "\\", "10", ";", "registr", "y", "\\u", "host", " ", "=", " ", "0.", "0.", "0.", "0", "\\", "10", ";", "registr", "y", "\\u", "port", " ", "=", " ", "%", "(", "registr", "y", "\\u", "port", ")", "s", "\\", "10", ";", "metadata", "\\u", "encrypt", "ion", "\\u", "key", " ", "=", " ", "%", "(", "metadata", "\\u", "encrypt", "ion", "\\u", "key", ")", "s", "\\", "10", ";", "log", "\\u", "file", " ", "=", " ", "%", "(", "log", "\\u", "file", ")", "s", "\\", "10", ";\"\"\"_", "%_", "cache", "\\u", "file", "\\u", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "open_", "(_", "cache", "\\u", "config", "\\u", "filepath_", "._", "replace_", "(_", "\".", "conf", "\"_", ",_", "\"-", "paste", ".", "ini", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "w", "'_", ")_", "as_", "paste", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "paste", "\\u", "file_", "._", "write_", "(_", "\"\"\"[", "app", ":", "gla", "nce", "-", "prune", "r", "]", "\\", "10", ";", "paste", ".", "app", "\\u", "factor", "y", " ", "=", " ", "gla", "nce", ".", "common", ".", "wsgi", ":", "app", "\\u", "factor", "y", "\\", "10", ";", "gla", "nce", ".", "app", "\\u", "factor", "y", " ", "=", " ", "gla", "nce", ".", "image", "\\u", "cache", ".", "prune", "r", ":", "Pru", "ner", "\\", "10", ";", "\\", "10", ";", "[", "app", ":", "gla", "nce", "-", "prefetch", "er", "]", "\\", "10", ";", "paste", ".", "app", "\\u", "factor", "y", " ", "=", " ", "gla", "nce", ".", "common", ".", "wsgi", ":", "app", "\\u", "factor", "y", "\\", "10", ";", "gla", "nce", ".", "app", "\\u", "factor", "y", " ", "=", " ", "gla", "nce", ".", "image", "\\u", "cache", ".", "prefetch", "er", ":", "Prefe", "tche", "r", "\\", "10", ";", "\\", "10", ";", "[", "app", ":", "gla", "nce", "-", "cleaner", "]", "\\", "10", ";", "paste", ".", "app", "\\u", "factor", "y", " ", "=", " ", "gla", "nce", ".", "common", ".", "wsgi", ":", "app", "\\u", "factor", "y", "\\", "10", ";", "gla", "nce", ".", "app", "\\u", "factor", "y", " ", "=", " ", "gla", "nce", ".", "image", "\\u", "cache", ".", "cleaner", ":", "Cleane", "r", "\\", "10", ";", "\\", "10", ";", "[", "app", ":", "gla", "nce", "-", "queue", "-", "image", "]", "\\", "10", ";", "paste", ".", "app", "\\u", "factor", "y", " ", "=", " ", "gla", "nce", ".", "common", ".", "wsgi", ":", "app", "\\u", "factor", "y", "\\", "10", ";", "gla", "nce", ".", "app", "\\u", "factor", "y", " ", "=", " ", "gla", "nce", ".", "image", "\\u", "cache", ".", "queue", "\\u", "image", ":", "Queue", "r", "\\", "10", ";\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "verify", "\\u", "no", "\\u", "images_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ids_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "a", " ", "bunch", " ", "of", " ", "images", "..._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "xrange_", "(_", "0_", ",_", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ids_", "[_", "x_", "]_", "=_", "self_", "._", "add", "\\u", "image_", "(_", "\"", "Image", "%", "s", "\"_", "%_", "str_", "(_", "x_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Queue", " ", "the", " ", "first", " ", "image", ",", " ", "verify", " ", "no", " ", "images", " ", "still", " ", "in", " ", "cache", " ", "after", " ", "queue", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "then", " ", "run", " ", "the", " ", "prefetch", "er", " ", "and", " ", "verify", " ", "tha", "t", " ", "the", " ", "image", " ", "is", " ", "then", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "cache_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "path_", "=_", "\"", "http", "://", "%", "s", ":", "%", "d", "/", "v1", "/", "queue", "d\\u", "images", "/", "%", "s", "\"_", "%_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "self_", "._", "api", "\\u", "port_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ids_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http_", "=_", "httplib2_", "._", "Http_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", ",_", "content_", "=_", "http_", "._", "request_", "(_", "path_", ",_", "'", "PU", "T", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "verify", "\\u", "no", "\\u", "cache", "d\\u", "images_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cmd_", "=_", "\"", "bin", "/", "gla", "nce", "-", "cache", "-", "prefetch", "er", " ", "--", "config", "-", "file", " ", "%", "s", "\"_", "%_", "cache", "\\u", "config", "\\u", "filepath_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "exitcode_", ",_", "out_", ",_", "err_", "=_", "execute_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0_", ",_", "exitcode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "''_", ",_", "out_", "._", "strip_", "(_", ")_", ",_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Verify", " ", "first", " ", "image", " ", "now", " ", "in", " ", "cache_", "\\u\\u\\uNL\\u\\u\\u_", "path_", "=_", "\"", "http", "://", "%", "s", ":", "%", "d", "/", "v1", "/", "cache", "d\\u", "images", "\"_", "%_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "self_", "._", "api", "\\u", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http_", "=_", "httplib2_", "._", "Http_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", ",_", "content_", "=_", "http_", "._", "request_", "(_", "path_", ",_", "'", "GET", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "json_", "._", "loads_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "cache", "d\\u", "images", "'_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cache", "d\\u", "images_", "=_", "data_", "[_", "'", "cache", "d\\u", "images", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "len_", "(_", "cache", "d\\u", "images_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ids_", "[_", "0_", "]_", "in_", "[_", "r_", "[_", "'", "image", "\\u", "id", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "r_", "in_", "data_", "[_", "'", "cache", "d\\u", "images", "'_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "stop", "\\u", "servers_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
cpbotha/nvpy/nvpy/nvpy.py
[ { "content": " def observer_view_keep_house(self, view, evt_type, evt):\n # queue up all notes that need to be saved\n nsaved = self.notes_db.save_threaded()\n msg = self.helper_save_sync_msg()\n\n if self.config.simplenote_sync:\n nsynced, sync_errors = self.notes_db.sync_to_server_threaded()\n if sync_errors:\n msg = ' '.join([i for i in [msg, 'Could not connect to simplenote server.'] if i])\n\n self.view.set_status_text(msg)\n\n # in continous rendering mode, we also generate a new HTML\n # the browser, if open, will refresh!\n if self.view.get_continuous_rendering():\n self.helper_markdown_to_html()", "metadata": "root.Controller.observer_view_keep_house", "header": "['class', 'Controller', ':', '___EOS___']", "index": 492 } ]
[ { "span": "nsaved ", "start_line": 494, "start_column": 8, "end_line": 494, "end_column": 14 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "view", "\\u", "keep", "\\u", "house_", "(_", "self_", ",_", "view_", ",_", "evt", "\\u", "type_", ",_", "evt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "queue", " ", "up", " ", "all", " ", "note", "s", " ", "tha", "t", " ", "need", " ", "to", " ", "be", " ", "saved_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nsa", "ved", "_", "=_", "self_", "._", "note", "s", "\\u", "db_", "._", "save", "\\u", "threaded", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "self_", "._", "help", "er", "\\u", "save", "\\u", "sync", "\\u", "msg_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "config_", "._", "simple", "note", "\\u", "sync_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ns", "ync", "ed_", ",_", "sync", "\\u", "errors_", "=_", "self_", "._", "note", "s", "\\u", "db_", "._", "sync", "\\u", "to", "\\u", "server", "\\u", "threaded", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sync", "\\u", "errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "'", " ", "'_", "._", "join_", "(_", "[_", "i_", "for_", "i_", "in_", "[_", "msg_", ",_", "'", "Cou", "ld", " ", "not", " ", "connect", " ", "to", " ", "simple", "note", " ", "server", ".'_", "]_", "if_", "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_", "self_", "._", "view_", "._", "set\\u", "status", "\\u", "text_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "conti", "nous", " ", "render", "ing", " ", "mode", ",", " ", "we", " ", "als", "o", " ", "generat", "e", " ", "a", " ", "new", " ", "HTML_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "browse", "r", ",", " ", "if", " ", "open", ",", " ", "will", " ", "refre", "sh", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "view_", "._", "get", "\\u", "continuous", "\\u", "render", "ing_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "help", "er", "\\u", "mark", "down", "\\u", "to", "\\u", "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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
ggordan/GutterColor/file.py
[ { "content": "from sublime import Region\nfrom threading import Thread\nfrom .line import Line\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class File():\n \"\"\" A File corresponds to one sublime.View \"\"\"\n\n", "metadata": "root.File", "header": "['module', '___EOS___']", "index": 4 }, { "content": " def __init__(self, view, action = 'initialize'):\n self.view = view # sublime.View\n self.id = self.view.buffer_id()\n self.action = action\n self.scan()", "metadata": "root.File.__init__", "header": "['class', 'File', '(', ')', ':', '___EOS___']", "index": 7 }, { "content": " def scan(self):\n \"\"\"Scan the file for colours and add/remove regions appropriately\"\"\"\n\n # Return a list of all the line regions in the current file\n if self.action == 'update':\n regions = [self.view.line(s) for s in self.view.sel()]\n else:\n regions = self.view.lines(Region(0, self.view.size()))\n\n for region in regions:\n line = Line(self.view, region, self.id)\n if line.has_color():\n line.add_region()\n else:\n try:\n self.view.erase_regions(\"gutter_color_%s\" % region.a)\n except:\n pass", "metadata": "root.File.scan", "header": "['class', 'File', '(', ')', ':', '___EOS___']", "index": 13 } ]
[ { "span": "from threading import Thread", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 28 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "sublime_", "import_", "Region_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "threading_", "import_", "Thread_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "line_", "import_", "Line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "File_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "A", " ", "File", " ", "correspond", "s", " ", "to", " ", "one", " ", "sublim", "e", ".", "View", " ", "\"\"\"_", "\\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_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "view_", ",_", "action_", "=_", "'", "initialize", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "=_", "view_", "#", " ", "sublim", "e", ".", "View_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "id_", "=_", "self_", "._", "view_", "._", "buffer", "\\u", "id_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "action_", "=_", "action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "scan_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "File_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "scan_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Sca", "n", " ", "the", " ", "file", " ", "for", " ", "colour", "s", " ", "and", " ", "add", "/", "remove", " ", "regions", " ", "appropr", "iate", "ly", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Return", " ", "a", " ", "list", " ", "of", " ", "all", " ", "the", " ", "line", " ", "regions", " ", "in", " ", "the", " ", "current", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "action_", "==_", "'", "update", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "regions_", "=_", "[_", "self_", "._", "view_", "._", "line_", "(_", "s_", ")_", "for_", "s_", "in_", "self_", "._", "view_", "._", "sel_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "regions_", "=_", "self_", "._", "view_", "._", "lines_", "(_", "Region_", "(_", "0_", ",_", "self_", "._", "view_", "._", "size_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "region_", "in_", "regions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "Line_", "(_", "self_", "._", "view_", ",_", "region_", ",_", "self_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "line_", "._", "has", "\\u", "color_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "._", "add", "\\u", "region_", "(_", ")_", "\\u\\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_", "._", "view_", "._", "erase", "\\u", "regions_", "(_", "\"", "gut", "ter", "\\u", "color", "\\u", "%", "s", "\"_", "%_", "region_", "._", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
iogf/vy/vyapp/plugins/cmd.py
[ { "content": "\"\"\"\nOverview\n========\n\nIt implements functionalities to execute python code that affects vy state. \n\nUsage\n=====\n\nIn order to use the functionalities of this module it is needed to introduce the concept of target that is implemented\nin vy. It is possible to instantiate more than an AreaVi instance at the same time, along tabs, panels etc. Each one\nof these AreaVi instances can be set as a target for commands. It means that commands should affect the AreaVi instance that was\nset as target. \n\nConsider the following scenary where there are two vy panes.\n\n\n----------------------\n| HELLO | CPPaste() |\n----------------------\n\nCPPaste is a python function that posts code onto codepad.org. In order to set as target the pane that has the string\nHELLO written on, move the focus to that AreaVi instance then press <Control-E>, it will appear the msg 'Target set!'\nat the statusbar. Once the target is set then it is possible to execute CPPaste() by selecting it then dropping\nit to the python interpreter by switching to NORMAL mode then pressing <Control-e>. You will notice\nyour default browser being opened and the string HELLO being posted at codepad.org. Try setting\nthe pane that has the string CPPaste() written on as target then executing it, you'll notice that CPPaste()\nposted onto codepad.org the string CPPaste(). It is possible to have only one target set for commands.\n\nThere is another important key command implemented in this module, such a key command permits\nto execute inline python code. There is no need to set a target when using <Key-semicolon> in NORMAL mode\nbecause it uses the AreaVi instance that has focus as target for the commands.\n\nIt is important to notice that the python code is executed inside vyapp.plugins.ENV dictionary.\n\nKey-Commands\n============\n\nMode: NORMAL\nEvent: <Control-E>\nDescription: Set an AreaVi instance as target for commands.\n\nMode: NORMAL\nEvent: <Control-e>\nDescription: Executes a sequence of python code that is selected.\n\nMode: NORMAL\nEvent: <Key-semicolon>\nDescription: Open an input box in order to type inline python code to be executed.\n\n\"\"\"\n\nfrom vyapp.tools import set_status_msg\nfrom vyapp.exe import exc\nfrom vyapp.ask import Ask\nfrom vyapp.plugins import ENV\n\nimport sys\n\n\n\n\ninstall = lambda area: area.install(('NORMAL', '<Key-semicolon>', lambda event: exec_cmd(event.widget, ENV)), \n ('NORMAL', '<Control-e>', lambda event: exec_region(event.widget, ENV)),\n ('NORMAL', '<Control-E>', lambda event: set_target(event.widget)))\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def exec_cmd(area, env):\n ask = Ask(area)\n area.active()\n exc(ask.data, env)", "metadata": "root.exec_cmd", "header": "['module', '___EOS___']", "index": 59 }, { "content": "def exec_region(area, env):\n data = area.join_ranges('sel')\n data = data.encode('utf-8')\n exc(data, env)\n area.clear_selection()", "metadata": "root.exec_region", "header": "['module', '___EOS___']", "index": 64 }, { "content": "def set_target(area):\n area.active()\n set_status_msg('Target set !')", "metadata": "root.set_target", "header": "['module', '___EOS___']", "index": 70 } ]
[ { "span": "import sys", "start_line": 57, "start_column": 0, "end_line": 57, "end_column": 10 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Over", "view", "\\", "10", ";", "=======", "=", "\\", "10", ";", "\\", "10", ";", "It", " ", "implement", "s", " ", "functional", "iti", "es", " ", "to", " ", "execute", " ", "python", " ", "code", " ", "tha", "t", " ", "affect", "s", " ", "vy", " ", "state", ".", " ", "\\", "10", ";", "\\", "10", ";", "Us", "age", "\\", "10", ";", "=====", "\\", "10", ";", "\\", "10", ";", "In", " ", "order", " ", "to", " ", "use", " ", "the", " ", "functional", "iti", "es", " ", "of", " ", "this", " ", "module", " ", "it", " ", "is", " ", "need", "ed", " ", "to", " ", "introduce", " ", "the", " ", "concept", " ", "of", " ", "target", " ", "tha", "t", " ", "is", " ", "implemented", "\\", "10", ";", "in", " ", "vy", ".", " ", "It", " ", "is", " ", "possib", "le", " ", "to", " ", "instantiate", " ", "more", " ", "than", " ", "an", " ", "Area", "Vi", " ", "instance", " ", "at", " ", "the", " ", "same", " ", "time", ",", " ", "along", " ", "tabs", ",", " ", "panel", "s", " ", "etc", ".", " ", "Ea", "ch", " ", "one", "\\", "10", ";", "of", " ", "these", " ", "Area", "Vi", " ", "instance", "s", " ", "can", " ", "be", " ", "set", " ", "as", " ", "a", " ", "target", " ", "for", " ", "command", "s", ".", " ", "It", " ", "means", " ", "tha", "t", " ", "command", "s", " ", "shou", "ld", " ", "affect", " ", "the", " ", "Area", "Vi", " ", "instance", " ", "tha", "t", " ", "was", "\\", "10", ";", "set", " ", "as", " ", "target", ".", " ", "\\", "10", ";", "\\", "10", ";", "Consider", " ", "the", " ", "follow", "ing", " ", "scen", "ary", " ", "where", " ", "there", " ", "are", " ", "two", " ", "vy", " ", "pane", "s", ".", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", "--------------", "--------", "\\", "10", ";", "|", " ", "HELL", "O", " ", "|", " ", "CPP", "ast", "e", "()", " ", " ", "|", "\\", "10", ";", "--------------", "--------", "\\", "10", ";", "\\", "10", ";", "CPP", "ast", "e", " ", "is", " ", "a", " ", "python", " ", "function", " ", "tha", "t", " ", "posts", " ", "code", " ", "onto", " ", "code", "pad", ".", "org", ".", " ", "In", " ", "order", " ", "to", " ", "set", " ", "as", " ", "target", " ", "the", " ", "pane", " ", "tha", "t", " ", "has", " ", "the", " ", "string", "\\", "10", ";", "HELL", "O", " ", "writt", "en", " ", "on", ",", " ", "move", " ", "the", " ", "foc", "us", " ", "to", " ", "tha", "t", " ", "Area", "Vi", " ", "instance", " ", "then", " ", "press", " ", "<", "Control", "-", "E", ">", ",", " ", "it", " ", "will", " ", "appear", " ", "the", " ", "msg", " ", "'", "Target", " ", "set", "!'", "\\", "10", ";", "at", " ", "the", " ", "statusba", "r", ".", " ", "On", "ce", " ", "the", " ", "target", " ", "is", " ", "set", " ", "then", " ", "it", " ", "is", " ", "possib", "le", " ", "to", " ", "execute", " ", "CPP", "ast", "e", "()", " ", "by", " ", "selecti", "ng", " ", "it", " ", "then", " ", "drop", "ping", "\\", "10", ";", "it", " ", "to", " ", "the", " ", "python", " ", "interprete", "r", " ", "by", " ", "switching", " ", "to", " ", "NORMA", "L", " ", "mode", " ", "then", " ", "press", "ing", " ", "<", "Control", "-", "e", ">.", " ", "You", " ", "will", " ", "notice", "\\", "10", ";", "your", " ", "default", " ", "browse", "r", " ", "bei", "ng", " ", "opene", "d", " ", "and", " ", "the", " ", "string", " ", "HELL", "O", " ", "bei", "ng", " ", "poste", "d", " ", "at", " ", "code", "pad", ".", "org", ".", " ", "Tr", "y", " ", "setti", "ng", "\\", "10", ";", "the", " ", "pane", " ", "tha", "t", " ", "has", " ", "the", " ", "string", " ", "CPP", "ast", "e", "()", " ", "writt", "en", " ", "on", " ", "as", " ", "target", " ", "then", " ", "executi", "ng", " ", "it", ",", " ", "you", "'", "ll", " ", "notice", " ", "tha", "t", " ", "CPP", "ast", "e", "()", "\\", "10", ";", "poste", "d", " ", "onto", " ", "code", "pad", ".", "org", " ", "the", " ", "string", " ", "CPP", "ast", "e", "()", ".", " ", "It", " ", "is", " ", "possib", "le", " ", "to", " ", "have", " ", "only", " ", "one", " ", "target", " ", "set", " ", "for", " ", "command", "s", ".", "\\", "10", ";", "\\", "10", ";", "There", " ", "is", " ", "anot", "her", " ", "importa", "nt", " ", "key", " ", "command", " ", "implemented", " ", "in", " ", "this", " ", "module", ",", " ", "suc", "h", " ", "a", " ", "key", " ", "command", " ", "permit", "s", "\\", "10", ";", "to", " ", "execute", " ", "inline", " ", "python", " ", "code", ".", " ", "There", " ", "is", " ", "no", " ", "need", " ", "to", " ", "set", " ", "a", " ", "target", " ", "whe", "n", " ", "usi", "ng", " ", "<", "Key", "-", "semico", "lon", ">", " ", "in", " ", "NORMA", "L", " ", "mode", "\\", "10", ";", "bec", "aus", "e", " ", "it", " ", "use", "s", " ", "the", " ", "Area", "Vi", " ", "instance", " ", "tha", "t", " ", "has", " ", "foc", "us", " ", "as", " ", "target", " ", "for", " ", "the", " ", "command", "s", ".", "\\", "10", ";", "\\", "10", ";", "It", " ", "is", " ", "importa", "nt", " ", "to", " ", "notice", " ", "tha", "t", " ", "the", " ", "python", " ", "code", " ", "is", " ", "executed", " ", "insi", "de", " ", "vy", "app", ".", "plugin", "s", ".", "ENV", " ", "dictionar", "y", ".", "\\", "10", ";", "\\", "10", ";", "Key", "-", "Command", "s", "\\", "10", ";", "============", "\\", "10", ";", "\\", "10", ";", "Mode", ":", " ", "NORMA", "L", "\\", "10", ";", "Event", ":", " ", "<", "Control", "-", "E", ">", "\\", "10", ";", "Descripti", "on", ":", " ", "Set", " ", "an", " ", "Area", "Vi", " ", "instance", " ", "as", " ", "target", " ", "for", " ", "command", "s", ".", "\\", "10", ";", "\\", "10", ";", "Mode", ":", " ", "NORMA", "L", "\\", "10", ";", "Event", ":", " ", "<", "Control", "-", "e", ">", "\\", "10", ";", "Descripti", "on", ":", " ", "Execut", "es", " ", "a", " ", "sequence", " ", "of", " ", "python", " ", "code", " ", "tha", "t", " ", "is", " ", "selecte", "d", ".", "\\", "10", ";", "\\", "10", ";", "Mode", ":", " ", "NORMA", "L", "\\", "10", ";", "Event", ":", " ", "<", "Key", "-", "semico", "lon", ">", "\\", "10", ";", "Descripti", "on", ":", " ", "Open", " ", "an", " ", "input", " ", "box", " ", "in", " ", "order", " ", "to", " ", "type", " ", "inline", " ", "python", " ", "code", " ", "to", " ", "be", " ", "executed", ".", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "vy", "app_", "._", "tools_", "import_", "set\\u", "status", "\\u", "msg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vy", "app_", "._", "exe_", "import_", "exc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vy", "app_", "._", "ask_", "import_", "As", "k_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vy", "app_", "._", "plugins_", "import_", "ENV_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "install_", "=_", "lambda_", "area_", ":_", "area_", "._", "install_", "(_", "(_", "'", "NORMA", "L", "'_", ",_", "'<", "Key", "-", "semico", "lon", ">'_", ",_", "lambda_", "event_", ":_", "exec", "\\u", "cmd_", "(_", "event_", "._", "widget_", ",_", "ENV_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "NORMA", "L", "'_", ",_", "'<", "Control", "-", "e", ">'_", ",_", "lambda_", "event_", ":_", "exec", "\\u", "region_", "(_", "event_", "._", "widget_", ",_", "ENV_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "NORMA", "L", "'_", ",_", "'<", "Control", "-", "E", ">'_", ",_", "lambda_", "event_", ":_", "set\\u", "target_", "(_", "event_", "._", "widget_", ")_", ")_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "exec", "\\u", "cmd_", "(_", "area_", ",_", "env_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ask_", "=_", "As", "k_", "(_", "area_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "area_", "._", "active_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exc_", "(_", "ask_", "._", "data_", ",_", "env_", ")_", "\\u\\u\\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_", "exec", "\\u", "region_", "(_", "area_", ",_", "env_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "area_", "._", "join", "\\u", "ranges_", "(_", "'", "sel", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "data_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exc_", "(_", "data_", ",_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "area_", "._", "clear", "\\u", "selection_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "target_", "(_", "area_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "area_", "._", "active_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "set\\u", "status", "\\u", "msg_", "(_", "'", "Target", " ", "set", " ", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\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 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Variable defined multiple times
openstack/horizon/openstack_dashboard/test/api_tests/base_tests.py
[ { "content": " def test_url_for(self):\n url = api_base.url_for(self.request, 'image')\n self.assertEqual('http://public.glance.example.com:9292/v1', url)\n\n url = api_base.url_for(self.request, 'image', endpoint_type='adminURL')\n self.assertEqual('http://admin.glance.example.com:9292/v1', url)\n\n url = api_base.url_for(self.request, 'compute')\n self.assertEqual('http://public.nova.example.com:8774/v2', url)\n\n url = api_base.url_for(self.request, 'compute',\n endpoint_type='adminURL')\n self.assertEqual('http://admin.nova.example.com:8774/v2', url)\n\n url = api_base.url_for(self.request, 'volumev2')\n self.assertEqual('http://public.nova.example.com:8776/v2', url)\n\n url = api_base.url_for(self.request, 'volumev2',\n endpoint_type=\"internalURL\")\n self.assertEqual('http://int.nova.example.com:8776/v2', url)\n\n url = api_base.url_for(self.request, 'volumev2',\n endpoint_type='adminURL')\n self.assertEqual('http://admin.nova.example.com:8776/v2', url)\n\n self.assertNotIn('notAnApi', self.request.user.service_catalog,\n 'Select a new nonexistent service catalog key')\n with self.assertRaises(exceptions.ServiceCatalogException):\n url = api_base.url_for(self.request, 'notAnApi')\n\n self.request.user.services_region = \"RegionTwo\"\n url = api_base.url_for(self.request, 'compute')\n self.assertEqual('http://public.nova2.example.com:8774/v2', url)\n\n self.request.user.services_region = \"RegionTwo\"\n url = api_base.url_for(self.request, 'compute',\n endpoint_type='adminURL')\n self.assertEqual('http://admin.nova2.example.com:8774/v2', url)\n\n self.request.user.services_region = \"RegionTwo\"\n with self.assertRaises(exceptions.ServiceCatalogException):\n url = api_base.url_for(self.request, 'image')\n\n self.request.user.services_region = \"bogus_value\"\n url = api_base.url_for(self.request, 'identity',\n endpoint_type='adminURL')\n self.assertEqual('http://admin.keystone.example.com:35357/v2.0', url)\n\n self.request.user.services_region = \"bogus_value\"\n with self.assertRaises(exceptions.ServiceCatalogException):\n url = api_base.url_for(self.request, 'image')", "metadata": "root.ApiHelperTests.test_url_for", "header": "['class', 'ApiHelperTests', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']", "index": 190 } ]
[ { "span": "url ", "start_line": 218, "start_column": 12, "end_line": 218, "end_column": 15 }, { "span": "url ", "start_line": 231, "start_column": 12, "end_line": 231, "end_column": 15 } ]
[ { "span": "url ", "start_line": 221, "start_column": 8, "end_line": 221, "end_column": 11 }, { "span": "url ", "start_line": 234, "start_column": 8, "end_line": 234, "end_column": 11 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Ap", "i", "Help", "er", "Tests_", "(_", "test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "url", "\\u", "for_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "api", "\\u", "base_", "._", "url", "\\u", "for_", "(_", "self_", "._", "request_", ",_", "'", "image", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "http", "://", "public", ".", "gla", "nce", ".", "example", ".", "com", ":", "929", "2", "/", "v1", "'_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "api", "\\u", "base_", "._", "url", "\\u", "for_", "(_", "self_", "._", "request_", ",_", "'", "image", "'_", ",_", "endpoint", "\\u", "type_", "=_", "'", "admin", "URL", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "http", "://", "admin", ".", "gla", "nce", ".", "example", ".", "com", ":", "929", "2", "/", "v1", "'_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "api", "\\u", "base_", "._", "url", "\\u", "for_", "(_", "self_", "._", "request_", ",_", "'", "compute", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "http", "://", "public", ".", "nova", ".", "example", ".", "com", ":", "877", "4", "/", "v2", "'_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "api", "\\u", "base_", "._", "url", "\\u", "for_", "(_", "self_", "._", "request_", ",_", "'", "compute", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "endpoint", "\\u", "type_", "=_", "'", "admin", "URL", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "http", "://", "admin", ".", "nova", ".", "example", ".", "com", ":", "877", "4", "/", "v2", "'_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "api", "\\u", "base_", "._", "url", "\\u", "for_", "(_", "self_", "._", "request_", ",_", "'", "volume", "v2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "http", "://", "public", ".", "nova", ".", "example", ".", "com", ":", "877", "6", "/", "v2", "'_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "api", "\\u", "base_", "._", "url", "\\u", "for_", "(_", "self_", "._", "request_", ",_", "'", "volume", "v2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "endpoint", "\\u", "type_", "=_", "\"", "internal", "URL", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "http", "://", "int", ".", "nova", ".", "example", ".", "com", ":", "877", "6", "/", "v2", "'_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "api", "\\u", "base_", "._", "url", "\\u", "for_", "(_", "self_", "._", "request_", ",_", "'", "volume", "v2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "endpoint", "\\u", "type_", "=_", "'", "admin", "URL", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "http", "://", "admin", ".", "nova", ".", "example", ".", "com", ":", "877", "6", "/", "v2", "'_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Not", "In_", "(_", "'", "not", "An", "Ap", "i", "'_", ",_", "self_", "._", "request_", "._", "user_", "._", "service", "\\u", "catalog_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Select", " ", "a", " ", "new", " ", "nonexist", "ent", " ", "service", " ", "catal", "og", " ", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "exceptions_", "._", "Service", "Catalog", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "api", "\\u", "base_", "._", "url", "\\u", "for_", "(_", "self_", "._", "request_", ",_", "'", "not", "An", "Ap", "i", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "request_", "._", "user_", "._", "service", "s", "\\u", "region_", "=_", "\"", "Region", "Tw", "o", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "api", "\\u", "base_", "._", "url", "\\u", "for_", "(_", "self_", "._", "request_", ",_", "'", "compute", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "http", "://", "public", ".", "nova", "2", ".", "example", ".", "com", ":", "877", "4", "/", "v2", "'_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "request_", "._", "user_", "._", "service", "s", "\\u", "region_", "=_", "\"", "Region", "Tw", "o", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "api", "\\u", "base_", "._", "url", "\\u", "for_", "(_", "self_", "._", "request_", ",_", "'", "compute", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "endpoint", "\\u", "type_", "=_", "'", "admin", "URL", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "http", "://", "admin", ".", "nova", "2", ".", "example", ".", "com", ":", "877", "4", "/", "v2", "'_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "request_", "._", "user_", "._", "service", "s", "\\u", "region_", "=_", "\"", "Region", "Tw", "o", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "exceptions_", "._", "Service", "Catalog", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "api", "\\u", "base_", "._", "url", "\\u", "for_", "(_", "self_", "._", "request_", ",_", "'", "image", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "request_", "._", "user_", "._", "service", "s", "\\u", "region_", "=_", "\"", "bog", "us", "\\u", "value", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "api", "\\u", "base_", "._", "url", "\\u", "for_", "(_", "self_", "._", "request_", ",_", "'", "identi", "ty", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "endpoint", "\\u", "type_", "=_", "'", "admin", "URL", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "http", "://", "admin", ".", "keystone", ".", "example", ".", "com", ":", "353", "5", "7", "/", "v2", ".0", "'_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "request_", "._", "user_", "._", "service", "s", "\\u", "region_", "=_", "\"", "bog", "us", "\\u", "value", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "exceptions_", "._", "Service", "Catalog", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u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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, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
eBay/bayesian-belief-networks/bayesian/factor_graph.py
[ { "content": "def make_factor_node_message(node, target_node):\n '''\n The rules for a factor node are:\n take the product of all the incoming\n messages (except for the destination\n node) and then take the sum over\n all the variables except for the\n destination variable.\n >>> def f(x1, x2, x3): pass\n >>> node = object()\n >>> node.func = f\n >>> target_node = object()\n >>> target_node.name = 'x2'\n >>> make_factor_node_message(node, target_node)\n '''\n\n if node.is_leaf():\n not_sum_func = make_not_sum_func(node.func, target_node.name)\n message = FactorMessage(node, target_node, [node.func], not_sum_func)\n return message\n\n args = set(get_args(node.func))\n\n # Compile list of factors for message\n factors = [node.func]\n\n # Now add the message that came from each\n # of the non-destination neighbours...\n neighbours = node.neighbours\n for neighbour in neighbours:\n if neighbour == target_node:\n continue\n # When we pass on a message, we unwrap\n # the original payload and wrap it\n # in new headers, this is purely\n # to verify the procedure is correct\n # according to usual nomenclature\n in_message = node.received_messages[neighbour.name]\n if in_message.destination != node:\n out_message = VariableMessage(\n neighbour, node, in_message.factors,\n in_message.func)\n out_message.argspec = in_message.argspec\n else:\n out_message = in_message\n factors.append(out_message)\n\n product_func = make_product_func(factors)\n not_sum_func = make_not_sum_func(product_func, target_node.name)\n message = FactorMessage(node, target_node, factors, not_sum_func)\n return message", "metadata": "root.make_factor_node_message", "header": "['module', '___EOS___']", "index": 402 }, { "content": "def discover_sample_ordering(graph):\n '''\n Try to get the order of variable nodes\n for sampling. This would be easier in\n the underlying BBN but lets try on\n the factor graph.\n '''\n iterations = 0\n ordering = []\n pmf_ordering = []\n accounted_for = set()\n variable_nodes = [n for n in graph.nodes if isinstance(n, VariableNode)]\n factor_nodes = [n for n in graph.nodes if isinstance(n, FactorNode)]\n required = len([n for n in graph.nodes if isinstance(n, VariableNode)])\n # Firstly any leaf factor nodes will\n # by definition only have one variable\n # node connection, therefore these\n # variables can be set first.\n for node in graph.get_leaves():\n if isinstance(node, FactorNode):\n ordering.append(node.neighbours[0])\n accounted_for.add(node.neighbours[0].name)\n pmf_ordering.append(node.func)\n\n # Now for each factor node whose variables\n # all but one are already in the ordering,\n # we can add that one variable. This is\n # actuall\n while len(ordering) < required:\n for node in factor_nodes:\n args = set(get_args(node.func))\n new_args = args.difference(accounted_for)\n if len(new_args) == 1:\n arg_name = list(new_args)[0]\n var_node = node.get_neighbour_by_name(arg_name)\n ordering.append(var_node)\n accounted_for.add(var_node.name)\n pmf_ordering.append(node.func)\n return zip(ordering, pmf_ordering)", "metadata": "root.discover_sample_ordering", "header": "['module', '___EOS___']", "index": 606 }, { "content": " def generate_samples(self, n):\n '''\n Generate and save samples to\n the SQLite sample db for this\n model.\n '''\n if self.inference_method != 'sample_db':\n raise IncorrectInferenceMethodError(\n 'generate_samples() not support for inference method: %s' % \\\n self.inference_method)\n valid_samples = 0\n if not hasattr(self, 'sample_ordering'):\n self.sample_ordering = self.discover_sample_ordering()\n fn = [x[0].name for x in self.sample_ordering]\n sdb = self.sample_db\n while valid_samples < n:\n try:\n sample = self.get_sample()\n except InvalidSampleException:\n # TODO: Need to figure\n # out why we get invalid\n # samples.\n continue\n sdb.save_sample([(v.name, v.value) for v in sample])\n valid_samples += 1\n sdb.commit()\n print '%s samples stored in %s' % (n, self.sample_db_filename)", "metadata": "root.FactorGraph.generate_samples", "header": "['class', 'FactorGraph', '(', 'object', ')', ':', '___EOS___']", "index": 1055 } ]
[ { "span": "args ", "start_line": 423, "start_column": 4, "end_line": 423, "end_column": 8 }, { "span": "iterations ", "start_line": 613, "start_column": 4, "end_line": 613, "end_column": 14 }, { "span": "variable_nodes ", "start_line": 617, "start_column": 4, "end_line": 617, "end_column": 18 }, { "span": "fn ", "start_line": 1068, "start_column": 8, "end_line": 1068, "end_column": 10 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "make", "\\u", "factor", "\\u", "node", "\\u", "message_", "(_", "node_", ",_", "target", "\\u", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "rule", "s", " ", "for", " ", "a", " ", "factor", " ", "node", " ", "are", ":", "\\", "10", ";", " ", " ", " ", " ", "take", " ", "the", " ", "product", " ", "of", " ", "all", " ", "the", " ", "inco", "ming", "\\", "10", ";", " ", " ", " ", " ", "message", "s", " ", "(", "except", " ", "for", " ", "the", " ", "destinat", "ion", "\\", "10", ";", " ", " ", " ", " ", "node", ")", " ", "and", " ", "then", " ", "take", " ", "the", " ", "sum", " ", "over", "\\", "10", ";", " ", " ", " ", " ", "all", " ", "the", " ", "variab", "les", " ", "except", " ", "for", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "destinat", "ion", " ", "variab", "le", ".", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "def", " ", "f", "(", "x1", ",", " ", "x2", ",", " ", "x3", "):", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "node", " ", "=", " ", "object", "()", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "node", ".", "func", " ", "=", " ", "f", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "target", "\\u", "node", " ", "=", " ", "object", "()", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "target", "\\u", "node", ".", "name", " ", "=", " ", "'", "x2", "'", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "make", "\\u", "factor", "\\u", "node", "\\u", "message", "(", "node", ",", " ", "target", "\\u", "node", ")", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "node_", "._", "is", "\\u", "leaf_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "not", "\\u", "sum", "\\u", "func_", "=_", "make", "\\u", "not", "\\u", "sum", "\\u", "func_", "(_", "node_", "._", "func_", ",_", "target", "\\u", "node_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "=_", "Factor", "Message_", "(_", "node_", ",_", "target", "\\u", "node_", ",_", "[_", "node_", "._", "func_", "]_", ",_", "not", "\\u", "sum", "\\u", "func_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "args_", "=_", "set_", "(_", "get", "\\u", "args_", "(_", "node_", "._", "func_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Compil", "e", " ", "list", " ", "of", " ", "factor", "s", " ", "for", " ", "message_", "\\u\\u\\uNL\\u\\u\\u_", "factors_", "=_", "[_", "node_", "._", "func_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "add", " ", "the", " ", "message", " ", "tha", "t", " ", "came", " ", "from", " ", "each_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "the", " ", "non", "-", "destinat", "ion", " ", "neighbour", "s", "..._", "\\u\\u\\uNL\\u\\u\\u_", "neighbours_", "=_", "node_", "._", "neighbours_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "neighbour", "_", "in_", "neighbours_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "neighbour", "_", "==_", "target", "\\u", "node_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Whe", "n", " ", "we", " ", "pass", " ", "on", " ", "a", " ", "message", ",", " ", "we", " ", "unwrap", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "original", " ", "payload", " ", "and", " ", "wrap", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "new", " ", "header", "s", ",", " ", "this", " ", "is", " ", "pure", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "verify", " ", "the", " ", "procedure", " ", "is", " ", "correct_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "according", " ", "to", " ", "usual", " ", "nome", "ncla", "ture_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "in", "\\u", "message_", "=_", "node_", "._", "receive", "d\\u", "messages_", "[_", "neighbour", "_", "._", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "in", "\\u", "message_", "._", "destination_", "!=_", "node_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out", "\\u", "message_", "=_", "Varia", "ble", "Message_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "neighbour", "_", ",_", "node_", ",_", "in", "\\u", "message_", "._", "factors_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "in", "\\u", "message_", "._", "func_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out", "\\u", "message_", "._", "argspec_", "=_", "in", "\\u", "message_", "._", "argspec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out", "\\u", "message_", "=_", "in", "\\u", "message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "factors_", "._", "append_", "(_", "out", "\\u", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "product", "\\u", "func_", "=_", "make", "\\u", "product", "\\u", "func_", "(_", "factors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "not", "\\u", "sum", "\\u", "func_", "=_", "make", "\\u", "not", "\\u", "sum", "\\u", "func_", "(_", "product", "\\u", "func_", ",_", "target", "\\u", "node_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "=_", "Factor", "Message_", "(_", "node_", ",_", "target", "\\u", "node_", ",_", "factors_", ",_", "not", "\\u", "sum", "\\u", "func_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "discove", "r", "\\u", "sample", "\\u", "ordering_", "(_", "graph_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Tr", "y", " ", "to", " ", "get", " ", "the", " ", "order", " ", "of", " ", "variab", "le", " ", "nodes", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "samp", "ling", ".", " ", "Thi", "s", " ", "wou", "ld", " ", "be", " ", "easi", "er", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "underl", "ying", " ", "BB", "N", " ", "but", " ", "lets", " ", "try", " ", "on", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "factor", " ", "graph", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iterations_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ordering_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pmf", "\\u", "ordering_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "account", "ed", "\\u", "for_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "variab", "le", "\\u", "nodes_", "=_", "[_", "n_", "for_", "n_", "in_", "graph_", "._", "nodes_", "if_", "isinstance_", "(_", "n_", ",_", "Varia", "ble", "Node_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "factor", "\\u", "nodes_", "=_", "[_", "n_", "for_", "n_", "in_", "graph_", "._", "nodes_", "if_", "isinstance_", "(_", "n_", ",_", "Factor", "Node_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "required_", "=_", "len_", "(_", "[_", "n_", "for_", "n_", "in_", "graph_", "._", "nodes_", "if_", "isinstance_", "(_", "n_", ",_", "Varia", "ble", "Node_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fi", "rst", "ly", " ", "any", " ", "leaf", " ", "factor", " ", "nodes", " ", "will", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "by", " ", "definit", "ion", " ", "only", " ", "have", " ", "one", " ", "variable_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "node", " ", "connecti", "on", ",", " ", "there", "fore", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "variab", "les", " ", "can", " ", "be", " ", "set", " ", "first", "._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "node_", "in_", "graph_", "._", "get", "\\u", "leaves_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "node_", ",_", "Factor", "Node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ordering_", "._", "append_", "(_", "node_", "._", "neighbours_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "account", "ed", "\\u", "for_", "._", "add_", "(_", "node_", "._", "neighbours_", "[_", "0_", "]_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pmf", "\\u", "ordering_", "._", "append_", "(_", "node_", "._", "func_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "for", " ", "each", " ", "factor", " ", "node", " ", "who", "se", " ", "variables_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "all", " ", "but", " ", "one", " ", "are", " ", "alr", "ead", "y", " ", "in", " ", "the", " ", "orderi", "ng", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "can", " ", "add", " ", "tha", "t", " ", "one", " ", "variab", "le", ".", " ", "Thi", "s", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "actual", "l_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "len_", "(_", "ordering_", ")_", "<_", "required_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "node_", "in_", "factor", "\\u", "nodes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "set_", "(_", "get", "\\u", "args_", "(_", "node_", "._", "func_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "args_", "=_", "args_", "._", "difference_", "(_", "account", "ed", "\\u", "for_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "new", "\\u", "args_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arg", "\\u", "name_", "=_", "list_", "(_", "new", "\\u", "args_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "var", "\\u", "node_", "=_", "node_", "._", "get", "\\u", "neighbour", "\\u", "by", "\\u", "name_", "(_", "arg", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ordering_", "._", "append_", "(_", "var", "\\u", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "account", "ed", "\\u", "for_", "._", "add_", "(_", "var", "\\u", "node_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pmf", "\\u", "ordering_", "._", "append_", "(_", "node_", "._", "func_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "zip_", "(_", "ordering_", ",_", "pmf", "\\u", "ordering_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Factor", "Graph_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "generat", "e\\u", "samples_", "(_", "self_", ",_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Generate", " ", "and", " ", "save", " ", "samples", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "SQL", "ite", " ", "sample", " ", "db", " ", "for", " ", "this", "\\", "10", ";", " ", " ", " ", " ", "model", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "infer", "ence", "\\u", "method_", "!=_", "'", "sample", "\\u", "db", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Inco", "rrect", "Infer", "ence", "Meth", "od", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "generat", "e\\u", "samples", "()", " ", "not", " ", "support", " ", "for", " ", "infer", "ence", " ", "method", ":", " ", "%", "s", "'_", "%_", "self_", "._", "infer", "ence", "\\u", "method_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "valid", "\\u", "samples_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "hasattr_", "(_", "self_", ",_", "'", "sample", "\\u", "orderi", "ng", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "sample", "\\u", "ordering_", "=_", "self_", "._", "discove", "r", "\\u", "sample", "\\u", "ordering_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fn_", "=_", "[_", "x_", "[_", "0_", "]_", "._", "name_", "for_", "x_", "in_", "self_", "._", "sample", "\\u", "ordering_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sdb", "_", "=_", "self_", "._", "sample", "\\u", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "valid", "\\u", "samples_", "<_", "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 ", " _", "sample_", "=_", "self_", "._", "get", "\\u", "sample_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Inva", "lid", "Sampl", "e", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Ne", "ed", " ", "to", " ", "figure_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "out", " ", "wh", "y", " ", "we", " ", "get", " ", "invalid_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "samples", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sdb", "_", "._", "save", "\\u", "sample_", "(_", "[_", "(_", "v_", "._", "name_", ",_", "v_", "._", "value_", ")_", "for_", "v_", "in_", "sample_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid", "\\u", "samples_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sdb", "_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'%", "s", " ", "samples", " ", "store", "d", " ", "in", " ", "%", "s", "'_", "%_", "(_", "n_", ",_", "self_", "._", "sample", "\\u", "db", "\\u", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
arachnys/cabot/cabot/cabotapp/migrations/0008_auto__add_field_statuscheckresult_job_number.py
[ { "content": "# -*- coding: utf-8 -*-\nimport datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Migration(SchemaMigration):\n\n\n\n\n\n models = {\n 'auth.group': {\n 'Meta': {'object_name': 'Group'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),\n 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'})\n },\n 'auth.permission': {\n 'Meta': {'ordering': \"('content_type__app_label', 'content_type__model', 'codename')\", 'unique_together': \"(('content_type', 'codename'),)\", 'object_name': 'Permission'},\n 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['contenttypes.ContentType']\"}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})\n },\n 'auth.user': {\n 'Meta': {'object_name': 'User'},\n 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),\n 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Group']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),\n 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})\n },\n 'cabotapp.instance': {\n 'Meta': {'ordering': \"['name']\", 'object_name': 'Instance'},\n 'address': ('django.db.models.fields.TextField', [], {'blank': 'True'}),\n 'alerts_enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'email_alert': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'hackpad_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'hipchat_alert': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'last_alert_sent': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),\n 'name': ('django.db.models.fields.TextField', [], {}),\n 'old_overall_status': ('django.db.models.fields.TextField', [], {'default': \"'PASSING'\"}),\n 'overall_status': ('django.db.models.fields.TextField', [], {'default': \"'PASSING'\"}),\n 'sms_alert': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'status_checks': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['cabotapp.StatusCheck']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'telephone_alert': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'users_to_notify': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.User']\", 'symmetrical': 'False', 'blank': 'True'})\n },\n 'cabotapp.instancestatussnapshot': {\n 'Meta': {'object_name': 'InstanceStatusSnapshot'},\n 'did_send_alert': ('django.db.models.fields.IntegerField', [], {'default': 'False'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'instance': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'snapshots'\", 'to': \"orm['cabotapp.Instance']\"}),\n 'num_checks_active': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'num_checks_failing': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'num_checks_passing': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'overall_status': ('django.db.models.fields.TextField', [], {'default': \"'PASSING'\"}),\n 'time': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'})\n },\n 'cabotapp.service': {\n 'Meta': {'ordering': \"['name']\", 'object_name': 'Service'},\n 'alerts_enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'email_alert': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'hackpad_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'hipchat_alert': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'instances': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['cabotapp.Instance']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'last_alert_sent': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),\n 'name': ('django.db.models.fields.TextField', [], {}),\n 'old_overall_status': ('django.db.models.fields.TextField', [], {'default': \"'PASSING'\"}),\n 'overall_status': ('django.db.models.fields.TextField', [], {'default': \"'PASSING'\"}),\n 'sms_alert': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'status_checks': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['cabotapp.StatusCheck']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'telephone_alert': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'url': ('django.db.models.fields.TextField', [], {'blank': 'True'}),\n 'users_to_notify': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.User']\", 'symmetrical': 'False', 'blank': 'True'})\n },\n 'cabotapp.servicestatussnapshot': {\n 'Meta': {'object_name': 'ServiceStatusSnapshot'},\n 'did_send_alert': ('django.db.models.fields.IntegerField', [], {'default': 'False'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'num_checks_active': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'num_checks_failing': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'num_checks_passing': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'overall_status': ('django.db.models.fields.TextField', [], {'default': \"'PASSING'\"}),\n 'service': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'snapshots'\", 'to': \"orm['cabotapp.Service']\"}),\n 'time': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'})\n },\n 'cabotapp.shift': {\n 'Meta': {'object_name': 'Shift'},\n 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'end': ('django.db.models.fields.DateTimeField', [], {}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'start': ('django.db.models.fields.DateTimeField', [], {}),\n 'uid': ('django.db.models.fields.TextField', [], {}),\n 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['auth.User']\"})\n },\n 'cabotapp.statuscheck': {\n 'Meta': {'ordering': \"['name']\", 'object_name': 'StatusCheck'},\n 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'cached_health': ('django.db.models.fields.TextField', [], {'null': 'True'}),\n 'calculated_status': ('django.db.models.fields.CharField', [], {'default': \"'passing'\", 'max_length': '50', 'blank': 'True'}),\n 'check_type': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),\n 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['auth.User']\", 'null': 'True'}),\n 'debounce': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True'}),\n 'endpoint': ('django.db.models.fields.TextField', [], {'null': 'True'}),\n 'expected_num_hosts': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True'}),\n 'frequency': ('django.db.models.fields.IntegerField', [], {'default': '5'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'importance': ('django.db.models.fields.CharField', [], {'default': \"'ERROR'\", 'max_length': '30'}),\n 'last_run': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),\n 'max_queued_build_time': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'metric': ('django.db.models.fields.TextField', [], {'null': 'True'}),\n 'name': ('django.db.models.fields.TextField', [], {}),\n 'password': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'polymorphic_ctype': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'polymorphic_cabotapp.statuscheck_set'\", 'null': 'True', 'to': \"orm['contenttypes.ContentType']\"}),\n 'status_code': ('django.db.models.fields.TextField', [], {'default': '200', 'null': 'True'}),\n 'text_match': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'timeout': ('django.db.models.fields.IntegerField', [], {'default': '30', 'null': 'True'}),\n 'username': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'value': ('django.db.models.fields.TextField', [], {'null': 'True'}),\n 'verify_ssl_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'})\n },\n 'cabotapp.statuscheckresult': {\n 'Meta': {'object_name': 'StatusCheckResult'},\n 'check': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['cabotapp.StatusCheck']\"}),\n 'error': ('django.db.models.fields.TextField', [], {'null': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'job_number': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),\n 'raw_data': ('django.db.models.fields.TextField', [], {'null': 'True'}),\n 'succeeded': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'time': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}),\n 'time_complete': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'})\n },\n 'cabotapp.userprofile': {\n 'Meta': {'object_name': 'UserProfile'},\n 'fallback_alert_user': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'hipchat_alias': ('django.db.models.fields.CharField', [], {'default': \"''\", 'max_length': '50', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'mobile_number': ('django.db.models.fields.CharField', [], {'default': \"''\", 'max_length': '20', 'blank': 'True'}),\n 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': \"'profile'\", 'unique': 'True', 'to': \"orm['auth.User']\"})\n },\n 'contenttypes.contenttype': {\n 'Meta': {'ordering': \"('name',)\", 'unique_together': \"(('app_label', 'model'),)\", 'object_name': 'ContentType', 'db_table': \"'django_content_type'\"},\n 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})\n }\n }\n\n complete_apps = ['cabotapp']", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 7 }, { "content": " def forwards(self, orm):\n # Adding field 'StatusCheckResult.job_number'\n db.add_column('cabotapp_statuscheckresult', 'job_number',\n self.gf('django.db.models.fields.PositiveIntegerField')(null=True),\n keep_default=False)", "metadata": "root.Migration.forwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 9 }, { "content": " def backwards(self, orm):\n # Deleting field 'StatusCheckResult.job_number'\n db.delete_column('cabotapp_statuscheckresult', 'job_number')", "metadata": "root.Migration.backwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 16 } ]
[ { "span": "import datetime", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 15 }, { "span": "from django.db import models", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 28 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "db_", "import_", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "v2_", "import_", "Schema", "Migration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "'", "auth", ".", "group", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Group", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "80", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "permissi", "on", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "content", "\\u", "type\\u\\u", "app", "\\u", "label", "',", " ", "'", "content", "\\u", "type\\u\\u", "model", "',", " ", "'", "code", "name", "')\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "content", "\\u", "type", "',", " ", "'", "code", "name", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Permi", "ssion", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "code", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "user", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "User", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "joine", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Ema", "il", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "7", "5", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "first", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Group", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "active", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "sta", "ff", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "super", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "login", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "128", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cab", "ota", "pp", ".", "instance", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'", "name", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Insta", "nce", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "address", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "alert", "s", "\\u", "enable", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "\\u", "alert", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hack", "pad", "\\u", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hip", "chat", "\\u", "alert", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "alert", "\\u", "sent", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "old", "\\u", "over", "all", "\\u", "status", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"'", "PASS", "ING", "'\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "over", "all", "\\u", "status", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"'", "PASS", "ING", "'\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sms", "\\u", "alert", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "\\u", "checks", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "cab", "ota", "pp", ".", "Status", "Check", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "telephone", "\\u", "alert", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "users", "\\u", "to", "\\u", "notif", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cab", "ota", "pp", ".", "instance", "status", "snapshot", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Insta", "nce", "Status", "Snapshot", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "did", "\\u", "send", "\\u", "alert", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "instance", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "snapshot", "s", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "cab", "ota", "pp", ".", "Insta", "nce", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "num", "\\u", "checks", "\\u", "active", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "num", "\\u", "checks", "\\u", "faili", "ng", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "num", "\\u", "checks", "\\u", "passi", "ng", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "over", "all", "\\u", "status", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"'", "PASS", "ING", "'\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "time", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cab", "ota", "pp", ".", "service", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'", "name", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Service", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "alert", "s", "\\u", "enable", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "\\u", "alert", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hack", "pad", "\\u", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hip", "chat", "\\u", "alert", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "instance", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "cab", "ota", "pp", ".", "Insta", "nce", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "alert", "\\u", "sent", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "old", "\\u", "over", "all", "\\u", "status", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"'", "PASS", "ING", "'\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "over", "all", "\\u", "status", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"'", "PASS", "ING", "'\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sms", "\\u", "alert", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "\\u", "checks", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "cab", "ota", "pp", ".", "Status", "Check", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "telephone", "\\u", "alert", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "users", "\\u", "to", "\\u", "notif", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cab", "ota", "pp", ".", "service", "status", "snapshot", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Service", "Status", "Snapshot", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "did", "\\u", "send", "\\u", "alert", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "num", "\\u", "checks", "\\u", "active", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "num", "\\u", "checks", "\\u", "faili", "ng", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "num", "\\u", "checks", "\\u", "passi", "ng", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "over", "all", "\\u", "status", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"'", "PASS", "ING", "'\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "service", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "snapshot", "s", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "cab", "ota", "pp", ".", "Service", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "time", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cab", "ota", "pp", ".", "shift", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Shi", "ft", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "delete", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "end", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "uid", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cab", "ota", "pp", ".", "statusc", "heck", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'", "name", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Status", "Check", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "active", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cache", "d\\u", "health", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "calculated", "\\u", "status", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"'", "passi", "ng", "'\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "check", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "\\u", "by", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deb", "oun", "ce", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "endpoint", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "expected", "\\u", "num", "\\u", "host", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "freque", "nc", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "5", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "importance", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"'", "ERROR", "'\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "run", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "max", "\\u", "queue", "d\\u", "build", "\\u", "time", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "metric", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "polymorphic", "\\u", "ctype", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "polymorphic", "\\u", "cab", "ota", "pp", ".", "statusc", "heck", "\\u", "set", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "\\u", "code", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "200", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "text", "\\u", "match", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "timeo", "ut", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "30", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "value", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "verify", "\\u", "ssl", "\\u", "certifica", "te", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cab", "ota", "pp", ".", "statusc", "heck", "result", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Status", "Check", "Result", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "check", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "cab", "ota", "pp", ".", "Status", "Check", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "error", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "job", "\\u", "number", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "raw", "\\u", "data", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "succe", "eded", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "time", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "time", "\\u", "complete", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cab", "ota", "pp", ".", "userprofile", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "User", "Profil", "e", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fall", "back", "\\u", "alert", "\\u", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hip", "chat", "\\u", "alias", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"''\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mobile", "\\u", "number", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"''\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "20", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "profile", "'\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "contenttype", "s", ".", "contenttype", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "name", "',)\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "app", "\\u", "label", "',", " ", "'", "model", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Conten", "t", "Type", "'_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "django", "\\u", "content", "\\u", "type", "'\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "app", "\\u", "label", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "model", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "complete", "\\u", "apps_", "=_", "[_", "'", "cab", "ota", "pp", "'_", "]_", "[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", " ", "'", "Status", "Check", "Result", ".", "job", "\\u", "number", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "add", "\\u", "column_", "(_", "'", "cab", "ota", "pp", "\\u", "statusc", "heck", "result", "'_", ",_", "'", "job", "\\u", "number", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ")_", "(_", "null_", "=_", "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", " ", "'", "Status", "Check", "Result", ".", "job", "\\u", "number", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "delete", "\\u", "column_", "(_", "'", "cab", "ota", "pp", "\\u", "statusc", "heck", "result", "'_", ",_", "'", "job", "\\u", "number", "'_", ")_", "\\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, 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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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
First parameter of a method is not named 'self'
cornell-brg/pymtl/pclib/rtl/regs.py
[ { "content": " def __init__( s, dtype = 1 ):\n\n s.in_ = InPort ( dtype )\n s.out = OutPort ( dtype )\n\n @s.posedge_clk\n def seq_logic():\n s.out.next = s.in_", "metadata": "root.Reg.__init__", "header": "['class', 'Reg', '(', 'Model', ')', ':', '___EOS___']", "index": 12 }, { "content": " def line_trace( s ):\n return \"{} ({}) {}\".format( s.in_, s.out, s.out )", "metadata": "root.Reg.line_trace", "header": "['class', 'Reg', '(', 'Model', ')', ':', '___EOS___']", "index": 21 }, { "content": " def __init__( s, dtype = 1 ):\n\n s.in_ = InPort ( dtype )\n s.en = InPort ( 1 )\n s.out = OutPort ( dtype )\n\n @s.posedge_clk\n def seq_logic():\n if s.en:\n s.out.next = s.in_", "metadata": "root.RegEn.__init__", "header": "['class', 'RegEn', '(', 'Model', ')', ':', '___EOS___']", "index": 30 }, { "content": " def line_trace( s ):\n return \"{} ({}) {}\".format( s.in_, s.out, s.out )", "metadata": "root.RegEn.line_trace", "header": "['class', 'RegEn', '(', 'Model', ')', ':', '___EOS___']", "index": 41 }, { "content": " def __init__( s, dtype = 1, reset_value = 0 ):\n\n s.in_ = InPort( dtype )\n s.out = OutPort( dtype )\n\n @s.posedge_clk\n def seq_logic():\n if s.reset:\n s.out.next = reset_value\n else:\n s.out.next = s.in_", "metadata": "root.RegRst.__init__", "header": "['class', 'RegRst', '(', 'Model', ')', ':', '___EOS___']", "index": 54 }, { "content": " def line_trace( s ):\n return \"{} ({}) {}\".format( s.in_, s.out, s.out )", "metadata": "root.RegRst.line_trace", "header": "['class', 'RegRst', '(', 'Model', ')', ':', '___EOS___']", "index": 66 }, { "content": " def __init__( s, dtype = 1, reset_value = 0 ):\n\n s.en = InPort( 1 )\n s.in_ = InPort ( dtype )\n s.out = OutPort( dtype )\n\n @s.posedge_clk\n def seq_logic():\n if s.reset:\n s.out.next = reset_value\n elif s.en:\n s.out.next = s.in_", "metadata": "root.RegEnRst.__init__", "header": "['class', 'RegEnRst', '(', 'Model', ')', ':', '___EOS___']", "index": 85 }, { "content": " def line_trace( s ):\n return \"{} ({}) {}\".format( s.in_, s.out, s.out )", "metadata": "root.RegEnRst.line_trace", "header": "['class', 'RegEnRst', '(', 'Model', ')', ':', '___EOS___']", "index": 98 } ]
[ { "span": "def __init__( s, dtype = 1 ):", "start_line": 12, "start_column": 2, "end_line": 12, "end_column": 31 }, { "span": "def line_trace( s ):", "start_line": 21, "start_column": 2, "end_line": 21, "end_column": 22 }, { "span": "def __init__( s, dtype = 1 ):", "start_line": 30, "start_column": 2, "end_line": 30, "end_column": 31 }, { "span": "def line_trace( s ):", "start_line": 41, "start_column": 2, "end_line": 41, "end_column": 22 }, { "span": "def __init__( s, dtype = 1, reset_value = 0 ):", "start_line": 54, "start_column": 2, "end_line": 54, "end_column": 48 }, { "span": "def line_trace( s ):", "start_line": 66, "start_column": 2, "end_line": 66, "end_column": 22 }, { "span": "def __init__( s, dtype = 1, reset_value = 0 ):", "start_line": 85, "start_column": 2, "end_line": 85, "end_column": 48 }, { "span": "def line_trace( s ):", "start_line": 98, "start_column": 2, "end_line": 98, "end_column": 22 } ]
[]
1
true
[ "[CLS]_", "First_", "parameter_", "of_", "a_", "method_", "is_", "not_", "named_", "'", "self", "'_", "[SEP]_", "class_", "Reg_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "dtype_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "dtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out_", "=_", "Out", "Port_", "(_", "dtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "s_", "._", "pose", "dge", "\\u", "clk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "seq", "\\u", "logic_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "out_", "._", "next_", "=_", "s_", "._", "in\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Reg_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "line", "\\u", "trace_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"{}", " ", "({})", " ", "{}\"_", "._", "format_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "out_", ",_", "s_", "._", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Reg", "En", "_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "dtype_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "dtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "en_", "=_", "In", "Port_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out_", "=_", "Out", "Port_", "(_", "dtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "s_", "._", "pose", "dge", "\\u", "clk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "seq", "\\u", "logic_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "s_", "._", "en_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "out_", "._", "next_", "=_", "s_", "._", "in\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Reg", "En", "_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "line", "\\u", "trace_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"{}", " ", "({})", " ", "{}\"_", "._", "format_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "out_", ",_", "s_", "._", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Reg", "Rs", "t_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "dtype_", "=_", "1_", ",_", "reset", "\\u", "value_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "dtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out_", "=_", "Out", "Port_", "(_", "dtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "s_", "._", "pose", "dge", "\\u", "clk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "seq", "\\u", "logic_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "s_", "._", "reset_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "out_", "._", "next_", "=_", "reset", "\\u", "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 ", " _", "s_", "._", "out_", "._", "next_", "=_", "s_", "._", "in\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Reg", "Rs", "t_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "line", "\\u", "trace_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"{}", " ", "({})", " ", "{}\"_", "._", "format_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "out_", ",_", "s_", "._", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Reg", "En", "Rs", "t_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "dtype_", "=_", "1_", ",_", "reset", "\\u", "value_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "en_", "=_", "In", "Port_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "dtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out_", "=_", "Out", "Port_", "(_", "dtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "s_", "._", "pose", "dge", "\\u", "clk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "seq", "\\u", "logic_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "s_", "._", "reset_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "out_", "._", "next_", "=_", "reset", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "s_", "._", "en_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "out_", "._", "next_", "=_", "s_", "._", "in\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Reg", "En", "Rs", "t_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "line", "\\u", "trace_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"{}", " ", "({})", " ", "{}\"_", "._", "format_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "out_", ",_", "s_", "._", "out_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2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 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
revsys/django-friendship/friendship/tests/tests.py
[ { "content": " def test_friendship_view_users(self):\n url = reverse('friendship_view_users')\n\n # test that the view requires authentication to access it\n response = self.client.get(url)\n self.assertResponse200(response)\n\n with self.settings(FRIENDSHIP_CONTEXT_OBJECT_LIST_NAME='object_list', TEMPLATE_DIRS=(TEST_TEMPLATES,)):\n response = self.client.get(url)\n self.assertResponse200(response)\n self.assertTrue('object_list' in response.context)", "metadata": "root.FriendshipViewTests.test_friendship_view_users", "header": "['class', 'FriendshipViewTests', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 239 }, { "content": " def test_friendship_view_friends(self):\n url = reverse('friendship_view_friends', kwargs={'username': self.user_bob.username})\n\n # test that the view requires authentication to access it\n response = self.client.get(url)\n self.assertResponse200(response)\n self.assertTrue('user' in response.context)\n\n with self.settings(FRIENDSHIP_CONTEXT_OBJECT_NAME='object', TEMPLATE_DIRS=(TEST_TEMPLATES,)):\n response = self.client.get(url)\n self.assertResponse200(response)\n self.assertTrue('object' in response.context)", "metadata": "root.FriendshipViewTests.test_friendship_view_friends", "header": "['class', 'FriendshipViewTests', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 251 }, { "content": " def test_friendship_add_friend(self):\n url = reverse('friendship_add_friend', kwargs={'to_username': self.user_amy.username})\n\n # test that the view requires authentication to access it\n response = self.client.get(url)\n self.assertResponse302(response)\n\n with self.login(self.user_bob.username, self.user_pw):\n # if we don't POST the view should return the\n # friendship_add_friend view\n response = self.client.get(url)\n self.assertResponse200(response)\n\n # on POST accept the friendship request and redirect to the\n # friendship_request_list view\n response = self.client.post(url)\n self.assertResponse302(response)\n redirect_url = reverse('friendship_request_list')\n self.assertTrue(redirect_url in response['Location'])", "metadata": "root.FriendshipViewTests.test_friendship_add_friend", "header": "['class', 'FriendshipViewTests', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 264 }, { "content": " def test_friendship_add_friend_dupe(self):\n url = reverse('friendship_add_friend', kwargs={'to_username': self.user_amy.username})\n\n with self.login(self.user_bob.username, self.user_pw):\n # if we don't POST the view should return the\n # friendship_add_friend view\n\n # on POST accept the friendship request and redirect to the\n # friendship_request_list view\n response = self.client.post(url)\n self.assertResponse302(response)\n redirect_url = reverse('friendship_request_list')\n self.assertTrue(redirect_url in response['Location'])\n\n response = self.client.post(url)\n self.assertResponse200(response)\n self.assertTrue('errors' in response.context)\n self.assertEqual(response.context['errors'], ['Friendship already requested'])", "metadata": "root.FriendshipViewTests.test_friendship_add_friend_dupe", "header": "['class', 'FriendshipViewTests', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 284 }, { "content": " def test_friendship_accept(self):\n url = reverse('friendship_accept', kwargs={'friendship_request_id': self.friendship_request.pk})\n\n # test that the view requires authentication to access it\n response = self.client.get(url)\n self.assertResponse302(response)\n\n with self.login(self.user_bob.username, self.user_pw):\n # if we don't POST the view should return the\n # friendship_requests_detail view\n response = self.client.get(url)\n self.assertResponse302(response)\n redirect_url = reverse('friendship_requests_detail', kwargs={'friendship_request_id': self.friendship_request.pk})\n self.assertTrue(redirect_url in response['Location'])\n\n # on POST accept the friendship request and redirect to the\n # friendship_view_friends view\n response = self.client.post(url)\n self.assertResponse302(response)\n redirect_url = reverse('friendship_view_friends', kwargs={'username': self.user_bob.username})\n self.assertTrue(redirect_url in response['Location'])\n\n with self.login(self.user_steve.username, self.user_pw):\n # on POST try to accept the friendship request\n # but I am logged in as Steve, so I cannot accept\n # a request sent to Bob\n response = self.client.post(url)\n self.assertResponse404(response)", "metadata": "root.FriendshipViewTests.test_friendship_accept", "header": "['class', 'FriendshipViewTests', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 325 }, { "content": " def test_friendship_reject(self):\n url = reverse('friendship_reject', kwargs={'friendship_request_id': self.friendship_request.pk})\n\n # test that the view requires authentication to access it\n response = self.client.get(url)\n self.assertResponse302(response)\n\n with self.login(self.user_bob.username, self.user_pw):\n # if we don't POST the view should return the\n # friendship_requests_detail view\n response = self.client.get(url)\n self.assertResponse302(response)\n redirect_url = reverse('friendship_requests_detail', kwargs={'friendship_request_id': self.friendship_request.pk})\n self.assertTrue(redirect_url in response['Location'])\n\n # on POST reject the friendship request and redirect to the\n # friendship_requests view\n response = self.client.post(url)\n self.assertResponse302(response)\n redirect_url = reverse('friendship_request_list')\n self.assertTrue(redirect_url in response['Location'])\n\n with self.login(self.user_steve.username, self.user_pw):\n # on POST try to reject the friendship request\n # but I am logged in as Steve, so I cannot reject\n # a request sent to Bob\n response = self.client.post(url)\n self.assertResponse404(response)", "metadata": "root.FriendshipViewTests.test_friendship_reject", "header": "['class', 'FriendshipViewTests', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 354 }, { "content": " def test_friendship_cancel(self):\n url = reverse('friendship_cancel', kwargs={'friendship_request_id': self.friendship_request.pk})\n\n # test that the view requires authentication to access it\n response = self.client.get(url)\n self.assertResponse302(response)\n\n with self.login(self.user_bob.username, self.user_pw):\n # if we don't POST the view should return the\n # friendship_requests_detail view\n response = self.client.get(url)\n self.assertResponse302(response)\n redirect_url = reverse('friendship_requests_detail', kwargs={'friendship_request_id': self.friendship_request.pk})\n self.assertTrue(redirect_url in response['Location'])\n\n # on POST try to cancel the friendship request\n # but I am logged in as Bob, so I cannot cancel\n # a request made by Steve\n response = self.client.post(url)\n self.assertResponse404(response)\n\n with self.login(self.user_steve.username, self.user_pw):\n # on POST cancel the friendship request and redirect to the\n # friendship_requests view\n response = self.client.post(url)\n self.assertResponse302(response)\n redirect_url = reverse('friendship_request_list')\n self.assertTrue(redirect_url in response['Location'])", "metadata": "root.FriendshipViewTests.test_friendship_cancel", "header": "['class', 'FriendshipViewTests', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 383 }, { "content": " def test_friendship_followers(self):\n url = reverse('friendship_followers', kwargs={'username': 'bob'})\n\n # test that the view requires authentication to access it\n response = self.client.get(url)\n self.assertResponse200(response)\n\n with self.settings(FRIENDSHIP_CONTEXT_OBJECT_NAME='object', TEMPLATE_DIRS=(TEST_TEMPLATES,)):\n response = self.client.get(url)\n self.assertResponse200(response)\n self.assertTrue('object' in response.context)", "metadata": "root.FriendshipViewTests.test_friendship_followers", "header": "['class', 'FriendshipViewTests', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 423 }, { "content": " def test_friendship_following(self):\n url = reverse('friendship_following', kwargs={'username': 'bob'})\n\n # test that the view requires authentication to access it\n response = self.client.get(url)\n self.assertResponse200(response)\n\n with self.settings(FRIENDSHIP_CONTEXT_OBJECT_NAME='object', TEMPLATE_DIRS=(TEST_TEMPLATES,)):\n response = self.client.get(url)\n self.assertResponse200(response)\n self.assertTrue('object' in response.context)", "metadata": "root.FriendshipViewTests.test_friendship_following", "header": "['class', 'FriendshipViewTests', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 435 }, { "content": " def test_follower_add(self):\n url = reverse('follower_add', kwargs={'followee_username': self.user_amy.username})\n\n # test that the view requires authentication to access it\n response = self.client.get(url)\n self.assertResponse302(response)\n\n with self.login(self.user_bob.username, self.user_pw):\n response = self.client.get(url)\n self.assertResponse200(response)\n\n # on POST accept the friendship request and redirect to the\n # friendship_following view\n response = self.client.post(url)\n self.assertResponse302(response)\n redirect_url = reverse('friendship_following', kwargs={'username': self.user_bob.username})\n self.assertTrue(redirect_url in response['Location'])\n\n response = self.client.post(url)\n self.assertResponse200(response)\n self.assertTrue('errors' in response.context)\n self.assertEqual(response.context['errors'], [\"User 'bob' already follows 'amy'\"])", "metadata": "root.FriendshipViewTests.test_follower_add", "header": "['class', 'FriendshipViewTests', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 447 }, { "content": " def test_follower_remove(self):\n # create a follow relationship so we can test removing a follower\n follow = Follow.objects.add_follower(self.user_bob, self.user_amy)\n\n url = reverse('follower_remove', kwargs={'followee_username': self.user_amy.username})\n\n # test that the view requires authentication to access it\n response = self.client.get(url)\n self.assertResponse302(response)\n\n with self.login(self.user_bob.username, self.user_pw):\n response = self.client.get(url)\n self.assertResponse200(response)\n\n response = self.client.post(url)\n self.assertResponse302(response)\n redirect_url = reverse('friendship_following', kwargs={'username': self.user_bob.username})\n self.assertTrue(redirect_url in response['Location'])", "metadata": "root.FriendshipViewTests.test_follower_remove", "header": "['class', 'FriendshipViewTests', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 470 } ]
[ { "span": "self.assertTrue('object_list' in response.context)", "start_line": 249, "start_column": 12, "end_line": 249, "end_column": 62 }, { "span": "self.assertTrue('user' in response.context)", "start_line": 257, "start_column": 8, "end_line": 257, "end_column": 51 }, { "span": "self.assertTrue('object' in response.context)", "start_line": 262, "start_column": 12, "end_line": 262, "end_column": 57 }, { "span": "self.assertTrue(redirect_url in response['Location'])", "start_line": 282, "start_column": 12, "end_line": 282, "end_column": 65 }, { "span": "self.assertTrue(redirect_url in response['Location'])", "start_line": 296, "start_column": 12, "end_line": 296, "end_column": 65 }, { "span": "self.assertTrue('errors' in response.context)", "start_line": 300, "start_column": 12, "end_line": 300, "end_column": 57 }, { "span": "self.assertTrue(redirect_url in response['Location'])", "start_line": 338, "start_column": 12, "end_line": 338, "end_column": 65 }, { "span": "self.assertTrue(redirect_url in response['Location'])", "start_line": 345, "start_column": 12, "end_line": 345, "end_column": 65 }, { "span": "self.assertTrue(redirect_url in response['Location'])", "start_line": 367, "start_column": 12, "end_line": 367, "end_column": 65 }, { "span": "self.assertTrue(redirect_url in response['Location'])", "start_line": 374, "start_column": 12, "end_line": 374, "end_column": 65 }, { "span": "self.assertTrue(redirect_url in response['Location'])", "start_line": 396, "start_column": 12, "end_line": 396, "end_column": 65 }, { "span": "self.assertTrue(redirect_url in response['Location'])", "start_line": 410, "start_column": 12, "end_line": 410, "end_column": 65 }, { "span": "self.assertTrue('object' in response.context)", "start_line": 433, "start_column": 12, "end_line": 433, "end_column": 57 }, { "span": "self.assertTrue('object' in response.context)", "start_line": 445, "start_column": 12, "end_line": 445, "end_column": 57 }, { "span": "self.assertTrue(redirect_url in response['Location'])", "start_line": 463, "start_column": 12, "end_line": 463, "end_column": 65 }, { "span": "self.assertTrue('errors' in response.context)", "start_line": 467, "start_column": 12, "end_line": 467, "end_column": 57 }, { "span": "self.assertTrue(redirect_url in response['Location'])", "start_line": 487, "start_column": 12, "end_line": 487, "end_column": 65 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Friends", "hip", "View", "Tests_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "friends", "hip", "\\u", "view", "\\u", "users_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "reverse_", "(_", "'", "friends", "hip", "\\u", "view", "\\u", "users", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "tha", "t", " ", "the", " ", "view", " ", "require", "s", " ", "authenticat", "ion", " ", "to", " ", "access", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e2", "00_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "settings_", "(_", "FRI", "ENDS", "HI", "P", "\\u", "CONTE", "XT", "\\u", "OBJ", "ECT", "\\u", "LIST", "\\u", "NAME_", "=_", "'", "object\\u", "list", "'_", ",_", "TEMPL", "ATE", "\\u", "DIRS_", "=_", "(_", "TEST", "\\u", "TEMPLATES_", ",_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e2", "00_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "object\\u", "list", "'_", "in_", "response_", "._", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Friends", "hip", "View", "Tests_", "(_", "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", "friends", "hip", "\\u", "view", "\\u", "friends_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "reverse_", "(_", "'", "friends", "hip", "\\u", "view", "\\u", "friends", "'_", ",_", "kwargs_", "=_", "{_", "'", "user", "name", "'_", ":_", "self_", "._", "user", "\\u", "bob_", "._", "username_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "tha", "t", " ", "the", " ", "view", " ", "require", "s", " ", "authenticat", "ion", " ", "to", " ", "access", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e2", "00_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "user", "'_", "in_", "response_", "._", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "settings_", "(_", "FRI", "ENDS", "HI", "P", "\\u", "CONTE", "XT", "\\u", "OBJ", "ECT", "\\u", "NAME_", "=_", "'", "object", "'_", ",_", "TEMPL", "ATE", "\\u", "DIRS_", "=_", "(_", "TEST", "\\u", "TEMPLATES_", ",_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e2", "00_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "object", "'_", "in_", "response_", "._", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Friends", "hip", "View", "Tests_", "(_", "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", "friends", "hip", "\\u", "add", "\\u", "friend_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "reverse_", "(_", "'", "friends", "hip", "\\u", "add", "\\u", "frie", "nd", "'_", ",_", "kwargs_", "=_", "{_", "'", "to", "\\u", "user", "name", "'_", ":_", "self_", "._", "user", "\\u", "am", "y_", "._", "username_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "tha", "t", " ", "the", " ", "view", " ", "require", "s", " ", "authenticat", "ion", " ", "to", " ", "access", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e3", "02_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "login_", "(_", "self_", "._", "user", "\\u", "bob_", "._", "username_", ",_", "self_", "._", "user", "\\u", "pw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "we", " ", "don", "'", "t", " ", "POST", " ", "the", " ", "view", " ", "shou", "ld", " ", "return", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "friends", "hip", "\\u", "add", "\\u", "frie", "nd", " ", "view_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e2", "00_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "on", " ", "POST", " ", "accept", " ", "the", " ", "friends", "hip", " ", "request", " ", "and", " ", "redirec", "t", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "friends", "hip", "\\u", "request", "\\u", "list", " ", "view_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "post_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e3", "02_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirec", "t", "\\u", "url_", "=_", "reverse_", "(_", "'", "friends", "hip", "\\u", "request", "\\u", "list", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "redirec", "t", "\\u", "url_", "in_", "response_", "[_", "'", "Locat", "ion", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Friends", "hip", "View", "Tests_", "(_", "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", "friends", "hip", "\\u", "add", "\\u", "frie", "nd", "\\u", "dupe", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "reverse_", "(_", "'", "friends", "hip", "\\u", "add", "\\u", "frie", "nd", "'_", ",_", "kwargs_", "=_", "{_", "'", "to", "\\u", "user", "name", "'_", ":_", "self_", "._", "user", "\\u", "am", "y_", "._", "username_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "login_", "(_", "self_", "._", "user", "\\u", "bob_", "._", "username_", ",_", "self_", "._", "user", "\\u", "pw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "we", " ", "don", "'", "t", " ", "POST", " ", "the", " ", "view", " ", "shou", "ld", " ", "return", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "friends", "hip", "\\u", "add", "\\u", "frie", "nd", " ", "view_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "on", " ", "POST", " ", "accept", " ", "the", " ", "friends", "hip", " ", "request", " ", "and", " ", "redirec", "t", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "friends", "hip", "\\u", "request", "\\u", "list", " ", "view_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "client_", "._", "post_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e3", "02_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirec", "t", "\\u", "url_", "=_", "reverse_", "(_", "'", "friends", "hip", "\\u", "request", "\\u", "list", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "redirec", "t", "\\u", "url_", "in_", "response_", "[_", "'", "Locat", "ion", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "post_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e2", "00_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "error", "s", "'_", "in_", "response_", "._", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "context_", "[_", "'", "error", "s", "'_", "]_", ",_", "[_", "'", "Friends", "hip", " ", "alr", "ead", "y", " ", "request", "ed", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Friends", "hip", "View", "Tests_", "(_", "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", "friends", "hip", "\\u", "accept_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "reverse_", "(_", "'", "friends", "hip", "\\u", "accept", "'_", ",_", "kwargs_", "=_", "{_", "'", "friends", "hip", "\\u", "request", "\\u", "id", "'_", ":_", "self_", "._", "friends", "hip", "\\u", "request_", "._", "pk_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "tha", "t", " ", "the", " ", "view", " ", "require", "s", " ", "authenticat", "ion", " ", "to", " ", "access", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e3", "02_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "login_", "(_", "self_", "._", "user", "\\u", "bob_", "._", "username_", ",_", "self_", "._", "user", "\\u", "pw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "we", " ", "don", "'", "t", " ", "POST", " ", "the", " ", "view", " ", "shou", "ld", " ", "return", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "friends", "hip", "\\u", "request", "s", "\\u", "deta", "il", " ", "view_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e3", "02_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirec", "t", "\\u", "url_", "=_", "reverse_", "(_", "'", "friends", "hip", "\\u", "request", "s", "\\u", "deta", "il", "'_", ",_", "kwargs_", "=_", "{_", "'", "friends", "hip", "\\u", "request", "\\u", "id", "'_", ":_", "self_", "._", "friends", "hip", "\\u", "request_", "._", "pk_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "redirec", "t", "\\u", "url_", "in_", "response_", "[_", "'", "Locat", "ion", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "on", " ", "POST", " ", "accept", " ", "the", " ", "friends", "hip", " ", "request", " ", "and", " ", "redirec", "t", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "friends", "hip", "\\u", "view", "\\u", "friends", " ", "view_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "post_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e3", "02_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirec", "t", "\\u", "url_", "=_", "reverse_", "(_", "'", "friends", "hip", "\\u", "view", "\\u", "friends", "'_", ",_", "kwargs_", "=_", "{_", "'", "user", "name", "'_", ":_", "self_", "._", "user", "\\u", "bob_", "._", "username_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "redirec", "t", "\\u", "url_", "in_", "response_", "[_", "'", "Locat", "ion", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "login_", "(_", "self_", "._", "user", "\\u", "ste", "ve_", "._", "username_", ",_", "self_", "._", "user", "\\u", "pw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "on", " ", "POST", " ", "try", " ", "to", " ", "accept", " ", "the", " ", "friends", "hip", " ", "request_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "but", " ", "I", " ", "am", " ", "logged", " ", "in", " ", "as", " ", "Ste", "ve", ",", " ", "so", " ", "I", " ", "cann", "ot", " ", "accept_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "request", " ", "sent", " ", "to", " ", "Bob", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "client_", "._", "post_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e4", "04_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Friends", "hip", "View", "Tests_", "(_", "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", "friends", "hip", "\\u", "reject_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "reverse_", "(_", "'", "friends", "hip", "\\u", "reject", "'_", ",_", "kwargs_", "=_", "{_", "'", "friends", "hip", "\\u", "request", "\\u", "id", "'_", ":_", "self_", "._", "friends", "hip", "\\u", "request_", "._", "pk_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "tha", "t", " ", "the", " ", "view", " ", "require", "s", " ", "authenticat", "ion", " ", "to", " ", "access", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e3", "02_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "login_", "(_", "self_", "._", "user", "\\u", "bob_", "._", "username_", ",_", "self_", "._", "user", "\\u", "pw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "we", " ", "don", "'", "t", " ", "POST", " ", "the", " ", "view", " ", "shou", "ld", " ", "return", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "friends", "hip", "\\u", "request", "s", "\\u", "deta", "il", " ", "view_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e3", "02_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirec", "t", "\\u", "url_", "=_", "reverse_", "(_", "'", "friends", "hip", "\\u", "request", "s", "\\u", "deta", "il", "'_", ",_", "kwargs_", "=_", "{_", "'", "friends", "hip", "\\u", "request", "\\u", "id", "'_", ":_", "self_", "._", "friends", "hip", "\\u", "request_", "._", "pk_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "redirec", "t", "\\u", "url_", "in_", "response_", "[_", "'", "Locat", "ion", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "on", " ", "POST", " ", "reject", " ", "the", " ", "friends", "hip", " ", "request", " ", "and", " ", "redirec", "t", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "friends", "hip", "\\u", "request", "s", " ", "view_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "post_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e3", "02_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirec", "t", "\\u", "url_", "=_", "reverse_", "(_", "'", "friends", "hip", "\\u", "request", "\\u", "list", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "redirec", "t", "\\u", "url_", "in_", "response_", "[_", "'", "Locat", "ion", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "login_", "(_", "self_", "._", "user", "\\u", "ste", "ve_", "._", "username_", ",_", "self_", "._", "user", "\\u", "pw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "on", " ", "POST", " ", "try", " ", "to", " ", "reject", " ", "the", " ", "friends", "hip", " ", "request_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "but", " ", "I", " ", "am", " ", "logged", " ", "in", " ", "as", " ", "Ste", "ve", ",", " ", "so", " ", "I", " ", "cann", "ot", " ", "reject_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "request", " ", "sent", " ", "to", " ", "Bob", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "client_", "._", "post_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e4", "04_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Friends", "hip", "View", "Tests_", "(_", "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", "friends", "hip", "\\u", "cancel_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "reverse_", "(_", "'", "friends", "hip", "\\u", "cancel", "'_", ",_", "kwargs_", "=_", "{_", "'", "friends", "hip", "\\u", "request", "\\u", "id", "'_", ":_", "self_", "._", "friends", "hip", "\\u", "request_", "._", "pk_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "tha", "t", " ", "the", " ", "view", " ", "require", "s", " ", "authenticat", "ion", " ", "to", " ", "access", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e3", "02_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "login_", "(_", "self_", "._", "user", "\\u", "bob_", "._", "username_", ",_", "self_", "._", "user", "\\u", "pw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "we", " ", "don", "'", "t", " ", "POST", " ", "the", " ", "view", " ", "shou", "ld", " ", "return", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "friends", "hip", "\\u", "request", "s", "\\u", "deta", "il", " ", "view_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e3", "02_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirec", "t", "\\u", "url_", "=_", "reverse_", "(_", "'", "friends", "hip", "\\u", "request", "s", "\\u", "deta", "il", "'_", ",_", "kwargs_", "=_", "{_", "'", "friends", "hip", "\\u", "request", "\\u", "id", "'_", ":_", "self_", "._", "friends", "hip", "\\u", "request_", "._", "pk_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "redirec", "t", "\\u", "url_", "in_", "response_", "[_", "'", "Locat", "ion", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "on", " ", "POST", " ", "try", " ", "to", " ", "cancel", " ", "the", " ", "friends", "hip", " ", "request_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "but", " ", "I", " ", "am", " ", "logged", " ", "in", " ", "as", " ", "Bob", ",", " ", "so", " ", "I", " ", "cann", "ot", " ", "cancel_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "request", " ", "made", " ", "by", " ", "Ste", "ve_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "post_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e4", "04_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "login_", "(_", "self_", "._", "user", "\\u", "ste", "ve_", "._", "username_", ",_", "self_", "._", "user", "\\u", "pw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "on", " ", "POST", " ", "cancel", " ", "the", " ", "friends", "hip", " ", "request", " ", "and", " ", "redirec", "t", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "friends", "hip", "\\u", "request", "s", " ", "view_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "client_", "._", "post_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e3", "02_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirec", "t", "\\u", "url_", "=_", "reverse_", "(_", "'", "friends", "hip", "\\u", "request", "\\u", "list", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "redirec", "t", "\\u", "url_", "in_", "response_", "[_", "'", "Locat", "ion", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Friends", "hip", "View", "Tests_", "(_", "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", "friends", "hip", "\\u", "followers", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "reverse_", "(_", "'", "friends", "hip", "\\u", "followers", "'_", ",_", "kwargs_", "=_", "{_", "'", "user", "name", "'_", ":_", "'", "bob", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "tha", "t", " ", "the", " ", "view", " ", "require", "s", " ", "authenticat", "ion", " ", "to", " ", "access", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e2", "00_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "settings_", "(_", "FRI", "ENDS", "HI", "P", "\\u", "CONTE", "XT", "\\u", "OBJ", "ECT", "\\u", "NAME_", "=_", "'", "object", "'_", ",_", "TEMPL", "ATE", "\\u", "DIRS_", "=_", "(_", "TEST", "\\u", "TEMPLATES_", ",_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e2", "00_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "object", "'_", "in_", "response_", "._", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Friends", "hip", "View", "Tests_", "(_", "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", "friends", "hip", "\\u", "following_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "reverse_", "(_", "'", "friends", "hip", "\\u", "follow", "ing", "'_", ",_", "kwargs_", "=_", "{_", "'", "user", "name", "'_", ":_", "'", "bob", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "tha", "t", " ", "the", " ", "view", " ", "require", "s", " ", "authenticat", "ion", " ", "to", " ", "access", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e2", "00_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "settings_", "(_", "FRI", "ENDS", "HI", "P", "\\u", "CONTE", "XT", "\\u", "OBJ", "ECT", "\\u", "NAME_", "=_", "'", "object", "'_", ",_", "TEMPL", "ATE", "\\u", "DIRS_", "=_", "(_", "TEST", "\\u", "TEMPLATES_", ",_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e2", "00_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "object", "'_", "in_", "response_", "._", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Friends", "hip", "View", "Tests_", "(_", "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", "follower", "\\u", "add_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "reverse_", "(_", "'", "follower", "\\u", "add", "'_", ",_", "kwargs_", "=_", "{_", "'", "followe", "e\\u", "user", "name", "'_", ":_", "self_", "._", "user", "\\u", "am", "y_", "._", "username_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "tha", "t", " ", "the", " ", "view", " ", "require", "s", " ", "authenticat", "ion", " ", "to", " ", "access", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e3", "02_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "login_", "(_", "self_", "._", "user", "\\u", "bob_", "._", "username_", ",_", "self_", "._", "user", "\\u", "pw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e2", "00_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "on", " ", "POST", " ", "accept", " ", "the", " ", "friends", "hip", " ", "request", " ", "and", " ", "redirec", "t", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "friends", "hip", "\\u", "follow", "ing", " ", "view_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "post_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e3", "02_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirec", "t", "\\u", "url_", "=_", "reverse_", "(_", "'", "friends", "hip", "\\u", "follow", "ing", "'_", ",_", "kwargs_", "=_", "{_", "'", "user", "name", "'_", ":_", "self_", "._", "user", "\\u", "bob_", "._", "username_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "redirec", "t", "\\u", "url_", "in_", "response_", "[_", "'", "Locat", "ion", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "post_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e2", "00_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "error", "s", "'_", "in_", "response_", "._", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "context_", "[_", "'", "error", "s", "'_", "]_", ",_", "[_", "\"", "User", " ", "'", "bob", "'", " ", "alr", "ead", "y", " ", "follow", "s", " ", "'", "am", "y", "'\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Friends", "hip", "View", "Tests_", "(_", "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", "follower", "\\u", "remove_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "follow", " ", "relation", "ship", " ", "so", " ", "we", " ", "can", " ", "test", " ", "remo", "ving", " ", "a", " ", "follower", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "follow_", "=_", "Follow", "_", "._", "objects_", "._", "add", "\\u", "follower", "_", "(_", "self_", "._", "user", "\\u", "bob_", ",_", "self_", "._", "user", "\\u", "am", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "reverse_", "(_", "'", "follower", "\\u", "remove", "'_", ",_", "kwargs_", "=_", "{_", "'", "followe", "e\\u", "user", "name", "'_", ":_", "self_", "._", "user", "\\u", "am", "y_", "._", "username_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "tha", "t", " ", "the", " ", "view", " ", "require", "s", " ", "authenticat", "ion", " ", "to", " ", "access", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e3", "02_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "login_", "(_", "self_", "._", "user", "\\u", "bob_", "._", "username_", ",_", "self_", "._", "user", "\\u", "pw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e2", "00_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "post_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Respons", "e3", "02_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirec", "t", "\\u", "url_", "=_", "reverse_", "(_", "'", "friends", "hip", "\\u", "follow", "ing", "'_", ",_", "kwargs_", "=_", "{_", "'", "user", "name", "'_", ":_", "self_", "._", "user", "\\u", "bob_", "._", "username_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "redirec", "t", "\\u", "url_", "in_", "response_", "[_", "'", "Locat", "ion", "'_", "]_", ")_" ]
[ 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, 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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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
Unused local variable
zzzeek/sqlalchemy/test/dialect/postgresql/test_reflection.py
[ { "content": " @classmethod\n def define_tables(cls, metadata):\n from sqlalchemy.testing import config\n dblink = config.file_config.get(\n 'sqla_testing', 'postgres_test_db_link')\n\n testtable = Table(\n 'testtable', metadata,\n Column('id', Integer, primary_key=True),\n Column('data', String(30)))\n\n for ddl in [\n \"CREATE SERVER test_server FOREIGN DATA WRAPPER postgres_fdw \"\n \"OPTIONS (dbname 'test', host '%s')\" % dblink,\n \"CREATE USER MAPPING FOR public \\\n SERVER test_server options (user 'scott', password 'tiger')\",\n \"CREATE FOREIGN TABLE test_foreigntable ( \"\n \" id INT, \"\n \" data VARCHAR(30) \"\n \") SERVER test_server OPTIONS (table_name 'testtable')\",\n ]:\n sa.event.listen(metadata, \"after_create\", sa.DDL(ddl))\n\n for ddl in [\n 'DROP FOREIGN TABLE test_foreigntable',\n 'DROP USER MAPPING FOR public SERVER test_server',\n \"DROP SERVER test_server\"\n ]:\n sa.event.listen(metadata, \"before_drop\", sa.DDL(ddl))", "metadata": "root.ForeignTableReflectionTest.define_tables", "header": "['class', 'ForeignTableReflectionTest', '(', 'fixtures', '.', 'TablesTest', ',', 'AssertsExecutionResults', ')', ':', '___EOS___']", "index": 25 }, { "content": " @testing.fails_if(\"postgresql < 8.1\", \"schema name leaks in, not sure\")\n @testing.provide_metadata\n def test_renamed_sequence_reflection(self):\n metadata = self.metadata\n t = Table('t', metadata, Column('id', Integer, primary_key=True))\n metadata.create_all()\n m2 = MetaData(testing.db)\n t2 = Table('t', m2, autoload=True, implicit_returning=False)\n eq_(t2.c.id.server_default.arg.text,\n \"nextval('t_id_seq'::regclass)\")\n r = t2.insert().execute()\n eq_(r.inserted_primary_key, [1])\n testing.db.connect().execution_options(autocommit=True).\\\n execute('alter table t_id_seq rename to foobar_id_seq'\n )\n m3 = MetaData(testing.db)\n t3 = Table('t', m3, autoload=True, implicit_returning=False)\n eq_(t3.c.id.server_default.arg.text,\n \"nextval('foobar_id_seq'::regclass)\")\n r = t3.insert().execute()\n eq_(r.inserted_primary_key, [2])", "metadata": "root.ReflectionTest.test_renamed_sequence_reflection", "header": "['class', 'ReflectionTest', '(', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 302 }, { "content": " @testing.provide_metadata\n def test_renamed_pk_reflection(self):\n metadata = self.metadata\n t = Table('t', metadata, Column('id', Integer, primary_key=True))\n metadata.create_all()\n testing.db.connect().execution_options(autocommit=True).\\\n execute('alter table t rename id to t_id')\n m2 = MetaData(testing.db)\n t2 = Table('t', m2, autoload=True)\n eq_([c.name for c in t2.primary_key], ['t_id'])", "metadata": "root.ReflectionTest.test_renamed_pk_reflection", "header": "['class', 'ReflectionTest', '(', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 324 }, { "content": " @testing.provide_metadata\n def test_cross_schema_reflection_six(self):\n # test that the search path *is* taken into account\n # by default\n meta1 = self.metadata\n\n Table('some_table', meta1,\n Column('id', Integer, primary_key=True),\n schema='test_schema'\n )\n Table('some_other_table', meta1,\n Column('id', Integer, primary_key=True),\n Column('sid', Integer, ForeignKey('test_schema.some_table.id')),\n schema='test_schema_2'\n )\n meta1.create_all()\n with testing.db.connect() as conn:\n conn.detach()\n\n conn.execute(\n \"set search_path to test_schema_2, test_schema, public\")\n\n m1 = MetaData(conn)\n\n t1_schema = Table('some_table',\n m1,\n schema=\"test_schema\",\n autoload=True)\n t2_schema = Table('some_other_table',\n m1,\n schema=\"test_schema_2\",\n autoload=True)\n\n t2_no_schema = Table('some_other_table',\n m1,\n autoload=True)\n\n t1_no_schema = Table('some_table',\n m1,\n autoload=True)\n\n m2 = MetaData(conn)\n t1_schema_isp = Table('some_table',\n m2,\n schema=\"test_schema\",\n autoload=True,\n postgresql_ignore_search_path=True)\n t2_schema_isp = Table('some_other_table',\n m2,\n schema=\"test_schema_2\",\n autoload=True,\n postgresql_ignore_search_path=True)\n\n # t2_schema refers to t1_schema, but since \"test_schema\"\n # is in the search path, we instead link to t2_no_schema\n assert t2_schema.c.sid.references(\n t1_no_schema.c.id)\n\n # the two no_schema tables refer to each other also.\n assert t2_no_schema.c.sid.references(\n t1_no_schema.c.id)\n\n # but if we're ignoring search path, then we maintain\n # those explicit schemas vs. what the \"default\" schema is\n assert t2_schema_isp.c.sid.references(t1_schema_isp.c.id)", "metadata": "root.ReflectionTest.test_cross_schema_reflection_six", "header": "['class', 'ReflectionTest', '(', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 483 }, { "content": " @testing.provide_metadata\n def test_index_reflection(self):\n \"\"\" Reflecting partial & expression-based indexes should warn\n \"\"\"\n\n metadata = self.metadata\n\n t1 = Table(\n 'party', metadata,\n Column(\n 'id', String(10), nullable=False),\n Column(\n 'name', String(20), index=True),\n Column(\n 'aname', String(20)))\n metadata.create_all()\n testing.db.execute(\"\"\"\n create index idx1 on party ((id || name))\n \"\"\")\n testing.db.execute(\"\"\"\n create unique index idx2 on party (id) where name = 'test'\n \"\"\")\n testing.db.execute(\"\"\"\n create index idx3 on party using btree\n (lower(name::text), lower(aname::text))\n \"\"\")\n\n def go():\n m2 = MetaData(testing.db)\n t2 = Table('party', m2, autoload=True)\n assert len(t2.indexes) == 2\n\n # Make sure indexes are in the order we expect them in\n\n tmp = [(idx.name, idx) for idx in t2.indexes]\n tmp.sort()\n r1, r2 = [idx[1] for idx in tmp]\n assert r1.name == 'idx2'\n assert r1.unique == True\n assert r2.unique == False\n assert [t2.c.id] == r1.columns\n assert [t2.c.name] == r2.columns\n\n testing.assert_warnings(\n go,\n ['Skipped unsupported reflection of '\n 'expression-based index idx1',\n 'Predicate of partial index idx2 ignored during '\n 'reflection',\n 'Skipped unsupported reflection of '\n 'expression-based index idx3'])", "metadata": "root.ReflectionTest.test_index_reflection", "header": "['class', 'ReflectionTest', '(', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 610 }, { "content": " @testing.provide_metadata\n def test_index_reflection_modified(self):\n \"\"\"reflect indexes when a column name has changed - PG 9\n does not update the name of the column in the index def.\n [ticket:2141]\n\n \"\"\"\n\n metadata = self.metadata\n\n t1 = Table('t', metadata,\n Column('id', Integer, primary_key=True),\n Column('x', Integer)\n )\n metadata.create_all()\n conn = testing.db.connect().execution_options(autocommit=True)\n conn.execute(\"CREATE INDEX idx1 ON t (x)\")\n conn.execute(\"ALTER TABLE t RENAME COLUMN x to y\")\n\n ind = testing.db.dialect.get_indexes(conn, \"t\", None)\n eq_(ind, [{'unique': False, 'column_names': ['y'], 'name': 'idx1'}])\n conn.close()", "metadata": "root.ReflectionTest.test_index_reflection_modified", "header": "['class', 'ReflectionTest', '(', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 662 } ]
[ { "span": "testtable ", "start_line": 31, "start_column": 8, "end_line": 31, "end_column": 17 }, { "span": "t ", "start_line": 306, "start_column": 8, "end_line": 306, "end_column": 9 }, { "span": "t ", "start_line": 327, "start_column": 8, "end_line": 327, "end_column": 9 }, { "span": "t1_schema ", "start_line": 507, "start_column": 12, "end_line": 507, "end_column": 21 }, { "span": "t1 ", "start_line": 617, "start_column": 8, "end_line": 617, "end_column": 10 }, { "span": "t1 ", "start_line": 672, "start_column": 8, "end_line": 672, "end_column": 10 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Fore", "ign", "Table", "Reflect", "ion", "Test_", "(_", "fixtures_", "._", "Table", "s", "Test_", ",_", "Assert", "s", "Execut", "ion", "Results_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "defin", "e\\u", "tables_", "(_", "cls_", ",_", "metadata_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "sqlalchemy_", "._", "testing_", "import_", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbl", "ink_", "=_", "config_", "._", "file", "\\u", "config_", "._", "get_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sqla", "\\u", "testi", "ng", "'_", ",_", "'", "postgres", "\\u", "test\\u", "db", "\\u", "link", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "testt", "able_", "=_", "Table_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "testt", "able", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "Integer_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "data", "'_", ",_", "String_", "(_", "30_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "ddl", "_", "in_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "CREATE", " ", "SERVER", " ", "test\\u", "server", " ", "FORE", "IGN", " ", "DATA", " ", "WRAP", "PER", " ", "postgres", "\\u", "fd", "w", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "OPTION", "S", " ", "(", "db", "name", " ", "'", "test", "',", " ", "host", " ", "'%", "s", "')\"_", "%_", "dbl", "ink_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "CREATE", " ", "USER", " ", "MAPPING", " ", "FOR", " ", "public", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "SERVER", " ", "test\\u", "server", " ", "options", " ", "(", "user", " ", "'", "sco", "tt", "',", " ", "password", " ", "'", "tige", "r", "')\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "CREATE", " ", "FORE", "IGN", " ", "TAB", "LE", " ", "test\\u", "foreign", "table", " ", "(", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", " ", " ", "id", " ", " ", "INT", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", " ", " ", "data", " ", " ", " ", " ", "VARCHA", "R", "(", "30", ")", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\")", " ", "SERVER", " ", "test\\u", "server", " ", "OPTION", "S", " ", "(", "table", "\\u", "name", " ", "'", "testt", "able", "')\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sa_", "._", "event_", "._", "listen_", "(_", "metadata_", ",_", "\"", "after", "\\u", "create", "\"_", ",_", "sa_", "._", "DD", "L_", "(_", "ddl", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "ddl", "_", "in_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "DROP", " ", "FORE", "IGN", " ", "TAB", "LE", " ", "test\\u", "foreign", "table", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "DROP", " ", "USER", " ", "MAPPING", " ", "FOR", " ", "public", " ", "SERVER", " ", "test\\u", "server", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "DROP", " ", "SERVER", " ", "test\\u", "server", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sa_", "._", "event_", "._", "listen_", "(_", "metadata_", ",_", "\"", "bef", "ore", "\\u", "drop", "\"_", ",_", "sa_", "._", "DD", "L_", "(_", "ddl", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Reflect", "ion", "Test_", "(_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "testing_", "._", "fail", "s", "\\u", "if_", "(_", "\"", "postgres", "ql", " ", "<", " ", "8.1", "\"_", ",_", "\"", "schema", " ", "name", " ", "leak", "s", " ", "in", ",", " ", "not", " ", "sure", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "testing_", "._", "provide", "\\u", "metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "renamed", "\\u", "sequence", "\\u", "reflection_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "metadata_", "=_", "self_", "._", "metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "Table_", "(_", "'", "t", "'_", ",_", "metadata_", ",_", "Column_", "(_", "'", "id", "'_", ",_", "Integer_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metadata_", "._", "create", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m2_", "=_", "Meta", "Data_", "(_", "testing_", "._", "db_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "Table_", "(_", "'", "t", "'_", ",_", "m2_", ",_", "autoload", "_", "=_", "True_", ",_", "implicit", "\\u", "return", "ing_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "t2_", "._", "c_", "._", "id_", "._", "server", "\\u", "default_", "._", "arg_", "._", "text_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "next", "val", "('", "t", "\\u", "id", "\\u", "seq", "':", ":", "reg", "class", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "t2_", "._", "insert_", "(_", ")_", "._", "execute_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "r_", "._", "inserted", "\\u", "primary", "\\u", "key_", ",_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "testing_", "._", "db_", "._", "connect_", "(_", ")_", "._", "executi", "on", "\\u", "options_", "(_", "autocommit_", "=_", "True_", ")_", "._", "execute_", "(_", "'", "alter", " ", "table", " ", "t", "\\u", "id", "\\u", "seq", " ", "rename", " ", "to", " ", "fooba", "r", "\\u", "id", "\\u", "seq", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m3_", "=_", "Meta", "Data_", "(_", "testing_", "._", "db_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t3_", "=_", "Table_", "(_", "'", "t", "'_", ",_", "m3_", ",_", "autoload", "_", "=_", "True_", ",_", "implicit", "\\u", "return", "ing_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "t3_", "._", "c_", "._", "id_", "._", "server", "\\u", "default_", "._", "arg_", "._", "text_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "next", "val", "('", "fooba", "r", "\\u", "id", "\\u", "seq", "':", ":", "reg", "class", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "t3_", "._", "insert_", "(_", ")_", "._", "execute_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "r_", "._", "inserted", "\\u", "primary", "\\u", "key_", ",_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Reflect", "ion", "Test_", "(_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "testing_", "._", "provide", "\\u", "metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "renamed", "\\u", "pk", "\\u", "reflection_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "metadata_", "=_", "self_", "._", "metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "Table_", "(_", "'", "t", "'_", ",_", "metadata_", ",_", "Column_", "(_", "'", "id", "'_", ",_", "Integer_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metadata_", "._", "create", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "testing_", "._", "db_", "._", "connect_", "(_", ")_", "._", "executi", "on", "\\u", "options_", "(_", "autocommit_", "=_", "True_", ")_", "._", "execute_", "(_", "'", "alter", " ", "table", " ", "t", " ", "rename", " ", "id", " ", "to", " ", "t", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m2_", "=_", "Meta", "Data_", "(_", "testing_", "._", "db_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "Table_", "(_", "'", "t", "'_", ",_", "m2_", ",_", "autoload", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "[_", "c_", "._", "name_", "for_", "c_", "in_", "t2_", "._", "primary", "\\u", "key_", "]_", ",_", "[_", "'", "t", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Reflect", "ion", "Test_", "(_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "testing_", "._", "provide", "\\u", "metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "cross", "\\u", "schema", "\\u", "reflection", "\\u", "six_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "tha", "t", " ", "the", " ", "search", " ", "path", " ", "*", "is", "*", " ", "take", "n", " ", "int", "o", " ", "account_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "by", " ", "default_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "meta", "1_", "=_", "self_", "._", "metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Table_", "(_", "'", "some", "\\u", "table", "'_", ",_", "meta", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "Integer_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "test\\u", "schema", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Table_", "(_", "'", "some", "\\u", "other", "\\u", "table", "'_", ",_", "meta", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "Integer_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "sid", "'_", ",_", "Integer_", ",_", "Fore", "ign", "Key_", "(_", "'", "test\\u", "schema", ".", "some", "\\u", "table", ".", "id", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "test\\u", "schema", "\\u", "2", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "meta", "1_", "._", "create", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "testing_", "._", "db_", "._", "connect_", "(_", ")_", "as_", "conn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn_", "._", "detach_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "conn_", "._", "execute_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "set", " ", "search", "\\u", "path", " ", "to", " ", "test\\u", "schema", "\\u", "2", ",", " ", "test\\u", "schema", ",", " ", "public", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "m1_", "=_", "Meta", "Data_", "(_", "conn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t1", "\\u", "schema_", "=_", "Table_", "(_", "'", "some", "\\u", "table", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "m1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "\"", "test\\u", "schema", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "autoload", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2", "\\u", "schema_", "=_", "Table_", "(_", "'", "some", "\\u", "other", "\\u", "table", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "m1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "\"", "test\\u", "schema", "\\u", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "autoload", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t2", "\\u", "no", "\\u", "schema_", "=_", "Table_", "(_", "'", "some", "\\u", "other", "\\u", "table", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "m1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "autoload", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t1", "\\u", "no", "\\u", "schema_", "=_", "Table_", "(_", "'", "some", "\\u", "table", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "m1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "autoload", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "m2_", "=_", "Meta", "Data_", "(_", "conn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t1", "\\u", "schema", "\\u", "isp", "_", "=_", "Table_", "(_", "'", "some", "\\u", "table", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "m2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "\"", "test\\u", "schema", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "autoload", "_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "postgres", "ql", "\\u", "ignore", "\\u", "search", "\\u", "path_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2", "\\u", "schema", "\\u", "isp", "_", "=_", "Table_", "(_", "'", "some", "\\u", "other", "\\u", "table", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "m2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "\"", "test\\u", "schema", "\\u", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "autoload", "_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "postgres", "ql", "\\u", "ignore", "\\u", "search", "\\u", "path_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "t2", "\\u", "schema", " ", "refer", "s", " ", "to", " ", "t1", "\\u", "schema", ",", " ", "but", " ", "sinc", "e", " ", "\"", "test\\u", "schema", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "in", " ", "the", " ", "search", " ", "path", ",", " ", "we", " ", "inst", "ead", " ", "link", " ", "to", " ", "t2", "\\u", "no", "\\u", "schema_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "t2", "\\u", "schema_", "._", "c_", "._", "sid_", "._", "references_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "t1", "\\u", "no", "\\u", "schema_", "._", "c_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "two", " ", "no", "\\u", "schema", " ", "tables", " ", "refer", " ", "to", " ", "each", " ", "other", " ", "als", "o", "._", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "t2", "\\u", "no", "\\u", "schema_", "._", "c_", "._", "sid_", "._", "references_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "t1", "\\u", "no", "\\u", "schema_", "._", "c_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "but", " ", "if", " ", "we", "'", "re", " ", "ign", "orin", "g", " ", "search", " ", "path", ",", " ", "then", " ", "we", " ", "maintain", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tho", "se", " ", "explicit", " ", "schema", "s", " ", "vs", ".", " ", "what", " ", "the", " ", "\"", "default", "\"", " ", "schema", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "t2", "\\u", "schema", "\\u", "isp", "_", "._", "c_", "._", "sid_", "._", "references_", "(_", "t1", "\\u", "schema", "\\u", "isp", "_", "._", "c_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Reflect", "ion", "Test_", "(_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "testing_", "._", "provide", "\\u", "metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "index", "\\u", "reflection_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Reflect", "ing", " ", "partial", " ", "&", " ", "express", "ion", "-", "based", " ", "indexe", "s", " ", "shou", "ld", " ", "warn", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "metadata_", "=_", "self_", "._", "metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t1_", "=_", "Table_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "part", "y", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ",_", "String_", "(_", "10_", ")_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ",_", "String_", "(_", "20_", ")_", ",_", "index_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ana", "me", "'_", ",_", "String_", "(_", "20_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metadata_", "._", "create", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "testing_", "._", "db_", "._", "execute_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", "create", " ", "index", " ", "idx", "1", " ", "on", " ", "part", "y", " ", "((", "id", " ", "||", " ", "name", "))\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "testing_", "._", "db_", "._", "execute_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", "create", " ", "unique", " ", "index", " ", "idx", "2", " ", "on", " ", "part", "y", " ", "(", "id", ")", " ", "where", " ", "name", " ", "=", " ", "'", "test", "'", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "testing_", "._", "db_", "._", "execute_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "create", " ", "index", " ", "idx", "3", " ", "on", " ", "part", "y", " ", "usi", "ng", " ", "bt", "ree", "\\", "10", ";", " ", " ", " ", " ", "(", "lower", "(", "name", "::", "text", "),", " ", "lower", "(", "ana", "me", "::", "text", "))\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "go_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m2_", "=_", "Meta", "Data_", "(_", "testing_", "._", "db_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "Table_", "(_", "'", "part", "y", "'_", ",_", "m2_", ",_", "autoload", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "t2_", "._", "indexes_", ")_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "indexe", "s", " ", "are", " ", "in", " ", "the", " ", "order", " ", "we", " ", "expect", " ", "them", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tmp_", "=_", "[_", "(_", "idx_", "._", "name_", ",_", "idx_", ")_", "for_", "idx_", "in_", "t2_", "._", "indexes_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r1_", ",_", "r2_", "=_", "[_", "idx_", "[_", "1_", "]_", "for_", "idx_", "in_", "tmp_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "r1_", "._", "name_", "==_", "'", "idx", "2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "r1_", "._", "unique_", "==_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "r2_", "._", "unique_", "==_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "[_", "t2_", "._", "c_", "._", "id_", "]_", "==_", "r1_", "._", "columns_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "[_", "t2_", "._", "c_", "._", "name_", "]_", "==_", "r2_", "._", "columns_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "testing_", "._", "assert", "\\u", "warnings_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "go_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "Skipped", " ", "unsup", "porte", "d", " ", "reflection", " ", "of", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "express", "ion", "-", "based", " ", "index", " ", "idx", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Predicate", " ", "of", " ", "partial", " ", "index", " ", "idx", "2", " ", "ignore", "d", " ", "dur", "ing", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reflection", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Skipped", " ", "unsup", "porte", "d", " ", "reflection", " ", "of", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "express", "ion", "-", "based", " ", "index", " ", "idx", "3", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Reflect", "ion", "Test_", "(_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "testing_", "._", "provide", "\\u", "metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "index", "\\u", "reflection", "\\u", "modified_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "reflect", " ", "indexe", "s", " ", "whe", "n", " ", "a", " ", "column", " ", "name", " ", "has", " ", "change", "d", " ", "-", " ", "PG", " ", "9", "\\", "10", ";", " ", " ", " ", " ", "doe", "s", " ", "not", " ", "update", " ", "the", " ", "name", " ", "of", " ", "the", " ", "column", " ", "in", " ", "the", " ", "index", " ", "def", ".", "\\", "10", ";", " ", " ", " ", " ", "[", "tick", "et", ":", "214", "1", "]", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "metadata_", "=_", "self_", "._", "metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t1_", "=_", "Table_", "(_", "'", "t", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "Integer_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "x", "'_", ",_", "Integer_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metadata_", "._", "create", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "=_", "testing_", "._", "db_", "._", "connect_", "(_", ")_", "._", "executi", "on", "\\u", "options_", "(_", "autocommit_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "._", "execute_", "(_", "\"", "CREATE", " ", "INDE", "X", " ", "idx", "1", " ", "ON", " ", "t", " ", "(", "x", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "._", "execute_", "(_", "\"", "ALT", "ER", " ", "TAB", "LE", " ", "t", " ", "RENA", "ME", " ", "COL", "UM", "N", " ", "x", " ", "to", " ", "y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ind_", "=_", "testing_", "._", "db_", "._", "dialect_", "._", "get", "\\u", "indexes_", "(_", "conn_", ",_", "\"", "t", "\"_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "ind_", ",_", "[_", "{_", "'", "unique", "'_", ":_", "False_", ",_", "'", "column", "\\u", "names", "'_", ":_", "[_", "'", "y", "'_", "]_", ",_", "'", "name", "'_", ":_", "'", "idx", "1", "'_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "._", "close_", "(_", ")_", "\\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, 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, 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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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Incomplete URL substring sanitization
meejah/txtorcon/test/test_addrmap.py
[ { "content": " def test_expires(self):\n \"\"\"\n Test simply expiry case\n \"\"\"\n\n clock = task.Clock()\n am = AddrMap()\n am.scheduler = IReactorTime(clock)\n\n now = datetime.datetime.now() + datetime.timedelta(seconds=10)\n nowutc = datetime.datetime.utcnow() + datetime.timedelta(seconds=10)\n line = 'www.example.com 72.30.2.43 \"%s\" EXPIRES=\"%s\"' % (now.strftime(self.fmt), nowutc.strftime(self.fmt))\n\n am.update(line)\n\n self.assertTrue('www.example.com' in am.addr)\n # advance time past when the expiry should have occurred\n clock.advance(10)\n self.assertTrue('www.example.com' not in am.addr)", "metadata": "root.AddrMapTests.test_expires", "header": "['class', 'AddrMapTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 43 }, { "content": " def test_expires_never(self):\n \"\"\"\n Test a NEVER expires line, as in what we'd get a startup for a\n configured address-mapping.\n \"\"\"\n\n clock = task.Clock()\n am = AddrMap()\n am.scheduler = IReactorTime(clock)\n\n line = 'www.example.com 72.30.2.43 \"NEVER\"'\n am.update(line)\n\n self.assertTrue('www.example.com' in am.addr)\n self.assertEqual(len(clock.getDelayedCalls()), 0)", "metadata": "root.AddrMapTests.test_expires_never", "header": "['class', 'AddrMapTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 63 }, { "content": " def test_expires_old(self):\n \"\"\"\n Test something that expires before \"now\"\n \"\"\"\n\n clock = task.Clock()\n am = AddrMap()\n am.scheduler = IReactorTime(clock)\n\n now = datetime.datetime.now() + datetime.timedelta(seconds=-10)\n nowutc = datetime.datetime.utcnow() + datetime.timedelta(seconds=-10)\n line = 'www.example.com 72.30.2.43 \"%s\" EXPIRES=\"%s\"' % (now.strftime(self.fmt), nowutc.strftime(self.fmt))\n\n am.update(line)\n self.assertTrue('www.example.com' in am.addr)\n # arguably we shouldn't even have put this in the map maybe,\n # but the reactor needs to iterate before our expiry callback\n # gets called (right away) which is simulated by the\n # clock.advance call\n clock.advance(0)\n self.assertTrue('www.example.com' not in am.addr)", "metadata": "root.AddrMapTests.test_expires_old", "header": "['class', 'AddrMapTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 79 }, { "content": " def test_expires_with_update(self):\n \"\"\"\n This test updates the expiry time and checks that we properly\n delay our expiry callback.\n \"\"\"\n clock = task.Clock()\n am = AddrMap()\n am.scheduler = IReactorTime(clock)\n\n # now do an actual update to an existing Addr entry.\n now = datetime.datetime.now() + datetime.timedelta(seconds=10)\n nowutc = datetime.datetime.utcnow() + datetime.timedelta(seconds=10)\n line = 'www.example.com 72.30.2.43 \"%s\" EXPIRES=\"%s\"' % (now.strftime(self.fmt), nowutc.strftime(self.fmt))\n am.update(line)\n self.assertTrue(am.find('www.example.com'))\n\n # the update\n now = datetime.datetime.now() + datetime.timedelta(seconds=20)\n nowutc = datetime.datetime.utcnow() + datetime.timedelta(seconds=20)\n line = 'www.example.com 72.30.2.43 \"%s\" EXPIRES=\"%s\"' % (now.strftime(self.fmt), nowutc.strftime(self.fmt))\n am.update(line)\n self.assertTrue('www.example.com' in am.addr)\n\n # advance time by the old expiry value and we should still\n # find the entry\n clock.advance(10)\n self.assertTrue('www.example.com' in am.addr)\n\n # ...but advance past the new expiry (another 10 seconds) and\n # it should vanish\n clock.advance(10)\n self.assertTrue('www.example.com' not in am.addr)", "metadata": "root.AddrMapTests.test_expires_with_update", "header": "['class', 'AddrMapTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 101 }, { "content": " def test_8596_cached_1(self):\n clock = task.Clock()\n am = AddrMap()\n am.scheduler = IReactorTime(clock)\n\n line = 'example.com 192.0.2.1 NEVER CACHED=\"YES\"'\n am.update(line)\n\n self.assertTrue('example.com' in am.addr)\n self.assertEqual(len(clock.getDelayedCalls()), 0)", "metadata": "root.AddrMapTests.test_8596_cached_1", "header": "['class', 'AddrMapTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 134 }, { "content": " def test_8596_cached_2(self):\n clock = task.Clock()\n am = AddrMap()\n am.scheduler = IReactorTime(clock)\n\n line = 'example.com 192.0.43.10 \"2013-04-03 22:29:11\" EXPIRES=\"2013-04-03 20:29:11\" CACHED=\"NO\"'\n am.update(line)\n\n self.assertTrue('example.com' in am.addr)\n self.assertEqual(len(clock.getDelayedCalls()), 1)", "metadata": "root.AddrMapTests.test_8596_cached_2", "header": "['class', 'AddrMapTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 145 } ]
[ { "span": "'www.example.com' in am.addr)", "start_line": 58, "start_column": 24, "end_line": 58, "end_column": 52 }, { "span": "'www.example.com' in am.addr)", "start_line": 76, "start_column": 24, "end_line": 76, "end_column": 52 }, { "span": "'www.example.com' in am.addr)", "start_line": 93, "start_column": 24, "end_line": 93, "end_column": 52 }, { "span": "'www.example.com' in am.addr)", "start_line": 122, "start_column": 24, "end_line": 122, "end_column": 52 }, { "span": "'www.example.com' in am.addr)", "start_line": 127, "start_column": 24, "end_line": 127, "end_column": 52 }, { "span": "'example.com' in am.addr)", "start_line": 142, "start_column": 24, "end_line": 142, "end_column": 48 }, { "span": "'example.com' in am.addr)", "start_line": 153, "start_column": 24, "end_line": 153, "end_column": 48 } ]
[]
1
true
[ "[CLS]_", "Incomp", "lete", "_", "URL_", "substring", "_", "sani", "ti", "zation_", "[SEP]_", "class_", "Add", "r", "Map", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "expires_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "simp", "ly", " ", "expir", "y", " ", "case", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "clock_", "=_", "task_", "._", "Clock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "am_", "=_", "Add", "r", "Map_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "am_", "._", "scheduler_", "=_", "IR", "eac", "tor", "Time_", "(_", "clock_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "now_", "=_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "+_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "now", "utc_", "=_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", "+_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "'", "www", ".", "example", ".", "com", " ", "72.", "30.", "2.4", "3", " ", "\"%", "s", "\"", " ", "EXPIRE", "S", "=\"", "%", "s", "\"'_", "%_", "(_", "now_", "._", "strftime_", "(_", "self_", "._", "fmt_", ")_", ",_", "now", "utc_", "._", "strftime_", "(_", "self_", "._", "fmt_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "am_", "._", "update_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "www", ".", "example", ".", "com", "'_", "in_", "am_", "._", "addr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "advance", " ", "time", " ", "past", " ", "whe", "n", " ", "the", " ", "expir", "y", " ", "shou", "ld", " ", "have", " ", "occur", "red_", "\\u\\u\\uNL\\u\\u\\u_", "clock_", "._", "advance_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "www", ".", "example", ".", "com", "'_", "not_", "in_", "am_", "._", "addr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Add", "r", "Map", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "expir", "es", "\\u", "neve", "r_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "a", " ", "NE", "VER", " ", "expir", "es", " ", "line", ",", " ", "as", " ", "in", " ", "what", " ", "we", "'", "d", " ", "get", " ", "a", " ", "start", "up", " ", "for", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "configur", "ed", " ", "address", "-", "mapping", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "clock_", "=_", "task_", "._", "Clock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "am_", "=_", "Add", "r", "Map_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "am_", "._", "scheduler_", "=_", "IR", "eac", "tor", "Time_", "(_", "clock_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "=_", "'", "www", ".", "example", ".", "com", " ", "72.", "30.", "2.4", "3", " ", "\"", "NE", "VER", "\"'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "am_", "._", "update_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "www", ".", "example", ".", "com", "'_", "in_", "am_", "._", "addr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "clock_", "._", "get", "Delay", "ed", "Calls", "_", "(_", ")_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Add", "r", "Map", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "expir", "es", "\\u", "old_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "somet", "hing", " ", "tha", "t", " ", "expir", "es", " ", "bef", "ore", " ", "\"", "now", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "clock_", "=_", "task_", "._", "Clock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "am_", "=_", "Add", "r", "Map_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "am_", "._", "scheduler_", "=_", "IR", "eac", "tor", "Time_", "(_", "clock_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "now_", "=_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "+_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "-_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "now", "utc_", "=_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", "+_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "-_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "'", "www", ".", "example", ".", "com", " ", "72.", "30.", "2.4", "3", " ", "\"%", "s", "\"", " ", "EXPIRE", "S", "=\"", "%", "s", "\"'_", "%_", "(_", "now_", "._", "strftime_", "(_", "self_", "._", "fmt_", ")_", ",_", "now", "utc_", "._", "strftime_", "(_", "self_", "._", "fmt_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "am_", "._", "update_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "www", ".", "example", ".", "com", "'_", "in_", "am_", "._", "addr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "argu", "abl", "y", " ", "we", " ", "shou", "ld", "n", "'", "t", " ", "even", " ", "have", " ", "put", " ", "this", " ", "in", " ", "the", " ", "map", " ", "may", "be", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "but", " ", "the", " ", "react", "or", " ", "need", "s", " ", "to", " ", "iterate", " ", "bef", "ore", " ", "our", " ", "expir", "y", " ", "callback_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "gets", " ", "call", "ed", " ", "(", "right", " ", "awa", "y", ")", " ", "whi", "ch", " ", "is", " ", "simulat", "ed", " ", "by", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "clock", ".", "advance", " ", "call_", "\\u\\u\\uNL\\u\\u\\u_", "clock_", "._", "advance_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "www", ".", "example", ".", "com", "'_", "not_", "in_", "am_", "._", "addr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Add", "r", "Map", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "expir", "es", "\\u", "with", "\\u", "update_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "test", " ", "update", "s", " ", "the", " ", "expir", "y", " ", "time", " ", "and", " ", "checks", " ", "tha", "t", " ", "we", " ", "proper", "ly", "\\", "10", ";", " ", " ", " ", " ", "dela", "y", " ", "our", " ", "expir", "y", " ", "callback", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "clock_", "=_", "task_", "._", "Clock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "am_", "=_", "Add", "r", "Map_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "am_", "._", "scheduler_", "=_", "IR", "eac", "tor", "Time_", "(_", "clock_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "now", " ", "do", " ", "an", " ", "actual", " ", "update", " ", "to", " ", "an", " ", "exist", "ing", " ", "Add", "r", " ", "entry", "._", "\\u\\u\\uNL\\u\\u\\u_", "now_", "=_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "+_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "now", "utc_", "=_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", "+_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "'", "www", ".", "example", ".", "com", " ", "72.", "30.", "2.4", "3", " ", "\"%", "s", "\"", " ", "EXPIRE", "S", "=\"", "%", "s", "\"'_", "%_", "(_", "now_", "._", "strftime_", "(_", "self_", "._", "fmt_", ")_", ",_", "now", "utc_", "._", "strftime_", "(_", "self_", "._", "fmt_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "am_", "._", "update_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "am_", "._", "find_", "(_", "'", "www", ".", "example", ".", "com", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "update_", "\\u\\u\\uNL\\u\\u\\u_", "now_", "=_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "+_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "now", "utc_", "=_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", "+_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "'", "www", ".", "example", ".", "com", " ", "72.", "30.", "2.4", "3", " ", "\"%", "s", "\"", " ", "EXPIRE", "S", "=\"", "%", "s", "\"'_", "%_", "(_", "now_", "._", "strftime_", "(_", "self_", "._", "fmt_", ")_", ",_", "now", "utc_", "._", "strftime_", "(_", "self_", "._", "fmt_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "am_", "._", "update_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "www", ".", "example", ".", "com", "'_", "in_", "am_", "._", "addr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "advance", " ", "time", " ", "by", " ", "the", " ", "old", " ", "expir", "y", " ", "value", " ", "and", " ", "we", " ", "shou", "ld", " ", "still", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "find", " ", "the", " ", "entry_", "\\u\\u\\uNL\\u\\u\\u_", "clock_", "._", "advance_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "www", ".", "example", ".", "com", "'_", "in_", "am_", "._", "addr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "...", "but", " ", "advance", " ", "past", " ", "the", " ", "new", " ", "expir", "y", " ", "(", "anot", "her", " ", "10", " ", "second", "s", ")", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", " ", "shou", "ld", " ", "vani", "sh_", "\\u\\u\\uNL\\u\\u\\u_", "clock_", "._", "advance_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "www", ".", "example", ".", "com", "'_", "not_", "in_", "am_", "._", "addr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Add", "r", "Map", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "859", "6", "\\u", "cache", "d\\u", "1_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "clock_", "=_", "task_", "._", "Clock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "am_", "=_", "Add", "r", "Map_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "am_", "._", "scheduler_", "=_", "IR", "eac", "tor", "Time_", "(_", "clock_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "=_", "'", "example", ".", "com", " ", "192", ".0", ".2", ".1", " ", "NE", "VER", " ", "CACHE", "D", "=\"", "YE", "S", "\"'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "am_", "._", "update_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "example", ".", "com", "'_", "in_", "am_", "._", "addr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "clock_", "._", "get", "Delay", "ed", "Calls", "_", "(_", ")_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Add", "r", "Map", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "859", "6", "\\u", "cache", "d\\u", "2_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "clock_", "=_", "task_", "._", "Clock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "am_", "=_", "Add", "r", "Map_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "am_", "._", "scheduler_", "=_", "IR", "eac", "tor", "Time_", "(_", "clock_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "=_", "'", "example", ".", "com", " ", "192", ".0", ".4", "3.1", "0", " ", "\"", "2013", "-0", "4", "-0", "3", " ", "2", "2", ":", "2", "9", ":", "11", "\"", " ", "EXPIRE", "S", "=\"", "2013", "-0", "4", "-0", "3", " ", "20", ":", "2", "9", ":", "11", "\"", " ", "CACHE", "D", "=\"", "NO", "\"'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "am_", "._", "update_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "example", ".", "com", "'_", "in_", "am_", "._", "addr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "clock_", "._", "get", "Delay", "ed", "Calls", "_", "(_", ")_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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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, 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 ]
Unused import
QuantSoftware/QuantSoftwareToolkit/bin/DataGenerate_SineWave.py
[ { "content": "import datetime as dt\nimport csv\nimport copy\nimport os\nimport pickle\nimport math\n\n# 3rd party imports\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# QSTK imports\nfrom QSTK.qstkutil import qsdateutil as du\n# import qstkutil.DataEvolved as de\n\n\n\n\n\nif __name__ == '__main__':\n main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def write(ls_symbols, d_data, ldt_timestamps):\n\n ldt_timestamps.reverse()\n ls_keys = ['actual_open', 'actual_high', 'actual_low', 'actual_close', 'volume', 'close']\n\n length = len(ldt_timestamps)\n\n for symbol in ls_symbols:\n\n sym_file = open('./' + symbol + '.csv', 'w')\n sym_file.write(\"Date,Open,High,Low,Close,Volume,Adj Close \\n\")\n\n for i,date in enumerate(ldt_timestamps):\n date_to_csv = '{:%Y-%m-%d}'.format(date)\n string_to_csv = date_to_csv\n\n for key in ls_keys:\n string_to_csv = string_to_csv + ',' + str(d_data[symbol][length-i-1])\n\n string_to_csv = string_to_csv + '\\n'\n sym_file.write(string_to_csv)", "metadata": "root.write", "header": "['module', '___EOS___']", "index": 16 }, { "content": "def main():\n print \"Creating Stock data from Sine Waves\"\n dt_start = dt.datetime(2000, 1, 1)\n dt_end = dt.datetime(2012, 10, 31)\n ldt_timestamps = du.getNYSEdays(dt_start, dt_end, dt.timedelta(hours=16))\n\n x = np.array(range(len(ldt_timestamps)))\n\n ls_symbols = ['SINE_FAST', 'SINE_SLOW', 'SINE_FAST_NOISE', 'SINE_SLOW_NOISE']\n sine_fast = 10*np.sin(x/10.) + 100\n sine_slow = 10*np.sin(x/30.) + 100\n\n sine_fast_noise = 10*(np.sin(x/10.) + np.random.randn(x.size)) + 100\n sine_slow_noise = 10*(np.sin(x/30.) + np.random.randn(x.size)) + 100\n\n d_data = dict(zip(ls_symbols, [sine_fast, sine_slow, sine_fast_noise, sine_slow_noise]))\n\n write(ls_symbols, d_data, ldt_timestamps)\n\n plt.clf()\n plt.plot(ldt_timestamps, sine_fast)\n plt.plot(ldt_timestamps, sine_slow)\n plt.plot(ldt_timestamps, sine_fast_noise)\n plt.plot(ldt_timestamps, sine_slow_noise)\n plt.ylim(50,150)\n plt.xticks(size='xx-small')\n plt.legend(ls_symbols, loc='best')\n plt.savefig('test.png',format='png')", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 39 } ]
[ { "span": "import csv", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 10 }, { "span": "import copy", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 11 }, { "span": "import os", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 9 }, { "span": "import pickle", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 13 }, { "span": "import math", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 11 }, { "span": "import pandas as pd", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 19 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "datetime_", "as_", "dt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "csv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "math_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "3", "rd", " ", "part", "y", " ", "imports_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "matplotlib_", "._", "pyplot_", "as_", "plt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pandas_", "as_", "pd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "QS", "TK", " ", "imports_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "QS", "TK", "_", "._", "qst", "ku", "til_", "import_", "qs", "dateutil_", "as_", "du_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "import", " ", "qst", "ku", "til", ".", "Data", "Evol", "ved", " ", "as", " ", "de_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "write_", "(_", "ls", "\\u", "symbols_", ",_", "d\\u", "data_", ",_", "ld", "t", "\\u", "timestamps_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ld", "t", "\\u", "timestamps_", "._", "reverse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ls", "\\u", "keys_", "=_", "[_", "'", "actual", "\\u", "open", "'_", ",_", "'", "actual", "\\u", "high", "'_", ",_", "'", "actual", "\\u", "low", "'_", ",_", "'", "actual", "\\u", "close", "'_", ",_", "'", "volume", "'_", ",_", "'", "close", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "length_", "=_", "len_", "(_", "ld", "t", "\\u", "timestamps_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "symbol_", "in_", "ls", "\\u", "symbols_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sym", "\\u", "file_", "=_", "open_", "(_", "'./'_", "+_", "symbol_", "+_", "'.", "csv", "'_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sym", "\\u", "file_", "._", "write_", "(_", "\"", "Date", ",", "Open", ",", "Hig", "h", ",", "Lo", "w", ",", "Clos", "e", ",", "Volume", ",", "Adj", " ", "Clos", "e", " ", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", ",_", "date_", "in_", "enumerate_", "(_", "ld", "t", "\\u", "timestamps_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "date", "\\u", "to", "\\u", "csv_", "=_", "'{:", "%", "Y", "-%", "m", "-%", "d", "}'_", "._", "format_", "(_", "date_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "string", "\\u", "to", "\\u", "csv_", "=_", "date", "\\u", "to", "\\u", "csv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", "in_", "ls", "\\u", "keys_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "string", "\\u", "to", "\\u", "csv_", "=_", "string", "\\u", "to", "\\u", "csv_", "+_", "','_", "+_", "str_", "(_", "d\\u", "data_", "[_", "symbol_", "]_", "[_", "length_", "-_", "i_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "string", "\\u", "to", "\\u", "csv_", "=_", "string", "\\u", "to", "\\u", "csv_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sym", "\\u", "file_", "._", "write_", "(_", "string", "\\u", "to", "\\u", "csv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Creat", "ing", " ", "Stock", " ", "data", " ", "from", " ", "Sin", "e", " ", "Wave", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dt", "\\u", "start_", "=_", "dt_", "._", "datetime_", "(_", "2000_", ",_", "1_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dt", "\\u", "end_", "=_", "dt_", "._", "datetime_", "(_", "2012_", ",_", "10_", ",_", "31_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ld", "t", "\\u", "timestamps_", "=_", "du_", "._", "get", "NY", "SE", "days_", "(_", "dt", "\\u", "start_", ",_", "dt", "\\u", "end_", ",_", "dt_", "._", "timedelta_", "(_", "hours_", "=_", "16_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "=_", "np_", "._", "array_", "(_", "range_", "(_", "len_", "(_", "ld", "t", "\\u", "timestamps_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ls", "\\u", "symbols_", "=_", "[_", "'", "SIN", "E", "\\u", "FAST", "'_", ",_", "'", "SIN", "E", "\\u", "SLO", "W", "'_", ",_", "'", "SIN", "E", "\\u", "FAST", "\\u", "NO", "ISE", "'_", ",_", "'", "SIN", "E", "\\u", "SLO", "W", "\\u", "NO", "ISE", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sine", "\\u", "fast_", "=_", "10_", "*_", "np_", "._", "sin_", "(_", "x_", "/_", "10._", ")_", "+_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sine", "\\u", "slow_", "=_", "10_", "*_", "np_", "._", "sin_", "(_", "x_", "/_", "30.", "_", ")_", "+_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sine", "\\u", "fast", "\\u", "noise_", "=_", "10_", "*_", "(_", "np_", "._", "sin_", "(_", "x_", "/_", "10._", ")_", "+_", "np_", "._", "random_", "._", "randn_", "(_", "x_", "._", "size_", ")_", ")_", "+_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sine", "\\u", "slow", "\\u", "noise_", "=_", "10_", "*_", "(_", "np_", "._", "sin_", "(_", "x_", "/_", "30.", "_", ")_", "+_", "np_", "._", "random_", "._", "randn_", "(_", "x_", "._", "size_", ")_", ")_", "+_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d\\u", "data_", "=_", "dict_", "(_", "zip_", "(_", "ls", "\\u", "symbols_", ",_", "[_", "sine", "\\u", "fast_", ",_", "sine", "\\u", "slow_", ",_", "sine", "\\u", "fast", "\\u", "noise_", ",_", "sine", "\\u", "slow", "\\u", "noise_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "write_", "(_", "ls", "\\u", "symbols_", ",_", "d\\u", "data_", ",_", "ld", "t", "\\u", "timestamps_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "clf_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "ld", "t", "\\u", "timestamps_", ",_", "sine", "\\u", "fast_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "ld", "t", "\\u", "timestamps_", ",_", "sine", "\\u", "slow_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "ld", "t", "\\u", "timestamps_", ",_", "sine", "\\u", "fast", "\\u", "noise_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "ld", "t", "\\u", "timestamps_", ",_", "sine", "\\u", "slow", "\\u", "noise_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylim_", "(_", "50_", ",_", "150_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xticks_", "(_", "size_", "=_", "'", "xx", "-", "small", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "legend_", "(_", "ls", "\\u", "symbols_", ",_", "loc_", "=_", "'", "best", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "savefig_", "(_", "'", "test", ".", "png", "'_", ",_", "format_", "=_", "'", "png", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
IEEERobotics/bot/bot/test_hardware/arm_test.py
[ { "content": "import os \nfrom time import sleep\nimport bot.hardware.complex_hardware.robot_arm as RA \nimport bot.lib.lib as lib \n\nbot_config = lib.get_config()\n\narm_config = bot_config[\"dagu_arm\"] \n\narm = RA.RobotArm(arm_config) \n\n\n\narm.competition_solver_barge('B')\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import os ", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 9 }, { "span": "from time import sleep", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 22 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "time_", "import_", "sleep_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "bot_", "._", "hardware_", "._", "complex", "\\u", "hardware_", "._", "robot", "\\u", "arm_", "as_", "RA_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "bot_", "._", "lib_", "._", "lib_", "as_", "lib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bot", "\\u", "config_", "=_", "lib_", "._", "get", "\\u", "config_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "arm", "\\u", "config_", "=_", "bot", "\\u", "config_", "[_", "\"", "dag", "u\\u", "arm", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "arm_", "=_", "RA_", "._", "Robot", "Arm_", "(_", "arm", "\\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_", "arm_", "._", "competition", "\\u", "solve", "r", "\\u", "bar", "ge_", "(_", "'", "B", "'_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
trailbehind/DeepOSM/src/label_chunks_cnn.py
[ { "content": "def train_neural_net(bands_to_use, \n image_size, \n train_images, \n train_labels, \n test_images, \n test_labels, \n convolution_patch_size,\n number_of_batches,\n batch_size): \n\n on_band_count = 0\n for b in bands_to_use:\n if b == 1:\n on_band_count += 1\n\n data_sets = DataSets()\n data_sets.train = DataSet(on_band_count, train_images, train_labels, dtype=tf.float32)\n data_sets.test = DataSet(on_band_count, test_images, test_labels, dtype=tf.float32)\n print(\"CREATED DATASET: {} training images, {} test images, with {} training labels, and {} test labels\".format(len(train_images), len(test_images), len(train_labels), len(test_labels)))\n\n sess = tf.InteractiveSession()\n\n def weight_variable(shape):\n initial = tf.truncated_normal(shape, stddev=0.1)\n return tf.Variable(initial)\n\n def bias_variable(shape):\n initial = tf.constant(0.1, shape=shape)\n return tf.Variable(initial)\n\n def conv2d(x, W):\n return tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')\n\n def max_pool_2x2(x):\n return tf.nn.max_pool(x, ksize=[1, 2, 2, 1],\n strides=[1, 2, 2, 1], padding='SAME')\n\n # placeholder for inputs\n x = tf.placeholder(\"float\", shape=[None, image_size*image_size*on_band_count])\n\n y_ = tf.placeholder(tf.float32, [None, 2])\n\n patch_size = convolution_patch_size\n\n # first layer of convolution\n W_conv1 = weight_variable([patch_size, patch_size, 1, 32])\n b_conv1 = bias_variable([32])\n\n x_image = tf.reshape(x, [-1,image_size,image_size,1])\n\n h_conv1 = tf.nn.relu(conv2d(x_image, W_conv1) + b_conv1)\n h_pool1 = max_pool_2x2(h_conv1)\n\n # second layer\n W_conv2 = weight_variable([patch_size, patch_size, 32, 64])\n b_conv2 = bias_variable([64])\n\n h_conv2 = tf.nn.relu(conv2d(h_pool1, W_conv2) + b_conv2)\n h_pool2 = max_pool_2x2(h_conv2)\n\n W_fc1 = weight_variable([image_size/4 * image_size/4 * 64 * on_band_count, 1024])\n b_fc1 = bias_variable([1024])\n\n h_pool2_flat = tf.reshape(h_pool2, [-1, image_size/4*image_size/4*64 * on_band_count])\n h_fc1 = tf.nn.relu(tf.matmul(h_pool2_flat, W_fc1) + b_fc1)\n\n #keep_prob = tf.placeholder(\"float\")\n #h_fc1_drop = tf.nn.dropout(h_fc1, keep_prob)\n\n W_fc2 = weight_variable([1024, 2])\n b_fc2 = bias_variable([2])\n\n y_conv=tf.nn.softmax(tf.matmul(h_fc1, W_fc2) + b_fc2)\n\n cross_entropy = -tf.reduce_sum(y_*tf.log(y_conv))\n loss = tf.reduce_mean(cross_entropy, name='xentropy_mean')\n train_step = tf.train.AdamOptimizer(1e-4).minimize(cross_entropy)\n correct_prediction = tf.equal(tf.argmax(y_conv,1), tf.argmax(y_,1))\n accuracy = tf.reduce_mean(tf.cast(correct_prediction, \"float\"))\n sess.run(tf.initialize_all_variables())\n\n loss_total = 0\n\n print(\"TRAINING...\") \n t0 = time.time()\n for i in range(number_of_batches):\n batch = data_sets.train.next_batch(batch_size)\n # train_accuracy = accuracy.eval(feed_dict={x:batch[0], y_: batch[1]})\n # print(\"step %d, training accuracy %g\"%(i, train_accuracy))\n\n _, loss_val = sess.run([train_step, cross_entropy],\n feed_dict={x: batch[0], y_: batch[1]})\n loss_total += loss_val\n print('step {}, loss = {}, loss rolling avg = {} '.format(i, loss_val, loss_total/(i+1)))\n\n # print the prediction matrix at this step\n # print \"{} test labels are predicted to be ON\".format(tf.argmax(y_conv,1).eval(feed_dict={x: data_sets.test.images}, session=sess).sum()/float(len(data_sets.test.images)))\n\n print(\"training time {0:.1f}s\".format(time.time()-t0))\n print(\"test accuracy %g\"%accuracy.eval(feed_dict={\n x: data_sets.test.images, y_: data_sets.test.labels,}))\n\n prediction=tf.argmax(y_conv,1)\n index = 0\n\n '''\n print prediction.eval(feed_dict={x: data_sets.test.images}, session=sess) \n for pred in prediction.eval(feed_dict={x: data_sets.test.images}, session=sess):\n if pred == 1:\n print index\n \n index += 1\n '''\n return prediction.eval(feed_dict={x: data_sets.test.images}, session=sess)", "metadata": "root.train_neural_net", "header": "['module', '___EOS___']", "index": 13 } ]
[ { "span": "loss ", "start_line": 88, "start_column": 2, "end_line": 88, "end_column": 6 }, { "span": "index ", "start_line": 116, "start_column": 2, "end_line": 116, "end_column": 7 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "train", "\\u", "neural", "\\u", "net_", "(_", "band", "s", "\\u", "to", "\\u", "use_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "images_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "labels_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "images_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "labels_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "convolution", "\\u", "patch", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "number", "\\u", "of", "\\u", "batches_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "batch", "\\u", "size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "on", "\\u", "band", "\\u", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "b_", "in_", "band", "s", "\\u", "to", "\\u", "use_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "b_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "on", "\\u", "band", "\\u", "count_", "+=_", "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_", "data\\u", "sets_", "=_", "Data", "Sets_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "sets_", "._", "train_", "=_", "Data", "Set_", "(_", "on", "\\u", "band", "\\u", "count_", ",_", "train", "\\u", "images_", ",_", "train", "\\u", "labels_", ",_", "dtype_", "=_", "tf_", "._", "float32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "sets_", "._", "test_", "=_", "Data", "Set_", "(_", "on", "\\u", "band", "\\u", "count_", ",_", "test\\u", "images_", ",_", "test\\u", "labels_", ",_", "dtype_", "=_", "tf_", "._", "float32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "CREATE", "D", " ", "DATASET", ":", " ", "{}", " ", "train", "ing", " ", "images", ",", " ", "{}", " ", "test", " ", "images", ",", " ", "with", " ", "{}", " ", "train", "ing", " ", "labels", ",", " ", "and", " ", "{}", " ", "test", " ", "labels", "\"_", "._", "format_", "(_", "len_", "(_", "train", "\\u", "images_", ")_", ",_", "len_", "(_", "test\\u", "images_", ")_", ",_", "len_", "(_", "train", "\\u", "labels_", ")_", ",_", "len_", "(_", "test\\u", "labels_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sess_", "=_", "tf_", "._", "Interact", "ive", "Session_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "weight", "\\u", "variable_", "(_", "shape_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initial_", "=_", "tf_", "._", "truncat", "ed", "\\u", "normal_", "(_", "shape_", ",_", "stddev_", "=_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "tf_", "._", "Variable_", "(_", "initial_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "bias", "\\u", "variable_", "(_", "shape_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initial_", "=_", "tf_", "._", "constant_", "(_", "0.1_", ",_", "shape_", "=_", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "tf_", "._", "Variable_", "(_", "initial_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "conv2d_", "(_", "x_", ",_", "W_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "tf_", "._", "nn_", "._", "conv2d_", "(_", "x_", ",_", "W_", ",_", "strides_", "=_", "[_", "1_", ",_", "1_", ",_", "1_", ",_", "1_", "]_", ",_", "padding_", "=_", "'", "SAM", "E", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "max", "\\u", "pool", "\\u", "2x", "2_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "tf_", "._", "nn_", "._", "max", "\\u", "pool_", "(_", "x_", ",_", "ksize_", "=_", "[_", "1_", ",_", "2_", ",_", "2_", ",_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "strides_", "=_", "[_", "1_", ",_", "2_", ",_", "2_", ",_", "1_", "]_", ",_", "padding_", "=_", "'", "SAM", "E", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "placehold", "er", " ", "for", " ", "inputs_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "x_", "=_", "tf_", "._", "placeholder_", "(_", "\"", "float", "\"_", ",_", "shape_", "=_", "[_", "None_", ",_", "image", "\\u", "size_", "*_", "image", "\\u", "size_", "*_", "on", "\\u", "band", "\\u", "count_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "y\\u_", "=_", "tf_", "._", "placeholder_", "(_", "tf_", "._", "float32_", ",_", "[_", "None_", ",_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "patch", "\\u", "size_", "=_", "convolution", "\\u", "patch", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "first", " ", "layer", " ", "of", " ", "convolution", "_", "\\u\\u\\uNL\\u\\u\\u_", "W", "\\u", "conv1_", "=_", "weight", "\\u", "variable_", "(_", "[_", "patch", "\\u", "size_", ",_", "patch", "\\u", "size_", ",_", "1_", ",_", "32_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b", "\\u", "conv1_", "=_", "bias", "\\u", "variable_", "(_", "[_", "32_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "x", "\\u", "image_", "=_", "tf_", "._", "reshape_", "(_", "x_", ",_", "[_", "-_", "1_", ",_", "image", "\\u", "size_", ",_", "image", "\\u", "size_", ",_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "h", "\\u", "conv1_", "=_", "tf_", "._", "nn_", "._", "relu_", "(_", "conv2d_", "(_", "x", "\\u", "image_", ",_", "W", "\\u", "conv1_", ")_", "+_", "b", "\\u", "conv1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h", "\\u", "pool", "1_", "=_", "max", "\\u", "pool", "\\u", "2x", "2_", "(_", "h", "\\u", "conv1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "second", " ", "layer_", "\\u\\u\\uNL\\u\\u\\u_", "W", "\\u", "conv2", "_", "=_", "weight", "\\u", "variable_", "(_", "[_", "patch", "\\u", "size_", ",_", "patch", "\\u", "size_", ",_", "32_", ",_", "64_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b", "\\u", "conv2", "_", "=_", "bias", "\\u", "variable_", "(_", "[_", "64_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "h", "\\u", "conv2", "_", "=_", "tf_", "._", "nn_", "._", "relu_", "(_", "conv2d_", "(_", "h", "\\u", "pool", "1_", ",_", "W", "\\u", "conv2", "_", ")_", "+_", "b", "\\u", "conv2", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h", "\\u", "pool", "2_", "=_", "max", "\\u", "pool", "\\u", "2x", "2_", "(_", "h", "\\u", "conv2", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "W", "\\u", "fc", "1_", "=_", "weight", "\\u", "variable_", "(_", "[_", "image", "\\u", "size_", "/_", "4_", "*_", "image", "\\u", "size_", "/_", "4_", "*_", "64_", "*_", "on", "\\u", "band", "\\u", "count_", ",_", "1024_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b", "\\u", "fc", "1_", "=_", "bias", "\\u", "variable_", "(_", "[_", "1024_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "h", "\\u", "pool", "2", "\\u", "flat_", "=_", "tf_", "._", "reshape_", "(_", "h", "\\u", "pool", "2_", ",_", "[_", "-_", "1_", ",_", "image", "\\u", "size_", "/_", "4_", "*_", "image", "\\u", "size_", "/_", "4_", "*_", "64_", "*_", "on", "\\u", "band", "\\u", "count_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h", "\\u", "fc", "1_", "=_", "tf_", "._", "nn_", "._", "relu_", "(_", "tf_", "._", "matmul_", "(_", "h", "\\u", "pool", "2", "\\u", "flat_", ",_", "W", "\\u", "fc", "1_", ")_", "+_", "b", "\\u", "fc", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "keep", "\\u", "prob", " ", "=", " ", "tf", ".", "placehold", "er", "(\"", "float", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "h", "\\u", "fc", "1", "\\u", "drop", " ", "=", " ", "tf", ".", "nn", ".", "drop", "out", "(", "h", "\\u", "fc", "1", ",", " ", "keep", "\\u", "prob", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "W", "\\u", "fc", "2_", "=_", "weight", "\\u", "variable_", "(_", "[_", "1024_", ",_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b", "\\u", "fc", "2_", "=_", "bias", "\\u", "variable_", "(_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "y", "\\u", "conv_", "=_", "tf_", "._", "nn_", "._", "softmax_", "(_", "tf_", "._", "matmul_", "(_", "h", "\\u", "fc", "1_", ",_", "W", "\\u", "fc", "2_", ")_", "+_", "b", "\\u", "fc", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cross", "\\u", "entropy_", "=_", "-_", "tf_", "._", "reduce", "\\u", "sum_", "(_", "y\\u_", "*_", "tf_", "._", "log_", "(_", "y", "\\u", "conv_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loss_", "=_", "tf_", "._", "reduce", "\\u", "mean_", "(_", "cross", "\\u", "entropy_", ",_", "name_", "=_", "'", "xen", "trop", "y", "\\u", "mean", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "step_", "=_", "tf_", "._", "train_", "._", "Adam", "Optimizer_", "(_", "1e-4_", ")_", "._", "minimize_", "(_", "cross", "\\u", "entropy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "correct", "\\u", "prediction_", "=_", "tf_", "._", "equal_", "(_", "tf_", "._", "argmax_", "(_", "y", "\\u", "conv_", ",_", "1_", ")_", ",_", "tf_", "._", "argmax_", "(_", "y\\u_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "accuracy_", "=_", "tf_", "._", "reduce", "\\u", "mean_", "(_", "tf_", "._", "cast_", "(_", "correct", "\\u", "prediction_", ",_", "\"", "float", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "run_", "(_", "tf_", "._", "initialize", "\\u", "all", "\\u", "variables_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loss", "\\u", "total_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"", "TRAIN", "ING", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t0_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "number", "\\u", "of", "\\u", "batches_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "batch_", "=_", "data\\u", "sets_", "._", "train_", "._", "next", "\\u", "batch_", "(_", "batch", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "train", "\\u", "accu", "rac", "y", " ", "=", " ", "accu", "rac", "y", ".", "eval", "(", "feed", "\\u", "dict", "={", "x", ":", "batch", "[", "0", "],", " ", "y", "\\u", ":", " ", "batch", "[", "1", "]}", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", "(\"", "step", " ", "%", "d", ",", " ", "train", "ing", " ", "accu", "rac", "y", " ", "%", "g", "\"%", "(", "i", ",", " ", "train", "\\u", "accu", "rac", "y", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", ",_", "loss", "\\u", "val_", "=_", "sess_", "._", "run_", "(_", "[_", "train", "\\u", "step_", ",_", "cross", "\\u", "entropy_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "feed", "\\u", "dict_", "=_", "{_", "x_", ":_", "batch_", "[_", "0_", "]_", ",_", "y\\u_", ":_", "batch_", "[_", "1_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loss", "\\u", "total_", "+=_", "loss", "\\u", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "step", " ", "{}", ",", " ", "loss", " ", "=", " ", "{}", ",", " ", "loss", " ", "rolling", " ", "avg", " ", "=", " ", "{}", " ", "'_", "._", "format_", "(_", "i_", ",_", "loss", "\\u", "val_", ",_", "loss", "\\u", "total_", "/_", "(_", "i_", "+_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "the", " ", "predicti", "on", " ", "matrix", " ", "at", " ", "this", " ", "step_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "\"{}", " ", "test", " ", "labels", " ", "are", " ", "predi", "cte", "d", " ", "to", " ", "be", " ", "ON", "\".", "format", "(", "tf", ".", "argm", "ax", "(", "y", "\\u", "conv", ",", "1", ").", "eval", "(", "feed", "\\u", "dict", "={", "x", ":", " ", "data\\u", "sets", ".", "test", ".", "images", "},", " ", "session", "=", "sess", ").", "sum", "()", "/", "float", "(", "len", "(", "data\\u", "sets", ".", "test", ".", "images", ")))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "\"", "train", "ing", " ", "time", " ", "{", "0", ":.", "1f", "}", "s", "\"_", "._", "format_", "(_", "time_", "._", "time_", "(_", ")_", "-_", "t0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "test", " ", "accu", "rac", "y", " ", "%", "g", "\"_", "%_", "accuracy_", "._", "eval_", "(_", "feed", "\\u", "dict_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "x_", ":_", "data\\u", "sets_", "._", "test_", "._", "images_", ",_", "y\\u_", ":_", "data\\u", "sets_", "._", "test_", "._", "labels_", ",_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "prediction_", "=_", "tf_", "._", "argmax_", "(_", "y", "\\u", "conv_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "\\", "10", ";", " ", " ", "print", " ", "predicti", "on", ".", "eval", "(", "feed", "\\u", "dict", "={", "x", ":", " ", "data\\u", "sets", ".", "test", ".", "images", "},", " ", "session", "=", "sess", ")", " ", " ", "\\", "10", ";", " ", " ", "for", " ", "pred", " ", "in", " ", "predicti", "on", ".", "eval", "(", "feed", "\\u", "dict", "={", "x", ":", " ", "data\\u", "sets", ".", "test", ".", "images", "},", " ", "session", "=", "sess", "):", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "pred", " ", "==", " ", "1", ":", "\\", "10", ";", " ", " ", "print", " ", "index", "\\", "10", ";", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "index", " ", "+=", " ", "1", "\\", "10", ";", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "prediction_", "._", "eval_", "(_", "feed", "\\u", "dict_", "=_", "{_", "x_", ":_", "data\\u", "sets_", "._", "test_", "._", "images_", "}_", ",_", "session_", "=_", "sess_", ")_" ]
[ 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,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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, 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 ]
Imprecise assert
dimagi/commcare-hq/corehq/apps/reports/tests/test_export_api.py
[ { "content": " def testExportTokenMigration(self):\n c = Client()\n c.login(**{'username': 'test', 'password': 'foobar'})\n\n _submit_form()\n time.sleep(1)\n resp = get_export_response(c)\n self.assertEqual(200, resp.status_code)\n self.assertTrue(_content(resp) is not None)\n self.assertTrue(\"X-CommCareHQ-Export-Token\" in resp)\n\n # blow away the timestamp property to ensure we're testing the\n # migration case\n prev_token = resp[\"X-CommCareHQ-Export-Token\"]\n prev_checkpoint = ExportSchema.get(prev_token)\n assert prev_checkpoint.timestamp", "metadata": "root.ExportTest.testExportTokenMigration", "header": "['class', 'ExportTest', '(', 'BaseAccountingTest', ',', 'DomainSubscriptionMixin', ')', ':', '___EOS___']", "index": 82 }, { "content": " def testExportTokens(self):\n c = Client()\n c.login(**{'username': 'test', 'password': 'foobar'})\n # no data = 404\n resp = get_export_response(c)\n self.assertEqual(404, resp.status_code)\n\n # data = data\n _submit_form()\n\n # now that this is time based we have to sleep first. this is annoying\n time.sleep(1)\n resp = get_export_response(c)\n self.assertEqual(200, resp.status_code)\n self.assertTrue(_content(resp) is not None)\n self.assertTrue(\"X-CommCareHQ-Export-Token\" in resp)\n prev_token = resp[\"X-CommCareHQ-Export-Token\"]\n\n # data but no new data = 404\n resp = get_export_response(c, prev_token)\n self.assertEqual(404, resp.status_code)\n\n _submit_form()\n time.sleep(1)\n resp = get_export_response(c, prev_token)\n self.assertEqual(200, resp.status_code)\n self.assertTrue(_content(resp) is not None)\n self.assertTrue(\"X-CommCareHQ-Export-Token\" in resp)", "metadata": "root.ExportTest.testExportTokens", "header": "['class', 'ExportTest', '(', 'BaseAccountingTest', ',', 'DomainSubscriptionMixin', ')', ':', '___EOS___']", "index": 99 }, { "content": " def testExportFilter(self):\n c = Client()\n c.login(**{'username': 'test', 'password': 'foobar'})\n\n # initially nothing\n self.assertEqual(404, get_export_response(c).status_code)\n\n # submit, assert something\n f = get_form()\n _submit_form(f)\n resp = get_export_response(c)\n self.assertEqual(200, resp.status_code)\n initial_content = _content(resp)\n \n # resubmit, assert same since it's a dupe\n _submit_form(f)\n resp = get_export_response(c)\n self.assertEqual(200, resp.status_code)\n # hack: check for the number of rows to ensure the new one \n # didn't get added. They aren't exactly the same because the\n # duplicate adds to the schema.\n content = _content(resp)\n self.assertEqual(initial_content.count(\"<tr>\"), \n content.count(\"<tr>\"))\n \n # unless we explicitly include errors\n resp = get_export_response(c, include_errors=True)\n self.assertEqual(200, resp.status_code)\n self.assertTrue(len(_content(resp)) > len(initial_content))", "metadata": "root.ExportTest.testExportFilter", "header": "['class', 'ExportTest', '(', 'BaseAccountingTest', ',', 'DomainSubscriptionMixin', ')', ':', '___EOS___']", "index": 128 } ]
[ { "span": "self.assertTrue(_content(resp) is not None)", "start_line": 90, "start_column": 8, "end_line": 90, "end_column": 51 }, { "span": "self.assertTrue(\"X-CommCareHQ-Export-Token\" in resp)", "start_line": 91, "start_column": 8, "end_line": 91, "end_column": 60 }, { "span": "self.assertTrue(_content(resp) is not None)", "start_line": 113, "start_column": 8, "end_line": 113, "end_column": 51 }, { "span": "self.assertTrue(\"X-CommCareHQ-Export-Token\" in resp)", "start_line": 114, "start_column": 8, "end_line": 114, "end_column": 60 }, { "span": "self.assertTrue(_content(resp) is not None)", "start_line": 125, "start_column": 8, "end_line": 125, "end_column": 51 }, { "span": "self.assertTrue(\"X-CommCareHQ-Export-Token\" in resp)", "start_line": 126, "start_column": 8, "end_line": 126, "end_column": 60 }, { "span": "self.assertTrue(len(_content(resp)) > len(initial_content))", "start_line": 156, "start_column": 8, "end_line": 156, "end_column": 67 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Export", "Test_", "(_", "Base", "Account", "ing", "Test_", ",_", "Doma", "in", "Subscription", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Export", "Token", "Migration_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "Client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "login_", "(_", "**_", "{_", "'", "user", "name", "'_", ":_", "'", "test", "'_", ",_", "'", "password", "'_", ":_", "'", "fooba", "r", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "submit", "\\u", "form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "get", "\\u", "export", "\\u", "response_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "200_", ",_", "resp_", "._", "status", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u", "content_", "(_", "resp_", ")_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "X", "-", "Comm", "Care", "HQ", "-", "Export", "-", "Token", "\"_", "in_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "blow", " ", "awa", "y", " ", "the", " ", "timestamp", " ", "property", " ", "to", " ", "ensure", " ", "we", "'", "re", " ", "testi", "ng", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "migrati", "on", " ", "case_", "\\u\\u\\uNL\\u\\u\\u_", "prev", "\\u", "token_", "=_", "resp_", "[_", "\"", "X", "-", "Comm", "Care", "HQ", "-", "Export", "-", "Token", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prev", "\\u", "checkpoint_", "=_", "Export", "Schema_", "._", "get_", "(_", "prev", "\\u", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "prev", "\\u", "checkpoint_", "._", "timestamp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Export", "Test_", "(_", "Base", "Account", "ing", "Test_", ",_", "Doma", "in", "Subscription", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Export", "Tokens_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "Client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "login_", "(_", "**_", "{_", "'", "user", "name", "'_", ":_", "'", "test", "'_", ",_", "'", "password", "'_", ":_", "'", "fooba", "r", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "no", " ", "data", " ", "=", " ", "404_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "get", "\\u", "export", "\\u", "response_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "404_", ",_", "resp_", "._", "status", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "data", " ", "=", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "submit", "\\u", "form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "now", " ", "tha", "t", " ", "this", " ", "is", " ", "time", " ", "based", " ", "we", " ", "have", " ", "to", " ", "sleep", " ", "first", ".", " ", "this", " ", "is", " ", "anno", "ying", "_", "\\u\\u\\uNL\\u\\u\\u_", "time_", "._", "sleep_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "get", "\\u", "export", "\\u", "response_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "200_", ",_", "resp_", "._", "status", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u", "content_", "(_", "resp_", ")_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "X", "-", "Comm", "Care", "HQ", "-", "Export", "-", "Token", "\"_", "in_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prev", "\\u", "token_", "=_", "resp_", "[_", "\"", "X", "-", "Comm", "Care", "HQ", "-", "Export", "-", "Token", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "data", " ", "but", " ", "no", " ", "new", " ", "data", " ", "=", " ", "404_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "get", "\\u", "export", "\\u", "response_", "(_", "c_", ",_", "prev", "\\u", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "404_", ",_", "resp_", "._", "status", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "submit", "\\u", "form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "get", "\\u", "export", "\\u", "response_", "(_", "c_", ",_", "prev", "\\u", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "200_", ",_", "resp_", "._", "status", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u", "content_", "(_", "resp_", ")_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "X", "-", "Comm", "Care", "HQ", "-", "Export", "-", "Token", "\"_", "in_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Export", "Test_", "(_", "Base", "Account", "ing", "Test_", ",_", "Doma", "in", "Subscription", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Export", "Filter_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "Client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "login_", "(_", "**_", "{_", "'", "user", "name", "'_", ":_", "'", "test", "'_", ",_", "'", "password", "'_", ":_", "'", "fooba", "r", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "initially", " ", "nothing_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "404_", ",_", "get", "\\u", "export", "\\u", "response_", "(_", "c_", ")_", "._", "status", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "submit", ",", " ", "assert", " ", "something_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "get", "\\u", "form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "submit", "\\u", "form_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "get", "\\u", "export", "\\u", "response_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "200_", ",_", "resp_", "._", "status", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "initial", "\\u", "content_", "=_", "\\u", "content_", "(_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "resu", "bmi", "t", ",", " ", "assert", " ", "same", " ", "sinc", "e", " ", "it", "'", "s", " ", "a", " ", "dupe", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "submit", "\\u", "form_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "get", "\\u", "export", "\\u", "response_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "200_", ",_", "resp_", "._", "status", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "hack", ":", " ", "check", " ", "for", " ", "the", " ", "number", " ", "of", " ", "rows", " ", "to", " ", "ensure", " ", "the", " ", "new", " ", "one", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "did", "n", "'", "t", " ", "get", " ", "adde", "d", ".", " ", "The", "y", " ", "are", "n", "'", "t", " ", "exact", "ly", " ", "the", " ", "same", " ", "bec", "aus", "e", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "duplicat", "e", " ", "adds", " ", "to", " ", "the", " ", "schema", "._", "\\u\\u\\uNL\\u\\u\\u_", "content_", "=_", "\\u", "content_", "(_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "initial", "\\u", "content_", "._", "count_", "(_", "\"<", "tr", ">\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "content_", "._", "count_", "(_", "\"<", "tr", ">\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unl", "ess", " ", "we", " ", "explicit", "ly", " ", "include", " ", "errors_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "get", "\\u", "export", "\\u", "response_", "(_", "c_", ",_", "include", "\\u", "errors_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "200_", ",_", "resp_", "._", "status", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "\\u", "content_", "(_", "resp_", ")_", ")_", ">_", "len_", "(_", "initial", "\\u", "content_", ")_", ")_", "\\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, 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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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused import
fasrc/slurmmon/lib/python/site-packages/slurmmon/tests/test_util.py
[ { "content": "# Copyright (c) 2013-2014\n# Harvard FAS Research Computing\n# All rights reserved.\n\n\"\"\"unit tests\"\"\"\n\nimport sys, os\nimport unittest\n\ntry:\n\timport slurmmon\nexcept ImportError:\n\tsys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../..')))\n\timport slurmmon\nfrom slurmmon import util as u\n\n\n\n\nif __name__=='__main__':\n\tunittest.main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class ShTestCase(unittest.TestCase):\n\tfunky_string = r\"\"\"foo'bar \"more\" \\' \\\" \\n zzz\"\"\"\n\tfunky_string_quoted = r\"\"\"'foo'\\''bar \"more\" \\'\\'' \\\" \\n zzz'\"\"\"\n\n\t#runsh() focused\n\n\t#runsh_i() focused\n\n\t#shquote() focused\n\t\n\t#sherrcheck() focused", "metadata": "root.ShTestCase", "header": "['module', '___EOS___']", "index": 17 }, { "content": "\tdef test_runsh_string(self):\n\t\t\"\"\"That runsh() works on sh code as a string.\"\"\"\n\t\tself.assertEqual(\n\t\t\tu.runsh('echo foo'),\n\t\t\t'foo\\n',\n\t\t)", "metadata": "root.ShTestCase.test_runsh_string", "header": "['class', 'ShTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 22 }, { "content": "\tdef test_runsh_list(self):\n\t\t\"\"\"That runsh() works on an argv list.\"\"\"\n\t\tself.assertEqual(\n\t\t\tu.runsh(['echo','foo']),\n\t\t\t'foo\\n',\n\t\t)", "metadata": "root.ShTestCase.test_runsh_list", "header": "['class', 'ShTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 28 }, { "content": "\tdef test_runsh_i_string(self):\n\t\t\"\"\"That runsh_i() works on sh code as a string.\"\"\"\n\t\tself.assertEqual(\n\t\t\t[line for line in u.runsh_i(\"echo -e 'foo\\nbar'\")],\n\t\t\t['foo\\n', 'bar\\n'],\n\t\t)", "metadata": "root.ShTestCase.test_runsh_i_string", "header": "['class', 'ShTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 36 }, { "content": "\tdef test_runsh_list(self):\n\t\t\"\"\"That runsh_i() works on an argv list.\"\"\"\n\t\tself.assertEqual(\n\t\t\t[line for line in u.runsh_i(['echo', '-e', 'foo\\nbar'])],\n\t\t\t['foo\\n', 'bar\\n'],\n\t\t)", "metadata": "root.ShTestCase.test_runsh_list", "header": "['class', 'ShTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 42 }, { "content": "\tdef test_shquote(self):\n\t\t\"\"\"That quoting with shquote() == quoting manually.\"\"\"\n\t\tself.assertEqual(\n\t\t\tu.shquote(ShTestCase.funky_string),\n\t\t\tShTestCase.funky_string_quoted\n\t\t)", "metadata": "root.ShTestCase.test_shquote", "header": "['class', 'ShTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 50 }, { "content": "\tdef test_shquote_runsh(self):\n\t\t\"\"\"That echo is identity for a funky_string.\"\"\"\n\t\tself.assertEqual(\n\t\t\tu.runsh('echo -n %s' % u.shquote(ShTestCase.funky_string)),\n\t\t\tShTestCase.funky_string\n\t\t)", "metadata": "root.ShTestCase.test_shquote_runsh", "header": "['class', 'ShTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 56 }, { "content": "\tdef test_sherrcheck_status(self):\n\t\tself.assertRaises(Exception, u.runsh, ['false'])", "metadata": "root.ShTestCase.test_sherrcheck_status", "header": "['class', 'ShTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 64 }, { "content": "\tdef test_sherrcheck_stderr(self):\n\t\tself.assertRaises(Exception, u.runsh, 'echo foo >&2')", "metadata": "root.ShTestCase.test_sherrcheck_stderr", "header": "['class', 'ShTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 66 } ]
[ { "span": "import slurmmon", "start_line": 10, "start_column": 1, "end_line": 10, "end_column": 16 }, { "span": "import slurmmon", "start_line": 13, "start_column": 1, "end_line": 13, "end_column": 16 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2013", "-", "2014_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Har", "vard", " ", "FA", "S", " ", "Rese", "arch", " ", "Comp", "uti", "ng_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "unit", " ", "tests", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", ",_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "import_", "slur", "mmo", "n_", "\\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\t", "_", "sys_", "._", "path_", "._", "append_", "(_", "os_", "._", "path_", "._", "abspath_", "(_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", ",_", "'../", "..'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "slur", "mmo", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "slur", "mmo", "n_", "import_", "util_", "as_", "u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "unittest_", "._", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Sh", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "fun", "ky", "\\u", "string_", "=_", "r", "\"\"\"", "foo", "'", "bar", " ", "\"", "more", "\"", " ", "\\\\'", " ", "\\\\\"", " ", "\\\\", "n", " ", "zzz", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fun", "ky", "\\u", "string", "\\u", "quoted", "_", "=_", "r", "\"\"\"'", "foo", "'\\\\'", "'", "bar", " ", "\"", "more", "\"", " ", "\\\\'\\\\", "''", " ", "\\\\\"", " ", "\\\\", "n", " ", "zzz", "'\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "runs", "h", "()", " ", "focused", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "runs", "h", "\\u", "i", "()", " ", "focused", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "sh", "quote", "()", " ", "focused", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "sher", "rch", "eck", "()", " ", "focused", "_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Sh", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "runs", "h", "\\u", "string_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Tha", "t", " ", "runs", "h", "()", " ", "works", " ", "on", " ", "sh", " ", "code", " ", "as", " ", "a", " ", "string", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u_", "._", "runs", "h_", "(_", "'", "echo", " ", "foo", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "foo", "\\\\", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sh", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "runs", "h", "\\u", "list_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Tha", "t", " ", "runs", "h", "()", " ", "works", " ", "on", " ", "an", " ", "argv", " ", "list", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u_", "._", "runs", "h_", "(_", "[_", "'", "echo", "'_", ",_", "'", "foo", "'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "foo", "\\\\", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sh", "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", "runs", "h", "\\u", "i", "\\u", "string_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Tha", "t", " ", "runs", "h", "\\u", "i", "()", " ", "works", " ", "on", " ", "sh", " ", "code", " ", "as", " ", "a", " ", "string", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "line_", "for_", "line_", "in_", "u_", "._", "runs", "h", "\\u", "i_", "(_", "\"", "echo", " ", "-", "e", " ", "'", "foo", "\\\\", "nba", "r", "'\"_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "foo", "\\\\", "n", "'_", ",_", "'", "bar", "\\\\", "n", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sh", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "runs", "h", "\\u", "list_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Tha", "t", " ", "runs", "h", "\\u", "i", "()", " ", "works", " ", "on", " ", "an", " ", "argv", " ", "list", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "line_", "for_", "line_", "in_", "u_", "._", "runs", "h", "\\u", "i_", "(_", "[_", "'", "echo", "'_", ",_", "'-", "e", "'_", ",_", "'", "foo", "\\\\", "nba", "r", "'_", "]_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "foo", "\\\\", "n", "'_", ",_", "'", "bar", "\\\\", "n", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sh", "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", "sh", "quote_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Tha", "t", " ", "quoting", " ", "with", " ", "sh", "quote", "()", " ", "==", " ", "quoting", " ", "manu", "ally", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u_", "._", "sh", "quote_", "(_", "Sh", "Test", "Case_", "._", "fun", "ky", "\\u", "string_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Sh", "Test", "Case_", "._", "fun", "ky", "\\u", "string", "\\u", "quoted", "_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sh", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "sh", "quote", "\\u", "runs", "h_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Tha", "t", " ", "echo", " ", "is", " ", "identi", "ty", " ", "for", " ", "a", " ", "fun", "ky", "\\u", "string", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u_", "._", "runs", "h_", "(_", "'", "echo", " ", "-", "n", " ", "%", "s", "'_", "%_", "u_", "._", "sh", "quote_", "(_", "Sh", "Test", "Case_", "._", "fun", "ky", "\\u", "string_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Sh", "Test", "Case_", "._", "fun", "ky", "\\u", "string_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sh", "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", "sher", "rch", "eck", "\\u", "status_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "self_", "._", "assert", "Raises_", "(_", "Exception_", ",_", "u_", "._", "runs", "h_", ",_", "[_", "'", "fal", "se", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sh", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "sher", "rch", "eck", "\\u", "stderr_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "self_", "._", "assert", "Raises_", "(_", "Exception_", ",_", "u_", "._", "runs", "h_", ",_", "'", "echo", " ", "foo", " ", ">", "&", "2", "'_", ")_", "\\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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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
ProgVal/Limnoria/plugins/PluginDownloader/config.py
[ { "content": "###\n# Copyright (c) 2011, Valentin Lorentz\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# * Redistributions of source code must retain the above copyright notice,\n# this list of conditions, and the following disclaimer.\n# * Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions, and the following disclaimer in the\n# documentation and/or other materials provided with the distribution.\n# * Neither the name of the author of this software nor the name of\n# contributors to this software may be used to endorse or promote products\n# derived from this software without specific prior written consent.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n# POSSIBILITY OF SUCH DAMAGE.\n\n###\n\nimport supybot.conf as conf\nimport supybot.registry as registry\nfrom supybot.i18n import PluginInternationalization, internationalizeDocstring\n\n_ = PluginInternationalization('PluginDownloader')\n\n\n\nPluginDownloader = conf.registerPlugin('PluginDownloader')\n# This is where your configuration variables (if any) should go. For example:\n# conf.registerGlobalValue(PluginDownloader, 'someConfigVariableName',\n# registry.Boolean(False, _(\"\"\"Help for someConfigVariableName.\"\"\")))\n\n\n# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def configure(advanced):\n # This will be called by supybot to configure this module. advanced is\n # a bool that specifies whether the user identified themself as an advanced\n # user or not. You should effect your configuration by manipulating the\n # registry as appropriate.\n from supybot.questions import expect, anything, something, yn\n conf.registerPlugin('PluginDownloader', True)", "metadata": "root.configure", "header": "['module', '___EOS___']", "index": 36 } ]
[ { "span": "import supybot.registry as registry", "start_line": 31, "start_column": 0, "end_line": 31, "end_column": 35 }, { "span": "from supybot.i18n import PluginInternationalization, internationalizeDocstring", "start_line": 32, "start_column": 0, "end_line": 32, "end_column": 78 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2011", ",", " ", "Val", "enti", "n", " ", "Lore", "ntz", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Redistributi", "on", " ", "and", " ", "use", " ", "in", " ", "source", " ", "and", " ", "binar", "y", " ", "forms", ",", " ", "with", " ", "or", " ", "with", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "modification", ",", " ", "are", " ", "permit", "ted", " ", "provided", " ", "tha", "t", " ", "the", " ", "follow", "ing", " ", "condition", "s", " ", "are", " ", "met", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "*", " ", "Redistributi", "ons", " ", "of", " ", "source", " ", "code", " ", "must", " ", "retain", " ", "the", " ", "above", " ", "copyr", "ight", " ", "notice", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "list", " ", "of", " ", "condition", "s", ",", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "*", " ", "Redistributi", "ons", " ", "in", " ", "binar", "y", " ", "form", " ", "must", " ", "reproduce", " ", "the", " ", "above", " ", "copyr", "ight", " ", "notice", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "list", " ", "of", " ", "condition", "s", ",", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", " ", "and", "/", "or", " ", "other", " ", "material", "s", " ", "provided", " ", "with", " ", "the", " ", "distribu", "tion", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "*", " ", "Nei", "ther", " ", "the", " ", "name", " ", "of", " ", "the", " ", "author", " ", "of", " ", "this", " ", "software", " ", "nor", " ", "the", " ", "name", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contributor", "s", " ", "to", " ", "this", " ", "software", " ", "may", " ", "be", " ", "used", " ", "to", " ", "endo", "rse", " ", "or", " ", "promote", " ", "products_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "derive", "d", " ", "from", " ", "this", " ", "software", " ", "with", "out", " ", "specific", " ", "prior", " ", "writt", "en", " ", "consent", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THIS", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "BY", " ", "THE", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "AND", " ", "CONTRIB", "UTO", "RS", " ", "\"", "AS", " ", "IS", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "AND", " ", "ANY", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", ",", " ", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",", " ", "THE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "AND", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ARE", " ", "DISC", "LAI", "MED", ".", " ", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", " ", "COPY", "RIG", "HT", " ", "OWNER", " ", "OR", " ", "CONTRIB", "UTO", "RS", " ", "BE_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "DIRECT", ",", " ", "INDI", "RECT", ",", " ", "INC", "IDENT", "AL", ",", " ", "SPECIAL", ",", " ", "EXE", "MPL", "ARY", ",", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "CONS", "EQU", "ENTI", "AL", " ", "DA", "MAGE", "S", " ", "(", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",", " ", "PROC", "URE", "MENT", " ", "OF_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SUBST", "ITU", "TE", " ", "GOOD", "S", " ", "OR", " ", "SERVICES", ";", " ", "LOSS", " ", "OF", " ", "USE", ",", " ", "DATA", ",", " ", "OR", " ", "PROF", "IT", "S", ";", " ", "OR", " ", "BUS", "INE", "SS_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "INTER", "RU", "PTION", ")", " ", "HO", "WE", "VER", " ", "CAU", "SED", " ", "AND", " ", "ON", " ", "ANY", " ", "THE", "ORY", " ", "OF", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "CONTR", "ACT", ",", " ", "STRI", "CT", " ", "LI", "ABI", "LIT", "Y", ",", " ", "OR", " ", "TOR", "T", " ", "(", "INC", "LU", "DING", " ", "NEG", "LIG", "ENCE", " ", "OR", " ", "OTHER", "WI", "SE", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ARI", "SIN", "G", " ", "IN", " ", "ANY", " ", "WAY", " ", "OUT", " ", "OF", " ", "THE", " ", "USE", " ", "OF", " ", "THIS", " ", "SOFT", "WARE", ",", " ", "EVE", "N", " ", "IF", " ", "ADV", "ISE", "D", " ", "OF", " ", "THE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "POS", "SIB", "ILI", "TY", " ", "OF", " ", "SUC", "H", " ", "DA", "MAGE", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sup", "ybo", "t_", "._", "conf_", "as_", "conf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sup", "ybo", "t_", "._", "registry_", "as_", "registry_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sup", "ybo", "t_", "._", "i18n_", "import_", "Plug", "in", "Intern", "ation", "ali", "zation_", ",_", "international", "ize", "Docs", "tring_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "=_", "Plug", "in", "Intern", "ation", "ali", "zation_", "(_", "'", "Plug", "in", "Downloade", "r", "'_", ")_", "\\u\\u\\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_", "Plug", "in", "Downloader_", "=_", "conf_", "._", "register", "Plugin_", "(_", "'", "Plug", "in", "Downloade", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "where", " ", "your", " ", "configura", "tion", " ", "variab", "les", " ", "(", "if", " ", "any", ")", " ", "shou", "ld", " ", "go", ".", " ", " ", "For", " ", "example", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "conf", ".", "register", "Global", "Value", "(", "Plug", "in", "Downloade", "r", ",", " ", "'", "some", "Config", "Varia", "ble", "Name", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "registr", "y", ".", "Boo", "lean", "(", "Fal", "se", ",", " ", "\\u(", "\"\"\"", "Help", " ", "for", " ", "some", "Config", "Varia", "ble", "Name", ".\"", "\"\"", ")))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "vim", ":", "set", " ", "shift", "widt", "h", "=", "4", " ", "tabs", "top", "=", "4", " ", "expand", "tab", " ", "text", "widt", "h", "=", "7", "9", ":_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "configure_", "(_", "advanced", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "will", " ", "be", " ", "call", "ed", " ", "by", " ", "sup", "ybo", "t", " ", "to", " ", "configur", "e", " ", "this", " ", "module", ".", " ", " ", "advanced", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "bool", " ", "tha", "t", " ", "speci", "fie", "s", " ", "whe", "ther", " ", "the", " ", "user", " ", "identifi", "ed", " ", "them", "self", " ", "as", " ", "an", " ", "advanced", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "user", " ", "or", " ", "not", ".", " ", " ", "You", " ", "shou", "ld", " ", "effect", " ", "your", " ", "configura", "tion", " ", "by", " ", "manipulati", "ng", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "registr", "y", " ", "as", " ", "appropr", "iate", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "sup", "ybo", "t_", "._", "questions_", "import_", "expect_", ",_", "anyt", "hing_", ",_", "something_", ",_", "yn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "register", "Plugin_", "(_", "'", "Plug", "in", "Downloade", "r", "'_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
hoytak/treedict/tests/test_retrieval.py
[ { "content": "#!/usr/bin/env python\n\n# Copyright (c) 2009-2011, Hoyt Koepke ([email protected])\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n# - Redistributions of source code must retain the above copyright\n# notice, this list of conditions and the following disclaimer.\n# - Redistributions in binary form must reproduce the above copyright\n# notice, this list of conditions and the following disclaimer in the\n# documentation and/or other materials provided with the distribution.\n# - Neither the name 'treedict' nor the\n# names of its contributors may be used to endorse or promote products\n# derived from this software without specific prior written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY Hoyt Koepke ''AS IS'' AND ANY\n# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL Hoyt Koepke BE LIABLE FOR ANY\n# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\nimport random, unittest, collections\nfrom treedict import TreeDict, getTree\nimport treedict\nfrom copy import deepcopy, copy\n\nfrom hashlib import md5\nimport random\n\nfrom treedict.treedict import _ldist\n\nfrom common import *\n\n\n\n\n\nif __name__ == '__main__':\n unittest.main()\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestRetrieval(unittest.TestCase):\n \n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n ##################################################\n # Some of the format specifying stuff\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n", "metadata": "root.TestRetrieval", "header": "['module', '___EOS___']", "index": 40 }, { "content": " def test_existance_01(self):\n p = sample_tree()\n self.assert_(\"123\" not in p)\n self.assert_(not p.has_key(\"123\"))", "metadata": "root.TestRetrieval.test_existance_01", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 42 }, { "content": " def test_existance_02(self):\n p = sample_tree()\n self.assert_(123 not in p)\n self.assert_(not p.has_key(123))", "metadata": "root.TestRetrieval.test_existance_02", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 47 }, { "content": " def test_existance_03(self):\n p = sample_tree()\n self.assert_(None not in p)\n self.assert_(not p.has_key(None))", "metadata": "root.TestRetrieval.test_existance_03", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 52 }, { "content": " def test_existance_04(self):\n p = sample_tree()\n self.assert_(\"si3dkdkdmmd\" not in p)\n self.assert_(not p.has_key(\"si3dkdkdmmd\"))", "metadata": "root.TestRetrieval.test_existance_04", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 57 }, { "content": " def test_existance_05(self):\n p = sample_tree()\n self.assert_(p not in p)\n self.assert_(not p.has_key(p))", "metadata": "root.TestRetrieval.test_existance_05", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 62 }, { "content": " def test_existance_06_dangling_node(self):\n p = makeTDInstance('roor')\n p.a\n\n self.assert_('a' not in p)", "metadata": "root.TestRetrieval.test_existance_06_dangling_node", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 68 }, { "content": " def test_existance_06b_dangling_node(self):\n p = makeTDInstance('roor')\n\n p.b = 123\n p.a\n\n self.assert_('b' in p)\n self.assert_('a' not in p)", "metadata": "root.TestRetrieval.test_existance_06b_dangling_node", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 74 }, { "content": " def test_existance_06c_dangling_node(self):\n p = makeTDInstance('roor')\n\n p.b = 123\n p.a\n p.aa.b.c\n p.bb.c.d = None\n\n self.assert_('a' not in p)\n self.assert_('b' in p)\n self.assert_('aa' not in p)\n self.assert_('bb' in p)", "metadata": "root.TestRetrieval.test_existance_06c_dangling_node", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 83 }, { "content": " def testExistanceThroughLink(self):\n p = makeTDInstance()\n p.a.b.link = p.d\n p.d.v = 1\n \n self.assert_('a.b.link.v' in p)", "metadata": "root.TestRetrieval.testExistanceThroughLink", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 96 }, { "content": " def testContains_01(self):\n p1 = makeTDInstance()\n p1.a.b = 123\n \n self.assert_('a' in p1)\n self.assert_('a.b' in p1)\n self.assert_('b' not in p1)\n self.assert_('b' in p1.a)", "metadata": "root.TestRetrieval.testContains_01", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 103 }, { "content": " def testContains_02(self):\n p1 = makeTDInstance()\n p1.a.b = 123\n p1.d\n \n self.assert_('a' in p1)\n self.assert_('a.b' in p1)\n self.assert_('d' not in p1)", "metadata": "root.TestRetrieval.testContains_02", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 113 }, { "content": " def testForwardReference(self):\n p = makeTDInstance('test')\n\n p.a.b.c = p.d.e.f\n\n p.d.e.f.g = 10\n\n self.assert_(p.a.b.c.g == 10)", "metadata": "root.TestRetrieval.testForwardReference", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 122 }, { "content": " def testDefaultValue_01(self):\n p = makeTDInstance()\n p.a.b = 123\n\n self.assert_(p.get('a.b') == 123)\n self.assert_(p.get('a.b', default_value = 1) == 123)\n self.assert_(p.get('a.c', default_value = 1) == 1)\n self.assert_(p.get('a.c', default_value = None) is None) ", "metadata": "root.TestRetrieval.testDefaultValue_01", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 131 }, { "content": " def testRetrieve_01_NonExistantBranchFromFrozenTree(self):\n p = makeTDInstance()\n p.a.b.c = 1\n p.freeze()\n\n self.assert_(p.a.b.c == 1)\n\n self.assertRaises(AttributeError, lambda: p.a.d)", "metadata": "root.TestRetrieval.testRetrieve_01_NonExistantBranchFromFrozenTree", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 141 }, { "content": " def testRetrieve_02_NonExistantBranchFromFrozenTree_control(self):\n p = makeTDInstance()\n p.a.b.c = 1\n # control; no freeze\n\n self.assert_(p.a.b.c == 1)\n \n p.a.d", "metadata": "root.TestRetrieval.testRetrieve_02_NonExistantBranchFromFrozenTree_control", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 150 }, { "content": " def testRetrieve_03_ThroughLink(self):\n p = makeTDInstance()\n p.a.b.link = p.d\n p.d.v = 1\n\n self.assert_(p[\"a.b.link.v\"] == 1)\n self.assert_(p.get(\"a.b.link.v\") == 1)", "metadata": "root.TestRetrieval.testRetrieve_03_ThroughLink", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 159 }, { "content": " def testRetrieve_04_ThroughMultipleLinks(self):\n p = makeTDInstance()\n\n p.l7.v = 1\n\n p.l6 = p.l7\n p.l5 = p.l6\n p.l4 = p.l5\n p.l3 = p.l4\n p.l2 = p.l3\n p.l1 = p.l2\n\n self.assert_(p.l7.v == 1)\n self.assert_(p.l6.v == 1)\n self.assert_(p.l5.v == 1)\n self.assert_(p.l4.v == 1)\n self.assert_(p.l3.v == 1)\n self.assert_(p.l2.v == 1)\n self.assert_(p.l1.v == 1)", "metadata": "root.TestRetrieval.testRetrieve_04_ThroughMultipleLinks", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 167 }, { "content": " def testNonexistantValues_01(self):\n\n p = makeTDInstance()\n self.assertRaises(KeyError, lambda: p[\"a\"])", "metadata": "root.TestRetrieval.testNonexistantValues_01", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 187 }, { "content": " def testNonexistantValues_02(self):\n\n p = makeTDInstance()\n self.assertRaises(KeyError, lambda: p[0])", "metadata": "root.TestRetrieval.testNonexistantValues_02", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 192 }, { "content": " def testNonexistantValues_03(self):\n\n p = makeTDInstance()\n self.assertRaises(KeyError, lambda: p[None])", "metadata": "root.TestRetrieval.testNonexistantValues_03", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 197 }, { "content": " def testNonexistantValues_04(self):\n\n p = makeTDInstance()\n p.freeze()\n self.assertRaises(AttributeError, lambda: p.a)", "metadata": "root.TestRetrieval.testNonexistantValues_04", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 202 }, { "content": " def testConvertTo_01(self):\n \n t = makeTDInstance()\n t.z = 3\n t.a.x = 1\n t.a.y = 2\n\n # Test default\n self.assert_(t.convertTo() == t.convertTo('nested_dict'))\n \n self.assert_(t.convertTo() == {'a' : {'x' : 1, 'y' : 2}, 'z' : 3})", "metadata": "root.TestRetrieval.testConvertTo_01", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 211 }, { "content": " def testConvertTo_02(self):\n\n t = random_tree(200)\n d = t.convertTo('nested_dict')\n t2 = TreeDict.fromdict(d, expand_nested = True)\n self.assert_(t == t2)", "metadata": "root.TestRetrieval.testConvertTo_02", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 223 }, { "content": " def testConvertTo_03_self_linked_01(self):\n\n t = makeTDInstance()\n t.makeBranch('b')\n t.a.b = t.b\n t.b.a = t.a\n\n d = t.convertTo('nested_dict')\n\n self.assert_(type(d['a']) is dict)\n self.assert_(type(d['b']) is dict)\n \n self.assert_(d['a']['b'] is d['b'])\n self.assert_(d['b']['a'] is d['a'])", "metadata": "root.TestRetrieval.testConvertTo_03_self_linked_01", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 230 }, { "content": " def testConvertTo_03_self_linked_02(self):\n\n t = random_selflinked_tree(0, 1)\n d = t.convertTo('nested_dict')\n t2 = TreeDict.fromdict(d, expand_nested = True)\n\n t.attach(recursive = True)\n t2.attach(recursive = True)\n\n self.assert_(t == t2)", "metadata": "root.TestRetrieval.testConvertTo_03_self_linked_02", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 245 }, { "content": " def testConvertTo_04_root_linked_01(self):\n\n t = makeTDInstance()\n t.a = t\n\n d = t.convertTo('nested_dict')\n\n self.assert_(d['a'] is d)", "metadata": "root.TestRetrieval.testConvertTo_04_root_linked_01", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 256 }, { "content": " def testConvertTo_04_root_linked_02(self):\n\n t = makeTDInstance()\n t.a.b.c = t\n t.a.b.x = t.a\n\n d = t.convertTo('nested_dict')\n\n self.assert_(d['a']['b']['c'] is d)\n self.assert_(d['a']['b']['x'] is d['a'])", "metadata": "root.TestRetrieval.testConvertTo_04_root_linked_02", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 265 }, { "content": " def testConvertTo_05_only_local_as_values_01(self):\n\n t = makeTDInstance()\n\n t.x.y = 1\n t.a.b.c = 1\n t.a.b.d = t.a.b\n t.a.b.xl = t.x\n t.a.xl = t.x\n\n d = t.a.convertTo('nested_dict', convert_values = False)\n \n self.assert_(type(d['b']['d']) is dict)\n self.assert_(type(d['b']) is dict)\n self.assert_(d['b'] is d['b']['d'])\n self.assert_(d['b']['c'] == 1)\n\n # TreeDict values are only converted if they are a branch somewhere in the \n self.assert_(isinstance(d['b']['xl'], TreeDict))\n self.assert_(isinstance(d['xl'], TreeDict))\n self.assert_(d['xl'] is d['b']['xl'])", "metadata": "root.TestRetrieval.testConvertTo_05_only_local_as_values_01", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 277 }, { "content": " def testConvertTo_05_only_local_as_values_01_control(self):\n\n t = makeTDInstance()\n\n t.x.y = 1\n t.a.b.c = 1\n t.a.b.d = t.a.b\n t.a.b.xl = t.x\n t.a.xl = t.x\n\n d = t.a.convertTo('nested_dict', convert_values = True)\n \n self.assert_(type(d['b']['d']) is dict)\n self.assert_(type(d['b']) is dict)\n self.assert_(d['b'] is d['b']['d'])\n self.assert_(d['b']['c'] == 1)\n\n # TreeDict values are only converted if they are a branch somewhere in the \n self.assert_(type(d['b']['xl']) is dict)\n self.assert_(type(d['xl']) is dict)\n self.assert_(d['xl'] is d['b']['xl'])", "metadata": "root.TestRetrieval.testConvertTo_05_only_local_as_values_01_control", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 299 }, { "content": " def testConvertTo_05_only_local_as_values_02(self):\n\n t = makeTDInstance()\n\n t.x.y = 1\n t.a.b.c = 1\n\n a_refs = random_node_list(0, 100, 0.5)\n x_refs = random_node_list(1, 100, 0.5)\n\n for n in a_refs:\n t.a[n] = t.a.b\n\n for n in x_refs:\n t.a[n] = t.x\n\n d = t.a.convertTo('nested_dict', convert_values = False)\n\n def get_value(d, n):\n for n in n.split('.'):\n d = d[n]\n return d\n \n for n in a_refs:\n self.assert_(type(get_value(d, n)) is dict)\n self.assert_(get_value(d, n) is d['b'])\n\n for n in x_refs:\n self.assert_(isinstance(get_value(d, n), TreeDict))\n self.assert_(get_value(d, n) is t.x)", "metadata": "root.TestRetrieval.testConvertTo_05_only_local_as_values_02", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 321 }, { "content": " def testConvertTo_06_prune_empty_01(self):\n\n t = makeTDInstance()\n\n t.makeBranch('a')\n\n d = t.convertTo('nested_dict', prune_empty = True)\n\n self.assert_(d == {})", "metadata": "root.TestRetrieval.testConvertTo_06_prune_empty_01", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 353 }, { "content": " def testConvertTo_06_prune_empty_02(self):\n\n t = makeTDInstance()\n\n t.a.x = 1\n t.a.makeBranch('b')\n\n d = t.convertTo('nested_dict', prune_empty = False)\n\n self.assert_(d == {'a' : {'x' : 1, 'b' : {} } } )\n \n d2 = t.convertTo('nested_dict', prune_empty = True)\n\n self.assert_(d2 == {'a' : {'x' : 1 } } )", "metadata": "root.TestRetrieval.testConvertTo_06_prune_empty_02", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 363 }, { "content": " def testConvertTo_07_lists(self):\n t = makeTDInstance()\n\n t.a.b = [1, makeTDInstance(x = 1)]\n\n d = t.convertTo('nested_dict', expand_lists = False)\n\n self.assert_(d == {'a' : {'b' : [1, makeTDInstance(x = 1)]}})\n \n d2 = t.convertTo('nested_dict', expand_lists = True)\n\n self.assert_(d2 == {'a' : {'b' : [1, {'x' : 1} ]}})", "metadata": "root.TestRetrieval.testConvertTo_07_lists", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 379 }, { "content": " def testConvertTo_08_self_referencing_lists(self):\n t = makeTDInstance()\n\n t.a = [t]\n\n d = t.convertTo('nested_dict', expand_lists = False)\n\n self.assert_(d['a'][0] is t)\n\n d2 = t.convertTo('nested_dict', expand_lists = True)\n\n self.assert_(d2['a'][0] is d2)", "metadata": "root.TestRetrieval.testConvertTo_08_self_referencing_lists", "header": "['class', 'TestRetrieval', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 392 } ]
[ { "span": "import random, unittest, collections", "start_line": 28, "start_column": 0, "end_line": 28, "end_column": 36 }, { "span": "from treedict import TreeDict, getTree", "start_line": 29, "start_column": 0, "end_line": 29, "end_column": 38 }, { "span": "import treedict", "start_line": 30, "start_column": 0, "end_line": 30, "end_column": 15 }, { "span": "from copy import deepcopy, copy", "start_line": 31, "start_column": 0, "end_line": 31, "end_column": 31 }, { "span": "import random", "start_line": 34, "start_column": 0, "end_line": 34, "end_column": 13 }, { "span": "from treedict.treedict import _ldist", "start_line": 36, "start_column": 0, "end_line": 36, "end_column": 36 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "200", "9", "-", "2011", ",", " ", "Ho", "yt", " ", "Ko", "ep", "ke", " ", "(", "ho", "yt", "ak", "@", "gma", "il", ".", "com", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Redistributi", "on", " ", "and", " ", "use", " ", "in", " ", "source", " ", "and", " ", "binar", "y", " ", "forms", ",", " ", "with", " ", "or", " ", "with", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "modification", ",", " ", "are", " ", "permit", "ted", " ", "provided", " ", "tha", "t", " ", "the", " ", "follow", "ing", " ", "condition", "s", " ", "are", " ", "met", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "Redistributi", "ons", " ", "of", " ", "source", " ", "code", " ", "must", " ", "retain", " ", "the", " ", "above", " ", "copyright_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "notice", ",", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "Redistributi", "ons", " ", "in", " ", "binar", "y", " ", "form", " ", "must", " ", "reproduce", " ", "the", " ", "above", " ", "copyright_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "notice", ",", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "documentation", " ", "and", "/", "or", " ", "other", " ", "material", "s", " ", "provided", " ", "with", " ", "the", " ", "distribu", "tion", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "Nei", "ther", " ", "the", " ", "name", " ", "'", "tree", "dict", "'", " ", "nor", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "names", " ", "of", " ", "its", " ", "contributor", "s", " ", "may", " ", "be", " ", "used", " ", "to", " ", "endo", "rse", " ", "or", " ", "promote", " ", "products_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "derive", "d", " ", "from", " ", "this", " ", "software", " ", "with", "out", " ", "specific", " ", "prior", " ", "writt", "en", " ", "permissi", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THIS", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "BY", " ", "Ho", "yt", " ", "Ko", "ep", "ke", " ", "''", "AS", " ", "IS", "''", " ", "AND", " ", "ANY_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", ",", " ", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",", " ", "THE", " ", "IMPL", "IED", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "AND", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", " ", "ARE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "DISC", "LAI", "MED", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "Ho", "yt", " ", "Ko", "ep", "ke", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "DIRECT", ",", " ", "INDI", "RECT", ",", " ", "INC", "IDENT", "AL", ",", " ", "SPECIAL", ",", " ", "EXE", "MPL", "ARY", ",", " ", "OR", " ", "CONS", "EQU", "ENTI", "AL", " ", "DA", "MAGE", "S_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",", " ", "PROC", "URE", "MENT", " ", "OF", " ", "SUBST", "ITU", "TE", " ", "GOOD", "S", " ", "OR", " ", "SERVICES", ";_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LOSS", " ", "OF", " ", "USE", ",", " ", "DATA", ",", " ", "OR", " ", "PROF", "IT", "S", ";", " ", "OR", " ", "BUS", "INE", "SS", " ", "INTER", "RU", "PTION", ")", " ", "HO", "WE", "VER", " ", "CAU", "SED", " ", "AND_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ON", " ", "ANY", " ", "THE", "ORY", " ", "OF", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "CONTR", "ACT", ",", " ", "STRI", "CT", " ", "LI", "ABI", "LIT", "Y", ",", " ", "OR", " ", "TOR", "T_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "INC", "LU", "DING", " ", "NEG", "LIG", "ENCE", " ", "OR", " ", "OTHER", "WI", "SE", ")", " ", "ARI", "SIN", "G", " ", "IN", " ", "ANY", " ", "WAY", " ", "OUT", " ", "OF", " ", "THE", " ", "USE", " ", "OF", " ", "THIS", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SOFT", "WARE", ",", " ", "EVE", "N", " ", "IF", " ", "ADV", "ISE", "D", " ", "OF", " ", "THE", " ", "POS", "SIB", "ILI", "TY", " ", "OF", " ", "SUC", "H", " ", "DA", "MAGE", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "random_", ",_", "unittest_", ",_", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tree", "dict_", "import_", "Tree", "Dict_", ",_", "get", "Tree_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tree", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "copy_", "import_", "deepcopy_", ",_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "hashlib_", "import_", "md5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "tree", "dict_", "._", "tree", "dict_", "import_", "\\u", "ldi", "st_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "common_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unittest_", "._", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "Retriev", "al_", "(_", "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\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "#", " ", "Some", " ", "of", " ", "the", " ", "format", " ", "speci", "fy", "ing", " ", "stuff_", "\\u\\u\\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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "exist", "anc", "e\\u", "01_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "sample", "\\u", "tree_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "\"", "123", "\"_", "not_", "in_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "not_", "p_", "._", "has", "\\u", "key_", "(_", "\"", "123", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "exist", "anc", "e\\u", "02_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "sample", "\\u", "tree_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "123_", "not_", "in_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "not_", "p_", "._", "has", "\\u", "key_", "(_", "123_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "exist", "anc", "e\\u", "03_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "sample", "\\u", "tree_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "None_", "not_", "in_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "not_", "p_", "._", "has", "\\u", "key_", "(_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "exist", "anc", "e\\u", "04_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "sample", "\\u", "tree_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "\"", "si", "3d", "kd", "kd", "mm", "d", "\"_", "not_", "in_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "not_", "p_", "._", "has", "\\u", "key_", "(_", "\"", "si", "3d", "kd", "kd", "mm", "d", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "exist", "anc", "e\\u", "05_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "sample", "\\u", "tree_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "p_", "not_", "in_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "not_", "p_", "._", "has", "\\u", "key_", "(_", "p_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "exist", "anc", "e\\u", "0", "6", "\\u", "dan", "glin", "g", "\\u", "node_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "make", "TD", "Instance_", "(_", "'", "roo", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "'", "a", "'_", "not_", "in_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "exist", "anc", "e\\u", "0", "6b", "\\u", "dan", "glin", "g", "\\u", "node_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "make", "TD", "Instance_", "(_", "'", "roo", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "b_", "=_", "123_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "'", "b", "'_", "in_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "'", "a", "'_", "not_", "in_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "exist", "anc", "e\\u", "0", "6c", "\\u", "dan", "glin", "g", "\\u", "node_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "make", "TD", "Instance_", "(_", "'", "roo", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "b_", "=_", "123_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "aa_", "._", "b_", "._", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "bb_", "._", "c_", "._", "d_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "'", "a", "'_", "not_", "in_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "'", "b", "'_", "in_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "'", "aa", "'_", "not_", "in_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "'", "bb", "'_", "in_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Exist", "anc", "e", "Through", "Link_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "a_", "._", "b_", "._", "link_", "=_", "p_", "._", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "d_", "._", "v_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "'", "a", ".", "b", ".", "link", ".", "v", "'_", "in_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Contain", "s", "\\u", "01_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p1_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p1_", "._", "a_", "._", "b_", "=_", "123_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "'", "a", "'_", "in_", "p1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "'", "a", ".", "b", "'_", "in_", "p1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "'", "b", "'_", "not_", "in_", "p1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "'", "b", "'_", "in_", "p1_", "._", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Contain", "s", "\\u", "02_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p1_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p1_", "._", "a_", "._", "b_", "=_", "123_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p1_", "._", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "'", "a", "'_", "in_", "p1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "'", "a", ".", "b", "'_", "in_", "p1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "'", "d", "'_", "not_", "in_", "p1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Forward", "Reference_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "make", "TD", "Instance_", "(_", "'", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "a_", "._", "b_", "._", "c_", "=_", "p_", "._", "d_", "._", "e_", "._", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "d_", "._", "e_", "._", "f_", "._", "g_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "p_", "._", "a_", "._", "b_", "._", "c_", "._", "g_", "==_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Default", "Value", "\\u", "01_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "a_", "._", "b_", "=_", "123_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "p_", "._", "get_", "(_", "'", "a", ".", "b", "'_", ")_", "==_", "123_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "p_", "._", "get_", "(_", "'", "a", ".", "b", "'_", ",_", "default", "\\u", "value_", "=_", "1_", ")_", "==_", "123_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "p_", "._", "get_", "(_", "'", "a", ".", "c", "'_", ",_", "default", "\\u", "value_", "=_", "1_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "p_", "._", "get_", "(_", "'", "a", ".", "c", "'_", ",_", "default", "\\u", "value_", "=_", "None_", ")_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Retrieve", "\\u", "01", "\\u", "Non", "Exist", "ant", "Branc", "h", "Fro", "m", "Fro", "zen", "Tree_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "a_", "._", "b_", "._", "c_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "freeze_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "p_", "._", "a_", "._", "b_", "._", "c_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Attribute", "Error_", ",_", "lambda_", ":_", "p_", "._", "a_", "._", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Retrieve", "\\u", "02", "\\u", "Non", "Exist", "ant", "Branc", "h", "Fro", "m", "Fro", "zen", "Tree", "\\u", "control_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "a_", "._", "b_", "._", "c_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "control", ";", " ", "no", " ", "freeze_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "p_", "._", "a_", "._", "b_", "._", "c_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "a_", "._", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Retrieve", "\\u", "03", "\\u", "Through", "Link_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "a_", "._", "b_", "._", "link_", "=_", "p_", "._", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "d_", "._", "v_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "p_", "[_", "\"", "a", ".", "b", ".", "link", ".", "v", "\"_", "]_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "p_", "._", "get_", "(_", "\"", "a", ".", "b", ".", "link", ".", "v", "\"_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Retrieve", "\\u", "04", "\\u", "Through", "Multipl", "e", "Links_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "l7", "_", "._", "v_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "l", "6_", "=_", "p_", "._", "l7", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "l", "5_", "=_", "p_", "._", "l", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "l4", "_", "=_", "p_", "._", "l", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "l3_", "=_", "p_", "._", "l4", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "l2_", "=_", "p_", "._", "l3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "l1_", "=_", "p_", "._", "l2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "p_", "._", "l7", "_", "._", "v_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "p_", "._", "l", "6_", "._", "v_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "p_", "._", "l", "5_", "._", "v_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "p_", "._", "l4", "_", "._", "v_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "p_", "._", "l3_", "._", "v_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "p_", "._", "l2_", "._", "v_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "p_", "._", "l1_", "._", "v_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Non", "exist", "ant", "Value", "s", "\\u", "01_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Key", "Error_", ",_", "lambda_", ":_", "p_", "[_", "\"", "a", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Non", "exist", "ant", "Value", "s", "\\u", "02_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Key", "Error_", ",_", "lambda_", ":_", "p_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Non", "exist", "ant", "Value", "s", "\\u", "03_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Key", "Error_", ",_", "lambda_", ":_", "p_", "[_", "None_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Non", "exist", "ant", "Value", "s", "\\u", "04_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "freeze_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Attribute", "Error_", ",_", "lambda_", ":_", "p_", "._", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Convert", "To", "\\u", "01_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "z_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "a_", "._", "x_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "a_", "._", "y_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "default_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "t_", "._", "convert", "To_", "(_", ")_", "==_", "t_", "._", "convert", "To_", "(_", "'", "nest", "ed", "\\u", "dict", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "t_", "._", "convert", "To_", "(_", ")_", "==_", "{_", "'", "a", "'_", ":_", "{_", "'", "x", "'_", ":_", "1_", ",_", "'", "y", "'_", ":_", "2_", "}_", ",_", "'", "z", "'_", ":_", "3_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Convert", "To", "\\u", "02_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "random", "\\u", "tree_", "(_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "t_", "._", "convert", "To_", "(_", "'", "nest", "ed", "\\u", "dict", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "Tree", "Dict_", "._", "from", "dict_", "(_", "d_", ",_", "expand", "\\u", "nested_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "t_", "==_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Convert", "To", "\\u", "03", "\\u", "self", "\\u", "linked", "\\u", "01_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "make", "Branch_", "(_", "'", "b", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "a_", "._", "b_", "=_", "t_", "._", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "b_", "._", "a_", "=_", "t_", "._", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "t_", "._", "convert", "To_", "(_", "'", "nest", "ed", "\\u", "dict", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "type_", "(_", "d_", "[_", "'", "a", "'_", "]_", ")_", "is_", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "type_", "(_", "d_", "[_", "'", "b", "'_", "]_", ")_", "is_", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "d_", "[_", "'", "a", "'_", "]_", "[_", "'", "b", "'_", "]_", "is_", "d_", "[_", "'", "b", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "d_", "[_", "'", "b", "'_", "]_", "[_", "'", "a", "'_", "]_", "is_", "d_", "[_", "'", "a", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Convert", "To", "\\u", "03", "\\u", "self", "\\u", "linked", "\\u", "02_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "random", "\\u", "self", "linked", "\\u", "tree_", "(_", "0_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "t_", "._", "convert", "To_", "(_", "'", "nest", "ed", "\\u", "dict", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "Tree", "Dict_", "._", "from", "dict_", "(_", "d_", ",_", "expand", "\\u", "nested_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "._", "attach_", "(_", "recursive_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "._", "attach_", "(_", "recursive_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "t_", "==_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Convert", "To", "\\u", "04", "\\u", "root", "\\u", "linked", "\\u", "01_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "a_", "=_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "t_", "._", "convert", "To_", "(_", "'", "nest", "ed", "\\u", "dict", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "d_", "[_", "'", "a", "'_", "]_", "is_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Convert", "To", "\\u", "04", "\\u", "root", "\\u", "linked", "\\u", "02_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "a_", "._", "b_", "._", "c_", "=_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "a_", "._", "b_", "._", "x_", "=_", "t_", "._", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "t_", "._", "convert", "To_", "(_", "'", "nest", "ed", "\\u", "dict", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "d_", "[_", "'", "a", "'_", "]_", "[_", "'", "b", "'_", "]_", "[_", "'", "c", "'_", "]_", "is_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "d_", "[_", "'", "a", "'_", "]_", "[_", "'", "b", "'_", "]_", "[_", "'", "x", "'_", "]_", "is_", "d_", "[_", "'", "a", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Convert", "To", "\\u", "05", "\\u", "only", "\\u", "local", "\\u", "as", "\\u", "values", "\\u", "01_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "._", "x_", "._", "y_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "a_", "._", "b_", "._", "c_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "a_", "._", "b_", "._", "d_", "=_", "t_", "._", "a_", "._", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "a_", "._", "b_", "._", "xl_", "=_", "t_", "._", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "a_", "._", "xl_", "=_", "t_", "._", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "t_", "._", "a_", "._", "convert", "To_", "(_", "'", "nest", "ed", "\\u", "dict", "'_", ",_", "convert", "\\u", "values_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "type_", "(_", "d_", "[_", "'", "b", "'_", "]_", "[_", "'", "d", "'_", "]_", ")_", "is_", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "type_", "(_", "d_", "[_", "'", "b", "'_", "]_", ")_", "is_", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "d_", "[_", "'", "b", "'_", "]_", "is_", "d_", "[_", "'", "b", "'_", "]_", "[_", "'", "d", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "d_", "[_", "'", "b", "'_", "]_", "[_", "'", "c", "'_", "]_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tree", "Dict", " ", "values", " ", "are", " ", "only", " ", "convert", "ed", " ", "if", " ", "the", "y", " ", "are", " ", "a", " ", "branch", " ", "some", "where", " ", "in", " ", "the", " _", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "isinstance_", "(_", "d_", "[_", "'", "b", "'_", "]_", "[_", "'", "xl", "'_", "]_", ",_", "Tree", "Dict_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "isinstance_", "(_", "d_", "[_", "'", "xl", "'_", "]_", ",_", "Tree", "Dict_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "d_", "[_", "'", "xl", "'_", "]_", "is_", "d_", "[_", "'", "b", "'_", "]_", "[_", "'", "xl", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Convert", "To", "\\u", "05", "\\u", "only", "\\u", "local", "\\u", "as", "\\u", "values", "\\u", "01", "\\u", "control_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "._", "x_", "._", "y_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "a_", "._", "b_", "._", "c_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "a_", "._", "b_", "._", "d_", "=_", "t_", "._", "a_", "._", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "a_", "._", "b_", "._", "xl_", "=_", "t_", "._", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "a_", "._", "xl_", "=_", "t_", "._", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "t_", "._", "a_", "._", "convert", "To_", "(_", "'", "nest", "ed", "\\u", "dict", "'_", ",_", "convert", "\\u", "values_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "type_", "(_", "d_", "[_", "'", "b", "'_", "]_", "[_", "'", "d", "'_", "]_", ")_", "is_", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "type_", "(_", "d_", "[_", "'", "b", "'_", "]_", ")_", "is_", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "d_", "[_", "'", "b", "'_", "]_", "is_", "d_", "[_", "'", "b", "'_", "]_", "[_", "'", "d", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "d_", "[_", "'", "b", "'_", "]_", "[_", "'", "c", "'_", "]_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tree", "Dict", " ", "values", " ", "are", " ", "only", " ", "convert", "ed", " ", "if", " ", "the", "y", " ", "are", " ", "a", " ", "branch", " ", "some", "where", " ", "in", " ", "the", " _", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "type_", "(_", "d_", "[_", "'", "b", "'_", "]_", "[_", "'", "xl", "'_", "]_", ")_", "is_", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "type_", "(_", "d_", "[_", "'", "xl", "'_", "]_", ")_", "is_", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "d_", "[_", "'", "xl", "'_", "]_", "is_", "d_", "[_", "'", "b", "'_", "]_", "[_", "'", "xl", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Convert", "To", "\\u", "05", "\\u", "only", "\\u", "local", "\\u", "as", "\\u", "values", "\\u", "02_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "._", "x_", "._", "y_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "a_", "._", "b_", "._", "c_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a", "\\u", "refs_", "=_", "random", "\\u", "node", "\\u", "list_", "(_", "0_", ",_", "100_", ",_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x", "\\u", "refs_", "=_", "random", "\\u", "node", "\\u", "list_", "(_", "1_", ",_", "100_", ",_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "n_", "in_", "a", "\\u", "refs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "._", "a_", "[_", "n_", "]_", "=_", "t_", "._", "a_", "._", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "n_", "in_", "x", "\\u", "refs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "._", "a_", "[_", "n_", "]_", "=_", "t_", "._", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "t_", "._", "a_", "._", "convert", "To_", "(_", "'", "nest", "ed", "\\u", "dict", "'_", ",_", "convert", "\\u", "values_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "value_", "(_", "d_", ",_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "n_", "in_", "n_", "._", "split_", "(_", "'.'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "d_", "[_", "n_", "]_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "n_", "in_", "a", "\\u", "refs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert\\u_", "(_", "type_", "(_", "get", "\\u", "value_", "(_", "d_", ",_", "n_", ")_", ")_", "is_", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "get", "\\u", "value_", "(_", "d_", ",_", "n_", ")_", "is_", "d_", "[_", "'", "b", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "n_", "in_", "x", "\\u", "refs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert\\u_", "(_", "isinstance_", "(_", "get", "\\u", "value_", "(_", "d_", ",_", "n_", ")_", ",_", "Tree", "Dict_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "get", "\\u", "value_", "(_", "d_", ",_", "n_", ")_", "is_", "t_", "._", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "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", "Convert", "To", "\\u", "0", "6", "\\u", "prune", "\\u", "empty", "\\u", "01_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "._", "make", "Branch_", "(_", "'", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "t_", "._", "convert", "To_", "(_", "'", "nest", "ed", "\\u", "dict", "'_", ",_", "prune", "\\u", "empty_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "d_", "==_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Convert", "To", "\\u", "0", "6", "\\u", "prune", "\\u", "empty", "\\u", "02_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "._", "a_", "._", "x_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "a_", "._", "make", "Branch_", "(_", "'", "b", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "t_", "._", "convert", "To_", "(_", "'", "nest", "ed", "\\u", "dict", "'_", ",_", "prune", "\\u", "empty_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "d_", "==_", "{_", "'", "a", "'_", ":_", "{_", "'", "x", "'_", ":_", "1_", ",_", "'", "b", "'_", ":_", "{_", "}_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d2_", "=_", "t_", "._", "convert", "To_", "(_", "'", "nest", "ed", "\\u", "dict", "'_", ",_", "prune", "\\u", "empty_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "d2_", "==_", "{_", "'", "a", "'_", ":_", "{_", "'", "x", "'_", ":_", "1_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Convert", "To", "\\u", "0", "7", "\\u", "lists_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "._", "a_", "._", "b_", "=_", "[_", "1_", ",_", "make", "TD", "Instance_", "(_", "x_", "=_", "1_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "t_", "._", "convert", "To_", "(_", "'", "nest", "ed", "\\u", "dict", "'_", ",_", "expand", "\\u", "lists_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "d_", "==_", "{_", "'", "a", "'_", ":_", "{_", "'", "b", "'_", ":_", "[_", "1_", ",_", "make", "TD", "Instance_", "(_", "x_", "=_", "1_", ")_", "]_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d2_", "=_", "t_", "._", "convert", "To_", "(_", "'", "nest", "ed", "\\u", "dict", "'_", ",_", "expand", "\\u", "lists_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "d2_", "==_", "{_", "'", "a", "'_", ":_", "{_", "'", "b", "'_", ":_", "[_", "1_", ",_", "{_", "'", "x", "'_", ":_", "1_", "}_", "]_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Retriev", "al_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Convert", "To", "\\u", "0", "8", "\\u", "self", "\\u", "referenci", "ng", "\\u", "lists_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "make", "TD", "Instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "._", "a_", "=_", "[_", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "t_", "._", "convert", "To_", "(_", "'", "nest", "ed", "\\u", "dict", "'_", ",_", "expand", "\\u", "lists_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "d_", "[_", "'", "a", "'_", "]_", "[_", "0_", "]_", "is_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d2_", "=_", "t_", "._", "convert", "To_", "(_", "'", "nest", "ed", "\\u", "dict", "'_", ",_", "expand", "\\u", "lists_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "d2_", "[_", "'", "a", "'_", "]_", "[_", "0_", "]_", "is_", "d2_", ")_", "\\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,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Variable defined multiple times
networkx/networkx/networkx/algorithms/flow/capacityscaling.py
[ { "content": "def capacity_scaling(G, demand='demand', capacity='capacity', weight='weight',\n heap=BinaryHeap):\n r\"\"\"Find a minimum cost flow satisfying all demands in digraph G.\n\n This is a capacity scaling successive shortest augmenting path algorithm.\n\n G is a digraph with edge costs and capacities and in which nodes\n have demand, i.e., they want to send or receive some amount of\n flow. A negative demand means that the node wants to send flow, a\n positive demand means that the node want to receive flow. A flow on\n the digraph G satisfies all demand if the net flow into each node\n is equal to the demand of that node.\n\n Parameters\n ----------\n G : NetworkX graph\n DiGraph or MultiDiGraph on which a minimum cost flow satisfying all\n demands is to be found.\n\n demand : string\n Nodes of the graph G are expected to have an attribute demand\n that indicates how much flow a node wants to send (negative\n demand) or receive (positive demand). Note that the sum of the\n demands should be 0 otherwise the problem in not feasible. If\n this attribute is not present, a node is considered to have 0\n demand. Default value: 'demand'.\n\n capacity : string\n Edges of the graph G are expected to have an attribute capacity\n that indicates how much flow the edge can support. If this\n attribute is not present, the edge is considered to have\n infinite capacity. Default value: 'capacity'.\n\n weight : string\n Edges of the graph G are expected to have an attribute weight\n that indicates the cost incurred by sending one unit of flow on\n that edge. If not present, the weight is considered to be 0.\n Default value: 'weight'.\n\n heap : class\n Type of heap to be used in the algorithm. It should be a subclass of\n :class:`MinHeap` or implement a compatible interface.\n\n If a stock heap implementation is to be used, :class:`BinaryHeap` is\n recommeded over :class:`PairingHeap` for Python implementations without\n optimized attribute accesses (e.g., CPython) despite a slower\n asymptotic running time. For Python implementations with optimized\n attribute accesses (e.g., PyPy), :class:`PairingHeap` provides better\n performance. Default value: :class:`BinaryHeap`.\n\n Returns\n -------\n flowCost : integer\n Cost of a minimum cost flow satisfying all demands.\n\n flowDict : dictionary\n If G is a digraph, a dict-of-dicts keyed by nodes such that\n flowDict[u][v] is the flow on edge (u, v).\n If G is a MultiDiGraph, a dict-of-dicts-of-dicts keyed by nodes\n so that flowDict[u][v][key] is the flow on edge (u, v, key).\n\n Raises\n ------\n NetworkXError\n This exception is raised if the input graph is not directed,\n not connected.\n\n NetworkXUnfeasible\n This exception is raised in the following situations:\n\n * The sum of the demands is not zero. Then, there is no\n flow satisfying all demands.\n * There is no flow satisfying all demand.\n\n NetworkXUnbounded\n This exception is raised if the digraph G has a cycle of\n negative cost and infinite capacity. Then, the cost of a flow\n satisfying all demands is unbounded below.\n\n Notes\n -----\n This algorithm does not work if edge weights are floating-point numbers.\n\n See also\n --------\n :meth:`network_simplex`\n\n Examples\n --------\n A simple example of a min cost flow problem.\n\n >>> import networkx as nx\n >>> G = nx.DiGraph()\n >>> G.add_node('a', demand = -5)\n >>> G.add_node('d', demand = 5)\n >>> G.add_edge('a', 'b', weight = 3, capacity = 4)\n >>> G.add_edge('a', 'c', weight = 6, capacity = 10)\n >>> G.add_edge('b', 'd', weight = 1, capacity = 9)\n >>> G.add_edge('c', 'd', weight = 2, capacity = 5)\n >>> flowCost, flowDict = nx.capacity_scaling(G)\n >>> flowCost\n 24\n >>> flowDict # doctest: +SKIP\n {'a': {'c': 1, 'b': 4}, 'c': {'d': 1}, 'b': {'d': 4}, 'd': {}}\n\n It is possible to change the name of the attributes used for the\n algorithm.\n\n >>> G = nx.DiGraph()\n >>> G.add_node('p', spam = -4)\n >>> G.add_node('q', spam = 2)\n >>> G.add_node('a', spam = -2)\n >>> G.add_node('d', spam = -1)\n >>> G.add_node('t', spam = 2)\n >>> G.add_node('w', spam = 3)\n >>> G.add_edge('p', 'q', cost = 7, vacancies = 5)\n >>> G.add_edge('p', 'a', cost = 1, vacancies = 4)\n >>> G.add_edge('q', 'd', cost = 2, vacancies = 3)\n >>> G.add_edge('t', 'q', cost = 1, vacancies = 2)\n >>> G.add_edge('a', 't', cost = 2, vacancies = 4)\n >>> G.add_edge('d', 'w', cost = 3, vacancies = 4)\n >>> G.add_edge('t', 'w', cost = 4, vacancies = 1)\n >>> flowCost, flowDict = nx.capacity_scaling(G, demand = 'spam',\n ... capacity = 'vacancies',\n ... weight = 'cost')\n >>> flowCost\n 37\n >>> flowDict # doctest: +SKIP\n {'a': {'t': 4}, 'd': {'w': 2}, 'q': {'d': 1}, 'p': {'q': 2, 'a': 2}, 't': {'q': 1, 'w': 1}, 'w': {}}\n \"\"\"\n R = _build_residual_network(G, demand, capacity, weight)\n\n inf = float('inf')\n # Account cost of negative selfloops.\n flow_cost = sum(\n 0 if e.get(capacity, inf) <= 0 or e.get(weight, 0) >= 0\n else e[capacity] * e[weight]\n for u, v, e in G.selfloop_edges(data=True))\n\n # Determine the maxmimum edge capacity.\n wmax = max(chain([-inf],\n (e['capacity'] for u, v, e in R.edges(data=True))))\n if wmax == -inf:\n # Residual network has no edges.\n return flow_cost, _build_flow_dict(G, R, capacity, weight)\n\n R_node = R.node\n R_succ = R.succ\n\n delta = 2 ** int(log(wmax, 2))\n while delta >= 1:\n # Saturate Δ-residual edges with negative reduced costs to achieve\n # Δ-optimality.\n for u in R:\n p_u = R_node[u]['potential']\n for v, es in R_succ[u].items():\n for k, e in es.items():\n flow = e['capacity'] - e['flow']\n if e['weight'] - p_u + R_node[v]['potential'] < 0:\n flow = e['capacity'] - e['flow']\n if flow >= delta:\n e['flow'] += flow\n R_succ[v][u][(k[0], not k[1])]['flow'] -= flow\n R_node[u]['excess'] -= flow\n R_node[v]['excess'] += flow\n # Determine the Δ-active nodes.\n S = set()\n T = set()\n S_add = S.add\n S_remove = S.remove\n T_add = T.add\n T_remove = T.remove\n for u in R:\n excess = R_node[u]['excess']\n if excess >= delta:\n S_add(u)\n elif excess <= -delta:\n T_add(u)\n # Repeatedly augment flow from S to T along shortest paths until\n # Δ-feasibility is achieved.\n while S and T:\n s = arbitrary_element(S)\n t = None\n # Search for a shortest path in terms of reduce costs from s to\n # any t in T in the Δ-residual network.\n d = {}\n pred = {s: None}\n h = heap()\n h_insert = h.insert\n h_get = h.get\n h_insert(s, 0)\n while h:\n u, d_u = h.pop()\n d[u] = d_u\n if u in T:\n # Path found.\n t = u\n break\n p_u = R_node[u]['potential']\n for v, es in R_succ[u].items():\n if v in d:\n continue\n wmin = inf\n # Find the minimum-weighted (u, v) Δ-residual edge.\n for k, e in es.items():\n if e['capacity'] - e['flow'] >= delta:\n w = e['weight']\n if w < wmin:\n wmin = w\n kmin = k\n emin = e\n if wmin == inf:\n continue\n # Update the distance label of v.\n d_v = d_u + wmin - p_u + R_node[v]['potential']\n if h_insert(v, d_v):\n pred[v] = (u, kmin, emin)\n if t is not None:\n # Augment Δ units of flow from s to t.\n while u != s:\n v = u\n u, k, e = pred[v]\n e['flow'] += delta\n R_succ[v][u][(k[0], not k[1])]['flow'] -= delta\n # Account node excess and deficit.\n R_node[s]['excess'] -= delta\n R_node[t]['excess'] += delta\n if R_node[s]['excess'] < delta:\n S_remove(s)\n if R_node[t]['excess'] > -delta:\n T_remove(t)\n # Update node potentials.\n d_t = d[t]\n for u, d_u in d.items():\n R_node[u]['potential'] -= d_u - d_t\n else:\n # Path not found.\n S_remove(s)\n delta //= 2\n\n if any(R.node[u]['excess'] != 0 for u in R):\n raise nx.NetworkXUnfeasible('No flow satisfying all demands.')\n\n # Calculate the flow cost.\n for u in R:\n for v, es in R_succ[u].items():\n for e in es.values():\n flow = e['flow']\n if flow > 0:\n flow_cost += flow * e['weight']\n\n return flow_cost, _build_flow_dict(G, R, capacity, weight)", "metadata": "root.capacity_scaling", "header": "['module', '___EOS___']", "index": 130 } ]
[ { "span": "flow ", "start_line": 287, "start_column": 20, "end_line": 287, "end_column": 24 } ]
[ { "span": "flow ", "start_line": 289, "start_column": 24, "end_line": 289, "end_column": 28 }, { "span": "flow ", "start_line": 377, "start_column": 16, "end_line": 377, "end_column": 20 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "capacit", "y", "\\u", "scaling_", "(_", "G_", ",_", "demand_", "=_", "'", "demand", "'_", ",_", "capacity_", "=_", "'", "capacit", "y", "'_", ",_", "weight_", "=_", "'", "weight", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "heap_", "=_", "Bin", "ary", "Hea", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r", "\"\"\"", "Fin", "d", " ", "a", " ", "minim", "um", " ", "cost", " ", "flow", " ", "satisfy", "ing", " ", "all", " ", "demand", "s", " ", "in", " ", "digraph", " ", "G", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "a", " ", "capacit", "y", " ", "scal", "ing", " ", "success", "ive", " ", "short", "est", " ", "augment", "ing", " ", "path", " ", "algo", "rit", "hm", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "G", " ", "is", " ", "a", " ", "digraph", " ", "with", " ", "edge", " ", "cost", "s", " ", "and", " ", "capacit", "ies", " ", "and", " ", "in", " ", "whi", "ch", " ", "nodes", "\\", "10", ";", " ", " ", " ", " ", "have", " ", "demand", ",", " ", "i", ".", "e", ".,", " ", "the", "y", " ", "want", " ", "to", " ", "send", " ", "or", " ", "receive", " ", "some", " ", "amo", "unt", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "flow", ".", " ", "A", " ", "negati", "ve", " ", "demand", " ", "means", " ", "tha", "t", " ", "the", " ", "node", " ", "want", "s", " ", "to", " ", "send", " ", "flow", ",", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "posit", "ive", " ", "demand", " ", "means", " ", "tha", "t", " ", "the", " ", "node", " ", "want", " ", "to", " ", "receive", " ", "flow", ".", " ", "A", " ", "flow", " ", "on", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "digraph", " ", "G", " ", "satisf", "ies", " ", "all", " ", "demand", " ", "if", " ", "the", " ", "net", " ", "flow", " ", "int", "o", " ", "each", " ", "node", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "equal", " ", "to", " ", "the", " ", "demand", " ", "of", " ", "tha", "t", " ", "node", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "G", " ", ":", " ", "Network", "X", " ", "graph", "\\", "10", ";", " ", " ", " ", " ", "Di", "Graph", " ", "or", " ", "Multi", "Di", "Graph", " ", "on", " ", "whi", "ch", " ", "a", " ", "minim", "um", " ", "cost", " ", "flow", " ", "satisfy", "ing", " ", "all", "\\", "10", ";", " ", " ", " ", " ", "demand", "s", " ", "is", " ", "to", " ", "be", " ", "found", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "demand", " ", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "Node", "s", " ", "of", " ", "the", " ", "graph", " ", "G", " ", "are", " ", "expected", " ", "to", " ", "have", " ", "an", " ", "attribute", " ", "demand", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", " ", "indicat", "es", " ", "how", " ", "muc", "h", " ", "flow", " ", "a", " ", "node", " ", "want", "s", " ", "to", " ", "send", " ", "(", "negati", "ve", "\\", "10", ";", " ", " ", " ", " ", "demand", ")", " ", "or", " ", "receive", " ", "(", "posit", "ive", " ", "demand", ").", " ", "Not", "e", " ", "tha", "t", " ", "the", " ", "sum", " ", "of", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "demand", "s", " ", "shou", "ld", " ", "be", " ", "0", " ", "other", "wis", "e", " ", "the", " ", "problem", " ", "in", " ", "not", " ", "feas", "ibl", "e", ".", " ", "If", "\\", "10", ";", " ", " ", " ", " ", "this", " ", "attribute", " ", "is", " ", "not", " ", "presen", "t", ",", " ", "a", " ", "node", " ", "is", " ", "consider", "ed", " ", "to", " ", "have", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "demand", ".", " ", "Default", " ", "value", ":", " ", "'", "demand", "'.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "capacit", "y", " ", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "Ed", "ges", " ", "of", " ", "the", " ", "graph", " ", "G", " ", "are", " ", "expected", " ", "to", " ", "have", " ", "an", " ", "attribute", " ", "capacit", "y", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", " ", "indicat", "es", " ", "how", " ", "muc", "h", " ", "flow", " ", "the", " ", "edge", " ", "can", " ", "support", ".", " ", "If", " ", "this", "\\", "10", ";", " ", " ", " ", " ", "attribute", " ", "is", " ", "not", " ", "presen", "t", ",", " ", "the", " ", "edge", " ", "is", " ", "consider", "ed", " ", "to", " ", "have", "\\", "10", ";", " ", " ", " ", " ", "infini", "te", " ", "capacit", "y", ".", " ", "Default", " ", "value", ":", " ", "'", "capacit", "y", "'.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "weight", " ", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "Ed", "ges", " ", "of", " ", "the", " ", "graph", " ", "G", " ", "are", " ", "expected", " ", "to", " ", "have", " ", "an", " ", "attribute", " ", "weight", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", " ", "indicat", "es", " ", "the", " ", "cost", " ", "inc", "urr", "ed", " ", "by", " ", "sendin", "g", " ", "one", " ", "unit", " ", "of", " ", "flow", " ", "on", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", " ", "edge", ".", " ", "If", " ", "not", " ", "presen", "t", ",", " ", "the", " ", "weight", " ", "is", " ", "consider", "ed", " ", "to", " ", "be", " ", "0.", "\\", "10", ";", " ", " ", " ", " ", "Default", " ", "value", ":", " ", "'", "weight", "'.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "heap", " ", ":", " ", "class", "\\", "10", ";", " ", " ", " ", " ", "Type", " ", "of", " ", "heap", " ", "to", " ", "be", " ", "used", " ", "in", " ", "the", " ", "algo", "rit", "hm", ".", " ", "It", " ", "shou", "ld", " ", "be", " ", "a", " ", "subclass", " ", "of", "\\", "10", ";", " ", " ", " ", " ", ":", "class", ":`", "Min", "Hea", "p", "`", " ", "or", " ", "implement", " ", "a", " ", "compatible", " ", "interface", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "a", " ", "stock", " ", "heap", " ", "implementation", " ", "is", " ", "to", " ", "be", " ", "used", ",", " ", ":", "class", ":`", "Bin", "ary", "Hea", "p", "`", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "recom", "med", "ed", " ", "over", " ", ":", "class", ":`", "Pair", "ing", "Hea", "p", "`", " ", "for", " ", "Pyth", "on", " ", "implementation", "s", " ", "with", "out", "\\", "10", ";", " ", " ", " ", " ", "optimize", "d", " ", "attribute", " ", "accesse", "s", " ", "(", "e", ".", "g", ".,", " ", "CP", "yth", "on", ")", " ", "desp", "ite", " ", "a", " ", "slowe", "r", "\\", "10", ";", " ", " ", " ", " ", "asy", "mpt", "oti", "c", " ", "runn", "ing", " ", "time", ".", " ", "For", " ", "Pyth", "on", " ", "implementation", "s", " ", "with", " ", "optimize", "d", "\\", "10", ";", " ", " ", " ", " ", "attribute", " ", "accesse", "s", " ", "(", "e", ".", "g", ".,", " ", "Py", "Py", "),", " ", ":", "class", ":`", "Pair", "ing", "Hea", "p", "`", " ", "provide", "s", " ", "bett", "er", "\\", "10", ";", " ", " ", " ", " ", "perform", "anc", "e", ".", " ", "Default", " ", "value", ":", " ", ":", "class", ":`", "Bin", "ary", "Hea", "p", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", " ", "flow", "Cost", " ", ":", " ", "integ", "er", "\\", "10", ";", " ", " ", " ", " ", "Cost", " ", "of", " ", "a", " ", "minim", "um", " ", "cost", " ", "flow", " ", "satisfy", "ing", " ", "all", " ", "demand", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "flow", "Dict", " ", ":", " ", "dictionar", "y", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "G", " ", "is", " ", "a", " ", "digraph", ",", " ", "a", " ", "dict", "-", "of", "-", "dict", "s", " ", "keyed", " ", "by", " ", "nodes", " ", "suc", "h", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "flow", "Dict", "[", "u", "][", "v", "]", " ", "is", " ", "the", " ", "flow", " ", "on", " ", "edge", " ", "(", "u", ",", " ", "v", ").", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "G", " ", "is", " ", "a", " ", "Multi", "Di", "Graph", ",", " ", "a", " ", "dict", "-", "of", "-", "dict", "s", "-", "of", "-", "dict", "s", " ", "keyed", " ", "by", " ", "nodes", "\\", "10", ";", " ", " ", " ", " ", "so", " ", "tha", "t", " ", "flow", "Dict", "[", "u", "][", "v", "][", "key", "]", " ", "is", " ", "the", " ", "flow", " ", "on", " ", "edge", " ", "(", "u", ",", " ", "v", ",", " ", "key", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", "\\", "10", ";", " ", " ", " ", " ", "------", "\\", "10", ";", " ", " ", " ", " ", "Network", "XE", "rror", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "exception", " ", "is", " ", "raise", "d", " ", "if", " ", "the", " ", "input", " ", "graph", " ", "is", " ", "not", " ", "direct", "ed", ",", "\\", "10", ";", " ", " ", " ", " ", "not", " ", "connect", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Network", "XU", "nfe", "asi", "ble", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "exception", " ", "is", " ", "raise", "d", " ", "in", " ", "the", " ", "follow", "ing", " ", "situation", "s", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "The", " ", "sum", " ", "of", " ", "the", " ", "demand", "s", " ", "is", " ", "not", " ", "zero", ".", " ", "The", "n", ",", " ", "there", " ", "is", " ", "no", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "flow", " ", "satisfy", "ing", " ", "all", " ", "demand", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "There", " ", "is", " ", "no", " ", "flow", " ", "satisfy", "ing", " ", "all", " ", "demand", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Network", "XU", "nbo", "unde", "d", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "exception", " ", "is", " ", "raise", "d", " ", "if", " ", "the", " ", "digraph", " ", "G", " ", "has", " ", "a", " ", "cycle", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "negati", "ve", " ", "cost", " ", "and", " ", "infini", "te", " ", "capacit", "y", ".", " ", "The", "n", ",", " ", "the", " ", "cost", " ", "of", " ", "a", " ", "flow", "\\", "10", ";", " ", " ", " ", " ", "satisfy", "ing", " ", "all", " ", "demand", "s", " ", "is", " ", "unbound", "ed", " ", "belo", "w", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "es", "\\", "10", ";", " ", " ", " ", " ", "-----", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "algo", "rit", "hm", " ", "doe", "s", " ", "not", " ", "work", " ", "if", " ", "edge", " ", "weight", "s", " ", "are", " ", "float", "ing", "-", "point", " ", "numbers", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "See", " ", "als", "o", "\\", "10", ";", " ", " ", " ", " ", "--------", "\\", "10", ";", " ", " ", " ", " ", ":", "meth", ":`", "network", "\\u", "simplex", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Exam", "ples", "\\", "10", ";", " ", " ", " ", " ", "--------", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "simple", " ", "example", " ", "of", " ", "a", " ", "min", " ", "cost", " ", "flow", " ", "problem", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "import", " ", "networkx", " ", "as", " ", "nx", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", " ", "=", " ", "nx", ".", "Di", "Graph", "()", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", ".", "add", "\\u", "node", "('", "a", "',", " ", "demand", " ", "=", " ", "-", "5", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", ".", "add", "\\u", "node", "('", "d", "',", " ", "demand", " ", "=", " ", "5", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", ".", "add", "\\u", "edge", "('", "a", "',", " ", "'", "b", "',", " ", "weight", " ", "=", " ", "3", ",", " ", "capacit", "y", " ", "=", " ", "4", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", ".", "add", "\\u", "edge", "('", "a", "',", " ", "'", "c", "',", " ", "weight", " ", "=", " ", "6", ",", " ", "capacit", "y", " ", "=", " ", "10", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", ".", "add", "\\u", "edge", "('", "b", "',", " ", "'", "d", "',", " ", "weight", " ", "=", " ", "1", ",", " ", "capacit", "y", " ", "=", " ", "9", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", ".", "add", "\\u", "edge", "('", "c", "',", " ", "'", "d", "',", " ", "weight", " ", "=", " ", "2", ",", " ", "capacit", "y", " ", "=", " ", "5", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "flow", "Cost", ",", " ", "flow", "Dict", " ", "=", " ", "nx", ".", "capacit", "y", "\\u", "scal", "ing", "(", "G", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "flow", "Cost", "\\", "10", ";", " ", " ", " ", " ", "24", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "flow", "Dict", " ", "#", " ", "docte", "st", ":", " ", "+", "SKIP", "\\", "10", ";", " ", " ", " ", " ", "{", "'", "a", "':", " ", "{", "'", "c", "':", " ", "1", ",", " ", "'", "b", "':", " ", "4", "},", " ", "'", "c", "':", " ", "{", "'", "d", "':", " ", "1", "},", " ", "'", "b", "':", " ", "{", "'", "d", "':", " ", "4", "},", " ", "'", "d", "':", " ", "{}", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "It", " ", "is", " ", "possib", "le", " ", "to", " ", "change", " ", "the", " ", "name", " ", "of", " ", "the", " ", "attribute", "s", " ", "used", " ", "for", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "algo", "rit", "hm", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", " ", "=", " ", "nx", ".", "Di", "Graph", "()", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", ".", "add", "\\u", "node", "('", "p", "',", " ", "spam", " ", "=", " ", "-", "4", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", ".", "add", "\\u", "node", "('", "q", "',", " ", "spam", " ", "=", " ", "2", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", ".", "add", "\\u", "node", "('", "a", "',", " ", "spam", " ", "=", " ", "-", "2", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", ".", "add", "\\u", "node", "('", "d", "',", " ", "spam", " ", "=", " ", "-1", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", ".", "add", "\\u", "node", "('", "t", "',", " ", "spam", " ", "=", " ", "2", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", ".", "add", "\\u", "node", "('", "w", "',", " ", "spam", " ", "=", " ", "3", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", ".", "add", "\\u", "edge", "('", "p", "',", " ", "'", "q", "',", " ", "cost", " ", "=", " ", "7", ",", " ", "vaca", "ncie", "s", " ", "=", " ", "5", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", ".", "add", "\\u", "edge", "('", "p", "',", " ", "'", "a", "',", " ", "cost", " ", "=", " ", "1", ",", " ", "vaca", "ncie", "s", " ", "=", " ", "4", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", ".", "add", "\\u", "edge", "('", "q", "',", " ", "'", "d", "',", " ", "cost", " ", "=", " ", "2", ",", " ", "vaca", "ncie", "s", " ", "=", " ", "3", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", ".", "add", "\\u", "edge", "('", "t", "',", " ", "'", "q", "',", " ", "cost", " ", "=", " ", "1", ",", " ", "vaca", "ncie", "s", " ", "=", " ", "2", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", ".", "add", "\\u", "edge", "('", "a", "',", " ", "'", "t", "',", " ", "cost", " ", "=", " ", "2", ",", " ", "vaca", "ncie", "s", " ", "=", " ", "4", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", ".", "add", "\\u", "edge", "('", "d", "',", " ", "'", "w", "',", " ", "cost", " ", "=", " ", "3", ",", " ", "vaca", "ncie", "s", " ", "=", " ", "4", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", ".", "add", "\\u", "edge", "('", "t", "',", " ", "'", "w", "',", " ", "cost", " ", "=", " ", "4", ",", " ", "vaca", "ncie", "s", " ", "=", " ", "1", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "flow", "Cost", ",", " ", "flow", "Dict", " ", "=", " ", "nx", ".", "capacit", "y", "\\u", "scal", "ing", "(", "G", ",", " ", "demand", " ", "=", " ", "'", "spam", "',", "\\", "10", ";", " ", " ", " ", " ", "...", " ", " ", " ", " ", " ", " ", "capacit", "y", " ", "=", " ", "'", "vaca", "ncie", "s", "',", "\\", "10", ";", " ", " ", " ", " ", "...", " ", " ", " ", " ", " ", " ", "weight", " ", "=", " ", "'", "cost", "')", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "flow", "Cost", "\\", "10", ";", " ", " ", " ", " ", "3", "7", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "flow", "Dict", " ", " ", "#", " ", "docte", "st", ":", " ", "+", "SKIP", "\\", "10", ";", " ", " ", " ", " ", "{", "'", "a", "':", " ", "{", "'", "t", "':", " ", "4", "},", " ", "'", "d", "':", " ", "{", "'", "w", "':", " ", "2", "},", " ", "'", "q", "':", " ", "{", "'", "d", "':", " ", "1", "},", " ", "'", "p", "':", " ", "{", "'", "q", "':", " ", "2", ",", " ", "'", "a", "':", " ", "2", "},", " ", "'", "t", "':", " ", "{", "'", "q", "':", " ", "1", ",", " ", "'", "w", "':", " ", "1", "},", " ", "'", "w", "':", " ", "{}", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R_", "=_", "\\u", "build", "\\u", "residu", "al", "\\u", "network_", "(_", "G_", ",_", "demand_", ",_", "capacity_", ",_", "weight_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "inf_", "=_", "float_", "(_", "'", "inf", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Account", " ", "cost", " ", "of", " ", "negati", "ve", " ", "self", "loop", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "flow", "\\u", "cost_", "=_", "sum_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "0_", "if_", "e_", "._", "get_", "(_", "capacity_", ",_", "inf_", ")_", "<=_", "0_", "or_", "e_", "._", "get_", "(_", "weight_", ",_", "0_", ")_", ">=_", "0_", "\\u\\u\\uNL\\u\\u\\u_", "else_", "e_", "[_", "capacity_", "]_", "*_", "e_", "[_", "weight_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "u_", ",_", "v_", ",_", "e_", "in_", "G_", "._", "self", "loop", "\\u", "edges_", "(_", "data_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Det", "erm", "ine", " ", "the", " ", "maxm", "imu", "m", " ", "edge", " ", "capacit", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "wma", "x_", "=_", "max_", "(_", "chain_", "(_", "[_", "-_", "inf_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "e_", "[_", "'", "capacit", "y", "'_", "]_", "for_", "u_", ",_", "v_", ",_", "e_", "in_", "R_", "._", "edges_", "(_", "data_", "=_", "True_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "wma", "x_", "==_", "-_", "inf_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Resid", "ual", " ", "network", " ", "has", " ", "no", " ", "edge", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "flow", "\\u", "cost_", ",_", "\\u", "build", "\\u", "flow", "\\u", "dict_", "(_", "G_", ",_", "R_", ",_", "capacity_", ",_", "weight_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "R", "\\u", "node_", "=_", "R_", "._", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R", "\\u", "succ_", "=_", "R_", "._", "succ_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "delta_", "=_", "2_", "**_", "int_", "(_", "log_", "(_", "wma", "x_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "delta_", ">=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Satur", "ate", " ", "\\", "916", ";", "-", "residu", "al", " ", "edge", "s", " ", "with", " ", "negati", "ve", " ", "reduce", "d", " ", "cost", "s", " ", "to", " ", "achieve", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\\", "916", ";", "-", "optim", "ality", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "u_", "in_", "R_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p", "\\u", "u_", "=_", "R", "\\u", "node_", "[_", "u_", "]_", "[_", "'", "potenti", "al", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "v_", ",_", "es_", "in_", "R", "\\u", "succ_", "[_", "u_", "]_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "k_", ",_", "e_", "in_", "es_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "flow_", "=_", "e_", "[_", "'", "capacit", "y", "'_", "]_", "-_", "e_", "[_", "'", "flow", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "e_", "[_", "'", "weight", "'_", "]_", "-_", "p", "\\u", "u_", "+_", "R", "\\u", "node_", "[_", "v_", "]_", "[_", "'", "potenti", "al", "'_", "]_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "flow_", "=_", "e_", "[_", "'", "capacit", "y", "'_", "]_", "-_", "e_", "[_", "'", "flow", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "flow_", ">=_", "delta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "e_", "[_", "'", "flow", "'_", "]_", "+=_", "flow_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R", "\\u", "succ_", "[_", "v_", "]_", "[_", "u_", "]_", "[_", "(_", "k_", "[_", "0_", "]_", ",_", "not_", "k_", "[_", "1_", "]_", ")_", "]_", "[_", "'", "flow", "'_", "]_", "-=_", "flow_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R", "\\u", "node_", "[_", "u_", "]_", "[_", "'", "excess", "'_", "]_", "-=_", "flow_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R", "\\u", "node_", "[_", "v_", "]_", "[_", "'", "excess", "'_", "]_", "+=_", "flow_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Det", "erm", "ine", " ", "the", " ", "\\", "916", ";", "-", "active", " ", "nodes", "._", "\\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_", "S_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "T_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "S", "\\u", "add_", "=_", "S_", "._", "add_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "S", "\\u", "remove_", "=_", "S_", "._", "remove_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "T", "\\u", "add_", "=_", "T_", "._", "add_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "T", "\\u", "remove_", "=_", "T_", "._", "remove_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "u_", "in_", "R_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "excess", "_", "=_", "R", "\\u", "node_", "[_", "u_", "]_", "[_", "'", "excess", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "excess", "_", ">=_", "delta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "S", "\\u", "add_", "(_", "u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "excess", "_", "<=_", "-_", "delta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "T", "\\u", "add_", "(_", "u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Repeat", "edl", "y", " ", "augment", " ", "flow", " ", "from", " ", "S", " ", "to", " ", "T", " ", "along", " ", "short", "est", " ", "path", "s", " ", "until_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\\", "916", ";", "-", "feas", "ibi", "lit", "y", " ", "is", " ", "achieve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "S_", "and_", "T_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "arbitra", "ry", "\\u", "element_", "(_", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Sear", "ch", " ", "for", " ", "a", " ", "short", "est", " ", "path", " ", "in", " ", "term", "s", " ", "of", " ", "reduce", " ", "cost", "s", " ", "from", " ", "s", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "any", " ", "t", " ", "in", " ", "T", " ", "in", " ", "the", " ", "\\", "916", ";", "-", "residu", "al", " ", "network", "._", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pred_", "=_", "{_", "s_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "=_", "heap_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h", "\\u", "insert_", "=_", "h_", "._", "insert_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h", "\\u", "get_", "=_", "h_", "._", "get_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h", "\\u", "insert_", "(_", "s_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "h_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "u_", ",_", "d\\u", "u_", "=_", "h_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "[_", "u_", "]_", "=_", "d\\u", "u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "u_", "in_", "T_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Path", " ", "found", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "t_", "=_", "u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p", "\\u", "u_", "=_", "R", "\\u", "node_", "[_", "u_", "]_", "[_", "'", "potenti", "al", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "v_", ",_", "es_", "in_", "R", "\\u", "succ_", "[_", "u_", "]_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "v_", "in_", "d_", ":_", "\\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_", "wmi", "n_", "=_", "inf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fin", "d", " ", "the", " ", "minim", "um", "-", "weight", "ed", " ", "(", "u", ",", " ", "v", ")", " ", "\\", "916", ";", "-", "residu", "al", " ", "edge", "._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", ",_", "e_", "in_", "es_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "e_", "[_", "'", "capacit", "y", "'_", "]_", "-_", "e_", "[_", "'", "flow", "'_", "]_", ">=_", "delta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "w_", "=_", "e_", "[_", "'", "weight", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "w_", "<_", "wmi", "n_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "wmi", "n_", "=_", "w_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kmi", "n_", "=_", "k_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "emi", "n_", "=_", "e_", "\\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_", "wmi", "n_", "==_", "inf_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Update", " ", "the", " ", "distance", " ", "label", " ", "of", " ", "v", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d\\u", "v_", "=_", "d\\u", "u_", "+_", "wmi", "n_", "-_", "p", "\\u", "u_", "+_", "R", "\\u", "node_", "[_", "v_", "]_", "[_", "'", "potenti", "al", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "h", "\\u", "insert_", "(_", "v_", ",_", "d\\u", "v_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "pred_", "[_", "v_", "]_", "=_", "(_", "u_", ",_", "kmi", "n_", ",_", "emi", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "t_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Augment", " ", "\\", "916", ";", " ", "unit", "s", " ", "of", " ", "flow", " ", "from", " ", "s", " ", "to", " ", "t", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "u_", "!=_", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v_", "=_", "u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", ",_", "k_", ",_", "e_", "=_", "pred_", "[_", "v_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "[_", "'", "flow", "'_", "]_", "+=_", "delta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R", "\\u", "succ_", "[_", "v_", "]_", "[_", "u_", "]_", "[_", "(_", "k_", "[_", "0_", "]_", ",_", "not_", "k_", "[_", "1_", "]_", ")_", "]_", "[_", "'", "flow", "'_", "]_", "-=_", "delta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Account", " ", "node", " ", "excess", " ", "and", " ", "def", "icit", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "R", "\\u", "node_", "[_", "s_", "]_", "[_", "'", "excess", "'_", "]_", "-=_", "delta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R", "\\u", "node_", "[_", "t_", "]_", "[_", "'", "excess", "'_", "]_", "+=_", "delta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "R", "\\u", "node_", "[_", "s_", "]_", "[_", "'", "excess", "'_", "]_", "<_", "delta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "S", "\\u", "remove_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "R", "\\u", "node_", "[_", "t_", "]_", "[_", "'", "excess", "'_", "]_", ">_", "-_", "delta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "T", "\\u", "remove_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Update", " ", "node", " ", "potenti", "als", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d\\u", "t_", "=_", "d_", "[_", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "u_", ",_", "d\\u", "u_", "in_", "d_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "R", "\\u", "node_", "[_", "u_", "]_", "[_", "'", "potenti", "al", "'_", "]_", "-=_", "d\\u", "u_", "-_", "d\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Path", " ", "not", " ", "found", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "S", "\\u", "remove_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "delta_", "//", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "any_", "(_", "R_", "._", "node_", "[_", "u_", "]_", "[_", "'", "excess", "'_", "]_", "!=_", "0_", "for_", "u_", "in_", "R_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "nx_", "._", "Network", "XU", "nfe", "asi", "ble_", "(_", "'", "No", " ", "flow", " ", "satisfy", "ing", " ", "all", " ", "demand", "s", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Calculat", "e", " ", "the", " ", "flow", " ", "cost", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "u_", "in_", "R_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "v_", ",_", "es_", "in_", "R", "\\u", "succ_", "[_", "u_", "]_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "e_", "in_", "es_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flow_", "=_", "e_", "[_", "'", "flow", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "flow_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "flow", "\\u", "cost_", "+=_", "flow_", "*_", "e_", "[_", "'", "weight", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "flow", "\\u", "cost_", ",_", "\\u", "build", "\\u", "flow", "\\u", "dict_", "(_", "G_", ",_", "R_", ",_", "capacity_", ",_", "weight_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
splunk/splunk-sdk-python/tests/test_role.py
[ { "content": " def check_role(self, role):\n self.check_entity(role)\n capabilities = role.service.capabilities\n for capability in role.content.capabilities:\n self.assertTrue(capability in capabilities)", "metadata": "root.RoleTestCase.check_role", "header": "['class', 'RoleTestCase', '(', 'testlib', '.', 'SDKTestCase', ')', ':', '___EOS___']", "index": 33 }, { "content": " def test_create(self):\n self.assertTrue(self.role_name in self.service.roles)\n self.check_entity(self.role)", "metadata": "root.RoleTestCase.test_create", "header": "['class', 'RoleTestCase', '(', 'testlib', '.', 'SDKTestCase', ')', ':', '___EOS___']", "index": 51 }, { "content": " def test_delete(self):\n self.assertTrue(self.role_name in self.service.roles)\n self.service.roles.delete(self.role_name)\n self.assertFalse(self.role_name in self.service.roles)\n self.assertRaises(client.HTTPError, self.role.refresh)", "metadata": "root.RoleTestCase.test_delete", "header": "['class', 'RoleTestCase', '(', 'testlib', '.', 'SDKTestCase', ')', ':', '___EOS___']", "index": 55 }, { "content": " def test_grant_and_revoke(self):\n self.assertFalse('edit_user' in self.role.capabilities)\n self.role.grant('edit_user')\n self.role.refresh()\n self.assertTrue('edit_user' in self.role.capabilities)\n\n self.assertFalse('change_own_password' in self.role.capabilities)\n self.role.grant('change_own_password')\n self.role.refresh()\n self.assertTrue('edit_user' in self.role.capabilities)\n self.assertTrue('change_own_password' in self.role.capabilities)\n\n self.role.revoke('edit_user')\n self.role.refresh()\n self.assertFalse('edit_user' in self.role.capabilities)\n self.assertTrue('change_own_password' in self.role.capabilities)\n\n self.role.revoke('change_own_password')\n self.role.refresh()\n self.assertFalse('edit_user' in self.role.capabilities)\n self.assertFalse('change_own_password' in self.role.capabilities)", "metadata": "root.RoleTestCase.test_grant_and_revoke", "header": "['class', 'RoleTestCase', '(', 'testlib', '.', 'SDKTestCase', ')', ':', '___EOS___']", "index": 61 } ]
[ { "span": "self.assertTrue(capability in capabilities)", "start_line": 37, "start_column": 12, "end_line": 37, "end_column": 55 }, { "span": "self.assertTrue(self.role_name in self.service.roles)", "start_line": 52, "start_column": 8, "end_line": 52, "end_column": 61 }, { "span": "self.assertTrue(self.role_name in self.service.roles)", "start_line": 56, "start_column": 8, "end_line": 56, "end_column": 61 }, { "span": "self.assertFalse(self.role_name in self.service.roles)", "start_line": 58, "start_column": 8, "end_line": 58, "end_column": 62 }, { "span": "self.assertFalse('edit_user' in self.role.capabilities)", "start_line": 62, "start_column": 8, "end_line": 62, "end_column": 63 }, { "span": "self.assertTrue('edit_user' in self.role.capabilities)", "start_line": 65, "start_column": 8, "end_line": 65, "end_column": 62 }, { "span": "self.assertFalse('change_own_password' in self.role.capabilities)", "start_line": 67, "start_column": 8, "end_line": 67, "end_column": 73 }, { "span": "self.assertTrue('edit_user' in self.role.capabilities)", "start_line": 70, "start_column": 8, "end_line": 70, "end_column": 62 }, { "span": "self.assertTrue('change_own_password' in self.role.capabilities)", "start_line": 71, "start_column": 8, "end_line": 71, "end_column": 72 }, { "span": "self.assertFalse('edit_user' in self.role.capabilities)", "start_line": 75, "start_column": 8, "end_line": 75, "end_column": 63 }, { "span": "self.assertTrue('change_own_password' in self.role.capabilities)", "start_line": 76, "start_column": 8, "end_line": 76, "end_column": 72 }, { "span": "self.assertFalse('edit_user' in self.role.capabilities)", "start_line": 80, "start_column": 8, "end_line": 80, "end_column": 63 }, { "span": "self.assertFalse('change_own_password' in self.role.capabilities)", "start_line": 81, "start_column": 8, "end_line": 81, "end_column": 73 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Ro", "le", "Test", "Case_", "(_", "testlib_", "._", "SD", "KT", "est", "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_", "check", "\\u", "role_", "(_", "self_", ",_", "role_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "check", "\\u", "entity_", "(_", "role_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "capabilities_", "=_", "role_", "._", "service_", "._", "capabilities_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "capability_", "in_", "role_", "._", "content_", "._", "capabilities_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "capability_", "in_", "capabilities_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ro", "le", "Test", "Case_", "(_", "testlib_", "._", "SD", "KT", "est", "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", "create_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "self_", "._", "role", "\\u", "name_", "in_", "self_", "._", "service_", "._", "roles_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "check", "\\u", "entity_", "(_", "self_", "._", "role_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ro", "le", "Test", "Case_", "(_", "testlib_", "._", "SD", "KT", "est", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "delete_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "self_", "._", "role", "\\u", "name_", "in_", "self_", "._", "service_", "._", "roles_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "service_", "._", "roles_", "._", "delete_", "(_", "self_", "._", "role", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "self_", "._", "role", "\\u", "name_", "in_", "self_", "._", "service_", "._", "roles_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "client_", "._", "HTTP", "Error_", ",_", "self_", "._", "role_", "._", "refresh_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ro", "le", "Test", "Case_", "(_", "testlib_", "._", "SD", "KT", "est", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "grant", "\\u", "and", "\\u", "revoke", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "False_", "(_", "'", "edit", "\\u", "user", "'_", "in_", "self_", "._", "role_", "._", "capabilities_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "role_", "._", "grant_", "(_", "'", "edit", "\\u", "user", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "role_", "._", "refresh_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "edit", "\\u", "user", "'_", "in_", "self_", "._", "role_", "._", "capabilities_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "change", "\\u", "own", "\\u", "password", "'_", "in_", "self_", "._", "role_", "._", "capabilities_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "role_", "._", "grant_", "(_", "'", "change", "\\u", "own", "\\u", "password", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "role_", "._", "refresh_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "edit", "\\u", "user", "'_", "in_", "self_", "._", "role_", "._", "capabilities_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "change", "\\u", "own", "\\u", "password", "'_", "in_", "self_", "._", "role_", "._", "capabilities_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "role_", "._", "revoke", "_", "(_", "'", "edit", "\\u", "user", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "role_", "._", "refresh_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "edit", "\\u", "user", "'_", "in_", "self_", "._", "role_", "._", "capabilities_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "change", "\\u", "own", "\\u", "password", "'_", "in_", "self_", "._", "role_", "._", "capabilities_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "role_", "._", "revoke", "_", "(_", "'", "change", "\\u", "own", "\\u", "password", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "role_", "._", "refresh_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "edit", "\\u", "user", "'_", "in_", "self_", "._", "role_", "._", "capabilities_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "change", "\\u", "own", "\\u", "password", "'_", "in_", "self_", "._", "role_", "._", "capabilities_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused import
PaloAltoNetworks/SplunkforPaloAltoNetworks/bin/panContentPack.py
[ { "content": "#!/usr/bin/env python\n\n# Copyright (c) 2015, Palo Alto Networks\n#\n# Permission to use, copy, modify, and/or distribute this software for any\n# purpose with or without fee is hereby granted, provided that the above\n# copyright notice and this permission notice appear in all copies.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\n# Author: Brian Torres-Gil <[email protected]>\n\n\"\"\"Update app and threat lookup files\n\nAbout this script\n-----------------\nPulls the latest app and threat information from a firewall\nor Panorama and outputs it as search results. This can be leveraged\nto update the app_list.csv and threat_list.csv files\nin the Palo Alto Networks Add-On (TA).\n\nExample usage in Splunk searchbar:\n\nUpdate app list:\n | pancontentpack 10.5.5.5 apps\n\nUpdate threat list:\n | pancontentpack 10.5.5.5 threats\n\nWhere 10.5.5.5 is the ip of a firewall or Panorama.\n\n\"\"\"\n\n\n#########################################################\n# Do NOT modify anything below this line unless you are\n# certain of the ramifications of the changes\n#########################################################\n\nimport sys # for system params and sys.exit()\nimport os\nimport traceback\n\nlibpath = os.path.dirname(os.path.abspath(__file__))\nsys.path[:0] = [os.path.join(libpath, 'lib')]\nimport common\nimport environment\nimport xmltodict\nfrom collections import OrderedDict\n\nlogger = common.logging.getLogger().getChild('updateAppsThreats')\n\ntry:\n import splunk.Intersplunk # so you can interact with Splunk\n import splunk.entity as entity # for splunk config info\nexcept ImportError as e:\n logger.error(\"Unable to import Splunk libraries. Run command with Splunk python:\"\n \" $SPLUNK_HOME/bin/splunk cmd python %s\" % __file__)\n sys.exit(3)\n\nlibpath = os.path.dirname(os.path.abspath(__file__))\nsys.path[:0] = [os.path.join(libpath, 'lib')]\nsys.path[:0] = [os.path.join(libpath, 'lib', 'pan-python', 'lib')]\nsys.path[:0] = [os.path.join(libpath, 'lib', 'pandevice')]\ntry:\n import pandevice.base\n import pan.xapi\nexcept ImportError:\n print \"Unable to import libraries. Please run command from app's bin directory where the script is located.\"\n exit(3)\n\nfrom common import log\n\n\n\n\n\n\n\n\nif __name__ == \"__main__\":\n main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def usage():\n common.exit_with_error(\"Usage: | pancontentpack <firewall/Panorama IP> <apps|threats>\")", "metadata": "root.usage", "header": "['module', '___EOS___']", "index": 80 }, { "content": "def parse_apps(apps_xml):\n obj = xmltodict.parse(apps_xml)\n try:\n apps = obj['response']['result']['application']['entry']\n except KeyError as e:\n logger.error(\"Unable to parse app xml from firewall\")\n raise e\n csv_apps = []\n for app in apps:\n a = OrderedDict()\n try:\n a['app'] = app['@name']\n a['app:category'] = app.get('category', \"\")\n a['app:subcategory'] = app.get('subcategory', \"\")\n a['app:technology'] = app.get('technology', \"\")\n a['app:risk'] = app['risk']\n a['app:evasive'] = app['evasive-behavior']\n a['app:excessive_bandwidth'] = app['consume-big-bandwidth']\n a['app:used_by_malware'] = app['used-by-malware']\n a['app:able_to_transfer_file'] = app['able-to-transfer-file']\n a['app:has_known_vulnerability'] = app['has-known-vulnerability']\n a['app:tunnels_other_application'] = app['tunnel-other-application']\n if a['app:tunnels_other_application'] != u\"yes\" and a['app:tunnels_other_application'] != u\"no\":\n a['app:tunnels_other_application'] = a['app:tunnels_other_application']['#text']\n a['app:prone_to_misuse'] = app['prone-to-misuse']\n a['app:pervasive_use'] = app['pervasive-use']\n a['app:is_saas'] = app.get('is-saas', \"no\")\n a['app:default_ports'] = \"\"\n try:\n # Sometimes there are more than one default tag\n # so make it a list and iterate over the default tags.\n default = app['default']\n if isinstance(default, list):\n for d in default:\n a['app:default_ports'] = d['port']['member']\n break\n else:\n a['app:default_ports'] = default['port']['member']\n except KeyError:\n pass\n else:\n if not isinstance(a['app:default_ports'], basestring):\n a['app:default_ports'] = \"|\".join(a['app:default_ports'])\n except Exception as e:\n logger.error(\"Error parsing app: %s\" % app['@name'])\n logger.error(traceback.format_exc())\n common.exit_with_error(str(e))\n # convert all out of unicode\n for key in a:\n a[key] = str(a[key])\n csv_apps.append(a)\n logger.info(\"Found %s apps\" % len(csv_apps))\n return csv_apps", "metadata": "root.parse_apps", "header": "['module', '___EOS___']", "index": 83 }, { "content": "def parse_threats(threats_xml):\n obj = xmltodict.parse(threats_xml)\n try:\n phone_home = obj['response']['result']['threats']['phone-home']['entry']\n vulnerability = obj['response']['result']['threats']['vulnerability']['entry']\n threats = phone_home + vulnerability\n except KeyError as e:\n logger.error(\"Unable to parse threat xml from firewall\")\n raise e\n csv_threats = []\n for threat in threats:\n a = OrderedDict()\n try:\n a['threat_id'] = threat['@name']\n a['threat:name'] = threat['threatname']\n a['threat:category'] = threat['category']\n a['threat:severity'] = threat['severity']\n a['threat:cve'] = threat.get('cve', None)\n if a['threat:cve'] is not None:\n a['threat:cve'] = threat['cve']['member']\n if not isinstance(a['threat:cve'], basestring):\n a['threat:cve'] = \", \".join(a['threat:cve'])\n else:\n a['threat:cve'] = \"\"\n except KeyError as e:\n logger.error(\"Error parsing app: %s\" % threat['@name'])\n raise e\n # convert all out of unicode\n for key in a:\n a[key] = str(a[key])\n csv_threats.append(a)\n logger.info(\"Found %s threats\" % len(csv_threats))\n return csv_threats", "metadata": "root.parse_threats", "header": "['module', '___EOS___']", "index": 138 }, { "content": "def main():\n # Get arguments\n args, kwargs = splunk.Intersplunk.getKeywordsAndOptions()\n\n # Enable debugging by passing 'debug=yes' as an argument of\n # the command on the Splunk searchbar.\n\n debug = common.check_debug(kwargs)\n\n if len(args) < 2:\n logger.error(\"pancontentpack: Wrong number of arguments: %s, expected 2.\\n\" % len(args))\n usage()\n\n if args[1] == \"apps\":\n logger.info(\"Getting apps from content pack on Palo Alto Networks device at %s...\" % args[0])\n elif args[1] == \"threats\":\n logger.info(\"Getting threats from content pack on Palo Alto Networks device at %s...\" % args[0])\n else:\n usage()\n\n # Results contains the data from the search results and settings\n # contains the sessionKey that we can use to talk to Splunk\n # Ignore the results\n results, unused1, settings = splunk.Intersplunk.getOrganizedResults()\n # Get the sessionKey\n sessionKey = settings['sessionKey']\n\n log(debug, \"Begin get API key\")\n # Get the API key from the Splunk store or from the device at hostname if no apikey is stored\n apikey = common.apikey(sessionKey, args[0], debug)\n\n device = pandevice.base.PanDevice(args[0], api_key=apikey)\n\n try:\n if args[1] == \"apps\":\n device.xapi.get(\"/config/predefined/application\")\n app_xml = device.xapi.xml_document\n csv = parse_apps(app_xml)\n else:\n device.xapi.get(\"/config/predefined/threats\")\n threat_xml = device.xapi.xml_document\n csv = parse_threats(threat_xml)\n\n except pan.xapi.PanXapiError as e:\n common.exit_with_error(str(e))\n\n\n # output results\n splunk.Intersplunk.outputResults(csv)", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 172 } ]
[ { "span": "import environment", "start_line": 52, "start_column": 0, "end_line": 52, "end_column": 18 }, { "span": "import splunk.entity as entity ", "start_line": 60, "start_column": 4, "end_line": 60, "end_column": 34 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "201", "5", ",", " ", "Pal", "o", " ", "Alt", "o", " ", "Network", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Permi", "ssion", " ", "to", " ", "use", ",", " ", "copy", ",", " ", "modif", "y", ",", " ", "and", "/", "or", " ", "distribute", " ", "this", " ", "software", " ", "for", " ", "any_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "purpose", " ", "with", " ", "or", " ", "with", "out", " ", "fe", "e", " ", "is", " ", "here", "by", " ", "grant", "ed", ",", " ", "provided", " ", "tha", "t", " ", "the", " ", "above_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "copyr", "ight", " ", "notice", " ", "and", " ", "this", " ", "permissi", "on", " ", "notice", " ", "appear", " ", "in", " ", "all", " ", "copie", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THE", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "\"", "AS", " ", "IS", "\"", " ", "AND", " ", "THE", " ", "AUTHOR", " ", "DISC", "LAI", "MS", " ", "ALL", " ", "WAR", "RAN", "TIES", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WITH", " ", "REG", "ARD", " ", "TO", " ", "THIS", " ", "SOFT", "WARE", " ", "INC", "LU", "DING", " ", "ALL", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", " ", "OF_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "AND", " ", "FIT", "NESS", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", " ", "AUTHOR", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ANY", " ", "SPECIAL", ",", " ", "DIRECT", ",", " ", "INDI", "RECT", ",", " ", "OR", " ", "CONS", "EQU", "ENTI", "AL", " ", "DA", "MAGE", "S", " ", "OR", " ", "ANY", " ", "DA", "MAGE", "S_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WH", "ATS", "OE", "VER", " ", "RESU", "LT", "ING", " ", "FROM", " ", "LOSS", " ", "OF", " ", "USE", ",", " ", "DATA", " ", "OR", " ", "PROF", "IT", "S", ",", " ", "WHE", "THER", " ", "IN", " ", "AN_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ACTI", "ON", " ", "OF", " ", "CONTR", "ACT", ",", " ", "NEG", "LIG", "ENCE", " ", "OR", " ", "OTHER", " ", "TOR", "TIO", "US", " ", "ACTI", "ON", ",", " ", "ARI", "SIN", "G", " ", "OUT", " ", "OF_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "OR", " ", "IN", " ", "CONNECTION", " ", "WITH", " ", "THE", " ", "USE", " ", "OR", " ", "PERF", "ORM", "ANCE", " ", "OF", " ", "THIS", " ", "SOFT", "WARE", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Author", ":", " ", "Brian", " ", "Tor", "res", "-", "Gi", "l", " ", "<", "bt", "orr", "es", "-", "gil", "@", "pal", "oa", "lto", "network", "s", ".", "com", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Update", " ", "app", " ", "and", " ", "threat", " ", "look", "up", " ", "files", "\\", "10", ";", "\\", "10", ";", "Abo", "ut", " ", "this", " ", "script", "\\", "10", ";", "--------------", "---", "\\", "10", ";", "Pul", "ls", " ", "the", " ", "late", "st", " ", "app", " ", "and", " ", "threat", " ", "informati", "on", " ", "from", " ", "a", " ", "firew", "all", "\\", "10", ";", "or", " ", "Pan", "ora", "ma", " ", "and", " ", "output", "s", " ", "it", " ", "as", " ", "search", " ", "results", ".", " ", "Thi", "s", " ", "can", " ", "be", " ", "leve", "rage", "d", "\\", "10", ";", "to", " ", "update", " ", "the", " ", "app", "\\u", "list", ".", "csv", " ", "and", " ", "threat", "\\u", "list", ".", "csv", " ", "files", "\\", "10", ";", "in", " ", "the", " ", "Pal", "o", " ", "Alt", "o", " ", "Network", "s", " ", "Add", "-", "On", " ", "(", "TA", ").", "\\", "10", ";", "\\", "10", ";", "Exam", "ple", " ", "usage", " ", "in", " ", "Spl", "unk", " ", "search", "bar", ":", "\\", "10", ";", "\\", "10", ";", "Update", " ", "app", " ", "list", ":", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "pan", "content", "pack", " ", "10.5", ".5", ".5", " ", "apps", "\\", "10", ";", "\\", "10", ";", "Update", " ", "threat", " ", "list", ":", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "pan", "content", "pack", " ", "10.5", ".5", ".5", " ", "threat", "s", "\\", "10", ";", "\\", "10", ";", "Whe", "re", " ", "10.5", ".5", ".5", " ", "is", " ", "the", " ", "ip", " ", "of", " ", "a", " ", "firew", "all", " ", "or", " ", "Pan", "ora", "ma", ".", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Do", " ", "NOT", " ", "modif", "y", " ", "anyt", "hing", " ", "belo", "w", " ", "this", " ", "line", " ", "unl", "ess", " ", "you", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "cert", "ain", " ", "of", " ", "the", " ", "ram", "ificatio", "ns", " ", "of", " ", "the", " ", "changes_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "#", " ", "for", " ", "system", " ", "params", " ", "and", " ", "sys", ".", "exit", "()", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "libpa", "th_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "abspath_", "(_", "\\u\\u", "file\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "[_", ":_", "0_", "]_", "=_", "[_", "os_", "._", "path_", "._", "join_", "(_", "libpa", "th_", ",_", "'", "lib", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "common_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "environment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "xmlt", "odict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "collections_", "import_", "Order", "ed", "Dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "=_", "common_", "._", "logging_", "._", "get", "Logger_", "(_", ")_", "._", "get", "Child_", "(_", "'", "update", "App", "s", "Thre", "ats", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "splu", "nk_", "._", "Inter", "splu", "nk_", "#", " ", "so", " ", "you", " ", "can", " ", "interact", " ", "with", " ", "Spl", "unk", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "splu", "nk_", "._", "entity_", "as_", "entity_", "#", " ", "for", " ", "splu", "nk", " ", "config", " ", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "error_", "(_", "\"", "Una", "ble", " ", "to", " ", "import", " ", "Spl", "unk", " ", "librar", "ies", ".", " ", "Run", " ", "command", " ", "with", " ", "Spl", "unk", " ", "python", ":\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", " ", "$", "SPL", "UNK", "\\u", "HOM", "E", "/", "bin", "/", "splu", "nk", " ", "cmd", " ", "python", " ", "%", "s", "\"_", "%_", "\\u\\u", "file\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "libpa", "th_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "abspath_", "(_", "\\u\\u", "file\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "[_", ":_", "0_", "]_", "=_", "[_", "os_", "._", "path_", "._", "join_", "(_", "libpa", "th_", ",_", "'", "lib", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "[_", ":_", "0_", "]_", "=_", "[_", "os_", "._", "path_", "._", "join_", "(_", "libpa", "th_", ",_", "'", "lib", "'_", ",_", "'", "pan", "-", "python", "'_", ",_", "'", "lib", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "[_", ":_", "0_", "]_", "=_", "[_", "os_", "._", "path_", "._", "join_", "(_", "libpa", "th_", ",_", "'", "lib", "'_", ",_", "'", "pand", "evice", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "pand", "evice", "_", "._", "base_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pan_", "._", "xapi", "_", "\\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_", "\"", "Una", "ble", " ", "to", " ", "import", " ", "librar", "ies", ".", " ", "Ple", "ase", " ", "run", " ", "command", " ", "from", " ", "app", "'", "s", " ", "bin", " ", "director", "y", " ", "where", " ", "the", " ", "script", " ", "is", " ", "located", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exit_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "common_", "import_", "log_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "usage_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "common_", "._", "exit", "\\u", "with", "\\u", "error_", "(_", "\"", "Us", "age", ":", " ", "|", " ", "pan", "content", "pack", " ", "<", "firew", "all", "/", "Pan", "ora", "ma", " ", "IP", ">", " ", "<", "apps", "|", "threat", "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_", "parse", "\\u", "apps_", "(_", "apps", "\\u", "xml_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "=_", "xmlt", "odict_", "._", "parse_", "(_", "apps", "\\u", "xml_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "apps_", "=_", "obj_", "[_", "'", "response", "'_", "]_", "[_", "'", "result", "'_", "]_", "[_", "'", "applica", "tion", "'_", "]_", "[_", "'", "entry", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "error_", "(_", "\"", "Una", "ble", " ", "to", " ", "parse", " ", "app", " ", "xml", " ", "from", " ", "firew", "all", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "csv", "\\u", "apps_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "app_", "in_", "apps_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "Order", "ed", "Dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "[_", "'", "app", "'_", "]_", "=_", "app_", "[_", "'@", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "'", "app", ":", "category", "'_", "]_", "=_", "app_", "._", "get_", "(_", "'", "category", "'_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "'", "app", ":", "subcategory", "'_", "]_", "=_", "app_", "._", "get_", "(_", "'", "subcategory", "'_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "'", "app", ":", "technology", "'_", "]_", "=_", "app_", "._", "get_", "(_", "'", "technology", "'_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "'", "app", ":", "risk", "'_", "]_", "=_", "app_", "[_", "'", "risk", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "'", "app", ":", "eva", "sive", "'_", "]_", "=_", "app_", "[_", "'", "eva", "sive", "-", "behavior", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "'", "app", ":", "excess", "ive", "\\u", "bandwi", "dth", "'_", "]_", "=_", "app_", "[_", "'", "consume", "-", "big", "-", "bandwi", "dth", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "'", "app", ":", "used", "\\u", "by", "\\u", "mal", "ware", "'_", "]_", "=_", "app_", "[_", "'", "used", "-", "by", "-", "mal", "ware", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "'", "app", ":", "able", "\\u", "to", "\\u", "transfer", "\\u", "file", "'_", "]_", "=_", "app_", "[_", "'", "able", "-", "to", "-", "transfer", "-", "file", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "'", "app", ":", "has", "\\u", "know", "n", "\\u", "vulnerability", "'_", "]_", "=_", "app_", "[_", "'", "has", "-", "know", "n", "-", "vulnerability", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "'", "app", ":", "tunnel", "s", "\\u", "other", "\\u", "applica", "tion", "'_", "]_", "=_", "app_", "[_", "'", "tunnel", "-", "other", "-", "applica", "tion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "a_", "[_", "'", "app", ":", "tunnel", "s", "\\u", "other", "\\u", "applica", "tion", "'_", "]_", "!=_", "u", "\"", "ye", "s", "\"_", "and_", "a_", "[_", "'", "app", ":", "tunnel", "s", "\\u", "other", "\\u", "applica", "tion", "'_", "]_", "!=_", "u", "\"", "no", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "[_", "'", "app", ":", "tunnel", "s", "\\u", "other", "\\u", "applica", "tion", "'_", "]_", "=_", "a_", "[_", "'", "app", ":", "tunnel", "s", "\\u", "other", "\\u", "applica", "tion", "'_", "]_", "[_", "'#", "text", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "a_", "[_", "'", "app", ":", "pron", "e\\u", "to", "\\u", "mis", "use", "'_", "]_", "=_", "app_", "[_", "'", "pron", "e-", "to", "-", "mis", "use", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "'", "app", ":", "per", "vas", "ive", "\\u", "use", "'_", "]_", "=_", "app_", "[_", "'", "per", "vas", "ive", "-", "use", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "'", "app", ":", "is", "\\u", "sa", "as", "'_", "]_", "=_", "app_", "._", "get_", "(_", "'", "is", "-", "sa", "as", "'_", ",_", "\"", "no", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "'", "app", ":", "default", "\\u", "port", "s", "'_", "]_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Some", "times", " ", "there", " ", "are", " ", "more", " ", "than", " ", "one", " ", "default", " ", "tag_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "make", " ", "it", " ", "a", " ", "list", " ", "and", " ", "iterate", " ", "over", " ", "the", " ", "default", " ", "tags", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "default_", "=_", "app_", "[_", "'", "default", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "default_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "d_", "in_", "default_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "a_", "[_", "'", "app", ":", "default", "\\u", "port", "s", "'_", "]_", "=_", "d_", "[_", "'", "port", "'_", "]_", "[_", "'", "member", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "a_", "[_", "'", "app", ":", "default", "\\u", "port", "s", "'_", "]_", "=_", "default_", "[_", "'", "port", "'_", "]_", "[_", "'", "member", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "isinstance_", "(_", "a_", "[_", "'", "app", ":", "default", "\\u", "port", "s", "'_", "]_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "a_", "[_", "'", "app", ":", "default", "\\u", "port", "s", "'_", "]_", "=_", "\"|\"_", "._", "join_", "(_", "a_", "[_", "'", "app", ":", "default", "\\u", "port", "s", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "error_", "(_", "\"", "Error", " ", "pars", "ing", " ", "app", ":", " ", "%", "s", "\"_", "%_", "app_", "[_", "'@", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "error_", "(_", "traceback_", "._", "format\\u", "exc_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "common_", "._", "exit", "\\u", "with", "\\u", "error_", "(_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "convert", " ", "all", " ", "out", " ", "of", " ", "unicode_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", "in_", "a_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "[_", "key_", "]_", "=_", "str_", "(_", "a_", "[_", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "csv", "\\u", "apps_", "._", "append_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logger_", "._", "info_", "(_", "\"", "Foun", "d", " ", "%", "s", " ", "apps", "\"_", "%_", "len_", "(_", "csv", "\\u", "apps_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "csv", "\\u", "apps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "\\u", "threat", "s_", "(_", "threat", "s", "\\u", "xml_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "=_", "xmlt", "odict_", "._", "parse_", "(_", "threat", "s", "\\u", "xml_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "phone", "\\u", "home_", "=_", "obj_", "[_", "'", "response", "'_", "]_", "[_", "'", "result", "'_", "]_", "[_", "'", "threat", "s", "'_", "]_", "[_", "'", "phone", "-", "home", "'_", "]_", "[_", "'", "entry", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vulnerability", "_", "=_", "obj_", "[_", "'", "response", "'_", "]_", "[_", "'", "result", "'_", "]_", "[_", "'", "threat", "s", "'_", "]_", "[_", "'", "vulnerability", "'_", "]_", "[_", "'", "entry", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "threat", "s_", "=_", "phone", "\\u", "home_", "+_", "vulnerability", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "error_", "(_", "\"", "Una", "ble", " ", "to", " ", "parse", " ", "threat", " ", "xml", " ", "from", " ", "firew", "all", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "csv", "\\u", "threat", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "threat", "_", "in_", "threat", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "Order", "ed", "Dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "[_", "'", "threat", "\\u", "id", "'_", "]_", "=_", "threat", "_", "[_", "'@", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "'", "threat", ":", "name", "'_", "]_", "=_", "threat", "_", "[_", "'", "threat", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "'", "threat", ":", "category", "'_", "]_", "=_", "threat", "_", "[_", "'", "category", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "'", "threat", ":", "sever", "it", "y", "'_", "]_", "=_", "threat", "_", "[_", "'", "sever", "it", "y", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "'", "threat", ":", "cve", "'_", "]_", "=_", "threat", "_", "._", "get_", "(_", "'", "cve", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "a_", "[_", "'", "threat", ":", "cve", "'_", "]_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "[_", "'", "threat", ":", "cve", "'_", "]_", "=_", "threat", "_", "[_", "'", "cve", "'_", "]_", "[_", "'", "member", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "a_", "[_", "'", "threat", ":", "cve", "'_", "]_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "a_", "[_", "'", "threat", ":", "cve", "'_", "]_", "=_", "\",", " ", "\"_", "._", "join_", "(_", "a_", "[_", "'", "threat", ":", "cve", "'_", "]_", ")_", "\\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 ", " _", "a_", "[_", "'", "threat", ":", "cve", "'_", "]_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "error_", "(_", "\"", "Error", " ", "pars", "ing", " ", "app", ":", " ", "%", "s", "\"_", "%_", "threat", "_", "[_", "'@", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "convert", " ", "all", " ", "out", " ", "of", " ", "unicode_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", "in_", "a_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "[_", "key_", "]_", "=_", "str_", "(_", "a_", "[_", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "csv", "\\u", "threat", "s_", "._", "append_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logger_", "._", "info_", "(_", "\"", "Foun", "d", " ", "%", "s", " ", "threat", "s", "\"_", "%_", "len_", "(_", "csv", "\\u", "threat", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "csv", "\\u", "threat", "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_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Get", " ", "arguments_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", ",_", "kwargs_", "=_", "splu", "nk_", "._", "Inter", "splu", "nk_", "._", "get", "Key", "words", "And", "Options_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Enable", " ", "debugg", "ing", " ", "by", " ", "passi", "ng", " ", "'", "debug", "=", "ye", "s", "'", " ", "as", " ", "an", " ", "argu", "ment", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "command", " ", "on", " ", "the", " ", "Spl", "unk", " ", "search", "bar", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "debug_", "=_", "common_", "._", "check", "\\u", "debug_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "args_", ")_", "<_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "error_", "(_", "\"", "pan", "content", "pack", ":", " ", "Wro", "ng", " ", "number", " ", "of", " ", "argu", "ment", "s", ":", " ", "%", "s", ",", " ", "expected", " ", "2", ".\\\\", "n", "\"_", "%_", "len_", "(_", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "usage_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "[_", "1_", "]_", "==_", "\"", "apps", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "\"", "Get", "ting", " ", "apps", " ", "from", " ", "content", " ", "pack", " ", "on", " ", "Pal", "o", " ", "Alt", "o", " ", "Network", "s", " ", "device", " ", "at", " ", "%", "s", "...\"_", "%_", "args_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "args_", "[_", "1_", "]_", "==_", "\"", "threat", "s", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "\"", "Get", "ting", " ", "threat", "s", " ", "from", " ", "content", " ", "pack", " ", "on", " ", "Pal", "o", " ", "Alt", "o", " ", "Network", "s", " ", "device", " ", "at", " ", "%", "s", "...\"_", "%_", "args_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "usage_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Result", "s", " ", "contain", "s", " ", "the", " ", "data", " ", "from", " ", "the", " ", "search", " ", "results", " ", "and", " ", "settings_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contain", "s", " ", "the", " ", "session", "Key", " ", "tha", "t", " ", "we", " ", "can", " ", "use", " ", "to", " ", "talk", " ", "to", " ", "Spl", "unk", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ignor", "e", " ", "the", " ", "results_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", ",_", "unu", "sed", "1_", ",_", "settings_", "=_", "splu", "nk_", "._", "Inter", "splu", "nk_", "._", "get", "Organiz", "ed", "Results_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "session", "Key_", "\\u\\u\\uNL\\u\\u\\u_", "session", "Key_", "=_", "settings_", "[_", "'", "session", "Key", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "(_", "debug_", ",_", "\"", "Begin", " ", "get", " ", "API", " ", "key", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "API", " ", "key", " ", "from", " ", "the", " ", "Spl", "unk", " ", "store", " ", "or", " ", "from", " ", "the", " ", "device", " ", "at", " ", "host", "name", " ", "if", " ", "no", " ", "api", "key", " ", "is", " ", "stored_", "\\u\\u\\uNL\\u\\u\\u_", "apikey_", "=_", "common_", "._", "apikey_", "(_", "session", "Key_", ",_", "args_", "[_", "0_", "]_", ",_", "debug_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "device_", "=_", "pand", "evice", "_", "._", "base_", "._", "Pan", "Device_", "(_", "args_", "[_", "0_", "]_", ",_", "api", "\\u", "key_", "=_", "apikey_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "args_", "[_", "1_", "]_", "==_", "\"", "apps", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "device_", "._", "xapi", "_", "._", "get_", "(_", "\"/", "config", "/", "prede", "fined", "/", "applica", "tion", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app", "\\u", "xml_", "=_", "device_", "._", "xapi", "_", "._", "xml", "\\u", "document_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "csv_", "=_", "parse", "\\u", "apps_", "(_", "app", "\\u", "xml_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "device_", "._", "xapi", "_", "._", "get_", "(_", "\"/", "config", "/", "prede", "fined", "/", "threat", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "threat", "\\u", "xml_", "=_", "device_", "._", "xapi", "_", "._", "xml", "\\u", "document_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "csv_", "=_", "parse", "\\u", "threat", "s_", "(_", "threat", "\\u", "xml_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "pan_", "._", "xapi", "_", "._", "Pan", "Xa", "pi", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "common_", "._", "exit", "\\u", "with", "\\u", "error_", "(_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "output", " ", "results_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "splu", "nk_", "._", "Inter", "splu", "nk_", "._", "output", "Results_", "(_", "csv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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 ]
Unused import
sightmachine/SimpleCV/SimpleCV/base.py
[ { "content": "#!/usr/bin/python\n\n# SimpleCV system includes\nimport os\nimport sys\nimport warnings\nimport time\nimport socket\nimport re\nimport urllib2\nimport types\nimport SocketServer\nimport threading\nimport tempfile\nimport zipfile\nimport pickle\nimport glob #for directory scanning\nimport abc #abstract base class\nimport colorsys\nimport logging\nimport pygame as pg\nimport scipy.ndimage as ndimage\nimport scipy.stats.stats as sss #for auto white balance\nimport scipy.cluster.vq as scv\nimport scipy.linalg as nla # for linear algebra / least squares\nimport math # math... who does that\nimport copy # for deep copy\nimport numpy as np\nimport scipy.spatial.distance as spsd\nimport scipy.cluster.vq as cluster #for kmeans\nimport pygame as pg\nimport platform\nimport copy\nimport types\nimport time\nimport itertools #for track\n\nfrom numpy import linspace\nfrom scipy.interpolate import UnivariateSpline\nfrom warnings import warn\nfrom copy import copy\nfrom math import *\nfrom pkg_resources import load_entry_point\nfrom SimpleHTTPServer import SimpleHTTPRequestHandler\nfrom types import IntType, LongType, FloatType, InstanceType\nfrom cStringIO import StringIO\nfrom numpy import int32\nfrom numpy import uint8\nfrom EXIF import *\nfrom pygame import gfxdraw\nfrom pickle import *\n\n# SimpleCV library includes\ntry:\n import cv2.cv as cv\nexcept ImportError:\n try:\n import cv\n except ImportError:\n raise ImportError(\"Cannot load OpenCV library which is required by SimpleCV\")\n\n\n#optional libraries\nPIL_ENABLED = True\ntry:\n from PIL import Image as pil\n from PIL import ImageFont as pilImageFont\n from PIL import ImageDraw as pilImageDraw\n from PIL import GifImagePlugin\n getheader = GifImagePlugin.getheader\n getdata = GifImagePlugin.getdata\nexcept ImportError:\n try:\n import Image as pil\n from GifImagePlugin import getheader, getdata\n except ImportError:\n PIL_ENABLED = False\n\nFREENECT_ENABLED = True\ntry:\n import freenect\nexcept ImportError:\n FREENECT_ENABLED = False\n\nZXING_ENABLED = True\ntry:\n import zxing\nexcept ImportError:\n ZXING_ENABLED = False\n\nOCR_ENABLED = True\ntry:\n import tesseract\nexcept ImportError:\n OCR_ENABLED = False\n\n\nPYSCREENSHOT_ENABLED = True\ntry:\n import pyscreenshot\nexcept ImportError:\n PYSCREENSHOT_ENABLED = False\n\nORANGE_ENABLED = True\ntry:\n try:\n import orange\n except ImportError:\n import Orange; import orange\n\n import orngTest #for cross validation\n import orngStat\n import orngEnsemble # for bagging / boosting\n\nexcept ImportError:\n ORANGE_ENABLED = False\n\nVIMBA_ENABLED = True\ntry:\n import pymba\nexcept ImportError:\n #TODO Log an error the pymba is not installed\n VIMBA_ENABLED = False\nexcept Exception:\n #TODO Log an error that AVT Vimba DLL is not installed properly\n VIMBA_ENABLED = False\n\n\ninit_options_handler = InitOptionsHandler()\n\ntry:\n import pygame as pg\nexcept ImportError:\n init_options_handler.set_headless()\n\n#couple quick typecheck helper functions\n\n\n\n\n\n\n\n\n\n#Logging system - Global elements\n\nconsoleHandler = logging.StreamHandler()\nformatter = logging.Formatter('%(levelname)s: %(message)s')\nconsoleHandler.setFormatter(formatter)\nlogger = logging.getLogger('Main Logger')\nlogger.addHandler(consoleHandler)\n\ntry:\n import IPython\n ipython_version = IPython.__version__\nexcept ImportError:\n ipython_version = None\n\n#This is used with sys.excepthook to log all uncaught exceptions.\n#By default, error messages ARE print to stderr.\n\nsys.excepthook = exception_handler\n\n\n\n#The two following functions are used internally.\n\n\n\n\n\n\n#supported image formats regular expression ignoring case\nIMAGE_FORMATS = ('*.[bB][mM][Pp]','*.[Gg][Ii][Ff]','*.[Jj][Pp][Gg]','*.[jJ][pP][eE]',\n'*.[jJ][Pp][Ee][Gg]','*.[pP][nN][gG]','*.[pP][bB][mM]','*.[pP][gG][mM]','*.[pP][pP][mM]',\n'*.[tT][iI][fF]','*.[tT][iI][fF][fF]','*.[wW][eE][bB][pP]')\n\n#maximum image size -\nMAX_DIMENSION = 2*6000 # about twice the size of a full 35mm images - if you hit this, you got a lot data.\nLAUNCH_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__)))\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class InitOptionsHandler(object):\n \"\"\"\n **summary**\n\n this handler is supposed to store global variables. for now, its only value\n defines if simplecv is being run on an ipython notebook.\n\n \"\"\"\n\n\n", "metadata": "root.InitOptionsHandler", "header": "['module', '___EOS___']", "index": 127 }, { "content": " def __init__(self):\n self.on_notebook = False\n self.headless = False", "metadata": "root.InitOptionsHandler.__init__", "header": "['class', 'InitOptionsHandler', '(', 'object', ')', ':', '___EOS___']", "index": 136 }, { "content": " def enable_notebook(self):\n self.on_notebook = True", "metadata": "root.InitOptionsHandler.enable_notebook", "header": "['class', 'InitOptionsHandler', '(', 'object', ')', ':', '___EOS___']", "index": 140 }, { "content": " def set_headless(self):\n # set SDL to use the dummy NULL video driver,\n # so it doesn't need a windowing system.\n os.environ[\"SDL_VIDEODRIVER\"] = \"dummy\"\n self.headless = True", "metadata": "root.InitOptionsHandler.set_headless", "header": "['class', 'InitOptionsHandler', '(', 'object', ')', ':', '___EOS___']", "index": 143 }, { "content": "def is_number(n):\n \"\"\"\n Determines if it is a number or not\n\n Returns: Type\n \"\"\"\n return type(n) in (IntType, LongType, FloatType)", "metadata": "root.is_number", "header": "['module', '___EOS___']", "index": 157 }, { "content": "def is_tuple(n):\n \"\"\"\n Determines if it is a tuple or not\n\n Returns: Boolean\n \"\"\"\n return type(n) == tuple", "metadata": "root.is_tuple", "header": "['module', '___EOS___']", "index": 165 }, { "content": "def reverse_tuple(n):\n \"\"\"\n Reverses a tuple\n\n Returns: Tuple\n \"\"\"\n return tuple(reversed(n))", "metadata": "root.reverse_tuple", "header": "['module', '___EOS___']", "index": 173 }, { "content": "def find(f, seq):\n \"\"\"\n Search for item in a list\n\n Returns: Boolean\n \"\"\"\n for item in seq:\n if (f == item):\n return True\n return False", "metadata": "root.find", "header": "['module', '___EOS___']", "index": 181 }, { "content": "def test():\n \"\"\"\n This function is meant to run builtin unittests\n \"\"\"\n\n print 'unit test'", "metadata": "root.test", "header": "['module', '___EOS___']", "index": 192 }, { "content": "def download_and_extract(URL):\n \"\"\"\n This function takes in a URL for a zip file, extracts it and returns\n the temporary path it was extracted to\n \"\"\"\n if URL == None:\n logger.warning(\"Please provide URL\")\n return None\n\n tmpdir = tempfile.mkdtemp()\n filename = os.path.basename(URL)\n path = tmpdir + \"/\" + filename\n zdata = urllib2.urlopen(URL)\n\n print \"Saving file to disk please wait....\"\n with open(path, \"wb\") as local_file:\n local_file.write(zdata.read())\n\n zfile = zipfile.ZipFile(path)\n print \"Extracting zipfile\"\n try:\n zfile.extractall(tmpdir)\n except:\n logger.warning(\"Couldn't extract zip file\")\n return None\n\n return tmpdir", "metadata": "root.download_and_extract", "header": "['module', '___EOS___']", "index": 200 }, { "content": "def int_to_bin(i):\n \"\"\"Integer to two bytes\"\"\"\n i1 = i % 256\n i2 = int(i/256)\n return chr(i1) + chr(i2)", "metadata": "root.int_to_bin", "header": "['module', '___EOS___']", "index": 228 }, { "content": "def npArray2cvMat(inputMat, dataType=cv.CV_32FC1):\n \"\"\"\n This function is a utility for converting numpy arrays to the cv.cvMat format.\n\n Returns: cvMatrix\n \"\"\"\n if( type(inputMat) == np.ndarray ):\n sz = len(inputMat.shape)\n temp_mat = None\n if( dataType == cv.CV_32FC1 or dataType == cv.CV_32FC2 or dataType == cv.CV_32FC3 or dataType == cv.CV_32FC4 ):\n temp_mat = np.array(inputMat, dtype='float32')\n elif( dataType == cv.CV_8UC1 or dataType == cv.CV_8UC2 or dataType == cv.CV_8UC3 or dataType == cv.CV_8UC3):\n temp_mat = np.array(inputMat,dtype='uint8')\n else:\n logger.warning(\"MatrixConversionUtil: the input matrix type is not supported\")\n return None\n if( sz == 1 ): #this needs to be changed so we can do row/col vectors\n retVal = cv.CreateMat(inputMat.shape[0], 1, dataType)\n cv.SetData(retVal, temp_mat.tostring(), temp_mat.dtype.itemsize * temp_mat.shape[0])\n elif( sz == 2 ):\n retVal = cv.CreateMat(temp_mat.shape[0], temp_mat.shape[1], dataType)\n cv.SetData(retVal, temp_mat.tostring(), temp_mat.dtype.itemsize * temp_mat.shape[1])\n elif( sz > 2 ):\n logger.warning(\"MatrixConversionUtil: the input matrix type is not supported\")\n return None\n return retVal\n else:\n logger.warning(\"MatrixConversionUtil: the input matrix type is not supported\")", "metadata": "root.npArray2cvMat", "header": "['module', '___EOS___']", "index": 234 }, { "content": "def exception_handler(excType, excValue, traceback):\n logger.error(\"\", exc_info=(excType, excValue, traceback))\n\n #print \"Hey!\",excValue\n #excValue has the most important info about the error.\n #It'd be possible to display only that and hide all the (unfriendly) rest.", "metadata": "root.exception_handler", "header": "['module', '___EOS___']", "index": 279 }, { "content": "def ipython_exception_handler(shell, excType, excValue, traceback,tb_offset=0):\n logger.error(\"\", exc_info=(excType, excValue, traceback))", "metadata": "root.ipython_exception_handler", "header": "['module', '___EOS___']", "index": 288 }, { "content": "def init_logging(log_level):\n logger.setLevel(log_level)", "metadata": "root.init_logging", "header": "['module', '___EOS___']", "index": 293 }, { "content": "def read_logging_level(log_level):\n levels_dict = {\n 1: logging.DEBUG, \"debug\": logging.DEBUG,\n 2: logging.INFO, \"info\": logging.INFO,\n 3: logging.WARNING, \"warning\": logging.WARNING,\n 4: logging.ERROR, \"error\": logging.ERROR,\n 5: logging.CRITICAL, \"critical\": logging.CRITICAL\n }\n\n if isinstance(log_level,str):\n log_level = log_level.lower()\n\n if log_level in levels_dict:\n return levels_dict[log_level]\n else:\n print \"The logging level given is not valid\"\n return None", "metadata": "root.read_logging_level", "header": "['module', '___EOS___']", "index": 296 }, { "content": "def get_logging_level():\n \"\"\"\n This function prints the current logging level of the main logger.\n \"\"\"\n levels_dict = {\n 10: \"DEBUG\",\n 20: \"INFO\",\n 30: \"WARNING\",\n 40: \"ERROR\",\n 50: \"CRITICAL\"\n }\n\n print \"The current logging level is:\", levels_dict[logger.getEffectiveLevel()]", "metadata": "root.get_logging_level", "header": "['module', '___EOS___']", "index": 314 }, { "content": "def set_logging(log_level,myfilename = None):\n \"\"\"\n This function sets the threshold for the logging system and, if desired,\n directs the messages to a logfile. Level options:\n\n 'DEBUG' or 1\n 'INFO' or 2\n 'WARNING' or 3\n 'ERROR' or 4\n 'CRITICAL' or 5\n\n If the user is on the interactive shell and wants to log to file, a custom\n excepthook is set. By default, if logging to file is not enabled, the way\n errors are displayed on the interactive shell is not changed.\n \"\"\"\n\n if myfilename and ipython_version:\n try:\n if ipython_version.startswith(\"0.10\"):\n __IPYTHON__.set_custom_exc((Exception,), ipython_exception_handler)\n else:\n ip = get_ipython()\n ip.set_custom_exc((Exception,), ipython_exception_handler)\n except NameError: #In case the interactive shell is not being used\n sys.exc_clear()\n\n\n level = read_logging_level(log_level)\n\n if level and myfilename:\n fileHandler = logging.FileHandler(filename=myfilename)\n fileHandler.setLevel(level)\n fileHandler.setFormatter(formatter)\n logger.addHandler(fileHandler)\n logger.removeHandler(consoleHandler) #Console logging is disabled.\n print \"Now logging to\",myfilename,\"with level\",log_level\n elif level:\n print \"Now logging with level\",log_level\n\n logger.setLevel(level)", "metadata": "root.set_logging", "header": "['module', '___EOS___']", "index": 328 }, { "content": "def system():\n \"\"\"\n \n **SUMMARY**\n \n Output of this function includes various informations related to system and library.\n \n Main purpose:\n - While submiting a bug, report the output of this function\n - Checking the current version and later upgrading the library based on the output\n \n **RETURNS**\n \n None\n\n **EXAMPLE**\n \n >>> import SimpleCV\n >>> SimpleCV.system()\n \n \n \"\"\"\n try :\n import platform\n print \"System : \", platform.system()\n print \"OS version : \", platform.version()\n print \"Python version :\", platform.python_version()\n try :\n from cv2 import __version__\n print \"Open CV version : \" + __version__\n except ImportError :\n print \"Open CV2 version : \" + \"2.1\"\n if (PIL_ENABLED) :\n print \"PIL version : \", pil.VERSION\n else :\n print \"PIL module not installed\"\n if (ORANGE_ENABLED) :\n print \"Orange Version : \" + orange.version\n else :\n print \"Orange module not installed\"\n try :\n import pygame as pg\n print \"PyGame Version : \" + pg.__version__\n except ImportError:\n print \"PyGame module not installed\"\n try :\n import pickle\n print \"Pickle Version : \" + pickle.__version__\n except :\n print \"Pickle module not installed\"\n\n except ImportError :\n print \"You need to install Platform to use this function\"\n print \"to install you can use:\"\n print \"easy_install platform\"\n return", "metadata": "root.system", "header": "['module', '___EOS___']", "index": 369 }, { "content": "class LazyProperty(object):\n\n", "metadata": "root.LazyProperty", "header": "['module', '___EOS___']", "index": 426 }, { "content": " def __init__(self, func):\n self._func = func\n self.__name__ = func.__name__\n self.__doc__ = func.__doc__", "metadata": "root.LazyProperty.__init__", "header": "['class', 'LazyProperty', '(', 'object', ')', ':', '___EOS___']", "index": 428 }, { "content": " def __get__(self, obj, klass=None):\n if obj is None: return None\n result = obj.__dict__[self.__name__] = self._func(obj)\n return result", "metadata": "root.LazyProperty.__get__", "header": "['class', 'LazyProperty', '(', 'object', ')', ':', '___EOS___']", "index": 433 } ]
[ { "span": "import warnings", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 15 }, { "span": "import time", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 11 }, { "span": "import socket", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 13 }, { "span": "import re", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 9 }, { "span": "import types", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 12 }, { "span": "import SocketServer", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 19 }, { "span": "import threading", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 16 }, { "span": "import pickle", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 13 }, { "span": "import glob ", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 11 }, { "span": "import abc ", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 10 }, { "span": "import colorsys", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 15 }, { "span": "import pygame as pg", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 19 }, { "span": "import scipy.ndimage as ndimage", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 31 }, { "span": "import scipy.stats.stats as sss ", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 31 }, { "span": "import scipy.cluster.vq as scv", "start_line": 23, "start_column": 0, "end_line": 23, "end_column": 30 }, { "span": "import scipy.linalg as nla ", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 26 }, { "span": "import math ", "start_line": 25, "start_column": 0, "end_line": 25, "end_column": 11 }, { "span": "import copy ", "start_line": 26, "start_column": 0, "end_line": 26, "end_column": 11 }, { "span": "import scipy.spatial.distance as spsd", "start_line": 28, "start_column": 0, "end_line": 28, "end_column": 37 }, { "span": "import scipy.cluster.vq as cluster ", "start_line": 29, "start_column": 0, "end_line": 29, "end_column": 34 }, { "span": "import pygame as pg", "start_line": 30, "start_column": 0, "end_line": 30, "end_column": 19 }, { "span": "import platform", "start_line": 31, "start_column": 0, "end_line": 31, "end_column": 15 }, { "span": "import copy", "start_line": 32, "start_column": 0, "end_line": 32, "end_column": 11 }, { "span": "import types", "start_line": 33, "start_column": 0, "end_line": 33, "end_column": 12 }, { "span": "import time", "start_line": 34, "start_column": 0, "end_line": 34, "end_column": 11 }, { "span": "import itertools ", "start_line": 35, "start_column": 0, "end_line": 35, "end_column": 16 }, { "span": "from numpy import linspace", "start_line": 37, "start_column": 0, "end_line": 37, "end_column": 26 }, { "span": "from scipy.interpolate import UnivariateSpline", "start_line": 38, "start_column": 0, "end_line": 38, "end_column": 46 }, { "span": "from warnings import warn", "start_line": 39, "start_column": 0, "end_line": 39, "end_column": 25 }, { "span": "from copy import copy", "start_line": 40, "start_column": 0, "end_line": 40, "end_column": 21 }, { "span": "from pkg_resources import load_entry_point", "start_line": 42, "start_column": 0, "end_line": 42, "end_column": 42 }, { "span": "from SimpleHTTPServer import SimpleHTTPRequestHandler", "start_line": 43, "start_column": 0, "end_line": 43, "end_column": 53 }, { "span": "from cStringIO import StringIO", "start_line": 45, "start_column": 0, "end_line": 45, "end_column": 30 }, { "span": "from numpy import int32", "start_line": 46, "start_column": 0, "end_line": 46, "end_column": 23 }, { "span": "from numpy import uint8", "start_line": 47, "start_column": 0, "end_line": 47, "end_column": 23 }, { "span": "from pygame import gfxdraw", "start_line": 49, "start_column": 0, "end_line": 49, "end_column": 26 }, { "span": "from PIL import ImageFont as pilImageFont", "start_line": 66, "start_column": 4, "end_line": 66, "end_column": 45 }, { "span": "from PIL import ImageDraw as pilImageDraw", "start_line": 67, "start_column": 4, "end_line": 67, "end_column": 45 }, { "span": "from GifImagePlugin import getheader, getdata", "start_line": 74, "start_column": 8, "end_line": 74, "end_column": 53 }, { "span": "import freenect", "start_line": 80, "start_column": 4, "end_line": 80, "end_column": 19 }, { "span": "import zxing", "start_line": 86, "start_column": 4, "end_line": 86, "end_column": 16 }, { "span": "import tesseract", "start_line": 92, "start_column": 4, "end_line": 92, "end_column": 20 }, { "span": "import pyscreenshot", "start_line": 99, "start_column": 4, "end_line": 99, "end_column": 23 }, { "span": "import Orange;", "start_line": 108, "start_column": 8, "end_line": 108, "end_column": 21 }, { "span": "import orngTest ", "start_line": 110, "start_column": 4, "end_line": 110, "end_column": 19 }, { "span": "import orngStat", "start_line": 111, "start_column": 4, "end_line": 111, "end_column": 19 }, { "span": "import orngEnsemble ", "start_line": 112, "start_column": 4, "end_line": 112, "end_column": 23 }, { "span": "import pymba", "start_line": 119, "start_column": 4, "end_line": 119, "end_column": 16 }, { "span": "import pygame as pg", "start_line": 152, "start_column": 4, "end_line": 152, "end_column": 23 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Simple", "CV", " ", "system", " ", "includes_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "warnings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "types_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Sock", "et", "Server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "threading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "zipfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "glob_", "#", "for", " ", "director", "y", " ", "scanning", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "abc_", "#", "abstract", " ", "base", " ", "class_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "colors", "ys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pygame_", "as_", "pg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "scipy_", "._", "ndimage_", "as_", "ndimage_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "scipy_", "._", "stats_", "._", "stats_", "as_", "sss", "_", "#", "for", " ", "auto", " ", "white", " ", "balance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "scipy_", "._", "cluster_", "._", "vq", "_", "as_", "sc", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "scipy_", "._", "linalg_", "as_", "nla", "_", "#", " ", "for", " ", "linear", " ", "algebra", " ", "/", " ", "leas", "t", " ", "squares_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "math_", "#", " ", "math", "...", " ", "who", " ", "doe", "s", " ", "that_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "copy_", "#", " ", "for", " ", "deep", " ", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "scipy_", "._", "spatial_", "._", "distance_", "as_", "sps", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "scipy_", "._", "cluster_", "._", "vq", "_", "as_", "cluster_", "#", "for", " ", "kmeans", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pygame_", "as_", "pg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "platform_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "types_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "itertools_", "#", "for", " ", "track_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "numpy_", "import_", "linspace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "scipy_", "._", "interpolate_", "import_", "Uni", "varia", "te", "Spline", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "warnings_", "import_", "warn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "copy_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "math_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pkg", "\\u", "resources_", "import_", "load", "\\u", "entry", "\\u", "point_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Simple", "HTTP", "Server_", "import_", "Simple", "HTTP", "Request", "Handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "types_", "import_", "Int", "Type_", ",_", "Long", "Type_", ",_", "Float", "Type_", ",_", "Insta", "nce", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "c", "String", "IO_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "numpy_", "import_", "int32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "numpy_", "import_", "uint8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "EX", "IF_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pygame_", "import_", "gfx", "draw_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pickle_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Simple", "CV", " ", "librar", "y", " ", "includes_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "cv2_", "._", "cv_", "as_", "cv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "cv_", "\\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_", "Import", "Error_", "(_", "\"", "Cann", "ot", " ", "load", " ", "Open", "CV", " ", "librar", "y", " ", "whi", "ch", " ", "is", " ", "require", "d", " ", "by", " ", "Simple", "CV", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "option", "al", " ", "libraries_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "PI", "L", "\\u", "ENABLED_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "PIL_", "import_", "Image_", "as_", "pil", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "PIL_", "import_", "Image", "Font_", "as_", "pil", "Image", "Font_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "PIL_", "import_", "Image", "Draw_", "as_", "pil", "Image", "Draw_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "PIL_", "import_", "Gi", "f", "Image", "Plugin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "getheader_", "=_", "Gi", "f", "Image", "Plugin_", "._", "getheader_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "getdata_", "=_", "Gi", "f", "Image", "Plugin_", "._", "getdata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "Image_", "as_", "pil", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Gi", "f", "Image", "Plugin_", "import_", "getheader_", ",_", "getdata_", "\\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 ", " _", "PI", "L", "\\u", "ENABLED_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "FREE", "NE", "CT", "\\u", "ENABLED_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "free", "nect", "_", "\\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 ", " _", "FREE", "NE", "CT", "\\u", "ENABLED_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ZX", "ING", "\\u", "ENABLED_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "zx", "ing_", "\\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 ", " _", "ZX", "ING", "\\u", "ENABLED_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "OCR", "\\u", "ENABLED_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "tess", "era", "ct_", "\\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 ", " _", "OCR", "\\u", "ENABLED_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "PY", "SCREEN", "SHO", "T", "\\u", "ENABLED_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "pys", "creen", "shot_", "\\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 ", " _", "PY", "SCREEN", "SHO", "T", "\\u", "ENABLED_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ORA", "NGE", "\\u", "ENABLED_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "orange", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "Orange_", ";_", "import_", "orange", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "orn", "g", "Test_", "#", "for", " ", "cross", " ", "validation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "orn", "g", "Stat_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "orn", "g", "Ensemble", "_", "#", " ", "for", " ", "bag", "ging", " ", "/", " ", "boost", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ORA", "NGE", "\\u", "ENABLED_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "VI", "MB", "A", "\\u", "ENABLED_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "pym", "ba_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "TOD", "O", " ", "Log", " ", "an", " ", "error", " ", "the", " ", "pym", "ba", " ", "is", " ", "not", " ", "installed_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "VI", "MB", "A", "\\u", "ENABLED_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "TOD", "O", " ", "Log", " ", "an", " ", "error", " ", "tha", "t", " ", "AV", "T", " ", "Vi", "mba", " ", "DLL", " ", "is", " ", "not", " ", "install", "ed", " ", "proper", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "VI", "MB", "A", "\\u", "ENABLED_", "=_", "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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "init", "\\u", "options", "\\u", "handler_", "=_", "Ini", "t", "Optio", "ns", "Handler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "pygame_", "as_", "pg_", "\\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 ", " _", "init", "\\u", "options", "\\u", "handler_", "._", "set\\u", "headl", "ess_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "couple", " ", "quick", " ", "typecheck", " ", "help", "er", " ", "functions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Log", "ging", " ", "system", " ", "-", " ", "Global", " ", "elements_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "console", "Handler_", "=_", "logging_", "._", "Stream", "Handler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "formatter_", "=_", "logging_", "._", "Formatter_", "(_", "'%", "(", "level", "name", ")", "s", ":", " ", "%", "(", "message", ")", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "console", "Handler_", "._", "set", "Formatter_", "(_", "formatter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "Main", " ", "Log", "ger", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "add", "Handler_", "(_", "console", "Handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "IP", "ython_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ipython", "\\u", "version_", "=_", "IP", "ython_", "._", "\\u\\u", "version\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ipython", "\\u", "version_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Thi", "s", " ", "is", " ", "used", " ", "with", " ", "sys", ".", "except", "hook", " ", "to", " ", "log", " ", "all", " ", "unca", "ugh", "t", " ", "exception", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "By", " ", "default", ",", " ", "error", " ", "message", "s", " ", "ARE", " ", "print", " ", "to", " ", "std", "err", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sys_", "._", "except", "hook_", "=_", "exception", "\\u", "handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "The", " ", "two", " ", "follow", "ing", " ", "function", "s", " ", "are", " ", "used", " ", "internal", "ly", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "support", "ed", " ", "image", " ", "formats", " ", "regular", " ", "express", "ion", " ", "ign", "orin", "g", " ", "case_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "IMA", "GE", "\\u", "FORMATS_", "=_", "(_", "'*", ".", "[", "b", "B", "][", "m", "M", "][", "Pp", "]'_", ",_", "'*", ".", "[", "Gg", "][", "Ii", "][", "Ff", "]'_", ",_", "'*", ".", "[", "J", "j", "][", "Pp", "][", "Gg", "]'_", ",_", "'*", ".", "[", "j", "J", "][", "p", "P", "][", "e", "E", "]'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'*", ".", "[", "j", "J", "][", "Pp", "][", "Ee", "][", "Gg", "]'_", ",_", "'*", ".", "[", "p", "P", "][", "n", "N", "][", "g", "G", "]'_", ",_", "'*", ".", "[", "p", "P", "][", "b", "B", "][", "m", "M", "]'_", ",_", "'*", ".", "[", "p", "P", "][", "g", "G", "][", "m", "M", "]'_", ",_", "'*", ".", "[", "p", "P", "][", "p", "P", "][", "m", "M", "]'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'*", ".", "[", "t", "T", "][", "i", "I", "][", "f", "F", "]'_", ",_", "'*", ".", "[", "t", "T", "][", "i", "I", "][", "f", "F", "][", "f", "F", "]'_", ",_", "'*", ".", "[", "w", "W", "][", "e", "E", "][", "b", "B", "][", "p", "P", "]'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "maxim", "um", " ", "image", " ", "size", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "MAX", "\\u", "DIMENSION", "_", "=_", "2_", "*_", "6000_", "#", " ", "abo", "ut", " ", "twi", "ce", " ", "the", " ", "size", " ", "of", " ", "a", " ", "full", " ", "3", "5", "mm", " ", "images", " ", "-", " ", "if", " ", "you", " ", "hit", " ", "this", ",", " ", "you", " ", "got", " ", "a", " ", "lot", " ", "data", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LAUN", "CH", "\\u", "PATH_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", ")_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Ini", "t", "Optio", "ns", "Handler_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "**", "summar", "y", "**", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "this", " ", "handler", " ", "is", " ", "supposed", " ", "to", " ", "store", " ", "global", " ", "variab", "les", ".", " ", "for", " ", "now", ",", " ", "its", " ", "only", " ", "value", "\\", "10", ";", " ", " ", " ", " ", "defin", "es", " ", "if", " ", "simple", "cv", " ", "is", " ", "bei", "ng", " ", "run", " ", "on", " ", "an", " ", "ipython", " ", "notebook", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Ini", "t", "Optio", "ns", "Handler_", "(_", "object_", ")_", ":_", "\\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_", "._", "on", "\\u", "notebook_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "headl", "ess_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ini", "t", "Optio", "ns", "Handler_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "enable", "\\u", "notebook_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "on", "\\u", "notebook_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ini", "t", "Optio", "ns", "Handler_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "headl", "ess_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set", " ", "SDL", " ", "to", " ", "use", " ", "the", " ", "dummy", " ", "NULL", " ", "video", " ", "driver", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "it", " ", "doe", "sn", "'", "t", " ", "need", " ", "a", " ", "window", "ing", " ", "system", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "environ_", "[_", "\"", "SDL", "\\u", "VIDEO", "DRIVER", "\"_", "]_", "=_", "\"", "dummy", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "headl", "ess_", "=_", "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_", "is", "\\u", "number_", "(_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Det", "erm", "ine", "s", " ", "if", " ", "it", " ", "is", " ", "a", " ", "number", " ", "or", " ", "not", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", " ", "Type", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "type_", "(_", "n_", ")_", "in_", "(_", "Int", "Type_", ",_", "Long", "Type_", ",_", "Float", "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_", "is", "\\u", "tuple_", "(_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Det", "erm", "ine", "s", " ", "if", " ", "it", " ", "is", " ", "a", " ", "tuple", " ", "or", " ", "not", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", " ", "Boo", "lean", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "type_", "(_", "n_", ")_", "==_", "tuple_", "\\u\\u\\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_", "reverse", "\\u", "tuple_", "(_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Revers", "es", " ", "a", " ", "tuple", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", " ", "Tup", "le", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "tuple_", "(_", "reversed_", "(_", "n_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "find_", "(_", "f_", ",_", "seq_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Sear", "ch", " ", "for", " ", "item", " ", "in", " ", "a", " ", "list", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", " ", "Boo", "lean", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "seq_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "f_", "==_", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "function", " ", "is", " ", "mean", "t", " ", "to", " ", "run", " ", "bui", "lti", "n", " ", "unittest", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "unit", " ", "test", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "download", "\\u", "and", "\\u", "extract_", "(_", "URL_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "function", " ", "take", "s", " ", "in", " ", "a", " ", "URL", " ", "for", " ", "a", " ", "zip", " ", "file", ",", " ", "extracts", " ", "it", " ", "and", " ", "return", "s", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "temporar", "y", " ", "path", " ", "it", " ", "was", " ", "extracted", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "URL_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "warning_", "(_", "\"", "Ple", "ase", " ", "provide", " ", "URL", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tmpdir_", "=_", "tempfile_", "._", "mkdtemp_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", "=_", "os_", "._", "path_", "._", "basename_", "(_", "URL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "tmpdir_", "+_", "\"/\"_", "+_", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zd", "ata_", "=_", "urllib2_", "._", "urlopen_", "(_", "URL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"", "Sav", "ing", " ", "file", " ", "to", " ", "disk", " ", "plea", "se", " ", "wait", "....", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "path_", ",_", "\"", "wb", "\"_", ")_", "as_", "local", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "\\u", "file_", "._", "write_", "(_", "zd", "ata_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "zfil", "e_", "=_", "zipfile_", "._", "Zip", "File_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Extract", "ing", " ", "zipfi", "le", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "zfil", "e_", "._", "extracta", "ll_", "(_", "tmpdir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "warning_", "(_", "\"", "Cou", "ld", "n", "'", "t", " ", "extract", " ", "zip", " ", "file", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "tmpdir_", "\\u\\u\\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_", "int\\u", "to", "\\u", "bin_", "(_", "i_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Integer", " ", "to", " ", "two", " ", "bytes", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i1_", "=_", "i_", "%_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i2_", "=_", "int_", "(_", "i_", "/_", "256_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "chr_", "(_", "i1_", ")_", "+_", "chr_", "(_", "i2_", ")_", "\\u\\u\\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_", "np", "Array", "2c", "v", "Mat_", "(_", "input", "Mat_", ",_", "data", "Type_", "=_", "cv_", "._", "CV", "\\u", "32", "FC", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "function", " ", "is", " ", "a", " ", "utility", " ", "for", " ", "convert", "ing", " ", "nump", "y", " ", "arrays", " ", "to", " ", "the", " ", "cv", ".", "cv", "Mat", " ", "format", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", " ", "cv", "Matrix", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "type_", "(_", "input", "Mat_", ")_", "==_", "np_", "._", "ndarray_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sz_", "=_", "len_", "(_", "input", "Mat_", "._", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp", "\\u", "mat_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "data", "Type_", "==_", "cv_", "._", "CV", "\\u", "32", "FC", "1_", "or_", "data", "Type_", "==_", "cv_", "._", "CV", "\\u", "32", "FC", "2_", "or_", "data", "Type_", "==_", "cv_", "._", "CV", "\\u", "32", "FC", "3_", "or_", "data", "Type_", "==_", "cv_", "._", "CV", "\\u", "32", "FC", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp", "\\u", "mat_", "=_", "np_", "._", "array_", "(_", "input", "Mat_", ",_", "dtype_", "=_", "'", "float", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "data", "Type_", "==_", "cv_", "._", "CV", "\\u", "8", "UC", "1_", "or_", "data", "Type_", "==_", "cv_", "._", "CV", "\\u", "8", "UC", "2_", "or_", "data", "Type_", "==_", "cv_", "._", "CV", "\\u", "8", "UC", "3_", "or_", "data", "Type_", "==_", "cv_", "._", "CV", "\\u", "8", "UC", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp", "\\u", "mat_", "=_", "np_", "._", "array_", "(_", "input", "Mat_", ",_", "dtype_", "=_", "'", "uint", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "warning_", "(_", "\"", "Matrix", "Conversion", "Ut", "il", ":", " ", "the", " ", "input", " ", "matrix", " ", "type", " ", "is", " ", "not", " ", "support", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "sz_", "==_", "1_", ")_", ":_", "#", "this", " ", "need", "s", " ", "to", " ", "be", " ", "change", "d", " ", "so", " ", "we", " ", "can", " ", "do", " ", "row", "/", "col", " ", "vectors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret", "Val_", "=_", "cv_", "._", "Creat", "e", "Mat_", "(_", "input", "Mat_", "._", "shape_", "[_", "0_", "]_", ",_", "1_", ",_", "data", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cv_", "._", "Set", "Data_", "(_", "ret", "Val_", ",_", "temp", "\\u", "mat_", "._", "tostring_", "(_", ")_", ",_", "temp", "\\u", "mat_", "._", "dtype_", "._", "itemsize_", "*_", "temp", "\\u", "mat_", "._", "shape_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "sz_", "==_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret", "Val_", "=_", "cv_", "._", "Creat", "e", "Mat_", "(_", "temp", "\\u", "mat_", "._", "shape_", "[_", "0_", "]_", ",_", "temp", "\\u", "mat_", "._", "shape_", "[_", "1_", "]_", ",_", "data", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cv_", "._", "Set", "Data_", "(_", "ret", "Val_", ",_", "temp", "\\u", "mat_", "._", "tostring_", "(_", ")_", ",_", "temp", "\\u", "mat_", "._", "dtype_", "._", "itemsize_", "*_", "temp", "\\u", "mat_", "._", "shape_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "sz_", ">_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "warning_", "(_", "\"", "Matrix", "Conversion", "Ut", "il", ":", " ", "the", " ", "input", " ", "matrix", " ", "type", " ", "is", " ", "not", " ", "support", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ret", "Val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "warning_", "(_", "\"", "Matrix", "Conversion", "Ut", "il", ":", " ", "the", " ", "input", " ", "matrix", " ", "type", " ", "is", " ", "not", " ", "support", "ed", "\"_", ")_", "\\u\\u\\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_", "exception", "\\u", "handler_", "(_", "exc", "Type_", ",_", "exc", "Value_", ",_", "traceback_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "error_", "(_", "\"\"_", ",_", "exc", "\\u", "info_", "=_", "(_", "exc", "Type_", ",_", "exc", "Value_", ",_", "traceback_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"", "He", "y", "!\"", ",", "exc", "Value_", "\\u\\u\\uNL\\u\\u\\u_", "#", "exc", "Value", " ", "has", " ", "the", " ", "most", " ", "importa", "nt", " ", "info", " ", "abo", "ut", " ", "the", " ", "error", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "It", "'", "d", " ", "be", " ", "possib", "le", " ", "to", " ", "display", " ", "only", " ", "tha", "t", " ", "and", " ", "hide", " ", "all", " ", "the", " ", "(", "unf", "rien", "dl", "y", ")", " ", "rest", "._", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "ipython", "\\u", "exception", "\\u", "handler_", "(_", "shell_", ",_", "exc", "Type_", ",_", "exc", "Value_", ",_", "traceback_", ",_", "tb", "\\u", "offset_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "error_", "(_", "\"\"_", ",_", "exc", "\\u", "info_", "=_", "(_", "exc", "Type_", ",_", "exc", "Value_", ",_", "traceback_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "init", "\\u", "logging_", "(_", "log", "\\u", "level_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "set", "Level_", "(_", "log", "\\u", "level_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read", "\\u", "logg", "ing", "\\u", "level_", "(_", "log", "\\u", "level_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "level", "s", "\\u", "dict_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "1_", ":_", "logging_", "._", "DEBUG_", ",_", "\"", "debug", "\"_", ":_", "logging_", "._", "DEBUG_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "2_", ":_", "logging_", "._", "INFO_", ",_", "\"", "info", "\"_", ":_", "logging_", "._", "INFO_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "3_", ":_", "logging_", "._", "WARNING_", ",_", "\"", "warn", "ing", "\"_", ":_", "logging_", "._", "WARNING_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "4_", ":_", "logging_", "._", "ERROR_", ",_", "\"", "error", "\"_", ":_", "logging_", "._", "ERROR_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "5_", ":_", "logging_", "._", "CRITICAL_", ",_", "\"", "critic", "al", "\"_", ":_", "logging_", "._", "CRITICAL_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "log", "\\u", "level_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log", "\\u", "level_", "=_", "log", "\\u", "level_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "log", "\\u", "level_", "in_", "level", "s", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "level", "s", "\\u", "dict_", "[_", "log", "\\u", "level_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "The", " ", "logg", "ing", " ", "level", " ", "give", "n", " ", "is", " ", "not", " ", "valid", "\"_", "\\u\\u\\uNEWLINE\\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_", "def_", "get", "\\u", "logg", "ing", "\\u", "level_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "function", " ", "print", "s", " ", "the", " ", "current", " ", "logg", "ing", " ", "level", " ", "of", " ", "the", " ", "main", " ", "logg", "er", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "level", "s", "\\u", "dict_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "10_", ":_", "\"", "DEBU", "G", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "20_", ":_", "\"", "INFO", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "30_", ":_", "\"", "WARN", "ING", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "40_", ":_", "\"", "ERROR", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "50_", ":_", "\"", "CRIT", "ICAL", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"", "The", " ", "current", " ", "logg", "ing", " ", "level", " ", "is", ":\"_", ",_", "level", "s", "\\u", "dict_", "[_", "logger_", "._", "get", "Effe", "ctive", "Level_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "logging_", "(_", "log", "\\u", "level_", ",_", "myfi", "lename", "_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "function", " ", "sets", " ", "the", " ", "threshol", "d", " ", "for", " ", "the", " ", "logg", "ing", " ", "system", " ", "and", ",", " ", "if", " ", "desi", "red", ",", "\\", "10", ";", " ", " ", " ", " ", "direct", "s", " ", "the", " ", "message", "s", " ", "to", " ", "a", " ", "logfile", ".", " ", "Leve", "l", " ", "options", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'", "DEBU", "G", "'", " ", "or", " ", "1", "\\", "10", ";", " ", " ", " ", " ", "'", "INFO", "'", " ", "or", " ", "2", "\\", "10", ";", " ", " ", " ", " ", "'", "WARN", "ING", "'", " ", "or", " ", "3", "\\", "10", ";", " ", " ", " ", " ", "'", "ERROR", "'", " ", "or", " ", "4", "\\", "10", ";", " ", " ", " ", " ", "'", "CRIT", "ICAL", "'", " ", "or", " ", "5", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "the", " ", "user", " ", "is", " ", "on", " ", "the", " ", "interactive", " ", "shell", " ", "and", " ", "want", "s", " ", "to", " ", "log", " ", "to", " ", "file", ",", " ", "a", " ", "custom", "\\", "10", ";", " ", " ", " ", " ", "except", "hook", " ", "is", " ", "set", ".", " ", "By", " ", "default", ",", " ", "if", " ", "logg", "ing", " ", "to", " ", "file", " ", "is", " ", "not", " ", "enable", "d", ",", " ", "the", " ", "way", "\\", "10", ";", " ", " ", " ", " ", "error", "s", " ", "are", " ", "displaye", "d", " ", "on", " ", "the", " ", "interactive", " ", "shell", " ", "is", " ", "not", " ", "change", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "myfi", "lename", "_", "and_", "ipython", "\\u", "version_", ":_", "\\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_", "ipython", "\\u", "version_", "._", "startswith_", "(_", "\"", "0.10", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "IP", "YT", "HON", "\\u\\u_", "._", "set\\u", "custom", "\\u", "exc_", "(_", "(_", "Exception_", ",_", ")_", ",_", "ipython", "\\u", "exception", "\\u", "handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ip_", "=_", "get", "\\u", "ipython", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip_", "._", "set\\u", "custom", "\\u", "exc_", "(_", "(_", "Exception_", ",_", ")_", ",_", "ipython", "\\u", "exception", "\\u", "handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Name", "Error_", ":_", "#", "In", " ", "case", " ", "the", " ", "interactive", " ", "shell", " ", "is", " ", "not", " ", "bei", "ng", " ", "used_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "exc", "\\u", "clear_", "(_", ")_", "\\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_", "level_", "=_", "read", "\\u", "logg", "ing", "\\u", "level_", "(_", "log", "\\u", "level_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "level_", "and_", "myfi", "lename", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file", "Handler_", "=_", "logging_", "._", "File", "Handler_", "(_", "filename_", "=_", "myfi", "lename", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "Handler_", "._", "set", "Level_", "(_", "level_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "Handler_", "._", "set", "Formatter_", "(_", "formatter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "add", "Handler_", "(_", "file", "Handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "remove", "Handler_", "(_", "console", "Handler_", ")_", "#", "Cons", "ole", " ", "logg", "ing", " ", "is", " ", "disable", "d", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "No", "w", " ", "logg", "ing", " ", "to", "\"_", ",_", "myfi", "lename", "_", ",_", "\"", "with", " ", "level", "\"_", ",_", "log", "\\u", "level_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "level_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "No", "w", " ", "logg", "ing", " ", "with", " ", "level", "\"_", ",_", "log", "\\u", "level_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logger_", "._", "set", "Level_", "(_", "level_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "system_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "**", "SUMMARY", "**", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Output", " ", "of", " ", "this", " ", "function", " ", "include", "s", " ", "vari", "ous", " ", "informations", " ", "relate", "d", " ", "to", " ", "system", " ", "and", " ", "librar", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Main", " ", "purpose", ":", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "Whi", "le", " ", "submit", "ing", " ", "a", " ", "bug", ",", " ", "report", " ", "the", " ", "output", " ", "of", " ", "this", " ", "function", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "Check", "ing", " ", "the", " ", "current", " ", "version", " ", "and", " ", "late", "r", " ", "up", "gradi", "ng", " ", "the", " ", "librar", "y", " ", "based", " ", "on", " ", "the", " ", "output", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "**", "RETURN", "S", "**", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "**", "EXAMPLE", "**", "\\", "10", ";", " ", " ", "\\", "10", ";", " ", " ", ">>>", " ", "import", " ", "Simple", "CV", "\\", "10", ";", " ", " ", ">>>", " ", "Simple", "CV", ".", "system", "()", "\\", "10", ";", " ", " ", "\\", "10", ";", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "platform_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "System", " ", ":", " ", "\"_", ",_", "platform_", "._", "system_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "OS", " ", "version", " ", ":", " ", "\"_", ",_", "platform_", "._", "version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Pyth", "on", " ", "version", " ", ":\"_", ",_", "platform_", "._", "python", "\\u", "version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "cv2_", "import_", "\\u\\u", "version\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Open", " ", "CV", " ", "version", " ", ":", " ", "\"_", "+_", "\\u\\u", "version\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Open", " ", "CV", "2", " ", "version", " ", ":", " ", "\"_", "+_", "\"", "2.1", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "PI", "L", "\\u", "ENABLED_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "PI", "L", " ", "version", " ", ":", " ", "\"_", ",_", "pil", "_", "._", "VERSION_", "\\u\\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_", "\"", "PI", "L", " ", "module", " ", "not", " ", "install", "ed", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "ORA", "NGE", "\\u", "ENABLED_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Ora", "nge", " ", "Version", " ", ":", " ", "\"_", "+_", "orange", "_", "._", "version_", "\\u\\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_", "\"", "Ora", "nge", " ", "module", " ", "not", " ", "install", "ed", "\"_", "\\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 ", " _", "import_", "pygame_", "as_", "pg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Py", "Game", " ", "Version", " ", ":", " ", "\"_", "+_", "pg_", "._", "\\u\\u", "version\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Py", "Game", " ", "module", " ", "not", " ", "install", "ed", "\"_", "\\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 ", " _", "import_", "pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Pickl", "e", " ", "Version", " ", ":", " ", "\"_", "+_", "pickle_", "._", "\\u\\u", "version\\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 ", " _", "print_", "\"", "Pickl", "e", " ", "module", " ", "not", " ", "install", "ed", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "You", " ", "need", " ", "to", " ", "install", " ", "Plat", "form", " ", "to", " ", "use", " ", "this", " ", "function", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "to", " ", "install", " ", "you", " ", "can", " ", "use", ":\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "easy", "\\u", "install", " ", "platform", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "La", "zy", "Property_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "La", "zy", "Property_", "(_", "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_", ",_", "func_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "func_", "=_", "func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "name\\u\\u_", "=_", "func_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "doc\\u\\u_", "=_", "func_", "._", "\\u\\u", "doc\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "La", "zy", "Property_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "get\\u\\u_", "(_", "self_", ",_", "obj_", ",_", "klass_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "obj_", "is_", "None_", ":_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "obj_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "\\u\\u", "name\\u\\u_", "]_", "=_", "self_", "._", "\\u", "func_", "(_", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result_", "\\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, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 2, 2, 2, 0, 1, 2, 0, 1, 1, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 0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